From c87c29366d5eb289fe34d60a08ba0d37a24d44fd Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sun, 19 Apr 2026 20:05:11 +0100 Subject: [PATCH] x86_64: irq: initialise tr_irqctx before running syscall handler --- arch/x86_64/irq.c | 6 ++++++ 1 file changed, 6 insertions(+) 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);