diff options
author | Andrew Waterman <andrew@sifive.com> | 2018-09-23 21:11:53 -0700 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2018-09-23 21:12:06 -0700 |
commit | 4c356d46aace73c1562816a41e0f63948bdb0497 (patch) | |
tree | 0dffa5b7d95a660f84773f7d6414ece04b4bd0e4 /p | |
parent | 8d6a8bac53b6aeedc3e460a4b9cdcb070591f697 (diff) | |
download | env-4c356d46aace73c1562816a41e0f63948bdb0497.zip env-4c356d46aace73c1562816a41e0f63948bdb0497.tar.gz env-4c356d46aace73c1562816a41e0f63948bdb0497.tar.bz2 |
Avoid writing reserved values to pmpaddr CSR
Diffstat (limited to 'p')
-rw-r--r-- | p/riscv_test.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/p/riscv_test.h b/p/riscv_test.h index 3fbcb50..7cb00d5 100644 --- a/p/riscv_test.h +++ b/p/riscv_test.h @@ -56,7 +56,8 @@ #define INIT_PMP \ la t0, 1f; \ csrw mtvec, t0; \ - li t0, -1; /* Set up a PMP to permit all accesses */ \ + /* Set up a PMP to permit all accesses */ \ + li t0, (1 << (31 + (__riscv_xlen / 64) * (53 - 31))) - 1; \ csrw pmpaddr0, t0; \ li t0, PMP_NAPOT | PMP_R | PMP_W | PMP_X; \ csrw pmpcfg0, t0; \ |