#[cfg(target_arch = "arm")]
#[macro_export]
macro_rules! bkpt {
() => {
asm!("bkpt" :::: "volatile");
};
($imm:expr) => {
asm!(concat!("bkpt #", stringify!($imm)) :::: "volatile");
};
}
#[cfg(not(target_arch = "arm"))]
#[macro_export]
macro_rules! bkpt {
() => {
asm!("nop" :::: "volatile");
};
($e:expr) => {
asm!("nop" :::: "volatile");
};
}
pub unsafe fn wfe() {
match () {
#[cfg(target_arch = "arm")]
() => asm!("wfe" :::: "volatile"),
#[cfg(not(target_arch = "arm"))]
() => {}
}
}
pub unsafe fn wfi() {
match () {
#[cfg(target_arch = "arm")]
() => asm!("wfi" :::: "volatile"),
#[cfg(not(target_arch = "arm"))]
() => {}
}
}
pub fn nop() {
unsafe {
asm!("nop" :::: "volatile");
}
}