Open
Description
For example, in cortex_m
:
pub fn disable() {
unsafe {
asm!("cpsid i", options(nomem, nostack, preserves_flags));
}
// Ensure no subsequent memory accesses are reordered to before interrupts are disabled.
compiler_fence(Ordering::SeqCst);
}
compiler_fence
does not currently work properly for the msp430 backend. Thank you @eddyb for pointing this out to me.
barrier
and nop
are also likely affected; barrier
needs a fence to prevent reordering, and both functions assume that Rust will not optimize out inline ASM (which I'm not sure is true).
Metadata
Metadata
Assignees
Labels
No labels