feat: overhaul userspace heap and virtual memory
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include <Memory/PageFrameAllocator.hpp>
|
||||
#include <Sched/Scheduler.hpp>
|
||||
#include <Sched/CrashReport.hpp>
|
||||
#include <Api/Heap.hpp>
|
||||
#include <Hal/SmpBoot.hpp>
|
||||
#include <Timekeeping/ApicTimer.hpp>
|
||||
|
||||
@@ -201,10 +202,12 @@ namespace Hal {
|
||||
// pushes past the mapped stack and kernel accesses to not-yet-grown
|
||||
// user stack buffers passed into syscalls.
|
||||
if ((errorCode & 1) == 0 && cpu != nullptr && cpu->currentSlot >= 0
|
||||
&& Sched::GetCurrentPid() >= 0
|
||||
&& Sched::TryGrowUserStack(cr2)) {
|
||||
if (fromUser) asm volatile("swapgs");
|
||||
return;
|
||||
&& Sched::GetCurrentPid() >= 0) {
|
||||
if (montauk::abi::TryHandleAnonymousPageFault(cr2, errorCode) ||
|
||||
Sched::TryGrowUserStack(cr2)) {
|
||||
if (fromUser) asm volatile("swapgs");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Not a growable fault. Hand the RAW frame (error code at offset 0)
|
||||
|
||||
Reference in New Issue
Block a user