diff options
author | Yunsup Lee <yunsup@cs.berkeley.edu> | 2015-03-17 04:36:33 -0700 |
---|---|---|
committer | Yunsup Lee <yunsup@cs.berkeley.edu> | 2015-03-17 04:36:38 -0700 |
commit | afef768f9fef1c224130583fae2b54f92818a794 (patch) | |
tree | 8b6692b61d1fa079bce9c5e2c5dad678d0b89d3b /p/riscv_test.h | |
parent | 4c4d152c48c6975e9e78e986925cac88814ae688 (diff) | |
download | env-afef768f9fef1c224130583fae2b54f92818a794.zip env-afef768f9fef1c224130583fae2b54f92818a794.tar.gz env-afef768f9fef1c224130583fae2b54f92818a794.tar.bz2 |
relay hwacha cause/aux to scause/sbadaddr
Diffstat (limited to 'p/riscv_test.h')
-rw-r--r-- | p/riscv_test.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/p/riscv_test.h b/p/riscv_test.h index 4efb6fc..ca8cf5e 100644 --- a/p/riscv_test.h +++ b/p/riscv_test.h @@ -130,12 +130,22 @@ tvec_user: \ ori TESTNUM, TESTNUM, 1337; /* some other exception occurred */ \ write_tohost: csrw tohost, TESTNUM; \ j write_tohost; \ - 2: mrts; \ + 2: j mrts_routine; \ .align 6; \ tvec_supervisor: \ EXTRA_TVEC_SUPERVISOR; \ csrr t5, mcause; \ bgez t5, tvec_user; \ + mrts_routine: \ + li t5, MSTATUS_XS; \ + csrr t6, mstatus; \ + and t5, t5, t6; \ + beqz t5, skip_vector_cause_aux; \ + vxcptcause t5; \ + csrw mcause, t5; \ + vxcptaux t5; \ + csrw mbadaddr, t5; \ + skip_vector_cause_aux: \ mrts; \ .align 6; \ tvec_hypervisor: \ |