mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:07:34 +00:00
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.
This commit is contained in:
parent
b06d01f040
commit
4fca9ee060
2 changed files with 48 additions and 40 deletions
|
@ -17,11 +17,15 @@ extern "C" void interrupt_common_asm_entry();
|
|||
|
||||
#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");
|
||||
" jmp interrupt_common_asm_entry\n"); \
|
||||
}
|
||||
|
||||
void register_interrupt_handler(u8 number, void (*handler)());
|
||||
void register_user_callable_interrupt_handler(u8 number, void (*handler)());
|
||||
|
|
|
@ -16,6 +16,9 @@ namespace Kernel {
|
|||
extern "C" void syscall_handler(TrapFrame*) __attribute__((used));
|
||||
extern "C" void syscall_asm_entry();
|
||||
|
||||
static void syscall_asm_entry_dummy() __attribute__((used));
|
||||
NEVER_INLINE void syscall_asm_entry_dummy()
|
||||
{
|
||||
// clang-format off
|
||||
#if ARCH(I386)
|
||||
asm(
|
||||
|
@ -53,6 +56,7 @@ asm(
|
|||
" hlt\n");
|
||||
#endif
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
namespace Syscall {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue