diff options
-rw-r--r-- | riscv/csrs.cc | 6 | ||||
-rw-r--r-- | riscv/csrs.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/riscv/csrs.cc b/riscv/csrs.cc index dff846c..dac7f9c 100644 --- a/riscv/csrs.cc +++ b/riscv/csrs.cc @@ -145,15 +145,15 @@ reg_t pmpaddr_csr_t::napot_mask() const noexcept { } -bool pmpaddr_csr_t::match4(reg_t cur_addr) const noexcept { +bool pmpaddr_csr_t::match4(reg_t addr) const noexcept { state_t* const state = proc->get_state(); uint8_t cfg = state->pmpcfg[pmpidx]; if ((cfg & PMP_A) == 0) return false; reg_t base = tor_base_paddr(); reg_t tor = tor_paddr(); bool is_tor = (cfg & PMP_A) == PMP_TOR; - bool napot_match = ((cur_addr ^ tor) & napot_mask()) == 0; - bool tor_match = base <= cur_addr && cur_addr < tor; + bool napot_match = ((addr ^ tor) & napot_mask()) == 0; + bool tor_match = base <= addr && addr < tor; return is_tor ? tor_match : napot_match; } diff --git a/riscv/csrs.h b/riscv/csrs.h index ab1adf6..306553c 100644 --- a/riscv/csrs.h +++ b/riscv/csrs.h @@ -84,7 +84,7 @@ class pmpaddr_csr_t: public logged_csr_t { reg_t napot_mask() const noexcept; // Does a 4-byte access at the specified address match this PMP entry? - bool match4(reg_t cur_addr) const noexcept; + bool match4(reg_t addr) const noexcept; protected: virtual bool unlogged_write(const reg_t val) noexcept override; |