From 29e067867e7a437d12351b481024d4bab431b202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matteo=20Gm=C3=BCr?= Date: Mon, 12 May 2025 13:51:12 +0000 Subject: Fix crashes because of are frame allocator copy --- arch/x86_64/src/context_switching/syscall/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/x86_64/src/context_switching/syscall/main.cpp') diff --git a/arch/x86_64/src/context_switching/syscall/main.cpp b/arch/x86_64/src/context_switching/syscall/main.cpp index 996d7fb..e291c10 100644 --- a/arch/x86_64/src/context_switching/syscall/main.cpp +++ b/arch/x86_64/src/context_switching/syscall/main.cpp @@ -18,9 +18,6 @@ namespace teachos::arch::context_switching::syscall asm volatile("syscall"); - error error_code{}; - asm volatile("mov %%rax, %[output]" : [output] "=m"(error_code)); - arguments values{}; asm volatile("mov %%rdi, %[output]" : [output] "=m"(values.arg_0)); asm volatile("mov %%rsi, %[output]" : [output] "=m"(values.arg_1)); @@ -29,6 +26,9 @@ namespace teachos::arch::context_switching::syscall asm volatile("mov %%r8, %[output]" : [output] "=m"(values.arg_4)); asm volatile("mov %%r9, %[output]" : [output] "=m"(values.arg_5)); + error error_code{}; + asm volatile("mov %%rax, %[output]" : [output] "=m"(error_code)); + return {error_code, values}; } -- cgit v1.2.3