*os_context_sigmask_addr(context) = orig_sigmask;
}
+void
+arch_handle_single_step_trap(os_context_t *context, int trap)
+{
+ unsigned int code = *((u32 *)(os_context_pc(context)));
+ int register_offset = code >> 11 & 0x1f;
+ handle_single_step_trap(context, trap, register_offset);
+ arch_skip_instruction(context);
+}
+
static void
sigtrap_handler(int signal, siginfo_t *info, void *void_context)
{
os_context_t *context = arch_os_get_context(&void_context);
unsigned int code = (os_context_insn(context) >> 6) & 0xfffff;
- /* FIXME: WTF is this magic number? Needs to become a #define
- * and go into handle_trap. */
+#ifdef LISP_FEATURE_LINUX
+ os_restore_fp_control(context);
+#endif
+ /* FIXME: This magic number is pseudo-atomic-trap from parms.lisp.
+ * Genesis should provide the proper #define, but it specialcases
+ * pseudo-atomic-trap to work around some oddity on SPARC.
+ * Eventually this should go into handle_trap. */
if (code==0x10) {
arch_clear_pseudo_atomic_interrupted(context);
arch_skip_instruction(context);
interrupt_handle_pending(context);
} else
- handle_trap(context,code);
+ handle_trap(context,code & 0x1f);
}
#define FIXNUM_VALUE(lispobj) (((int)lispobj) >> N_FIXNUM_TAG_BITS)
unsigned int op, rs, rt, rd, funct, dest = 32;
int immed;
int result;
+#ifdef LISP_FEATURE_LINUX
+ os_restore_fp_control(context);
+#endif
op = (bad_inst >> 26) & 0x3f;
rs = (bad_inst >> 21) & 0x1f;
arch_skip_instruction(context);
}
+unsigned int
+arch_get_fp_control(void)
+{
+ register unsigned int ret asm("$2");
+
+ __asm__ __volatile__ ("cfc1 %0, $31" : "=r" (ret));
+
+ return ret;
+}
+
+void
+arch_set_fp_control(unsigned int fp)
+{
+ __asm__ __volatile__ ("ctc1 %0, $31" :: "r" (fp));
+}
+
void
arch_install_interrupt_handlers(void)
{