implement inline 5- and 6-argument syscalls for mipsn32 and mips64
[musl] / src / internal / sh / syscall.s
1 .global __syscall
2 .hidden __syscall
3 .type   __syscall, @function
4 __syscall:
5         ! The kernel syscall entry point documents that the trap number indicates
6         ! the number of arguments being passed, but it then ignores that information.
7         ! Since we do not actually know how many arguments are being passed, we will
8         ! say there are six, since that is the maximum we support here.
9         mov r4, r3
10         mov r5, r4
11         mov r6, r5
12         mov r7, r6
13         mov.l @r15, r7
14         mov.l @(4,r15), r0
15         mov.l @(8,r15), r1
16         trapa #31
17         or r0, r0
18         or r0, r0
19         or r0, r0
20         or r0, r0
21         or r0, r0
22         rts
23          nop