/* Generated from {{ data["template"] }}. Do NOT modify */ #include "i386_intr.h" #include #define IDT_INTERRUPT 0x70 #define KERNEL_CS 0x8 #define IDT_ATTR(dpl, type) (((type) << 5) | ((dpl & 3) << 13) | (1 << 15)) #define IDT_ENTRY 256 #define DECLARE_ISR(iv) extern void _asm_isr##iv(); #define ISR_INSTALL(idt, iv, isr, dpl) \ _idt[iv] = ((ptr_t)isr & 0xffff0000) | IDT_ATTR(dpl, IDT_INTERRUPT); \ _idt[iv] <<= 32; \ _idt[iv] |= (KERNEL_CS << 16) | ((ptr_t)isr & 0x0000ffff); \ u64_t _idt[IDT_ENTRY]; u16_t _idt_limit = sizeof(_idt) - 1; {% for isrdef in data["exception"]["ivdefs"] -%} DECLARE_ISR({{ isrdef["iv"] }}) {% endfor %} void exception_install_handler() { {% for isrdef in data["exception"]["ivdefs"] %} ISR_INSTALL(_idt, {{ isrdef["iv"] }}, _asm_isr{{ isrdef["iv"] }}, {{ isrdef["dpl"] }}) {% endfor %} }