summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYunsup Lee <yunsup@cs.berkeley.edu>2015-03-17 04:36:33 -0700
committerYunsup Lee <yunsup@cs.berkeley.edu>2015-03-17 04:36:38 -0700
commitafef768f9fef1c224130583fae2b54f92818a794 (patch)
tree8b6692b61d1fa079bce9c5e2c5dad678d0b89d3b
parent4c4d152c48c6975e9e78e986925cac88814ae688 (diff)
downloadenv-afef768f9fef1c224130583fae2b54f92818a794.zip
env-afef768f9fef1c224130583fae2b54f92818a794.tar.gz
env-afef768f9fef1c224130583fae2b54f92818a794.tar.bz2
relay hwacha cause/aux to scause/sbadaddr
-rw-r--r--p/riscv_test.h12
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: \