Interrupt handlers and smp_calls take a void*
[akaros.git] / kern / trap.h
index 95368b6..dbdcdc1 100644 (file)
 #include <inc/mmu.h>
 
 // func ptr for interrupt service routines
-typedef void (*isr_t)(trapframe_t* tf);
+typedef void (*isr_t)(trapframe_t* tf, void* data);
+typedef struct InterruptHandler {
+       isr_t isr;
+       void* data;
+} handler_t;
 
 /* The kernel's interrupt descriptor table */
 extern gatedesc_t idt[];
 
 void idt_init(void);
-void register_interrupt_handler(isr_t (COUNT(256)table)[], uint8_t isr, isr_t handler);
+void register_interrupt_handler(handler_t (COUNT(256)table)[], uint8_t int_num,
+                                isr_t handler, void* data);
 void (IN_HANDLER print_regs)(push_regs_t *regs);
 void (IN_HANDLER print_trapframe)(trapframe_t *tf);
 void (IN_HANDLER page_fault_handler)(trapframe_t *tf);