1 ; Trap 0 handler (syscall interface).
3 ; The trap handler returns the result in r0 and the error code (errno value)
4 ; in r2. r1 is reserved in case an 8 byte quantity ever needs to be
5 ; returned in registers.
10 trap #0 ; trap 0 returns result in r0, error code in r2
11 cmpui r2,#1 ; is error code zero?
12 bc .Lret ; yes, skip setting errno
13 ld r4,@(sp) ; no, set errno
16 jmp lr ; return to caller