Bare support for dispatching parallel processes
[akaros.git] / kern / include / trap.h
1 /* See COPYRIGHT for copyright information. */
2
3 #ifndef ROS_KERN_TRAP_H
4 #define ROS_KERN_TRAP_H
5 #ifndef ROS_KERNEL
6 # error "This is an ROS kernel header; user programs should not #include it"
7 #endif
8
9 #include <arch/mmu.h>
10 #include <arch/trap.h>
11
12 // func ptr for interrupt service routines
13 typedef void ( *poly_isr_t)(trapframe_t* tf, TV(t) data);
14 typedef void (*isr_t)(trapframe_t* tf, void * data);
15 typedef struct InterruptHandler {
16         poly_isr_t isr;
17         TV(t) data;
18 } handler_t;
19 extern handler_t interrupt_handlers[];
20
21 void idt_init(void);
22 void register_interrupt_handler(handler_t (COUNT(256)table)[], uint8_t int_num,
23                                 poly_isr_t handler, TV(t) data);
24 void ( print_trapframe)(trapframe_t *tf);
25 void ( page_fault_handler)(trapframe_t *tf);
26
27 void sysenter_init(void);
28 extern void sysenter_handler();
29 #endif /* ROS_KERN_TRAP_H */