diff options
author | rtm <rtm> | 2007-09-25 15:23:44 +0000 |
---|---|---|
committer | rtm <rtm> | 2007-09-25 15:23:44 +0000 |
commit | 3eda2714e67a499e833ec33bc27f4c6bf45638eb (patch) | |
tree | ec5ccaec2b9ab689ead3bfb97be18a5bb99c97a6 /trap.c | |
parent | d7a90d3b5c73e2f5698d1635812164c0cfee32dc (diff) | |
download | xv6-labs-3eda2714e67a499e833ec33bc27f4c6bf45638eb.tar.gz xv6-labs-3eda2714e67a499e833ec33bc27f4c6bf45638eb.tar.bz2 xv6-labs-3eda2714e67a499e833ec33bc27f4c6bf45638eb.zip |
tell SETGATE to leave interrupts on for T_SYSCALL
panic if unknown fault with CPL=0 (i.e. in kernel)
Diffstat (limited to 'trap.c')
-rw-r--r-- | trap.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); |