Skip to main content

psync/
os.rs

1pub(crate) fn park() {
2    #[cfg(all(feature = "rp235x", target_os = "none", target_arch = "arm"))]
3    unsafe {
4        core::arch::asm!("wfe", options(nostack, preserves_flags))
5    };
6    #[cfg(not(all(feature = "rp235x", target_os = "none", target_arch = "arm")))]
7    core::hint::spin_loop();
8}
9
10pub(crate) fn unpark() {
11    #[cfg(all(feature = "rp235x", target_os = "none", target_arch = "arm"))]
12    unsafe {
13        core::arch::asm!("dsb", "sev", options(nostack, preserves_flags))
14    };
15}