+
+#else
+
+static void
+sigsegv_handler(int signal, siginfo_t *info, void* void_context)
+{
+ os_context_t *context = (os_context_t*)void_context;
+ os_vm_address_t addr;
+
+#ifdef i386
+ interrupt_handle_now(signal,contextstruct);
+#else
+#define CONTROL_STACK_TOP (((char*)CONTROL_STACK_START)+CONTROL_STACK_SIZE)
+
+ addr = arch_get_bad_addr(signal,info,context);
+
+ if(addr != NULL &&
+ *os_context_register_addr(context,reg_ALLOC) & (1L<<63)){
+ /* This is the end of a pseudo-atomic section during which
+ * a signal was received. We must deal with the pending interrupt
+ * (see also interrupt.c, ../code/interrupt.lisp)
+ */
+
+ /* (how we got here: when interrupting, we set bit 63 in
+ * reg_Alloc. At the end of the atomic section we tried to
+ * write to reg_Alloc, got a SIGSEGV (there's nothing mapped
+ * there) so ended up here
+ */
+ *os_context_register_addr(context,reg_ALLOC) -= (1L<<63);
+ interrupt_handle_pending(context);
+ } else if (addr > CONTROL_STACK_TOP && addr < BINDING_STACK_START) {
+ fprintf(stderr, "Possible stack overflow at 0x%016lX: CONTROL_STACK_TOP=%lx, BINDING_STACK_START=%lx\n",addr, CONTROL_STACK_TOP,BINDING_STACK_START);
+ /* try to fix control frame pointer */
+ while ( ! (CONTROL_STACK_START <= *current_control_frame_pointer &&
+ *current_control_frame_pointer <= CONTROL_STACK_TOP))
+ ((char*)current_control_frame_pointer) -= sizeof(lispobj);
+ ldb_monitor();
+ } else if (!interrupt_maybe_gc(signal, info, context)) {
+ interrupt_handle_now(signal, info, context);
+ }
+#endif
+}
+#endif
+
+
+