[metal] Clean up code for getting pointer to struct mman (#828)

Co-authored-by: tkchia <tkchia-cosmo@gmx.com>
This commit is contained in:
tkchia 2023-06-12 01:32:39 +08:00 committed by GitHub
parent 5a6a4819d4
commit e47c0cc929
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 6 deletions

View file

@ -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) {