diff options
author | Christopher Celio <celio@eecs.berkeley.edu> | 2015-06-23 18:08:49 -0700 |
---|---|---|
committer | Christopher Celio <celio@eecs.berkeley.edu> | 2015-06-23 18:08:49 -0700 |
commit | c60e1a9e2f48f8c011a4967247a7618d42c53462 (patch) | |
tree | ee5ae8f77b9439e863a49c7982eeeba51a36fd2c /p | |
parent | dac4ddd40078f31f4c2e766368c237eba84ef68c (diff) | |
download | env-c60e1a9e2f48f8c011a4967247a7618d42c53462.zip env-c60e1a9e2f48f8c011a4967247a7618d42c53462.tar.gz env-c60e1a9e2f48f8c011a4967247a7618d42c53462.tar.bz2 |
Avoid "csrw stvec" if stvec_handler doesn't exist.
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 b82b108..efd9c52 100644 --- a/p/riscv_test.h +++ b/p/riscv_test.h @@ -168,8 +168,9 @@ _start: \ RISCV_MULTICORE_DISABLE; \ CHECK_XLEN; \ la t0, stvec_handler; \ + beqz t0, 1f; \ csrw stvec, t0; \ - li t0, MSTATUS_PRV1 | MSTATUS_PRV2 | MSTATUS_IE1 | MSTATUS_IE2; \ +1: li t0, MSTATUS_PRV1 | MSTATUS_PRV2 | MSTATUS_IE1 | MSTATUS_IE2; \ csrc mstatus, t0; \ init; \ EXTRA_INIT; \ |