From 52f89cf8fab24266aeb880925702e1a1ae6ee40e Mon Sep 17 00:00:00 2001 From: "TOIDA,Suguru" Date: Fri, 1 Mar 2019 15:43:39 +0900 Subject: [PATCH] add system call execution for uti Change-Id: Ide79726b79964e72596ed78c87ec61d1eaf7e1c7 --- executer/user/arch/arm64/archdep_c.c | 69 ++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 executer/user/arch/arm64/archdep_c.c diff --git a/executer/user/arch/arm64/archdep_c.c b/executer/user/arch/arm64/archdep_c.c new file mode 100644 index 00000000..51759b8f --- /dev/null +++ b/executer/user/arch/arm64/archdep_c.c @@ -0,0 +1,69 @@ +/* archdep_c.c COPYRIGHT FUJITSU LIMITED 2019 */ + +long uti_syscall6(long syscall_number, + long arg0, long arg1, long arg2, + long arg3, long arg4, long arg5) +{ + long ret; + + asm volatile( + "mov x8, %1;" + "mov x0, %2;" + "mov x1, %3;" + "mov x2, %4;" + "mov x3, %5;" + "mov x4, %6;" + "mov x5, %7;" + "svc #0x0;" + "mov %0, x0;" + : "=r" (ret) + : "r" (syscall_number), + "r" (arg0), "r" (arg1), "r" (arg2), + "r" (arg3), "r" (arg4), "r" (arg5)); + return ret; +} + +long uti_syscall3(long syscall_number, long arg0, long arg1, long arg2) +{ + long ret; + + asm volatile( + "mov x8, %1;" + "mov x0, %2;" + "mov x1, %3;" + "mov x2, %4;" + "svc #0x0;" + "mov %0, x0;" + : "=r" (ret) + : "r" (syscall_number), + "r" (arg0), "r" (arg1), "r" (arg2)); + return ret; +} + +long uti_syscall1(long syscall_number, long arg0) +{ + long ret; + + asm volatile( + "mov x8, %1;" + "mov x0, %2;" + "svc #0x0;" + "mov %0, x0;" + : "=r" (ret) + : "r" (syscall_number), + "r" (arg0)); + return ret; +} + +long uti_syscall0(long syscall_number) +{ + long ret; + + asm volatile( + "mov x8, %1;" + "svc #0x0;" + "mov %0, x0;" + : "=r" (ret) + : "r" (syscall_number)); + return ret; +}