X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/b26d3165c52589d1f8de37bf0df27ad96f460f47..1025235c72c31f7fa7b648c0e32ddcaa68a8f66a:/lunaix-os/scripts/templates/i386/i386_isrdef.c.j2 diff --git a/lunaix-os/scripts/templates/i386/i386_isrdef.c.j2 b/lunaix-os/scripts/templates/i386/i386_isrdef.c.j2 deleted file mode 100644 index 936263f..0000000 --- a/lunaix-os/scripts/templates/i386/i386_isrdef.c.j2 +++ /dev/null @@ -1,31 +0,0 @@ -/* 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 %} -} \ No newline at end of file