diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/kernel/arch/i386/sysenter.c | 3 | ||||
-rw-r--r-- | src/kernel/proc.c | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/kernel/arch/i386/sysenter.c b/src/kernel/arch/i386/sysenter.c index 5712ee3..1aee254 100644 --- a/src/kernel/arch/i386/sysenter.c +++ b/src/kernel/arch/i386/sysenter.c @@ -1,4 +1,5 @@ #include <kernel/arch/generic.h> +#include <kernel/arch/i386/interrupts/irq.h> #include <kernel/arch/i386/sysenter.h> #include <kernel/proc.h> #include <shared/syscalls.h> @@ -21,6 +22,8 @@ _Noreturn void sysenter_stage2(void) { regs->esp = (userptr_t) regs->ecx; // fix them up regs->eip = (userptr_t) regs->edx; + irq_interrupt_flag(false); + val = _syscall(regs->eax, regs->ebx, regs->esi, regs->edi, (uintptr_t)regs->ebp); if (process_current->state == PS_RUNNING) { // TODO move to _syscall() diff --git a/src/kernel/proc.c b/src/kernel/proc.c index 74660fa..1f012fa 100644 --- a/src/kernel/proc.c +++ b/src/kernel/proc.c @@ -83,16 +83,16 @@ _Noreturn void process_idle(void) { cpu_shutdown(); } - irq_interrupt_flag(true); for (;;) { - asm("hlt" ::: "memory"); // TODO move to irq.c for (size_t i = 0; i < len; i++) { if (procs[i]->waits4irq.ready()) { - irq_interrupt_flag(false); vfs_root_handler(&procs[i]->waits4irq.req); // TODO this should be a function pointer too process_switch_any(); } } + irq_interrupt_flag(true); + asm("hlt" ::: "memory"); // TODO move to irq.c + irq_interrupt_flag(false); } } |