diff --git a/src/system/kernel/arch/x86/arch_int.c b/src/system/kernel/arch/x86/arch_int.c index f7c635d01c..b0cb635cab 100644 --- a/src/system/kernel/arch/x86/arch_int.c +++ b/src/system/kernel/arch/x86/arch_int.c @@ -334,6 +334,9 @@ i386_handle_trap(struct iframe frame) struct thread *thread = thread_get_current_thread(); int ret = B_HANDLED_INTERRUPT; + // all exceptions besides 3 (breakpoint), and 99 (syscall) enter this + // function with interrupts disabled + if (thread) x86_push_iframe(&thread->arch_info.iframes, &frame); else @@ -530,6 +533,9 @@ i386_handle_trap(struct iframe frame) } if (frame.cs == USER_CODE_SEG) { + enable_interrupts(); + // interrupts are not enabled at this point if we came from + // a hardware interrupt thread_at_kernel_exit(); i386_init_user_debug_at_kernel_exit(&frame); } diff --git a/src/system/kernel/signal.c b/src/system/kernel/signal.c index 5f0e4c7b27..83ae0e7d58 100644 --- a/src/system/kernel/signal.c +++ b/src/system/kernel/signal.c @@ -169,11 +169,6 @@ handle_signals(struct thread *thread) && !notify_debugger(thread, signal, handler, true)) continue; - // ToDo: when we have more than a thread per process, - // it can likely happen (for any thread other than the first) - // that here, interrupts are still disabled. - // Just search for the cause if it still happens! - thread_exit(); // won't return }