Merge branch 'master' into net-dev (with code changes listed below besides normal...
[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
20 void idt_init(void);
21 void register_interrupt_handler(handler_t (COUNT(256)table)[], uint8_t int_num,
22                                 poly_isr_t handler, TV(t) data);
23 void (IN_HANDLER print_trapframe)(trapframe_t *tf);
24 void (IN_HANDLER page_fault_handler)(trapframe_t *tf);
25
26 void sysenter_init(void);
27 extern void sysenter_handler();
28 #endif /* ROS_KERN_TRAP_H */