From afef768f9fef1c224130583fae2b54f92818a794 Mon Sep 17 00:00:00 2001 From: Yunsup Lee Date: Tue, 17 Mar 2015 04:36:33 -0700 Subject: relay hwacha cause/aux to scause/sbadaddr --- p/riscv_test.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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: \ -- cgit v1.1