Add spin_loop hint for RISC-V architecture

This commit also updates `stdarch` git submodule.
This commit is contained in:
luojia65
2021-12-05 16:32:14 +08:00
parent bdaa901049
commit 70855b24b8
2 changed files with 6 additions and 1 deletions

View File

@@ -137,6 +137,11 @@ pub fn spin_loop() {
unsafe { crate::arch::arm::__yield() }; unsafe { crate::arch::arm::__yield() };
} }
} }
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
{
crate::arch::riscv::pause();
}
} }
/// An identity function that *__hints__* to the compiler to be maximally pessimistic about what /// An identity function that *__hints__* to the compiler to be maximally pessimistic about what