]> sourceware.org Git - newlib-cygwin.git/blob - libgloss/m32r/trap0.S
2009-03-16 Jeff Johnston <jjohnstn@redhat.com>
[newlib-cygwin.git] / libgloss / m32r / trap0.S
1 ; Trap 0 handler (syscall interface).
2 ;
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.
6
7 .text
8 .global __trap0
9 __trap0:
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
14 st r2,@r4
15 .Lret:
16 jmp lr ; return to caller
This page took 0.035976 seconds and 5 git commands to generate.