]> 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)
commit66083f271d2b4cd9a75149f69995b96fe0b3a9ad
tree72d840aaf31b844a760a4efd94c2a4287cd4bc96
parent93afa612c1aa6b1bf053eef36d51ba220447b002
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