[Zion] Map user stacks in as regular MemoryObjects.

This allows us to easily track the physical memory so it
can be freed when the thread exits. It also simplifies the page fault
handler as it just needs to check regular mappings to find a user stack.
This commit is contained in:
Drew Galbraith 2023-11-24 16:51:35 -08:00
parent ba1b4df702
commit 2dd69f5844
6 changed files with 29 additions and 42 deletions

View file

@ -65,8 +65,8 @@ class AddressSpace : public KernelObject {
uint64_t cr3() { return cr3_; }
// User Mappings.
uint64_t AllocateUserStack();
void FreeUserStack(uint64_t);
glcr::ErrorOr<uint64_t> AllocateUserStack();
[[nodiscard]] glcr::ErrorCode FreeUserStack(uint64_t stack_base);
uint64_t GetNextMemMapAddr(uint64_t size, uint64_t align);
// Maps in a memory object at a specific address.