tell SETGATE to leave interrupts on for T_SYSCALL
panic if unknown fault with CPL=0 (i.e. in kernel)
This commit is contained in:
parent
d7a90d3b5c
commit
3eda2714e6
1 changed files with 2 additions and 2 deletions
4
trap.c
4
trap.c
|
@ -20,7 +20,7 @@ tvinit(void)
|
||||||
|
|
||||||
for(i = 0; i < 256; i++)
|
for(i = 0; i < 256; i++)
|
||||||
SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0);
|
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");
|
initlock(&tickslock, "time");
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ trap(struct trapframe *tf)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if(cp == 0){
|
if(cp == 0 || (tf->cs & 3) == 0){
|
||||||
// Otherwise it's our mistake.
|
// Otherwise it's our mistake.
|
||||||
cprintf("unexpected trap %d from cpu %d eip %x\n",
|
cprintf("unexpected trap %d from cpu %d eip %x\n",
|
||||||
tf->trapno, cpu(), tf->eip);
|
tf->trapno, cpu(), tf->eip);
|
||||||
|
|
Loading…
Reference in a new issue