Permalink
Browse files

Port safepoints to FreeBSD/x86

  • Loading branch information...
1 parent 3b39e49 commit ed46a50c259dc0884f28c437bc2c1dc3f207183b @lichtblau lichtblau committed Sep 14, 2012
Showing with 16 additions and 2 deletions.
  1. +11 −1 src/runtime/bsd-os.c
  2. +1 −1 src/runtime/x86-assem.S
  3. +4 −0 src/runtime/x86-bsd-os.c
View
@@ -213,6 +213,10 @@ memory_fault_handler(int signal, siginfo_t *siginfo, os_context_t *context)
FSHOW((stderr, "Memory fault at: %p, PC: %p\n", fault_addr, *os_context_pc_addr(context)));
+#ifdef LISP_FEATURE_SB_SAFEPOINT
+ if (!handle_safepoint_violation(context, fault_addr))
+#endif
+
if (!gencgc_handle_wp_violation(fault_addr))
if(!handle_guard_page_triggered(context,fault_addr))
lisp_memory_fault_error(context, fault_addr);
@@ -241,9 +245,15 @@ os_install_interrupt_handlers(void)
memory_fault_handler);
#endif
-#ifdef THREADS_USING_GCSIGNAL
+#ifdef LISP_FEATURE_SB_THREAD
+# ifdef LISP_FEATURE_SB_SAFEPOINT
+# ifdef LISP_FEATURE_SB_THRUPTION
+ undoably_install_low_level_interrupt_handler(SIGPIPE, thruption_handler);
+# endif
+# else
undoably_install_low_level_interrupt_handler(SIG_STOP_FOR_GC,
sig_stop_for_gc_handler);
+# endif
#endif
SHOW("leaving os_install_interrupt_handlers()");
}
View
@@ -131,7 +131,7 @@
# define LoadCurrentThreadSlot(offset,reg); \
movl SBCL_THREAD_BASE_EA, reg ; \
movl offset(reg), reg ;
-#elif defined(LISP_FEATURE_LINUX) || defined(LISP_FEATURE_SUNOS)
+#elif defined(LISP_FEATURE_LINUX) || defined(LISP_FEATURE_SUNOS) || defined(LISP_FEATURE_FREEBSD)
/* see comment in arch_os_thread_init */
# define SBCL_THREAD_BASE_EA %fs:THREAD_SELFPTR_OFFSET
# define MAYBE_FS(addr) addr
View
@@ -186,6 +186,10 @@ int arch_os_thread_init(struct thread *thread) {
#endif
#endif
+#ifdef LISP_FEATURE_SB_SAFEPOINT
+ thread->selfptr = thread;
+#endif
+
#ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK
stack_t sigstack;

0 comments on commit ed46a50

Please sign in to comment.