syscalls: fix handle_syscall function performing more that 1 syscall at a time
This commit is contained in:
+23
-29
@@ -239,38 +239,32 @@ void handle_syscall(TrapFrame *tf)
|
|||||||
debug_log("EDX: %X\n", tf->edx);
|
debug_log("EDX: %X\n", tf->edx);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(tf->eax == 1)//exit
|
switch(tf->eax)
|
||||||
{
|
{
|
||||||
int r = sys_exit(tf);
|
case 1://exit
|
||||||
tf->eax = r;
|
tf->eax = sys_exit(tf);
|
||||||
}
|
break;
|
||||||
|
|
||||||
if(tf->eax == 2)//fork
|
case 2://fork
|
||||||
{
|
tf->eax = sys_fork(tf);
|
||||||
int r = sys_fork(tf);
|
break;
|
||||||
debug_log("RRRRRRRR = %X\n", r);
|
|
||||||
tf->eax = r;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(tf->eax == 3)//read
|
case 3://read
|
||||||
{
|
tf->eax = sys_read(tf);
|
||||||
int r = sys_read(tf);
|
break;
|
||||||
tf->eax = r;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(tf->eax == 4)//write
|
case 4://write
|
||||||
{
|
tf->eax = sys_write(tf);
|
||||||
int r = sys_write(tf);
|
break;
|
||||||
tf->eax = r;
|
case 5://open
|
||||||
}
|
tf->eax = sys_open(tf);
|
||||||
if(tf->eax == 5)//open
|
break;
|
||||||
{
|
case 6://close
|
||||||
int r = sys_open(tf);
|
tf->eax = sys_close(tf);
|
||||||
tf->eax = r;
|
break;
|
||||||
}
|
default:
|
||||||
if(tf->eax == 6)//close
|
debug_log("unknown syscall: %X\n", tf->eax);
|
||||||
{
|
tf->eax = -1;
|
||||||
int r = sys_close(tf);
|
break;
|
||||||
tf->eax = r;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user