aboutsummaryrefslogtreecommitdiff
path: root/env
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2013-09-21 06:32:12 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2013-09-21 06:32:12 -0700
commit8dd97c2e7af399bc04b9d132bd1f1a4bdbbfec57 (patch)
tree227332e682571ba104b4b11fc24a75d08f960d27 /env
parentccc285d2f196a717bb639ef1a9a0a005d7527975 (diff)
downloadriscv-tests-8dd97c2e7af399bc04b9d132bd1f1a4bdbbfec57.zip
riscv-tests-8dd97c2e7af399bc04b9d132bd1f1a4bdbbfec57.tar.gz
riscv-tests-8dd97c2e7af399bc04b9d132bd1f1a4bdbbfec57.tar.bz2
Re-enable virtual memory tests
Diffstat (limited to 'env')
-rw-r--r--env/v/vm.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/env/v/vm.c b/env/v/vm.c
index bfbf197..173287a 100644
--- a/env/v/vm.c
+++ b/env/v/vm.c
@@ -99,7 +99,7 @@ void handle_fault(unsigned long addr)
__builtin___clear_cache(0,0);
}
-void emulate_vxcptsave(trapframe_t* tf)
+static void emulate_vxcptsave(trapframe_t* tf)
{
long where = tf->gpr[(tf->insn >> 22) & 0x1F];
@@ -107,7 +107,7 @@ void emulate_vxcptsave(trapframe_t* tf)
fencevl();
}
-void do_vxcptrestore(long* where)
+static void do_vxcptrestore(long* where)
{
vxcpthold();
@@ -152,7 +152,7 @@ void do_vxcptrestore(long* where)
}
}
-void emulate_vxcptrestore(trapframe_t* tf)
+static void emulate_vxcptrestore(trapframe_t* tf)
{
long* where = (long*)tf->gpr[(tf->insn >> 22) & 0x1F];
vxcptkill();
@@ -160,7 +160,7 @@ void emulate_vxcptrestore(trapframe_t* tf)
do_vxcptrestore(where);
}
-void restore_vector(trapframe_t* tf)
+static void restore_vector(trapframe_t* tf)
{
mtpcr(PCR_VECBANK, tf->vecbank);
//vcfg(tf->veccfg);
@@ -191,10 +191,12 @@ void handle_trap(trapframe_t* tf)
if (tf->insn == fssr)
terminate(1); // FP test on non-FP hardware. "succeed."
+#if 0
else if ((tf->insn & 0xF83FFFFF) == 0x37B)
emulate_vxcptsave(tf);
else if ((tf->insn & 0xF83FFFFF) == 0x77B)
emulate_vxcptrestore(tf);
+#endif
else
assert(0);
tf->epc += 4;
@@ -243,7 +245,12 @@ void vm_boot(long test_addr, long seed)
// relocate
long adjustment = RELOC(0L), tmp;
mtpcr(PCR_EVEC, (char*)&trap_entry + adjustment);
- asm volatile ("add sp, sp, %1; rdpc %0; addi %0, %0, 16; add %0, %0, %1; jr %0" : "=&r"(tmp) : "r"(adjustment));
+ asm volatile ("add sp, sp, %1\n"
+ "jal %0, 1f\n"
+ "1: add %0, %0, %1\n"
+ "jr %0, 8"
+ : "=&r"(tmp)
+ : "r"(adjustment));
memset(RELOC(&l3pt[0]), 0, MAX_TEST_PAGES*sizeof(pte_t));
mtpcr(PCR_FATC, 0);