]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
fix: replace x86 'cli; hlt' asm in syscall.c with HAL calls
authorTulio A M Mendes <[email protected]>
Tue, 10 Feb 2026 04:58:10 +0000 (01:58 -0300)
committerTulio A M Mendes <[email protected]>
Tue, 10 Feb 2026 04:58:10 +0000 (01:58 -0300)
commita8b4dfae4d71cb5b44fa4ce6c6681c3690e37b31
treee28b18008f56b1b4cd6c4464b27270f9d9a3a58c
parent3309751490abd289d97e5d810509a38f2058ba8f
fix: replace x86 'cli; hlt' asm in syscall.c with HAL calls

syscall.c used raw x86 inline assembly ('cli; hlt') in the exit
syscall idle loop. This would not compile on ARM/RISC-V/MIPS.

Add hal_cpu_disable_interrupts() to the HAL CPU interface with
implementations for x86 (cli) and stubs for other architectures.
Replace the raw asm with hal_cpu_disable_interrupts() + hal_cpu_idle().

Passes: make, cppcheck, QEMU smoke test.
include/hal/cpu.h
src/hal/x86/cpu.c
src/kernel/syscall.c