changeset 119:94ee7046d190

tweak (this commit can executed)
author anatofuz
date Mon, 02 Dec 2019 18:07:42 +0900
parents 822d74c14f38
children ed85941a7514
files src/syscall.cbc
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/syscall.cbc	Mon Dec 02 13:26:02 2019 +0900
+++ b/src/syscall.cbc	Mon Dec 02 18:07:42 2019 +0900
@@ -143,9 +143,15 @@
         [SYS_close]   =sys_close,
 };
 
+/*
 static enum Code cbccodes[] = {
 	[SYS_cbc_read]	= C_start_code, 
 };
+*/
+
+static __code (*cbccodes[])(__code (*)(int)) = {
+       [SYS_cbc_read]  = cbc_read, 
+};
 
 __ncode cbc_trap_return(){
     return; 
@@ -163,7 +169,6 @@
 {
     int num;
     int ret;
-    struct Context* cbc_context;
 
     num = proc->tf->r0;
 
@@ -173,7 +178,8 @@
 
     if((num >= NELEM(syscalls)) && (num <= NELEM(cbccodes)) && cbccodes[num]) {
         proc->cbc_arg.cbc_console_arg.num = num;	
-        goto meta(cbc_context, cbccodes[num]);
+        goto (cbccodes[num])(cbc_ret);
+        //goto meta(&proc->cbc_context, cbccodes[num]);
     }