Kernel: Make UNMAP_AFTER_INIT imply NEVER_INLINE as well

We want to make sure these functions actually do get unmapped. If they
were inlined somewhere, the inlined version(s) would remain mapped.

Thanks to "thislooksfun" for the suggestion! :^)
This commit is contained in:
Andreas Kling 2021-02-21 00:42:16 +01:00
parent f23b29f605
commit 1bc859fb68
2 changed files with 3 additions and 3 deletions

View file

@ -720,12 +720,12 @@ void exit_trap(TrapFrame* trap)
return Processor::current().exit_trap(*trap);
}
NEVER_INLINE UNMAP_AFTER_INIT void write_cr0(u32 value)
UNMAP_AFTER_INIT void write_cr0(u32 value)
{
asm volatile("movl %%eax, %%cr0" ::"a"(value));
}
NEVER_INLINE UNMAP_AFTER_INIT void write_cr4(u32 value)
UNMAP_AFTER_INIT void write_cr4(u32 value)
{
asm volatile("movl %%eax, %%cr4" ::"a"(value));
}

View file

@ -35,7 +35,7 @@
#include <LibC/sys/arch/i386/regs.h>
#define READONLY_AFTER_INIT __attribute__((section(".ro_after_init")))
#define UNMAP_AFTER_INIT __attribute__((section(".unmap_after_init")))
#define UNMAP_AFTER_INIT NEVER_INLINE __attribute__((section(".unmap_after_init")))
#define PAGE_SIZE 4096
#define GENERIC_INTERRUPT_HANDLERS_COUNT (256 - IRQ_VECTOR_BASE)