aboutsummaryrefslogtreecommitdiff
path: root/pk/handlers.c
diff options
context:
space:
mode:
Diffstat (limited to 'pk/handlers.c')
-rw-r--r--pk/handlers.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/pk/handlers.c b/pk/handlers.c
index d4c3d7c..474aa34 100644
--- a/pk/handlers.c
+++ b/pk/handlers.c
@@ -2,6 +2,7 @@
#include "pk.h"
int have_fp = 1; // initialized to 1 because it can't be in the .bss section!
+int have_vector = 1;
static void handle_fp_disabled(trapframe_t* tf)
{
@@ -21,6 +22,14 @@ static void handle_fp_disabled(trapframe_t* tf)
}
}
+static void handle_vector_disabled(trapframe_t* tf)
+{
+ if (have_vector)
+ tf->sr |= SR_EV;
+ else
+ panic("No vector hardware! pc %lx, insn %x",tf->epc,(uint32_t)tf->insn);
+}
+
static void handle_privileged_instruction(trapframe_t* tf)
{
dump_tf(tf);
@@ -112,6 +121,7 @@ void handle_trap(trapframe_t* tf)
handle_misaligned_ldst,
handle_fault_load,
handle_fault_store,
+ handle_vector_disabled,
};
int exccode = (tf->cause & CAUSE_EXCCODE) >> CAUSE_EXCCODE_SHIFT;