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/).
7
7
8
8
## [ Unreleased]
9
9
10
+ ### Added
11
+
12
+ - ` dmb ` data memory barrier in ASM module.
13
+
10
14
## [ v0.2.0]
11
15
12
16
### Added
Original file line number Diff line number Diff line change 2
2
3
3
use core:: sync:: atomic:: { compiler_fence, Ordering } ;
4
4
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
+
5
19
/// Data Synchronization Barrier
6
20
///
7
21
/// 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