summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkolya <kolya>2008-10-15 04:57:02 +0000
committerkolya <kolya>2008-10-15 04:57:02 +0000
commit15ce79de141f66c7dd2f2948ce4584a2d31f7040 (patch)
tree21c74e4dcfb860672156bde7098339f7e38d4039
parent00ce31c09cd46331a0b509ac7987dd3ce5def1f3 (diff)
downloadxv6-labs-15ce79de141f66c7dd2f2948ce4584a2d31f7040.tar.gz
xv6-labs-15ce79de141f66c7dd2f2948ce4584a2d31f7040.tar.bz2
xv6-labs-15ce79de141f66c7dd2f2948ce4584a2d31f7040.zip
check cp->killed before returning to user from a timer interrupt
-rw-r--r--trap.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/trap.c b/trap.c
index 533f3f0..fd00071 100644
--- a/trap.c
+++ b/trap.c
@@ -91,4 +91,8 @@ trap(struct trapframe *tf)
// If interrupts were on while locks held, would need to check nlock.
if(cp && cp->state == RUNNING && tf->trapno == IRQ_OFFSET+IRQ_TIMER)
yield();
+
+ // Check if the process has been killed since we yielded
+ if(cp && cp->killed && (tf->cs&3) == DPL_USER)
+ exit();
}