Manage KernelStacks separately rather than just allocing bytes.
Create a global KernelStackManager that will handle the relevant allocs.
This commit is contained in:
parent
3c3341a90f
commit
f22dd66c8d
9 changed files with 104 additions and 24 deletions
18
zion/memory/virtual_memory.cpp
Normal file
18
zion/memory/virtual_memory.cpp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include "memory/virtual_memory.h"
|
||||
|
||||
#include "memory/kernel_stack_manager.h"
|
||||
|
||||
extern KernelStackManager* gKernelStackManager;
|
||||
|
||||
uint64_t* VirtualMemory::AllocateKernelStack() {
|
||||
return gKernelStackManager->AllocateKernelStack();
|
||||
}
|
||||
|
||||
uint64_t VirtualMemory::GetNextMemMapAddr(uint64_t size) {
|
||||
uint64_t addr = next_memmap_addr_;
|
||||
next_memmap_addr_ += size;
|
||||
if (next_memmap_addr_ >= 0x30'00000000) {
|
||||
panic("OOM: Memmap");
|
||||
}
|
||||
return addr;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue