From be6511639c2d9291e9050682c4d7ce3e7042d061 Mon Sep 17 00:00:00 2001 From: Yunsup Lee Date: Mon, 16 Mar 2015 02:09:10 -0700 Subject: clean up pt and vector environments --- p/riscv_test.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'p/riscv_test.h') diff --git a/p/riscv_test.h b/p/riscv_test.h index 0c677f7..bea9b3a 100644 --- a/p/riscv_test.h +++ b/p/riscv_test.h @@ -53,6 +53,12 @@ RVTEST_ENABLE_SUPERVISOR; \ .endm +#define RVTEST_RV64SV \ + .macro init; \ + RVTEST_ENABLE_SUPERVISOR; \ + RVTEST_VEC_ENABLE; \ + .endm + #define RVTEST_RV32M \ .macro init; \ RVTEST_ENABLE_MACHINE; \ @@ -91,9 +97,9 @@ 2:fssr x0; \ #define RVTEST_VEC_ENABLE \ - li a0, SSSTATUS_XS & (SSTATUS_XS >> 1); \ - csrs status, a0; \ - csrr a1, status; \ + li a0, SSTATUS_XS & (SSTATUS_XS >> 1); \ + csrs sstatus, a0; \ + csrr a1, sstatus; \ and a0, a0, a1; \ bnez a0, 2f; \ RVTEST_PASS; \ @@ -103,6 +109,10 @@ csrr a0, hartid; \ 1: bnez a0, 1b +#define EXTRA_TVEC_USER +#define EXTRA_TVEC_SUPERVISOR +#define EXTRA_TVEC_HYPERVISOR +#define EXTRA_TVEC_MACHINE #define EXTRA_INIT #define EXTRA_INIT_TIMER @@ -110,6 +120,7 @@ .text; \ .align 6; \ tvec_user: \ + EXTRA_TVEC_USER; \ la t5, hcall; \ csrr t6, mepc; \ beq t5, t6, write_tohost; \ @@ -122,14 +133,17 @@ tvec_user: \ 2: mrts; \ .align 6; \ tvec_supervisor: \ + EXTRA_TVEC_SUPERVISOR; \ csrr t5, mcause; \ bgez t5, tvec_user; \ mrts; \ .align 6; \ tvec_hypervisor: \ + EXTRA_TVEC_HYPERVISOR; \ RVTEST_FAIL; /* no hypervisor */ \ .align 6; \ tvec_machine: \ + EXTRA_TVEC_MACHINE; \ .weak mtvec; \ la t5, hcall; \ csrr t6, mepc; \ -- cgit v1.1