Skip to content

Commit

Permalink
Merge pull request #206 from jsgf/pmpcfgx-eq
Browse files Browse the repository at this point in the history
Implement Eq and PartialEq for Range and Permission
  • Loading branch information
romancardenas authored May 7, 2024
2 parents ad8a0bb + 4f4d161 commit 3128975
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions riscv/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Add `Mcause::from(usize)` for use in unit tests
- Add `Mstatus::from(usize)` for use in unit tests
- Add `Mstatus.bits()`
- Add `Eq` and `PartialEq` for `pmpcfgx::{Range, Permission}`
- Export `riscv::register::macros` module macros for external use

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions riscv/src/register/pmpcfgx.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Physical memory protection configuration
/// Permission enum contains all possible permission modes for pmp registers
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum Permission {
NONE = 0b000,
R = 0b001,
Expand All @@ -14,7 +14,7 @@ pub enum Permission {
}

/// Range enum contains all possible addressing modes for pmp registers
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum Range {
OFF = 0b00,
TOR = 0b01,
Expand Down

0 comments on commit 3128975

Please sign in to comment.