[Zion] Free paging structures after process exit.
This commit is contained in:
parent
39ac0216dd
commit
46ae5de30a
5 changed files with 39 additions and 1 deletions
|
|
@ -18,6 +18,8 @@ AddressSpace::AddressSpace() {
|
|||
InitializePml4(cr3_);
|
||||
}
|
||||
|
||||
AddressSpace::~AddressSpace() { CleanupPml4(cr3_); }
|
||||
|
||||
glcr::ErrorOr<uint64_t> AddressSpace::AllocateUserStack() {
|
||||
uint64_t base = user_stacks_.NewUserStack();
|
||||
auto mem_object = glcr::StaticCastRefPtr<MemoryObject>(
|
||||
|
|
|
|||
|
|
@ -62,6 +62,10 @@ class AddressSpace : public KernelObject {
|
|||
AddressSpace(const AddressSpace&) = delete;
|
||||
AddressSpace(AddressSpace&&) = delete;
|
||||
|
||||
// Deconstructing an address space will free all paging structures associated
|
||||
// with this address space.
|
||||
~AddressSpace();
|
||||
|
||||
uint64_t cr3() { return cr3_; }
|
||||
|
||||
// User Mappings.
|
||||
|
|
|
|||
|
|
@ -105,6 +105,8 @@ void Process::Cleanup() {
|
|||
PANIC_ON_ERR(vmas_->FreeAddressRange(0, kUserSpaceMax),
|
||||
"Failed to cleanup userspace mappings in process exit.");
|
||||
|
||||
// 4. Release paging structures. TODO
|
||||
// 4. Release paging structures.
|
||||
vmas_ = nullptr;
|
||||
|
||||
state_ = FINISHED;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue