From 70855b24b89e348aef0e28a0fe6db6d5bf19d11e Mon Sep 17 00:00:00 2001 From: luojia65 Date: Sun, 5 Dec 2021 16:32:14 +0800 Subject: [PATCH 1/2] Add spin_loop hint for RISC-V architecture This commit also updates `stdarch` git submodule. --- library/core/src/hint.rs | 5 +++++ library/stdarch | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/library/core/src/hint.rs b/library/core/src/hint.rs index 95798879155c5..f49aefea81bac 100644 --- a/library/core/src/hint.rs +++ b/library/core/src/hint.rs @@ -137,6 +137,11 @@ pub fn spin_loop() { 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 diff --git a/library/stdarch b/library/stdarch index cfba59fccd90b..43b4556c44197 160000 --- a/library/stdarch +++ b/library/stdarch @@ -1 +1 @@ -Subproject commit cfba59fccd90b3b52a614120834320f764ab08d1 +Subproject commit 43b4556c44197af4ef82e42a12dfc513a1397f87 From 0ccf58b928c3197bb5531c422e3ad5c5bd899191 Mon Sep 17 00:00:00 2001 From: luojia65 Date: Thu, 9 Dec 2021 22:33:25 +0800 Subject: [PATCH 2/2] Update stdarch dependency --- library/stdarch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/stdarch b/library/stdarch index 43b4556c44197..b70ae88ef2a6c 160000 --- a/library/stdarch +++ b/library/stdarch @@ -1 +1 @@ -Subproject commit 43b4556c44197af4ef82e42a12dfc513a1397f87 +Subproject commit b70ae88ef2a6c83acad0a1e83d5bd78f9655fd05