mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-08-08 19:00:27 +00:00
[metal] Fix bug: munmap() should clear PAGE_RSRV in page table
This commit is contained in:
parent
da336b3ea8
commit
28bd57c6d0
1 changed files with 1 additions and 1 deletions
|
@ -26,7 +26,7 @@ noasan int sys_munmap_metal(void *addr, size_t size) {
|
||||||
mm = (struct mman *)(BANE + 0x0500);
|
mm = (struct mman *)(BANE + 0x0500);
|
||||||
for (i = 0; i < size; i += 4096) {
|
for (i = 0; i < size; i += 4096) {
|
||||||
e = __get_virtual(mm, __get_pml4t(), (uint64_t)addr + i, false);
|
e = __get_virtual(mm, __get_pml4t(), (uint64_t)addr + i, false);
|
||||||
if (e) *e = ~PAGE_V;
|
if (e) *e = ~(PAGE_V | PAGE_RSRV);
|
||||||
invlpg(e);
|
invlpg(e);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue