From 3eda2714e67a499e833ec33bc27f4c6bf45638eb Mon Sep 17 00:00:00 2001 From: rtm Date: Tue, 25 Sep 2007 15:23:44 +0000 Subject: [PATCH] tell SETGATE to leave interrupts on for T_SYSCALL panic if unknown fault with CPL=0 (i.e. in kernel) --- trap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trap.c b/trap.c index ed286ed..ea15029 100644 --- a/trap.c +++ b/trap.c @@ -20,7 +20,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], DPL_USER); + SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER); initlock(&tickslock, "time"); } @@ -72,7 +72,7 @@ trap(struct trapframe *tf) break; default: - if(cp == 0){ + if(cp == 0 || (tf->cs & 3) == 0){ // Otherwise it's our mistake. cprintf("unexpected trap %d from cpu %d eip %x\n", tf->trapno, cpu(), tf->eip);