diff src/syscall.c @ 31:96a5833d0d82

fix
author mir3636
date Fri, 18 Jan 2019 18:20:02 +0900
parents 6a7ab1d7001c
children 96af12a50fdb
line wrap: on
line diff
--- a/src/syscall.c	Fri Jan 18 11:50:48 2019 +0900
+++ b/src/syscall.c	Fri Jan 18 18:20:02 2019 +0900
@@ -146,7 +146,7 @@
 };
 
 __code cbc_trap_return(){
-    goto trap_swi();
+    return; 
 }
 
 __code cbc_ret(int ret){
@@ -161,9 +161,11 @@
 
     num = proc->tf->r0;
 
+    if (num == 5)
+	num = 22;
     //cprintf ("syscall(%d) from %s(%d)\n", num, proc->name, proc->pid);
 
-    if((num > 0) && (num > NELEM(syscalls)) && cbccodes[num]) {
+    if((num >= NELEM(syscalls)) && (num <= NELEM(cbccodes)) && cbccodes[num]) {
 	
     	goto (cbccodes[num])(cbc_ret);
     }