From ed3da12bb378d82878fff1d50e5e9e7af3d7265d Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 4 Dec 2019 20:38:10 +0100 Subject: More-working syscall logic (parameters work!) --- src/kernel/interrupts/interrupts.h | 95 +++++++++++++++++++++++++++++++++++--- 1 file changed, 89 insertions(+), 6 deletions(-) (limited to 'src/kernel/interrupts/interrupts.h') diff --git a/src/kernel/interrupts/interrupts.h b/src/kernel/interrupts/interrupts.h index cb30492..10612c0 100644 --- a/src/kernel/interrupts/interrupts.h +++ b/src/kernel/interrupts/interrupts.h @@ -2,6 +2,7 @@ #define MELVIX_INTERRUPTS_H #include +#include /** * Initialize the Interrupt Descriptor Table with 256 entries @@ -17,11 +18,6 @@ void idt_install(); */ void idt_set_gate(unsigned char num, unsigned long base, unsigned short sel, unsigned char flags); -/** - * Install 32 exception ISRs into the IDT - */ -void isrs_install(); - /** * Registers that get passed into an IRQ handler */ @@ -32,6 +28,26 @@ struct regs { unsigned int eip, cs, eflags, useresp, ss; }; +/** + * Install 32 exception ISRs into the IDT + */ +void isrs_install(); + +/** + * Add a new Interrupt Request Handler + * @param irq The index of the IRQ routine + * @param handler The interrupt handler function + */ +typedef void (*irq_handler_t)(struct regs *); + +void isr_install_handler(size_t isr, irq_handler_t handler); + +/** + * Uninstall a handler by index + * @param irq The index of the IRQ routine that should be removed + */ +void isr_uninstall_handler(size_t isr); + /** * Initialize the Interrupt Requests by mapping the ISRs to the correct * entries in the IDT (install the exception handlers) @@ -64,4 +80,71 @@ void irq_handler(struct regs *r); */ int irq_is_installed(int irq); -#endif +// Defined in isr.asm +extern void isr0(); + +extern void isr1(); + +extern void isr2(); + +extern void isr3(); + +extern void isr4(); + +extern void isr5(); + +extern void isr6(); + +extern void isr7(); + +extern void isr8(); + +extern void isr9(); + +extern void isr10(); + +extern void isr11(); + +extern void isr12(); + +extern void isr13(); + +extern void isr14(); + +extern void isr15(); + +extern void isr16(); + +extern void isr17(); + +extern void isr18(); + +extern void isr19(); + +extern void isr20(); + +extern void isr21(); + +extern void isr22(); + +extern void isr23(); + +extern void isr24(); + +extern void isr25(); + +extern void isr26(); + +extern void isr27(); + +extern void isr28(); + +extern void isr29(); + +extern void isr30(); + +extern void isr31(); + +extern void isr128(); + +#endif \ No newline at end of file -- cgit v1.2.3