forked from PoliEcho-holding-org/kern
add vmm_free
This commit is contained in:
@@ -6,4 +6,5 @@
|
||||
#define CANONICAL_MASK_USER 0x00007FFFFFFFFFF000
|
||||
|
||||
int vmm_alloc(void** vaddr, uint64_t count, uint64_t flags);
|
||||
int vmm_free(void* vaddr);
|
||||
#endif
|
||||
@@ -86,4 +86,9 @@ int vmm_alloc(void** vaddr, uint64_t count, uint64_t flags) {
|
||||
}
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
int vmm_free(void* vaddr) {
|
||||
uint64_t* pml4 = pag_get_pml4();
|
||||
return pag_unmap(pml4, vaddr);
|
||||
}
|
||||
Reference in New Issue
Block a user