4.104.115
Last change
on this file since 0fd07a10 was
0fd07a10,
checked in by Joel Sherrill <joel.sherrill@…>, on 10/02/08 at 21:34:36
|
2008-10-02 Joel Sherrill <joel.sherrill@…>
- .cvsignore, ChangeLog?, Makefile.am, bsp_specs, configure.ac,
preinstall.am, console/console-io.c, console/syscalls.S,
include/.cvsignore, include/bsp.h, start/start.S, startup/bspstart.c,
startup/crtn.S, startup/linkcmds, timer/timer.c, tools/.cvsignore,
tools/Makefile.am, tools/configure.ac, tools/runtest.in: New files.
|
-
Property mode set to
100644
|
File size:
901 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 | #define SYS_sbrk 11 |
---|
19 | |
---|
20 | #define POUND # |
---|
21 | #define SYSCALL(N) mov.b POUND N,0x400 |
---|
22 | |
---|
23 | #define S(n) _sys_##n: .global _sys_##n | SYSCALL(SYS_##n) | rts |
---|
24 | |
---|
25 | S(write) |
---|
26 | S(exit) |
---|
27 | S(sbrk) |
---|
28 | |
---|
29 | .global _abort |
---|
30 | _abort: |
---|
31 | /* This is for debuggers. The simulator stops here too. */ |
---|
32 | brk |
---|
33 | |
---|
34 | /* Else, fall back on the simulator's "kill me" option. */ |
---|
35 | #if defined(__r8c_cpu__) || defined(__m16c_cpu__) |
---|
36 | mov.w #42,r1 |
---|
37 | #else |
---|
38 | mov.w #42,r0 |
---|
39 | #endif |
---|
40 | |
---|
41 | SYSCALL(SYS_kill) |
---|
42 | |
---|
43 | /* Else, exit. */ |
---|
44 | jmp.a __exit |
---|
45 | |
---|
Note: See
TracBrowser
for help on using the repository browser.