From 67780639e9cfd08e96bf840d076c776a72cc446c Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Sun, 5 Nov 2023 20:33:24 +0000 Subject: [PATCH] Fix typos in aarch64-mes-gcc --- lib/linux/aarch64-mes-gcc/_exit.c | 4 ++-- lib/linux/aarch64-mes-gcc/_write.c | 4 ++-- lib/linux/aarch64-mes-gcc/crt1.c | 14 +++++++------- lib/linux/aarch64-mes-gcc/syscall-internal.c | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/linux/aarch64-mes-gcc/_exit.c b/lib/linux/aarch64-mes-gcc/_exit.c index fcc148ec..29027e68 100644 --- a/lib/linux/aarch64-mes-gcc/_exit.c +++ b/lib/linux/aarch64-mes-gcc/_exit.c @@ -28,9 +28,9 @@ void _exit (int code) { asm ( - "mov x7, $"SYS_exit"\n\t" + "mov x7, #"SYS_exit"\n\t" "mov x0, %0\n\t" - "svc $0\n\t" + "svc #0\n\t" : // no outputs "=" (r) : "r" (code) : "x0", "x7" diff --git a/lib/linux/aarch64-mes-gcc/_write.c b/lib/linux/aarch64-mes-gcc/_write.c index 7e748757..07addc26 100644 --- a/lib/linux/aarch64-mes-gcc/_write.c +++ b/lib/linux/aarch64-mes-gcc/_write.c @@ -29,11 +29,11 @@ _write (int filedes, void const *buffer, size_t size) { long r; asm ( - "mov x7, $"SYS_write"\n\t" + "mov x7, #"SYS_write"\n\t" "mov x0, %1\n\t" "mov x1, %2\n\t" "mov x2, %3\n\t" - "svc $0\n\t" + "svc #0\n\t" "mov %0, x0\n\t" : "=r" (r) : "r" (filedes), "r" (buffer), "r" (size) diff --git a/lib/linux/aarch64-mes-gcc/crt1.c b/lib/linux/aarch64-mes-gcc/crt1.c index 989497e1..072a4e9d 100644 --- a/lib/linux/aarch64-mes-gcc/crt1.c +++ b/lib/linux/aarch64-mes-gcc/crt1.c @@ -31,22 +31,22 @@ void _start () { asm ( - "mov w0,#0\n\t" - "mov %0,w0\n" + "mov x0,#0\n\t" + "mov %0,x0\n" : "=r" (__stdin) : //no inputs "" ); asm ( - "mov w0,#1\n\t" - "mov %0,w0\n" + "mov x0,#1\n\t" + "mov %0,x0\n" : "=r" (__stdout) : //no inputs "" ); asm ( - "mov w0,#2\n\t" - "mov %0,w0\n" + "mov x0,#2\n\t" + "mov %0,x0\n" : "=r" (__stderr) : //no inputs "" ); @@ -56,7 +56,7 @@ _start () "ldr x0,[sp]\n\t" /* x0 = argc */ "add x1,sp,#8\n\t" /* x1 = &argv[0] */ "add x2,x0,#1\n\t" /* x2 = argc + 1 (skip zero word after argv) */ - "lsl x2,#3\n\t" /* x2 = (argc + 1) << 3 */ + "lsl x2,x2,#3\n\t" /* x2 = (argc + 1) << 3 */ "add x2,x2,x1\n\t" /* x2 = ((argc + 1) << 3) + &argv[0] */ "stp x1,x2,[sp,#0x10]!\n\t" /* argv, envp */ "stp xzr,x0,[sp,#0x10]!\n\t" /* 0, argc */ diff --git a/lib/linux/aarch64-mes-gcc/syscall-internal.c b/lib/linux/aarch64-mes-gcc/syscall-internal.c index b077a9be..a40a63a8 100644 --- a/lib/linux/aarch64-mes-gcc/syscall-internal.c +++ b/lib/linux/aarch64-mes-gcc/syscall-internal.c @@ -27,7 +27,7 @@ __sys_call_internal (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) @@ -44,7 +44,7 @@ __sys_call2_internal (long sys_call, long one, long two) "mov x7, %1\n\t" "mov x0, %2\n\t" "mov x1, %3\n\t" - "swi $0\n\t" + "svc #0\n\t" "mov %0, x0\n\t" : "=r" (r) : "r" (sys_call), "r" (one), "r" (two)