]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
refactor: replace hardcoded 0xC0000000 in elf.c and uaccess.c with hal_mm_kernel_virt...
authorTulio A M Mendes <[email protected]>
Tue, 10 Feb 2026 05:01:18 +0000 (02:01 -0300)
committerTulio A M Mendes <[email protected]>
Tue, 10 Feb 2026 05:01:18 +0000 (02:01 -0300)
commit5e872beaea8db7533780c95766dfd8b24f821a7c
tree460bab7c48f1cfe31da2176d9ce663a027ca4f1a
parenta8b4dfae4d71cb5b44fa4ce6c6681c3690e37b31
refactor: replace hardcoded 0xC0000000 in elf.c and uaccess.c with hal_mm_kernel_virt_base()

Both elf.c and uaccess.c had X86_KERNEL_VIRT_BASE defined as
0xC0000000U inside #if x86 blocks. While technically correct
(only compiled on x86), this is inconsistent with the rest of the
codebase which now uses hal_mm_kernel_virt_base() everywhere.

Replace with the HAL abstraction for consistency and to ensure
the kernel virtual base is defined in exactly one place per arch.

Passes: make, cppcheck, QEMU smoke test.
src/kernel/elf.c
src/kernel/uaccess.c