]>
git.dujemihanovic.xyz Git - nameless-os.git/blob - kernel/arch/x86/irq/interrupt.c
2 #include <irq/interrupt.h>
5 #include <irq/i8259a.h>
7 /* This table will hold pointers to our interrupt handlers. */
8 static int (*int_handler_table
[256])(void);
10 void int_handler(int interrupt
)
12 if (int_handler_table
[interrupt
] == NULL
) {
13 kprint("WARNING: Unhandled interrupt ", 0);
15 kprint(" occurred!\n", 0);
17 int ret
= (*int_handler_table
[interrupt
])();
19 kprint("WARNING: Error while handling interrupt ", 0);
24 if (interrupt
>= 0x20) {
25 pic_send_eoi(interrupt
- 0x20);
29 int register_interrupt(int irq
, int (*handler
)(void))
31 int_handler_table
[irq
] = handler
;
32 if (irq
>= 32 && irq
< 48) {