From b6dc6187f7b0868f0a08e80a20c2a13c32e519ed Mon Sep 17 00:00:00 2001 From: rsc Date: Wed, 8 Aug 2007 09:02:42 +0000 Subject: add DPL_USER constant --- trap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'trap.c') 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. -- cgit v1.2.3