0
|
1 #include "syscall.h"
|
|
2
|
|
3 #define SYSCALL(name) \
|
|
4 .globl name; \
|
|
5 name: \
|
|
6 PUSH {r4};\
|
|
7 MOV r4, r3;\
|
|
8 MOV r3, r2;\
|
|
9 MOV r2, r1;\
|
|
10 MOV r1, r0;\
|
|
11 MOV r0, #SYS_ ## name;\
|
|
12 swi 0x00;\
|
|
13 POP {r4};\
|
|
14 bx lr;
|
|
15
|
|
16 SYSCALL(fork)
|
|
17 SYSCALL(exit)
|
|
18 SYSCALL(wait)
|
|
19 SYSCALL(pipe)
|
|
20 SYSCALL(read)
|
|
21 SYSCALL(write)
|
|
22 SYSCALL(close)
|
|
23 SYSCALL(kill)
|
|
24 SYSCALL(exec)
|
|
25 SYSCALL(open)
|
|
26 SYSCALL(mknod)
|
|
27 SYSCALL(unlink)
|
|
28 SYSCALL(fstat)
|
|
29 SYSCALL(link)
|
|
30 SYSCALL(mkdir)
|
|
31 SYSCALL(chdir)
|
|
32 SYSCALL(dup)
|
|
33 SYSCALL(getpid)
|
|
34 SYSCALL(sbrk)
|
|
35 SYSCALL(sleep)
|
|
36 SYSCALL(uptime)
|