or1k: syscall: Pass arguments on the stack
commitf764bcffed69d8c62625dc4b6c1a6af21bd6dbc2
authorJoel Stanley <joel@jms.id.au>
Wed, 6 Dec 2017 01:56:21 +0000 (6 12:26 +1030)
committerWaldemar Brodkorb <wbx@openadk.org>
Sun, 10 Dec 2017 18:36:45 +0000 (10 19:36 +0100)
tree31bf056e4035b87d8f4317b82a651214f5bb92a9
parent7c36bcae09d66bbaa35cbb02253ae0556f42677e
or1k: syscall: Pass arguments on the stack

Busybox internally calls syscall(2).

 - in unistd.h defined something like
   int syscall(nr, ....)

 - in syscall.c (common) implemented as
   int syscall(nr, arg1, arg3, arg3, arg4, arg5, arg6)

This will not work, busybox thinks syscall should have varargs calling
conventions.  But it doesnt in the uclibc implementation so no args go through.

Most architectures this will work.  But on openrisc varargs are all sent on the
stack.  Regular args are passed in registers.

Commit message and idea from Stafford Horne <shorne@gmail.com>.

Signed-off-by: Joel Stanley <joel@jms.id.au>
libc/sysdeps/linux/or1k/Makefile.arch
libc/sysdeps/linux/or1k/syscall.c [new file with mode: 0644]