Mercurial > hg > CbC > CbC_xv6
diff src/usr/usys.S @ 0:83c23a36980d
Init
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 26 May 2017 23:11:05 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/usr/usys.S Fri May 26 23:11:05 2017 +0900 @@ -0,0 +1,36 @@ +#include "syscall.h" + +#define SYSCALL(name) \ +.globl name; \ +name: \ + PUSH {r4};\ + MOV r4, r3;\ + MOV r3, r2;\ + MOV r2, r1;\ + MOV r1, r0;\ + MOV r0, #SYS_ ## name;\ + swi 0x00;\ + POP {r4};\ + bx lr; + +SYSCALL(fork) +SYSCALL(exit) +SYSCALL(wait) +SYSCALL(pipe) +SYSCALL(read) +SYSCALL(write) +SYSCALL(close) +SYSCALL(kill) +SYSCALL(exec) +SYSCALL(open) +SYSCALL(mknod) +SYSCALL(unlink) +SYSCALL(fstat) +SYSCALL(link) +SYSCALL(mkdir) +SYSCALL(chdir) +SYSCALL(dup) +SYSCALL(getpid) +SYSCALL(sbrk) +SYSCALL(sleep) +SYSCALL(uptime)