Skip to content

Commit

Permalink
Fix typos in bit definitions in menvcfg
Browse files Browse the repository at this point in the history
  • Loading branch information
ted-logan committed May 4, 2023
1 parent 7f85966 commit da9e373
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/register/menvcfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl Menvcfg {
/// Cache Block Invalidate instruction Enable
#[inline]
pub fn mpp(&self) -> CBIE {
match self.bits.get_bits(4..5) {
match self.bits.get_bits(4..6) {
0b00 => CBIE::IllegalInstruction,
0b01 => CBIE::ExecutedFlush,
0b10 => CBIE::Reserved,
Expand Down Expand Up @@ -83,17 +83,17 @@ set_clear_csr!(
#[inline]
pub unsafe fn set_cbie(cbie: CBIE) {
let mut value = _read();
value.set_bits(4..5, cbie as usize);
value.set_bits(4..6, cbie as usize);
_write(value);
}

set_clear_csr!(
/// Cache Block Clean and Flush instruction Enable
, set_cbcfe, clear_cbcfe, 6 << 0);
, set_cbcfe, clear_cbcfe, 1 << 6);

set_clear_csr!(
/// Cache Block Zero instruction Enable
, set_cbze, clear_cbze, 7 << 0);
, set_cbze, clear_cbze, 1 << 7);

#[cfg(riscv64)]
set_clear_csr!(
Expand Down

0 comments on commit da9e373

Please sign in to comment.