OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [libgloss/] [m32r/] [trap0.S] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1005 ivang
; 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.