Mercurial > hg > CbC > CbC_xv6
diff src/syscall.cbc @ 91:b5ddf6fb0a6d
use CbCFile instead of File struct Interface
author | anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 18 Oct 2019 20:39:36 +0900 |
parents | 214d21c891c7 |
children | bc5bcfd2f6d6 |
line wrap: on
line diff
--- a/src/syscall.cbc Thu Oct 17 10:42:54 2019 +0900 +++ b/src/syscall.cbc Fri Oct 18 20:39:36 2019 +0900 @@ -143,8 +143,8 @@ [SYS_close] =sys_close, }; -static __code (*cbccodes[])(__code (*)(int)) = { - [SYS_cbc_read] = cbc_read, +static enum Code cbccodes[] = { + [SYS_cbc_read] = C_start_code, }; __ncode cbc_trap_return(){ @@ -163,16 +163,17 @@ { int num; int ret; + struct Context* cbc_context; num = proc->tf->r0; if (num == 5) - num = 22; + num = 22; //cprintf ("syscall(%d) from %s(%d)\n", num, proc->name, proc->pid); if((num >= NELEM(syscalls)) && (num <= NELEM(cbccodes)) && cbccodes[num]) { proc->cbc_arg.cbc_console_arg.num = num; - goto (cbccodes[num])(cbc_ret); + goto meta(cbc_context, cbccodes[num]); }