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

4.104.115
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?, Makefile.am, bsp_specs, configure.ac, preinstall.am, 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
RevLine 
[ea1116d]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
Note: See TracBrowser for help on using the repository browser.