aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPentin Alexander Sergeevich <30556064+pentin-as@users.noreply.github.com>2019-07-01 23:52:37 +0500
committerAndrew Waterman <andrew@sifive.com>2019-07-01 11:52:37 -0700
commitfad99cec99c30a1ef79d0daa53bbd796c632e538 (patch)
treed8d3553949e340e6228d79a25af22acfdbb080c8
parenta2456ef50d41bb5679b1cd73372bbc1ea1c1268a (diff)
downloadriscv-tests-fad99cec99c30a1ef79d0daa53bbd796c632e538.zip
riscv-tests-fad99cec99c30a1ef79d0daa53bbd796c632e538.tar.gz
riscv-tests-fad99cec99c30a1ef79d0daa53bbd796c632e538.tar.bz2
pmp: first set the address, then cfg (#194)
-rw-r--r--benchmarks/pmp/pmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/benchmarks/pmp/pmp.c b/benchmarks/pmp/pmp.c
index 195a575..2ccd769 100644
--- a/benchmarks/pmp/pmp.c
+++ b/benchmarks/pmp/pmp.c
@@ -44,8 +44,8 @@ static void init_pt()
#endif
write_csr(sptbr, ((uintptr_t)l1pt >> RISCV_PGSHIFT) |
(vm_choice * (SATP_MODE & ~(SATP_MODE<<1))));
- write_csr(pmpcfg0, (PMP_NAPOT | PMP_R) << 16);
write_csr(pmpaddr2, -1);
+ write_csr(pmpcfg0, (PMP_NAPOT | PMP_R) << 16);
}
INLINE uintptr_t va2pa(uintptr_t va)