summaryrefslogtreecommitdiff
path: root/trap.c
diff options
context:
space:
mode:
authorrtm <rtm>2006-07-12 01:48:35 +0000
committerrtm <rtm>2006-07-12 01:48:35 +0000
commit4e8f237be819424f922399f8d121d9867b675541 (patch)
tree53459cfde9630b3ae0d2d46d0ce3d4c1ac423944 /trap.c
parentb41b38d0da0854f3fa92967b70180ea1156154d4 (diff)
downloadxv6-labs-4e8f237be819424f922399f8d121d9867b675541.tar.gz
xv6-labs-4e8f237be819424f922399f8d121d9867b675541.tar.bz2
xv6-labs-4e8f237be819424f922399f8d121d9867b675541.zip
no more big kernel lock
succeeds at usertests.c pipe test
Diffstat (limited to 'trap.c')
-rw-r--r--trap.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/trap.c b/trap.c
index d7739f7..862225b 100644
--- a/trap.c
+++ b/trap.c
@@ -5,6 +5,7 @@
#include "defs.h"
#include "x86.h"
#include "traps.h"
+#include "syscall.h"
struct Gatedesc idt[256];
struct Pseudodesc idt_pd = { 0, sizeof(idt) - 1, (unsigned) &idt };
@@ -35,12 +36,6 @@ trap(struct Trapframe *tf)
{
int v = tf->tf_trapno;
- if(tf->tf_cs == 0x8 && kernel_lock == cpu())
- cprintf("cpu %d: trap %d from %x:%x with lock=%d\n",
- cpu(), v, tf->tf_cs, tf->tf_eip, kernel_lock);
-
- acquire_spinlock(&kernel_lock); // released in trapret in trapasm.S
-
if(v == T_SYSCALL){
struct proc *cp = curproc[cpu()];
if(cp == 0)
@@ -55,7 +50,8 @@ trap(struct Trapframe *tf)
panic("trap ret but not RUNNING");
if(tf != cp->tf)
panic("trap ret wrong tf");
- if(read_esp() < (unsigned)cp->kstack || read_esp() >= (unsigned)cp->kstack + KSTACKSIZE)
+ if(read_esp() < (unsigned)cp->kstack ||
+ read_esp() >= (unsigned)cp->kstack + KSTACKSIZE)
panic("trap ret esp wrong");
if(cp->killed)
proc_exit();