From e5f326040d041f4e2abf4e350c915e22eebe13ef Mon Sep 17 00:00:00 2001 From: Danny Milosavljevic Date: Mon, 11 Mar 2019 16:33:40 +0100 Subject: [PATCH] ARM: Fix system call handling in arm-mes-gcc. * lib/linux/arm-mes-gcc/syscall.c (_sys_call, _sys_call1, _sys_call2, _sys_call3, _sys_call4, _sys_call5, _sys_call6): Modify. --- lib/linux/arm-mes-gcc/syscall.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/linux/arm-mes-gcc/syscall.c b/lib/linux/arm-mes-gcc/syscall.c index cbca261f..a7adc13a 100644 --- a/lib/linux/arm-mes-gcc/syscall.c +++ b/lib/linux/arm-mes-gcc/syscall.c @@ -29,7 +29,7 @@ _sys_call (long sys_call) asm ( "mov r7, %1\n\t" "swi $0\n\t" - "mov r0, %0\n\t" + "mov %0, r0\n\t" : "=r" (r) : "r" (sys_call) : "r0" // , "r7" // error: r7 cannot be used in asm here @@ -52,7 +52,7 @@ _sys_call1 (long sys_call, long one) "mov r7, %1\n\t" "mov r0, %2\n\t" "swi $0\n\t" - "mov r0, %0\n\t" + "mov %0, r0\n\t" : "=r" (r) : "r" (sys_call), "r" (one) : "r0" @@ -76,7 +76,7 @@ _sys_call2 (long sys_call, long one, long two) "mov r0, %2\n\t" "mov r1, %3\n\t" "swi $0\n\t" - "mov r0, %0\n\t" + "mov %0, r0\n\t" : "=r" (r) : "r" (sys_call), "r" (one), "r" (two) : "r0", "r1" @@ -101,7 +101,7 @@ _sys_call3 (long sys_call, long one, long two, long three) "mov r1, %3\n\t" "mov r2, %4\n\t" "swi $0\n\t" - "mov r0, %0\n\t" + "mov %0, r0\n\t" : "=r" (r) : "r" (sys_call), "r" (one), "r" (two), "r" (three) : "r0", "r1", "r2" @@ -127,7 +127,7 @@ _sys_call4 (long sys_call, long one, long two, long three, long four) "mov r2, %4\n\t" "mov r3, %5\n\t" "swi $0\n\t" - "mov r0, %0\n\t" + "mov %0, r0\n\t" : "=r" (r) : "r" (sys_call), "r" (one), "r" (two), "r" (three), "r" (four) : "r0", "r1", "r2", "r3" @@ -155,7 +155,7 @@ _sys_call6 (long sys_call, long one, long two, long three, long four, long five, "mov r4, %6\n\t" "mov r5, %7\n\t" "swi $0\n\t" - "mov r0, %0\n\t" + "mov %0, r0\n\t" : "=r" (r) : "r" (sys_call), "r" (one), "r" (two), "r" (three), "r" (four), "r" (five), "r" (six) : "r0", "r1", "r2", "r3", "r4", "r5"