-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RISC-V platform and PAUSE instruction (#1262)
- Loading branch information
Showing
4 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +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)) } | ||
} |