blob: 5b16b8f20cbcde33fc9180291af2a5876130255c [file] [log] [blame]
rofl0r1c8eb8b2012-11-09 23:36:55 +01001 .global __syscall
Rich Felker7405cd12015-04-14 13:48:20 -04002 .hidden __syscall
rofl0r1c8eb8b2012-11-09 23:36:55 +01003 .type __syscall,@function
4__syscall:
5 mr 0, 3 # Save the system call number
6 mr 3, 4 # Shift the arguments: arg1
7 mr 4, 5 # arg2
8 mr 5, 6 # arg3
9 mr 6, 7 # arg4
10 mr 7, 8 # arg5
11 mr 8, 9 # arg6
12 sc
13 bnslr+ # return if not summary overflow
14 #else error:
15 # return negated value.
16 neg 3, 3
17 blr
18 .end __syscall
19 .size __syscall, .-__syscall