]> 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)
commitd1c1d948957f3f11607ed8d8dd15c2578f9af6f5
treeaece7a97e1ad2405d3aee9fe18d4cbb6d81e542c
parent99219a06658557e2ae163f046c7005f4352f0f52
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