summaryrefslogtreecommitdiff
path: root/Kernel/Arch/x86/Interrupts.h
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Arch/x86/Interrupts.h')
-rw-r--r--Kernel/Arch/x86/Interrupts.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/Kernel/Arch/x86/Interrupts.h b/Kernel/Arch/x86/Interrupts.h
index 1607d60ab5..f97b82c43f 100644
--- a/Kernel/Arch/x86/Interrupts.h
+++ b/Kernel/Arch/x86/Interrupts.h
@@ -16,6 +16,13 @@ class GenericInterruptHandeler;
extern "C" void interrupt_common_asm_entry();
+#if ARCH(I386)
+# define INTERRUPT_HANDLER_PUSH_PADDING
+#else
+# define INTERRUPT_HANDLER_PUSH_PADDING "pushw $0\npushw $0\n"
+#endif
+
+// clang-format off
#define GENERATE_GENERIC_INTERRUPT_HANDLER_ASM_ENTRY(isr_number) \
extern "C" void interrupt_##isr_number##_asm_entry(); \
static void interrupt_##isr_number##_asm_entry_dummy() __attribute__((used)); \
@@ -23,10 +30,12 @@ extern "C" void interrupt_common_asm_entry();
{ \
asm(".globl interrupt_" #isr_number "_asm_entry\n" \
"interrupt_" #isr_number "_asm_entry:\n" \
+ INTERRUPT_HANDLER_PUSH_PADDING \
" pushw $" #isr_number "\n" \
" pushw $0\n" \
" jmp interrupt_common_asm_entry\n"); \
}
+// clang-format on
void register_interrupt_handler(u8 number, void (*handler)());
void register_user_callable_interrupt_handler(u8 number, void (*handler)());