diff options
author | Yunsup Lee <yunsup@cs.berkeley.edu> | 2013-11-05 21:09:11 -0800 |
---|---|---|
committer | Yunsup Lee <yunsup@cs.berkeley.edu> | 2013-11-05 21:09:22 -0800 |
commit | 43c14ea417d21968d918447662a1c4722a3887d2 (patch) | |
tree | 1d3dba4907275ccfcf8fed4bcdf6d0888f5cdfe0 /pk/handlers.c | |
parent | d1412a1cb9f54ab116166b0eb93b412b7194f1cb (diff) | |
download | riscv-pk-43c14ea417d21968d918447662a1c4722a3887d2.zip riscv-pk-43c14ea417d21968d918447662a1c4722a3887d2.tar.gz riscv-pk-43c14ea417d21968d918447662a1c4722a3887d2.tar.bz2 |
sync pcr.h, correctly name SR_EA
Diffstat (limited to 'pk/handlers.c')
-rw-r--r-- | pk/handlers.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/pk/handlers.c b/pk/handlers.c index 45b2317..8d71e4f 100644 --- a/pk/handlers.c +++ b/pk/handlers.c @@ -7,31 +7,19 @@ #include "vm.h" int have_fp = 1; // initialized to 1 because it can't be in the .bss section! -int have_vector = 1; +int have_accelerator = 1; -static void handle_vector_disabled(trapframe_t* tf) +static void handle_accelerator_disabled(trapframe_t* tf) { - if (have_vector) - tf->sr |= SR_EV; + if (have_accelerator) + tf->sr |= SR_EA; else { dump_tf(tf); - panic("No vector hardware!"); + panic("No accelerator hardware!"); } } -static void handle_vector_bank(trapframe_t* tf) -{ - dump_tf(tf); - panic("Not enought banks were enabled to execute a vector instruction!"); -} - -static void handle_vector_illegal_instruction(trapframe_t* tf) -{ - dump_tf(tf); - panic("An illegal vector instruction was executed!"); -} - static void handle_privileged_instruction(trapframe_t* tf) { dump_tf(tf); @@ -152,9 +140,7 @@ void handle_trap(trapframe_t* tf) [CAUSE_MISALIGNED_STORE] = handle_misaligned_store, [CAUSE_FAULT_LOAD] = handle_fault_load, [CAUSE_FAULT_STORE] = handle_fault_store, - [CAUSE_VECTOR_DISABLED] = handle_vector_disabled, - [CAUSE_VECTOR_BANK] = handle_vector_bank, - [CAUSE_VECTOR_ILLEGAL_INSTRUCTION] = handle_vector_illegal_instruction, + [CAUSE_ACCELERATOR_DISABLED] = handle_accelerator_disabled, }; kassert(tf->cause < ARRAY_SIZE(trap_handlers) && trap_handlers[tf->cause]); |