mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-19 09:00:31 +00:00
[metal] Clean up code for getting pointer to struct mman
(#828)
Co-authored-by: tkchia <tkchia-cosmo@gmx.com>
This commit is contained in:
parent
5a6a4819d4
commit
e47c0cc929
5 changed files with 8 additions and 6 deletions
|
@ -23,9 +23,8 @@
|
|||
noasan int sys_munmap_metal(void *addr, size_t size) {
|
||||
size_t i;
|
||||
uint64_t *e, paddr;
|
||||
struct mman *mm;
|
||||
struct mman *mm = __get_mm();
|
||||
uint64_t *pml4t = __get_pml4t();
|
||||
mm = (struct mman *)(BANE + 0x0500);
|
||||
for (i = 0; i < size; i += 4096) {
|
||||
e = __get_virtual(mm, pml4t, (uint64_t)addr + i, false);
|
||||
if (e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue