Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

disable_cpu_interrupts

Function disable_cpu_interrupts 

Source
pub unsafe fn disable_cpu_interrupts() -> bool
Expand description

Clear the CPU’s interrupt-enable bit (COP0 SR.IEc) and report whether it was set, so restore_cpu_interrupts can put it back. Sections nest.

This gates every interrupt at the CPU, whatever mask says. Use without_interrupts unless a guard cannot be a closure.

§Safety

Pair every call with one restore_cpu_interrupts of its result, in reverse order. Interrupts enabled early would let a handler run inside a section whose code assumes it cannot.