diff --git a/arch/x86_64/irq.c b/arch/x86_64/irq.c index 592fd8b..b095928 100644 --- a/arch/x86_64/irq.c +++ b/arch/x86_64/irq.c @@ -217,6 +217,12 @@ void irq_dispatch(struct ml_cpu_context *regs) void syscall_dispatch(struct ml_cpu_context *regs) { + struct thread *thr = get_current_thread(); + if (thr) { + thr->tr_irqctx = regs; + put_current_thread(thr); + } + unsigned int sysid = regs->rax; virt_addr_t syscall_impl = syscall_get_function(sysid);