#include "validate.h"
vm_size_t os_vm_page_size;
-#if defined GENCGC
-#include "gencgc.h"
-#endif
/* The different BSD variants have diverged in exactly where they
* store signal context information, but at least they tend to use the
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)
{
* any OS-dependent special low-level handling for signals
*/
-#if !defined GENCGC
-
-void
-os_install_interrupt_handlers(void)
-{
- SHOW("os_install_interrupt_handlers()/bsd-os/!defined(GENCGC)");
-}
-
-#else
+#if defined LISP_FEATURE_GENCGC
/*
* The GENCGC needs to be hooked into whatever signal is raised for
#else
#error unsupported BSD variant
#endif
- if (!gencgc_handle_wp_violation(fault_addr)) {
- interrupt_handle_now(signal, siginfo, void_context);
- }
+ os_context_t *context = arch_os_get_context(&void_context);
+ if (!gencgc_handle_wp_violation(fault_addr))
+ if(!handle_control_stack_guard_triggered(context,fault_addr))
+ /* FIXME is this context or void_context? not that it */
+ /* makes a difference currently except on linux/sparc */
+ interrupt_handle_now(signal, siginfo, void_context);
}
void
os_install_interrupt_handlers(void)
{
SHOW("os_install_interrupt_handlers()/bsd-os/defined(GENCGC)");
-#if defined __FreeBSD__
- undoably_install_low_level_interrupt_handler(SIGBUS,
+ undoably_install_low_level_interrupt_handler(SIG_MEMORY_FAULT,
memory_fault_handler);
-#elif defined __OpenBSD__
- 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 */
+#else
+/* As of 2002.07.31, this configuration has never been tested */
+void
+os_install_interrupt_handlers(void)
+{
+ SHOW("os_install_interrupt_handlers()/bsd-os/!defined(GENCGC)");
+}
+
+#endif /* defined GENCGC */