Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make fence operations safe #180

Merged
merged 2 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions riscv/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

### Changed

- Made `asm::fence`, `fence_i` and `sfence` safe (ie, removed `unsafe` from their definitions)

## [v0.11.0] - 2024-01-14

### Added
Expand Down
6 changes: 3 additions & 3 deletions riscv/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ instruction!(
/// are ordinarily not ordered with respect to loads and stores in the instruction stream.
/// Executing an `SFENCE.VMA` instruction guarantees that any stores in the instruction stream prior to the
/// `SFENCE.VMA` are ordered before all implicit references subsequent to the `SFENCE.VMA`.
, unsafe sfence_vma_all, "sfence.vma");
, sfence_vma_all, "sfence.vma");
instruction!(
/// `FENCE` instruction wrapper
///
Expand All @@ -71,7 +71,7 @@ instruction!(
/// The FENCE instruction also orders memory reads and writes made by the hart as observed by
/// memory reads and writes made by an external device. However, FENCE does not order observations
/// of events made by an external device using any other signaling mechanism.
, unsafe fence, "fence");
, fence, "fence");
instruction!(
/// `FENCE.I` instruction wrapper
///
Expand All @@ -89,7 +89,7 @@ instruction!(
/// The unused fields in the FENCE.I instruction, imm\[11:0\], rs1, and rd, are reserved for
/// finer-grain fences in future extensions. For forward compatibility, base
/// implementations shall ignore these fields, and standard software shall zero these fields.
, unsafe fence_i, "fence.i");
, fence_i, "fence.i");

/// `SFENCE.VMA` instruction wrapper
///
Expand Down
Loading