master
E. Almqvist 3 years ago
parent a42e869204
commit 468c3874be
  1. 10
      kernel/pic.c
  2. 2
      kernel/pic.h

@ -58,3 +58,13 @@ void irq(uint8 idx, bool t) {
outb(port, data); outb(port, data);
} }
} }
static uint16 irq_reg(int ocw3) {
outb(PIC1_CMD, ocw3);
outb(PIC2_CMD, ocw3);
return (inb(PIC2_CMD) << 8 | inb(PIC1_CMD));
}
uint16 get_irr() { return irq_reg(PIC_R_IRR); } // fetch IRR
uint16 get_isr() { return irq_reg(PIC_R_ISR); } // fetch ISR

@ -42,3 +42,5 @@ void pic_disable();
void irq(uint8, bool); void irq(uint8, bool);
static uint16 irq_reg(int ocw3); static uint16 irq_reg(int ocw3);
uint16 get_irr();
uint16 get_isr();

Loading…
Cancel
Save