]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commitdiff
refactor: guard multiboot2.h include in pmm.c with #if x86
authorTulio A M Mendes <[email protected]>
Tue, 10 Feb 2026 04:30:39 +0000 (01:30 -0300)
committerTulio A M Mendes <[email protected]>
Tue, 10 Feb 2026 04:30:39 +0000 (01:30 -0300)
multiboot2.h is an x86/GRUB boot protocol header. pmm.c (generic
mm/ code) included it unconditionally even though all Multiboot2
usage is already inside #if x86 blocks. Guard the include so it
is not pulled in on ARM/RISC-V/MIPS builds.

Passes: make, cppcheck, QEMU smoke test.

src/mm/pmm.c

index 5a81163e97a197334cc9bd5c1281cce80ec4fce6..8410cb898e44c1b135ebe9ab6ed71ce8899e44d1 100644 (file)
@@ -1,5 +1,7 @@
 #include "pmm.h"
+#if defined(__i386__) || defined(__x86_64__)
 #include "multiboot2.h"
+#endif
 #include "utils.h"
 #include "uart_console.h"
 #include "hal/cpu.h"