diff options
Diffstat (limited to 'include/asm/interrupt.h')
| -rw-r--r-- | include/asm/interrupt.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/asm/interrupt.h b/include/asm/interrupt.h index d1ea6c1..1187fef 100644 --- a/include/asm/interrupt.h +++ b/include/asm/interrupt.h @@ -1,2 +1,29 @@ +#include <stdint.h> + +#define irq_enable(n) \ + __asm__ volatile ( \ + "inb $0xA1, %%al\n" \ + "shl $8, %%ax\n" \ + "inb $0x21, %%al\n" \ + "xor $0xFFFF, %%bx\n" \ + "and %%bx, %%ax\n" \ + "outb %%al, $0x21\n" \ + "shr $8, %%ax\n" \ + "outb %%al, $0xA1\n" \ + :: "b" (n) \ + ); + +#define irq_disable(n) \ + __asm__ volatile ( \ + "inb $0xA1, %%al\n" \ + "shl $8, %%ax\n" \ + "inb $0x21, %%al\n" \ + "or %%bx, %%ax\n" \ + "outb %%al, $0x21\n" \ + "shr $8, %%ax\n" \ + "outb %%al, $0xA1\n" \ + :: "b" (n) \ + ); + void register_isr(uint8_t n, uint8_t dpl, void *handler); void register_trap(uint8_t n, uint8_t dpl, void *handler); |
