From 63e731a01fbe47f00fb0cbf67a00b03b19bf089e Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Sun, 5 Nov 2023 21:03:04 +0000 Subject: [PATCH] Fixes for __sys_call on aarch64-mes-gcc --- include/stdint.h | 2 +- lib/linux/aarch64-mes-gcc/syscall.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/stdint.h b/include/stdint.h index 694840dc..c48ad941 100644 --- a/include/stdint.h +++ b/include/stdint.h @@ -87,7 +87,7 @@ typedef unsigned uintmax_t; #define INT_MIN -2147483648 #define INT_MAX 2147483647 -#if __i386__ || __arm__ || __riscv_xlen == 32 +#if __i386__ || __arm__ || __aarch64__ || __riscv_xlen == 32 #define LONG_MIN INT_MIN #define LONG_MAX INT_MAX #define UINT_MAX UINT32_MAX diff --git a/lib/linux/aarch64-mes-gcc/syscall.c b/lib/linux/aarch64-mes-gcc/syscall.c index b1a4329b..fc28e110 100644 --- a/lib/linux/aarch64-mes-gcc/syscall.c +++ b/lib/linux/aarch64-mes-gcc/syscall.c @@ -29,7 +29,7 @@ __sys_call (long sys_call) long r; asm ( "mov x7, %1\n\t" - "svc $0\n\t" + "svc #0\n\t" "mov %0, x0\n\t" : "=r" (r) : "r" (sys_call) @@ -61,7 +61,7 @@ __sys_call1 (long sys_call, long one) asm ( "mov x7, %1\n\t" "mov x0, %2\n\t" - "svc $0\n\t" + "svc #0\n\t" "mov %0, x0\n\t" : "=r" (r) : "r" (sys_call), "r" (one) @@ -94,7 +94,7 @@ __sys_call2 (long sys_call, long one, long two) "mov x7, %1\n\t" "mov x0, %2\n\t" "mov x1, %3\n\t" - "svc $0\n\t" + "svc #0\n\t" "mov %0, x0\n\t" : "=r" (r) : "r" (sys_call), "r" (one), "r" (two) @@ -128,8 +128,8 @@ __sys_call3 (long sys_call, long one, long two, long three) "mov x0, %2\n\t" "mov x1, %3\n\t" "mov x2, %4\n\t" - "svc $0\n\t" - "mov %0, r0\n\t" + "svc #0\n\t" + "mov %0, x0\n\t" : "=r" (r) : "r" (sys_call), "r" (one), "r" (two), "r" (three) : "x0", "x1", "x2", "x7" @@ -163,8 +163,8 @@ __sys_call4 (long sys_call, long one, long two, long three, long four) "mov x1, %3\n\t" "mov x2, %4\n\t" "mov x3, %5\n\t" - "svc $0\n\t" - "mov %0, r0\n\t" + "svc #0\n\t" + "mov %0, x0\n\t" : "=r" (r) : "r" (sys_call), "r" (one), "r" (two), "r" (three), "r" (four) : "x0", "x1", "x2", "x3", "x7"