From b81960a4094f30e0e4d9a90ad7c2699e7b63c80c Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Thu, 6 Nov 2014 18:16:16 -0800 Subject: Improve VM env debug messages --- v/vm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'v') diff --git a/v/vm.c b/v/vm.c index d2f1fd2..deb46c2 100644 --- a/v/vm.c +++ b/v/vm.c @@ -172,13 +172,13 @@ void handle_trap(trapframe_t* tf) { assert(tf->epc % 4 == 0); - int fssr; - asm ("la %0, 1f; lw %0, 0(%0); b 2f; 1: fssr x0; 2:" : "=r"(fssr)); + int* fssr; + asm ("jal %0, 1f; fssr x0; 1:" : "=r"(fssr)); - if (*(int*)tf->epc == fssr) + if (*(int*)tf->epc == *fssr) terminate(1); // FP test on non-FP hardware. "succeed." else - assert(0); + assert(!"illegal instruction"); tf->epc += 4; } else if (tf->cause == CAUSE_FAULT_LOAD || tf->cause == CAUSE_FAULT_STORE) @@ -193,10 +193,10 @@ void handle_trap(trapframe_t* tf) handle_fault(badvaddr); } else - assert(0); + assert(!"unexpected interrupt"); } else - assert(0); + assert(!"unexpected exception"); out: if (!(tf->sr & SR_PS) && (tf->sr & SR_EA)) { -- cgit v1.1