]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
fix: implement real irq_save/irq_restore for ARM, RISC-V, MIPS
authorTulio A M Mendes <[email protected]>
Tue, 10 Feb 2026 04:12:07 +0000 (01:12 -0300)
committerTulio A M Mendes <[email protected]>
Tue, 10 Feb 2026 04:12:07 +0000 (01:12 -0300)
commit72ab5d54f7d87abc8ff90b51242c44eaeb8b0104
treea7d8cbd8dce3854305556f7bf857cc228f127b5b
parent9a3854c8e48867812264de31893064449740c571
fix: implement real irq_save/irq_restore for ARM, RISC-V, MIPS

spinlock.h had no-op irq_save/irq_restore for non-x86 architectures,
meaning spin_lock_irqsave would not actually disable interrupts on
ARM, RISC-V, or MIPS — breaking all critical sections.

Add proper implementations:
- ARM: mrs/msr CPSR with cpsid i
- RISC-V: csrrci/csrsi mstatus MIE bit
- MIPS: mfc0/di/ei on CP0 Status IE bit

Passes: make, cppcheck, QEMU smoke test.
include/spinlock.h