From 0dc4d97e70c17df56a260d31a1cb44881cf64520 Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Tue, 25 Jun 2024 12:49:40 -0500 Subject: kernel: interrupt: create a generic interrupt API Create a generic interface for drivers to make use of interrupt vectors. This API should be platform-agnostic enough to allow any driver to make use of virtually any interrupt vector on any CPU. On x86, the first 32 interrupts are set aside for CPU exceptions, and interrupt 128 is set aside for system calls. Signed-off-by: Danny Holman --- include/kernel/interrupt.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 include/kernel/interrupt.h (limited to 'include/kernel') diff --git a/include/kernel/interrupt.h b/include/kernel/interrupt.h new file mode 100644 index 0000000..b707fe7 --- /dev/null +++ b/include/kernel/interrupt.h @@ -0,0 +1,13 @@ +#ifndef KERNEL_INTERRUPT_H +#define KERNEL_INTERRUPT_H + +#include +#include +#include + +void register_isr_handler(unsigned int isr, void (*handler)(struct isr_frame *frame)); +void clear_isr_handler(unsigned int isr); + +void isr_dispatch(struct isr_frame frame); + +#endif -- cgit v1.2.3