This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch releases/12.12
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/releases/12.12 by this push:
     new fce6e9de5e6 x86_64:fix syscall type mismatch
fce6e9de5e6 is described below

commit fce6e9de5e6386084646ab91913c0d8a67b1058a
Author: anjiahao <[email protected]>
AuthorDate: Mon Jan 13 15:09:05 2025 +0800

    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 <[email protected]>
---
 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"

Reply via email to