aboutsummaryrefslogtreecommitdiff
path: root/pk/handlers.c
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@s141.Millennium.Berkeley.EDU>2011-01-10 16:35:20 -0800
committerAndrew Waterman <waterman@s141.Millennium.Berkeley.EDU>2011-01-10 16:35:20 -0800
commit0cf0242c3bb3fbd9aba37ca21325ea4d11b83f1b (patch)
tree38d355d9b28f003ab682e9b75c7552366f37cca8 /pk/handlers.c
parentb83d64df0179835678c54401ec88bd37e03e19ba (diff)
downloadriscv-pk-0cf0242c3bb3fbd9aba37ca21325ea4d11b83f1b.zip
riscv-pk-0cf0242c3bb3fbd9aba37ca21325ea4d11b83f1b.tar.gz
riscv-pk-0cf0242c3bb3fbd9aba37ca21325ea4d11b83f1b.tar.bz2
[pk] added --disable-fp-emulation option for code size
Diffstat (limited to 'pk/handlers.c')
-rw-r--r--pk/handlers.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/pk/handlers.c b/pk/handlers.c
index 25005c8..2947903 100644
--- a/pk/handlers.c
+++ b/pk/handlers.c
@@ -19,11 +19,15 @@ void handle_fp_disabled(trapframe_t* tf)
}
else
{
+#ifdef PK_ENABLE_FP_EMULATION
if(emulate_fp(tf) != 0)
{
dump_tf(tf);
panic("FPU emulation failed!");
}
+#else
+ panic("FPU emulation disabled! pc %lx, insn %x",tf->epc,(uint32_t)tf->insn);
+#endif
}
}
@@ -41,8 +45,10 @@ void handle_privileged_instruction(trapframe_t* tf)
void handle_illegal_instruction(trapframe_t* tf)
{
+#ifdef PK_ENABLE_FP_EMULATION
if(emulate_fp(tf) == 0)
return;
+#endif
dump_tf(tf);
panic("An illegal instruction was executed!");