diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2014-12-07 11:49:52 +0100 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2014-12-07 11:49:52 +0100 |
commit | d7aaba8c85cc71f3184cddcf20b740c5157c864d (patch) | |
tree | d99c9d6765eb433c73498c5e99ebcdb088c0e7e6 /kernel/l0/paging.c | |
parent | 26b68c108664cb54089613bdbc54624ed66f7fda (diff) | |
download | kogata-d7aaba8c85cc71f3184cddcf20b740c5157c864d.tar.gz kogata-d7aaba8c85cc71f3184cddcf20b740c5157c864d.zip |
Refactor kmalloc & tests in kmain.
Diffstat (limited to 'kernel/l0/paging.c')
-rw-r--r-- | kernel/l0/paging.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/l0/paging.c b/kernel/l0/paging.c index 744424f..3f38997 100644 --- a/kernel/l0/paging.c +++ b/kernel/l0/paging.c @@ -60,7 +60,7 @@ void page_fault_handler(registers_t *regs) { invlpg(¤t_pt[pt]); return; } - asm volatile("sti"); // from now on we are preemptible + if (regs->eflags & EFLAGS_IF) asm volatile("sti"); // from now on we are preemptible if (vaddr >= (void*)&kernel_stack_protector && vaddr < (void*)&kernel_stack_protector + PAGE_SIZE) { dbg_printf("Kernel stack overflow at 0x%p\n", vaddr); @@ -87,7 +87,7 @@ void page_fault_handler(registers_t *regs) { } i->pf(current_pd_d, i, vaddr); } else { - asm volatile("sti"); // userspace PF handlers should always be preemptible + if (regs->eflags & EFLAGS_IF) asm volatile("sti"); // userspace PF handlers should always be preemptible dbg_printf("Userspace page fault at 0x%p\n", vaddr); PANIC("Unhandled userspace page fault"); |