Exemplo n.º 1
0
void pic_isr(struct thread_state* state, unsigned ring, unsigned irq) {
  (void)state;
  (void)ring;

  unsigned pirq = irq - 32;
  if (!pic_is_spurious(pirq)) {
    if (pirq == 8) rtc_update(); // try to keep RTC latency as low as possible.
    pic_eoi(pirq);
    isr_send_signal(irq);
  }
}
Exemplo n.º 2
0
static void pic_eoi(uint32_t vector) {
    if(vector > PIC_SLAVE_OFFSET + PIC_NUM_PINS) return;
    if(pic_is_spurious(vector)) return;

    //don't ignore INT_SPURIOUS_MASTER interrupts because that is the IDE
    //secondary IRQ vector
    if(vector >= PIC_SLAVE_OFFSET) {
        outb(SLAVE_COMMAND, EOI);
    }

    if(vector != INT_SPURIOUS_MASTER) {
        outb(MASTER_COMMAND, EOI);
    }
}