diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/interrupt.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/interrupt.rs b/src/interrupt.rs index 95b5989..2e43e85 100644 --- a/src/interrupt.rs +++ b/src/interrupt.rs @@ -45,7 +45,7 @@ pub fn disable() { asm!("cpsid i" : : - : + : "memory" : "volatile"); }, #[cfg(not(target_arch = "arm"))] @@ -66,7 +66,7 @@ pub unsafe fn enable() { asm!("cpsie i" : : - : + : "memory" : "volatile"); } #[cfg(not(target_arch = "arm"))] @@ -81,10 +81,6 @@ pub struct CriticalSection { _0: (), } -macro_rules! barrier { - () => { asm!("" ::: "memory" : "volatile") } -} - /// Execute closure `f` in an interrupt-free context. /// /// This as also known as a "critical section". @@ -97,9 +93,7 @@ where // disable interrupts disable(); - unsafe { barrier!() } let r = f(&CriticalSection { _0: () }); - unsafe { barrier!() } // If the interrupts were active before our `disable` call, then re-enable // them. Otherwise, keep them disabled |