swissChili | 9b3584b | 2021-02-18 13:57:27 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "kint.h" |
| 4 | #include "registers.h" |
| 5 | |
| 6 | #define PIC1 0x20 |
| 7 | #define PIC2 0xa0 |
| 8 | #define PIC1_COMMAND PIC1 |
| 9 | #define PIC1_DATA (PIC1 + 1) |
| 10 | #define PIC2_COMMAND PIC2 |
| 11 | #define PIC2_DATA (PIC2 + 1) |
| 12 | |
| 13 | #define PIC_EOI 0x20 // End of input |
| 14 | |
swissChili | defeb0d | 2021-02-18 15:28:36 -0800 | [diff] [blame] | 15 | #define IRQ_TO_INT(irq) ((irq) + 32) |
| 16 | |
swissChili | 9b3584b | 2021-02-18 13:57:27 -0800 | [diff] [blame] | 17 | void pic_send_eoi(uchar interrupt); |
swissChili | 825d46b | 2021-02-21 10:14:16 -0800 | [diff] [blame] | 18 | void add_interrupt_handler(uchar interrupt, void (*handler)(struct registers *)); |
swissChili | defeb0d | 2021-02-18 15:28:36 -0800 | [diff] [blame] | 19 | |
| 20 | void pic_remap(); |