diff options
author | Stafford Horne <shorne@gmail.com> | 2017-12-14 15:29:07 +0900 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2018-01-15 20:01:19 +0000 |
commit | 6237a836c8c9df96a185dd59522c05c33ea2b622 (patch) | |
tree | 4e2bab1b795bbaf9db7f48af860bbb400b66ee0e | |
parent | c55cb0c0bcf04c7ad1f6f48d914850f516bd106c (diff) |
or1k: Use new common syscall() implementation
Now that the common syscall implementation supports vararg calling
conventions we can safely use it on OpenRISC.
This saves a bit of code in the openrisc implementation.
Signed-off-by: Stafford Horne <shorne@gmail.com>
-rw-r--r-- | libc/sysdeps/linux/or1k/Makefile.arch | 2 | ||||
-rw-r--r-- | libc/sysdeps/linux/or1k/syscall.c | 32 |
2 files changed, 1 insertions, 33 deletions
diff --git a/libc/sysdeps/linux/or1k/Makefile.arch b/libc/sysdeps/linux/or1k/Makefile.arch index 191eebafd..f6758fa63 100644 --- a/libc/sysdeps/linux/or1k/Makefile.arch +++ b/libc/sysdeps/linux/or1k/Makefile.arch @@ -5,5 +5,5 @@ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. # -CSRC-y := __syscall_error.c __init_brk.c brk.c sbrk.c clone.c syscall.c +CSRC-y := __syscall_error.c __init_brk.c brk.c sbrk.c clone.c SSRC-y := __longjmp.S setjmp.S or1k_clone.S diff --git a/libc/sysdeps/linux/or1k/syscall.c b/libc/sysdeps/linux/or1k/syscall.c deleted file mode 100644 index 2f4356737..000000000 --- a/libc/sysdeps/linux/or1k/syscall.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (C) 2017 Joel Stanley <joel@jms.id.au> - * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. - */ - -#include <stdarg.h> -#include <sys/syscall.h> -#include <unistd.h> - -long int syscall (long num, ...) -{ - unsigned long arg1 = 0; - unsigned long arg2 = 0; - unsigned long arg3 = 0; - unsigned long arg4 = 0; - unsigned long arg5 = 0; - unsigned long arg6 = 0; - va_list arg; - - va_start (arg, num); - arg1 = va_arg (arg, unsigned long); - arg2 = va_arg (arg, unsigned long); - arg3 = va_arg (arg, unsigned long); - arg4 = va_arg (arg, unsigned long); - arg5 = va_arg (arg, unsigned long); - arg6 = va_arg (arg, unsigned long); - va_end (arg); - - __asm__ volatile ( "" ::: "memory" ); - - return INLINE_SYSCALL_NCS(num, 6, arg1, arg2, arg3, arg4, arg5, arg6); -} |