]> 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)
commit99219a06658557e2ae163f046c7005f4352f0f52
tree207f403515f505ee9466163414072e2c47fe4dac
parent406b73b6a36e30c0be7ae1cdee1d4e7db0008358
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