diff options
| author | Russ Cox <rsc@swtch.com> | 2009-07-11 18:17:32 -0700 |
|---|---|---|
| committer | Russ Cox <rsc@swtch.com> | 2009-07-11 18:17:32 -0700 |
| commit | 8b75366ce4ae7ad5f77225b247d097955574ba0b (patch) | |
| tree | d9f462b7d0d76ea6b3f8afea35887f912bfda94b /trap.c | |
| parent | 27ff8f0e6f56e5f84688bcd41a7b4018b4e61173 (diff) | |
| download | xv6-labs-2022-8b75366ce4ae7ad5f77225b247d097955574ba0b.tar.xz xv6-labs-2022-8b75366ce4ae7ad5f77225b247d097955574ba0b.zip | |
s/IRQ_OFFSET/T_IRQ0/: it's a trap number, not an irq number.
move the SYSCALL number up, so does not overlap the IRQ traps.
Diffstat (limited to 'trap.c')
| -rw-r--r-- | trap.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -45,7 +45,7 @@ trap(struct trapframe *tf) } switch(tf->trapno){ - case IRQ_OFFSET + IRQ_TIMER: + case T_IRQ0 + IRQ_TIMER: if(cpu() == 0){ acquire(&tickslock); ticks++; @@ -54,20 +54,20 @@ trap(struct trapframe *tf) } lapiceoi(); break; - case IRQ_OFFSET + IRQ_IDE: + case T_IRQ0 + IRQ_IDE: ideintr(); lapiceoi(); break; - case IRQ_OFFSET + IRQ_KBD: + case T_IRQ0 + IRQ_KBD: kbdintr(); lapiceoi(); break; - case IRQ_OFFSET + IRQ_COM1: + case T_IRQ0 + IRQ_COM1: uartintr(); lapiceoi(); break; - case IRQ_OFFSET + 7: - case IRQ_OFFSET + IRQ_SPURIOUS: + case T_IRQ0 + 7: + case T_IRQ0 + IRQ_SPURIOUS: cprintf("cpu%d: spurious interrupt at %x:%x\n", cpu(), tf->cs, tf->eip); lapiceoi(); @@ -94,7 +94,7 @@ trap(struct trapframe *tf) // Force process to give up CPU on clock tick. // If interrupts were on while locks held, would need to check nlock. - if(cp && cp->state == RUNNING && tf->trapno == IRQ_OFFSET+IRQ_TIMER) + if(cp && cp->state == RUNNING && tf->trapno == T_IRQ0+IRQ_TIMER) yield(); // Check if the process has been killed since we yielded |
