[Zion] Free all user space mappings when exitting a process.

This commit is contained in:
Drew Galbraith 2023-11-24 17:07:55 -08:00
parent e50d3f8abc
commit 39ac0216dd
2 changed files with 5 additions and 1 deletions

View File

@ -25,3 +25,5 @@ const uint64_t kKernelStackOffset = 4 * kPageSize;
const uint64_t kUserStackMin = 0x00007FF0'00000000;
const uint64_t kUserStackMax = 0x00008000'00000000;
const uint64_t kUserStackSize = MiB;
const uint64_t kUserSpaceMax = 0x00008000'00000000;

View File

@ -101,7 +101,9 @@ void Process::Cleanup() {
// 2. Release all capabailities.
caps_.ReleaseAll();
// 3. Unmap all user memory. TODO
// 3. Unmap all user memory.
PANIC_ON_ERR(vmas_->FreeAddressRange(0, kUserSpaceMax),
"Failed to cleanup userspace mappings in process exit.");
// 4. Release paging structures. TODO
state_ = FINISHED;