source: rtems/c/src/lib/libbsp/m32r/m32rsim/console/syscalls.S @ 183af89

4.115
Last change on this file since 183af89 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: 866 bytes
Line 
1/*
2 *  System call support for simulator in gdb.
3 *  Adapted from newlib 1.16.0.
4 *
5 *  $Id$
6 */
7
8#define SYS_exit        1
9#define SYS_open        2
10#define SYS_close       3
11#define SYS_read        4
12#define SYS_write       5
13#define SYS_lseek       6
14#define SYS_unlink      7
15#define SYS_getpid      8
16#define SYS_kill        9
17#define SYS_fstat       10
18
19#define POUND #
20#define SYSCALL(N) mov.b POUND N,0x400
21
22#define S(n) _sys_##n: .global _sys_##n | SYSCALL(SYS_##n) | rts
23
24S(write)
25S(exit)
26
27       .global _abort
28_abort:
29        /* This is for debuggers.  The simulator stops here too. */
30        brk
31
32        /* Else, fall back on the simulator's "kill me" option.  */
33#if defined(__r8c_cpu__) || defined(__m16c_cpu__)
34        mov.w   #42,r1
35#else
36        mov.w   #42,r0
37#endif
38
39        SYSCALL(SYS_kill)
40
41        /* Else, exit. */
42        jmp.a   __exit
43
Note: See TracBrowser for help on using the repository browser.