git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: striped more arch-related code from the kernel code base
[lunaix-os.git]
/
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
index 01ab6391bd47d60d6cc26cc08a214da6b768c675..936263f4285758479b1cb05b9b40b92f8b2cf477 100644
(file)
--- a/
lunaix-os/scripts/templates/i386/i386_isrdef.c.j2
+++ b/
lunaix-os/scripts/templates/i386/i386_isrdef.c.j2
@@
-1,3
+1,5
@@
+/* Generated from {{ data["template"] }}. Do NOT modify */
+
#include "i386_intr.h"
#include <lunaix/types.h>
#include "i386_intr.h"
#include <lunaix/types.h>
@@
-8,22
+10,22
@@
#define DECLARE_ISR(iv) extern void _asm_isr##iv();
#define DECLARE_ISR(iv) extern void _asm_isr##iv();
-#define ISR_INSTALL(idt, iv, isr
)
\
- _idt[iv] = ((ptr_t)isr & 0xffff0000) | IDT_ATTR(
0, IDT_INTERRUPT);
\
+#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;
_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"] -%}
- DECLARE_ISR({{ isrdef["i
ndex
"] }})
+{% for isrdef in data["exception"]
["ivdefs"]
-%}
+ DECLARE_ISR({{ isrdef["i
v
"] }})
{% endfor %}
void
exception_install_handler()
{
{% endfor %}
void
exception_install_handler()
{
-{% for isrdef in data["exception"] %}
- ISR_INSTALL(_idt, {{ isrdef["i
ndex"] }}, _asm_isr{{ isrdef["index
"] }})
+{% for isrdef in data["exception"]
["ivdefs"]
%}
+ ISR_INSTALL(_idt, {{ isrdef["i
v"] }}, _asm_isr{{ isrdef["iv"] }}, {{ isrdef["dpl
"] }})
{% endfor %}
}
\ No newline at end of file
{% endfor %}
}
\ No newline at end of file