Skip to content

Commit 3128975

Browse files
Merge pull request #206 from jsgf/pmpcfgx-eq
Implement Eq and PartialEq for Range and Permission
2 parents ad8a0bb + 4f4d161 commit 3128975

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

riscv/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1212
- Add `Mcause::from(usize)` for use in unit tests
1313
- Add `Mstatus::from(usize)` for use in unit tests
1414
- Add `Mstatus.bits()`
15+
- Add `Eq` and `PartialEq` for `pmpcfgx::{Range, Permission}`
1516
- Export `riscv::register::macros` module macros for external use
1617

1718
### Fixed

riscv/src/register/pmpcfgx.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Physical memory protection configuration
22
33
/// Permission enum contains all possible permission modes for pmp registers
4-
#[derive(Clone, Copy, Debug)]
4+
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
55
pub enum Permission {
66
NONE = 0b000,
77
R = 0b001,
@@ -14,7 +14,7 @@ pub enum Permission {
1414
}
1515

1616
/// Range enum contains all possible addressing modes for pmp registers
17-
#[derive(Clone, Copy, Debug)]
17+
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
1818
pub enum Range {
1919
OFF = 0b00,
2020
TOR = 0b01,

0 commit comments

Comments
 (0)