Newer
Older
extern uint vectors[]; // in vectors.S: array of 256 entry pointers
case T_IRQ0 + IRQ_TIMER:
acquire(&tickslock);
ticks++;
wakeup(&ticks);
release(&tickslock);
case T_IRQ0 + IRQ_IDE:
case T_IRQ0 + IRQ_IDE+1:
// Bochs generates spurious IDE1 interrupts.
break;
case T_IRQ0 + IRQ_KBD:
case T_IRQ0 + IRQ_COM1:
case T_IRQ0 + 7:
case T_IRQ0 + IRQ_SPURIOUS:
cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
tf->trapno, cpu->id, tf->eip, rcr2());
cprintf("pid %d %s: trap %d err %d on cpu %d "
"eip 0x%x addr 0x%x--kill proc\n",
proc->pid, proc->name, tf->trapno, tf->err, cpu->id, tf->eip,
// 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.)
// Force process to give up CPU on clock tick.
// If interrupts were on while locks held, would need to check nlock.
if(proc && proc->state == RUNNING && tf->trapno == T_IRQ0+IRQ_TIMER)
// Check if the process has been killed since we yielded