source: rtems/c/src/lib/libbsp/m32r/m32rsim/console/trap0.S @ ea1116d

Last change on this file since ea1116d was ea1116d, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 2, 2008 at 9:56:30 PM

2008-10-02 Joel Sherrill <joel.sherrill@…>

  • .cvsignore, ChangeLog?,, bsp_specs,,, console/console-io.c, console/syscalls.S, console/trap0.S, include/.cvsignore, include/bsp.h, include/tm27.h, start/start.S, startup/linkcmds: New files.
  • Property mode set to 100644
File size: 451 bytes
[ea1116d]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.
7        .text
8        .global __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
16        jmp     lr              ; return to caller
Note: See TracBrowser for help on using the repository browser.