use core::arch::asm;
#[inline(always)]
pub fn rmb_impl() {
unsafe {
#[cfg(target_feature = "v7")]
asm!("dmb ld", options(nostack, preserves_flags));
#[cfg(not(target_feature = "v7"))]
asm!("mcr p15, 0, {}, c7, c10, 5", in(reg) 0, options(nostack, preserves_flags));
}
}
#[inline(always)]
pub fn wmb_impl() {
unsafe {
#[cfg(target_feature = "v7")]
asm!("dmb st", options(nostack, preserves_flags));
#[cfg(not(target_feature = "v7"))]
asm!("mcr p15, 0, {}, c7, c10, 4", in(reg) 0, options(nostack, preserves_flags));
}
}
#[inline(always)]
pub fn mb_impl() {
unsafe {
#[cfg(target_feature = "v7")]
asm!("dmb sy", options(nostack, preserves_flags));
#[cfg(not(target_feature = "v7"))]
asm!("mcr p15, 0, {}, c7, c10, 5", in(reg) 0, options(nostack, preserves_flags));
}
}