File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77
88## [ Unreleased]
99
10+ ### Added
11+
12+ - ` dmb ` data memory barrier in ASM module.
13+
1014## [ v0.2.0]
1115
1216### Added
Original file line number Diff line number Diff line change 22
33use core:: sync:: atomic:: { compiler_fence, Ordering } ;
44
5+ /// Data Memory Barrier
6+ ///
7+ /// Ensures that all explicit memory accesses that appear in program order before the `DMB`
8+ /// instruction are observed before any explicit memory accesses that appear in program order
9+ /// after the `DMB` instruction.
10+ #[ inline]
11+ pub fn dmb ( ) {
12+ compiler_fence ( Ordering :: SeqCst ) ;
13+ unsafe {
14+ core:: arch:: asm!( "dmb" , options( nostack, preserves_flags) ) ;
15+ }
16+ compiler_fence ( Ordering :: SeqCst ) ;
17+ }
18+
519/// Data Synchronization Barrier
620///
721/// Acts as a special kind of memory barrier. No instruction in program order after this instruction
You can’t perform that action at this time.
0 commit comments