From 59ca1c46970fa8df2d0fa4b8163a99ca418bd2cf Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 9 Apr 2022 19:03:29 +0200 Subject: kernel/vfs: prevent the vfs functions from switching processes --- src/kernel/arch/i386/sysenter.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/kernel/arch/i386/sysenter.c') diff --git a/src/kernel/arch/i386/sysenter.c b/src/kernel/arch/i386/sysenter.c index cda4f15..5712ee3 100644 --- a/src/kernel/arch/i386/sysenter.c +++ b/src/kernel/arch/i386/sysenter.c @@ -23,7 +23,10 @@ _Noreturn void sysenter_stage2(void) { val = _syscall(regs->eax, regs->ebx, regs->esi, regs->edi, (uintptr_t)regs->ebp); - regs_savereturn(&process_current->regs, val); - - process_switch(process_current); // TODO process_resume + if (process_current->state == PS_RUNNING) { // TODO move to _syscall() + regs_savereturn(&process_current->regs, val); + process_switch(process_current); // TODO process_resume + } else { + process_switch_any(); + } } -- cgit v1.2.3