xv6

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 3eda2714e67a499e833ec33bc27f4c6bf45638eb
parent d7a90d3b5c73e2f5698d1635812164c0cfee32dc
Author: rtm <rtm>
Date:   Tue, 25 Sep 2007 15:23:44 +0000

tell SETGATE to leave interrupts on for T_SYSCALL
panic if unknown fault with CPL=0 (i.e. in kernel)

Diffstat:
Mtrap.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 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);