summaryrefslogtreecommitdiff
path: root/Kernel/Arch/x86
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-05-28 16:08:51 +0200
committerLinus Groh <mail@linusgroh.de>2021-05-28 19:52:22 +0100
commit4fca9ee060fd761f006f751b3ab79875a4c526f0 (patch)
tree99727be49ec5718a93b667e778ae284fffa06111 /Kernel/Arch/x86
parentb06d01f04057674d1ae05a1940b30affcb82e844 (diff)
downloadserenity-4fca9ee060fd761f006f751b3ab79875a4c526f0.zip
Kernel: Allow building the kernel with -O0
Unfortunately the kernel doesn't run with -O0 but at least it can be successfully built with this change.
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)());