Skip to content

Commit 70855b2

Browse files
committed
Add spin_loop hint for RISC-V architecture
This commit also updates `stdarch` git submodule.
1 parent bdaa901 commit 70855b2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

library/core/src/hint.rs

+5
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ pub fn spin_loop() {
137137
unsafe { crate::arch::arm::__yield() };
138138
}
139139
}
140+
141+
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
142+
{
143+
crate::arch::riscv::pause();
144+
}
140145
}
141146

142147
/// An identity function that *__hints__* to the compiler to be maximally pessimistic about what

0 commit comments

Comments
 (0)