summaryrefslogtreecommitdiff
path: root/src/kernel/idt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/idt.c')
-rw-r--r--src/kernel/idt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/kernel/idt.c b/src/kernel/idt.c
index 99284ac..c79ae7b 100644
--- a/src/kernel/idt.c
+++ b/src/kernel/idt.c
@@ -256,9 +256,10 @@ void exception_halt(uint32_t eax, uint32_t ebx, uint32_t ecx,
__builtin_unreachable();
}
+#define MAX_STACK_EXPAND_PAGES 256
//returns true if stack was expanded
bool pf_check_stack(uint32_t cr2) {
- if (cr2 >= active_task->stack_bottom - 0x1000) {
+ if (cr2 >= active_task->stack_bottom - 0x1000 * MAX_STACK_EXPAND_PAGES) {
switch_to_kernel_cr3();
pd_user_allocate(active_task->page_directory, active_task->stack_bottom -= 4096, 1, true);
switch_to_task_cr3();