Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add PAUSE instruction to RISC-V core::arch
Use `#[inline]` instead of `#[inline(always)]`
  • Loading branch information
luojia65 committed Dec 4, 2021
commit 1a9eec30e25c551e4a0eac39e1e25816e591afd2
9 changes: 9 additions & 0 deletions crates/core_arch/src/riscv/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
//! RISC-V intrinsics

/// Generates the `PAUSE` instruction
///
/// The PAUSE instruction is a HINT that indicates the current hart's rate of instruction retirement
/// should be temporarily reduced or paused. The duration of its effect must be bounded and may be zero.
#[inline]
pub fn pause() {
unsafe { asm!(".word 0x0100000F", options(nomem, nostack)) }
}