0.pre7.14.flaky4.5:
[sbcl.git] / src / runtime / bsd-os.c
index 1560173..eaf6e10 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * OS-dependent routines for FreeBSD (and could maybe be extended to all BSD?)
+ * OS-dependent routines for BSD-ish systems
  *
  * This file (along with os.h) exports an OS-independent interface to
  * the operating system VM facilities. This interface looks a lot like
  * files for more information.
  */
 
-/*
- * $Header$
- */
-
 #include <stdio.h>
 #include <sys/param.h>
 #include <sys/file.h>
@@ -30,6 +26,7 @@
 #include "arch.h"
 #include "globals.h"
 #include "interrupt.h"
+#include "interr.h"
 #include "lispregs.h"
 #include "sbcl.h"
 
@@ -167,6 +164,10 @@ os_map(int fd, int offset, os_vm_address_t addr, os_vm_size_t len)
     return addr;
 }
 
+/* FIXME: If this can be a no-op on BSD/x86, then it 
+ * deserves a more precise name.
+ *
+ * (Perhaps os_prepare_data_area_to_be_executed()?) */
 void
 os_flush_icache(os_vm_address_t address, os_vm_size_t length)
 {
@@ -194,8 +195,7 @@ is_valid_lisp_addr(os_vm_address_t addr)
 {
     return in_range_p(addr, READ_ONLY_SPACE_START, READ_ONLY_SPACE_SIZE)
        || in_range_p(addr, STATIC_SPACE_START   , STATIC_SPACE_SIZE   )
-       || in_range_p(addr, DYNAMIC_0_SPACE_START, DYNAMIC_SPACE_SIZE  )
-       || in_range_p(addr, DYNAMIC_1_SPACE_START, DYNAMIC_SPACE_SIZE  )
+       || in_range_p(addr, DYNAMIC_SPACE_START  , DYNAMIC_SPACE_SIZE  )
        || in_range_p(addr, CONTROL_STACK_START  , CONTROL_STACK_SIZE  )
        || in_range_p(addr, BINDING_STACK_START  , BINDING_STACK_SIZE  );
 }
@@ -208,7 +208,9 @@ is_valid_lisp_addr(os_vm_address_t addr)
 
 void
 os_install_interrupt_handlers(void)
-{}
+{
+    SHOW("os_install_interrupt_handlers()/bsd-os/!defined(GENCGC)");
+}
 
 #else
 
@@ -235,13 +237,17 @@ memory_fault_handler(int signal, siginfo_t *siginfo, void *void_context)
 void
 os_install_interrupt_handlers(void)
 {
+    SHOW("os_install_interrupt_handlers()/bsd-os/defined(GENCGC)");
 #if defined __FreeBSD__
-    interrupt_install_low_level_handler(SIGBUS, memory_fault_handler);
+    undoably_install_low_level_interrupt_handler(SIGBUS,
+                                                memory_fault_handler);
 #elif defined __OpenBSD__
-    interrupt_install_low_level_handler(SIGSEGV, memory_fault_handler);
+    undoably_install_low_level_interrupt_handler(SIGSEGV,
+                                                memory_fault_handler);
 #else
 #error unsupported BSD variant
 #endif
+    SHOW("leaving os_install_interrupt_handlers()");
 }
 
 #endif /* !defined GENCGC */