summaryrefslogtreecommitdiff
path: root/trap.c
diff options
context:
space:
mode:
Diffstat (limited to 'trap.c')
-rw-r--r--trap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/trap.c b/trap.c
index 89c6bf5..33d7be1 100644
--- a/trap.c
+++ b/trap.c
@@ -29,10 +29,13 @@ void
trap(struct Trapframe *tf)
{
int v = tf->tf_trapno;
+
+ acquire_spinlock(&kernel_lock); // released in trapret in trapasm.S
+
cprintf("trap %d eip %x:%x\n", tf->tf_trapno, tf->tf_cs, tf->tf_eip);
if(v == T_SYSCALL){
- curproc->tf = tf;
+ curproc[cpu()]->tf = tf;
syscall();
return;
}