From 431cffa5d8e9a2ae41d3684d40caca9d953d5451 Mon Sep 17 00:00:00 2001 From: anjiahao Date: Mon, 13 Jan 2025 15:09:05 +0800 Subject: [PATCH] x86_64:fix syscall type mismatch /home/ajh/work/vela_system/nuttx/include/arch/syscall.h:181: Error: operand type mismatch for `movq' `rax`: Used in 64-bit mode, suitable for storing 64 bits of data. `eax`: In 64-bit mode, typically used for operating on 32-bit data. When writing to `eax`, the high 32 bits of `rax` are automatically cleared to zero. `nbr` is an unsigned int, is 32-bit. Signed-off-by: anjiahao --- arch/x86_64/include/syscall.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86_64/include/syscall.h b/arch/x86_64/include/syscall.h index ce4a4592c95..8a140625248 100644 --- a/arch/x86_64/include/syscall.h +++ b/arch/x86_64/include/syscall.h @@ -175,7 +175,7 @@ static inline uintptr_t sys_call6(unsigned int nbr, uintptr_t parm1, __asm__ volatile ( - "movq %1, %%rax\n" + "movl %1, %%eax\n" "movq %2, %%rdi\n" "movq %3, %%rsi\n" "movq %4, %%rdx\n"