mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
change compiler fence to SeqCst
This commit is contained in:
parent
d261dfd4e1
commit
dd858183be
1 changed files with 3 additions and 3 deletions
|
|
@ -569,7 +569,7 @@ where
|
|||
/// Read the contents of this register
|
||||
pub fn r(&self, reg: Register) -> T {
|
||||
// prevent re-ordering
|
||||
core::sync::atomic::compiler_fence(core::sync::atomic::Ordering::Acquire);
|
||||
core::sync::atomic::compiler_fence(core::sync::atomic::Ordering::SeqCst);
|
||||
|
||||
let usize_base: *mut usize = unsafe { core::mem::transmute(self.base) };
|
||||
unsafe { usize_base.add(reg.offset).read_volatile() }
|
||||
|
|
@ -579,7 +579,7 @@ where
|
|||
/// Read a field from this CSR
|
||||
pub fn rf(&self, field: Field) -> T {
|
||||
// prevent re-ordering
|
||||
core::sync::atomic::compiler_fence(core::sync::atomic::Ordering::Acquire);
|
||||
core::sync::atomic::compiler_fence(core::sync::atomic::Ordering::SeqCst);
|
||||
|
||||
let usize_base: *mut usize = unsafe { core::mem::transmute(self.base) };
|
||||
((unsafe { usize_base.add(field.register.offset).read_volatile() } >> field.offset)
|
||||
|
|
@ -599,7 +599,7 @@ where
|
|||
.write_volatile(previous | value_as_usize)
|
||||
};
|
||||
// prevent re-ordering
|
||||
core::sync::atomic::compiler_fence(core::sync::atomic::Ordering::Acquire);
|
||||
core::sync::atomic::compiler_fence(core::sync::atomic::Ordering::SeqCst);
|
||||
}
|
||||
/// Write a given field without reading it first
|
||||
pub fn wfo(&mut self, field: Field, value: T) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue