summaryrefslogtreecommitdiff
path: root/trap.c
diff options
context:
space:
mode:
authorrsc <rsc>2007-08-08 09:02:42 +0000
committerrsc <rsc>2007-08-08 09:02:42 +0000
commitb6dc6187f7b0868f0a08e80a20c2a13c32e519ed (patch)
treee680e25b97933c24e61c80ec9552860b0f359283 /trap.c
parentf83f7ce2f6ef5b840d8af8ed2573e1934865406f (diff)
downloadxv6-labs-b6dc6187f7b0868f0a08e80a20c2a13c32e519ed.tar.gz
xv6-labs-b6dc6187f7b0868f0a08e80a20c2a13c32e519ed.tar.bz2
xv6-labs-b6dc6187f7b0868f0a08e80a20c2a13c32e519ed.zip
add DPL_USER constant
Diffstat (limited to 'trap.c')
-rw-r--r--trap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/trap.c b/trap.c
index 0625e56..0c4a956 100644
--- a/trap.c
+++ b/trap.c
@@ -18,7 +18,7 @@ tvinit(void)
for(i = 0; i < 256; i++)
SETGATE(idt[i], 0, SEG_KCODE << 3, vectors[i], 0);
- SETGATE(idt[T_SYSCALL], 0, SEG_KCODE << 3, vectors[T_SYSCALL], 3);
+ SETGATE(idt[T_SYSCALL], 0, SEG_KCODE << 3, vectors[T_SYSCALL], DPL_USER);
}
void
@@ -56,7 +56,7 @@ trap(struct trapframe *tf)
// Force process exit if it has been killed and is in user space.
// (If it is still executing in the kernel, let it keep running
// until it gets to the regular system call return.)
- if((tf->cs&3) == 3 && cp->killed)
+ if((tf->cs&3) == DPL_USER && cp->killed)
proc_exit();
// Force process to give up CPU and let others run.