16static irq_handler_fn irq_handlers[16];
22 irq_handlers[irq] = fn;
27 uint8_t irq = frame->vector - 32;
32 if (irq == 7 || irq == 15) {
34 uint8_t isr = pic_read_isr();
36 if (!(isr & (1 << (irq > 7 ? irq - 8 : irq)))) {
42 if (irq_handlers[irq] != NULL)
43 irq_handlers[irq](frame);
Initializes and holds the IDT for the kernel.
void irq_handler(struct interrupt_frame *frame)
Calls the correct handler and returns the interrupt.
void irq_register(uint8_t irq, irq_handler_fn fn)
Registers a handler function for the specified IRQ number.
IRQ Handler and utilities.
void pic_send_eoi(uint8_t irq)
Sends an EOI to tell the PIC that the interrupt is over.
Handles the legacy PIC for IRQ interrupts.
The frame holding the registers when an interrupt happens.