aboutsummaryrefslogtreecommitdiff
path: root/pk/mtrap.c
diff options
context:
space:
mode:
Diffstat (limited to 'pk/mtrap.c')
-rw-r--r--pk/mtrap.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/pk/mtrap.c b/pk/mtrap.c
index d5aafd6..88a8a46 100644
--- a/pk/mtrap.c
+++ b/pk/mtrap.c
@@ -9,7 +9,11 @@ uintptr_t illegal_insn_trap(uintptr_t mcause, uintptr_t* regs)
asm (".pushsection .rodata\n"
"illegal_insn_trap_table:\n"
" .word truly_illegal_insn\n"
+#ifdef PK_ENABLE_FP_EMULATION
" .word emulate_float_load\n"
+#else
+ " .word truly_illegal_insn\n"
+#endif
" .word truly_illegal_insn\n"
" .word truly_illegal_insn\n"
" .word truly_illegal_insn\n"
@@ -17,26 +21,42 @@ uintptr_t illegal_insn_trap(uintptr_t mcause, uintptr_t* regs)
" .word truly_illegal_insn\n"
" .word truly_illegal_insn\n"
" .word truly_illegal_insn\n"
+#ifdef PK_ENABLE_FP_EMULATION
" .word emulate_float_store\n"
+#else
+ " .word truly_illegal_insn\n"
+#endif
" .word truly_illegal_insn\n"
" .word truly_illegal_insn\n"
" .word emulate_mul_div\n"
" .word truly_illegal_insn\n"
" .word emulate_mul_div32\n"
" .word truly_illegal_insn\n"
+#ifdef PK_ENABLE_FP_EMULATION
" .word emulate_fmadd\n"
" .word emulate_fmsub\n"
" .word emulate_fnmsub\n"
" .word emulate_fnmadd\n"
" .word emulate_fp\n"
+#else
+ " .word truly_illegal_insn\n"
+ " .word truly_illegal_insn\n"
" .word truly_illegal_insn\n"
" .word truly_illegal_insn\n"
" .word truly_illegal_insn\n"
+#endif
+ " .word truly_illegal_insn\n"
+ " .word truly_illegal_insn\n"
" .word truly_illegal_insn\n"
" .word truly_illegal_insn\n"
" .word truly_illegal_insn\n"
" .word truly_illegal_insn\n"
+ " .word truly_illegal_insn\n"
+#ifdef PK_ENABLE_FP_EMULATION
" .word emulate_system\n"
+#else
+ " .word truly_illegal_insn\n"
+#endif
" .word truly_illegal_insn\n"
" .word truly_illegal_insn\n"
" .word truly_illegal_insn\n"