36 #define PIC1_PORT 0x20 37 #define PIC2_PORT 0xA0 38 #define PIC1_COMMAND_PORT PIC1_PORT 39 #define PIC1_DATA_PORT (PIC1_PORT+1) 40 #define PIC2_COMMAND_PORT PIC2_PORT 41 #define PIC2_DATA_PORT (PIC2_PORT+1) 43 #define ICW1_ICW4 0x01 44 #define ICW1_SINGLE 0x02 45 #define ICW1_INTERVAL4 0x04 46 #define ICW1_LEVEL 0x08 47 #define ICW1_INIT 0x10 49 #define ICW4_8086 0x01 50 #define ICW4_AUTO 0x02 51 #define ICW4_BUF_SLAVE 0x08 52 #define ICW4_BUF_MASTER 0x0C 53 #define ICW4_SFNM 0x10 66 #define IRQ_KEYBOARD 1 73 #define IRQ_CMOS_CLOCK 8 74 #define IRQ_PS2_MOUSE 12 82 typedef uint32_t (*irq_callback)(uint32_t irq); 84 void picInit(uint32_t interruptOffset);
uint32_t(* irq_callback)(uint32_t irq)
bool picReserveIRQ(uint32_t irq, irq_callback callback)
Assign a callback function to an IRQ.
void picInit(uint32_t interruptOffset)
Initializes the programmable interrupt controller.
void picFreeIRQ(uint32_t irq)
Release an IRQ.