Skip to content

Commit d9f8105

Browse files
committed
Add spin_loop hint for RISC-V architecture
This commit also updates `stdarch` git submodule.
1 parent 66a4788 commit d9f8105

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

core/src/hint.rs

Lines changed: 5 additions & 0 deletions
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

stdarch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit cfba59fccd90b3b52a614120834320f764ab08d1
1+
Subproject commit 43b4556c44197af4ef82e42a12dfc513a1397f87

0 commit comments

Comments
 (0)