Skip to content

Commit

Permalink
Save only usefull bits of pmpaddr
Browse files Browse the repository at this point in the history
Fixes #1876
  • Loading branch information
marcfedorow authored Dec 16, 2024
1 parent a2dcf1f commit 5939641
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions riscv/csrs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ bool pmpaddr_csr_t::unlogged_write(const reg_t val) noexcept {

if (pmpidx < proc->n_pmp && !locked && !next_locked_and_tor()) {
this->val = val & ((reg_t(1) << (MAX_PADDR_BITS - PMP_SHIFT)) - 1);
this->val &= proc->pmp_tor_mask();
}
else
return false;
Expand Down

0 comments on commit 5939641

Please sign in to comment.