diff options
author | Gunnar Beutner <gbeutner@serenityos.org> | 2021-05-28 16:08:51 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-05-28 19:52:22 +0100 |
commit | 4fca9ee060fd761f006f751b3ab79875a4c526f0 (patch) | |
tree | 99727be49ec5718a93b667e778ae284fffa06111 /Kernel/Arch/x86 | |
parent | b06d01f04057674d1ae05a1940b30affcb82e844 (diff) | |
download | serenity-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.h | 18 |
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)()); |