summaryrefslogtreecommitdiff
path: root/Kernel/Arch/x86
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Arch/x86')
-rw-r--r--Kernel/Arch/x86/Interrupts.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/Kernel/Arch/x86/Interrupts.h b/Kernel/Arch/x86/Interrupts.h
index d9d9b8285b..63a666f33d 100644
--- a/Kernel/Arch/x86/Interrupts.h
+++ b/Kernel/Arch/x86/Interrupts.h
@@ -15,13 +15,17 @@ class GenericInterruptHandeler;
extern "C" void interrupt_common_asm_entry();
-#define GENERATE_GENERIC_INTERRUPT_HANDLER_ASM_ENTRY(isr_number) \
- extern "C" void interrupt_##isr_number##_asm_entry(); \
- asm(".globl interrupt_" #isr_number "_asm_entry\n" \
- "interrupt_" #isr_number "_asm_entry:\n" \
- " pushw $" #isr_number "\n" \
- " pushw $0\n" \
- " jmp interrupt_common_asm_entry\n");
+#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)); \
+ NEVER_INLINE void interrupt_##isr_number##_asm_entry_dummy() \
+ { \
+ asm(".globl interrupt_" #isr_number "_asm_entry\n" \
+ "interrupt_" #isr_number "_asm_entry:\n" \
+ " pushw $" #isr_number "\n" \
+ " pushw $0\n" \
+ " jmp interrupt_common_asm_entry\n"); \
+ }
void register_interrupt_handler(u8 number, void (*handler)());
void register_user_callable_interrupt_handler(u8 number, void (*handler)());