OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.17.0/] [libgloss/] [m32r/] [trap0.S] - Blame information for rev 410

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 148 jeremybenn
; 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

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.