From 6eedad425a0d08cabad4deaee52f90bf0f54bf65 Mon Sep 17 00:00:00 2001 From: Scott Johnson Date: Tue, 23 Feb 2021 16:28:49 -0800 Subject: Add tor_paddr() method to simplify callers --- riscv/mmu.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'riscv/mmu.cc') diff --git a/riscv/mmu.cc b/riscv/mmu.cc index 2fd5a43..7afccae 100644 --- a/riscv/mmu.cc +++ b/riscv/mmu.cc @@ -222,7 +222,7 @@ reg_t mmu_t::pmp_ok(reg_t addr, reg_t len, access_type type, reg_t mode) reg_t base = 0; for (size_t i = 0; i < proc->n_pmp; i++) { - reg_t tor = (proc->state.pmpaddr[i]->raw_value() & proc->pmp_tor_mask()) << PMP_SHIFT; + reg_t tor = proc->state.pmpaddr[i]->tor_paddr(); uint8_t cfg = proc->state.pmpcfg[i]; if (cfg & PMP_A) { @@ -273,7 +273,7 @@ reg_t mmu_t::pmp_homogeneous(reg_t addr, reg_t len) reg_t base = 0; for (size_t i = 0; i < proc->n_pmp; i++) { - reg_t tor = (proc->state.pmpaddr[i]->raw_value() & proc->pmp_tor_mask()) << PMP_SHIFT; + reg_t tor = proc->state.pmpaddr[i]->tor_paddr(); uint8_t cfg = proc->state.pmpcfg[i]; if (cfg & PMP_A) { -- cgit v1.1