#[cfg(not(portable_atomic_no_asm))]
use core::arch::asm;
#[inline]
pub(super) fn is_enabled() -> bool {
let r: usize;
unsafe {
asm!("csrr {0}, mstatus", out(reg) r, options(nomem, nostack, preserves_flags));
}
r & 0x8 != 0
}
#[inline]
pub(super) fn disable() {
unsafe {
asm!("csrci mstatus, 0x8", options(nostack));
}
}
#[inline]
pub(super) unsafe fn enable() {
unsafe {
asm!("csrsi mstatus, 0x8", options(nostack));
}
}