]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
refactor: remove #if x86 guard from scheduler fork_child_trampoline
authorTulio A M Mendes <[email protected]>
Tue, 10 Feb 2026 05:53:40 +0000 (02:53 -0300)
committerTulio A M Mendes <[email protected]>
Tue, 10 Feb 2026 05:53:40 +0000 (02:53 -0300)
commit59646a508f767d03f5a4f7b5d922858ca46e6f07
tree37552543944f7ccae1b2b5c9ea8d8678d57a8093
parentae9590cd04a843c2014cbce1c056c36763e365a5
refactor: remove #if x86 guard from scheduler fork_child_trampoline

Add hal_usermode_enter_regs() to the HAL usermode interface so
fork_child_trampoline() can call it generically without #if x86.

- Add declaration to include/hal/usermode.h
- Implement in src/hal/x86/usermode.c (calls x86_enter_usermode_regs)
- Add stubs in ARM, RISC-V, MIPS HAL usermode.c
- scheduler.c now uses hal_usermode_enter_regs() with no guards

Passes: make, cppcheck, QEMU smoke test.
include/hal/usermode.h
src/hal/arm/usermode.c
src/hal/mips/usermode.c
src/hal/riscv/usermode.c
src/hal/x86/usermode.c
src/kernel/scheduler.c