X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fbsd-os.c;h=54a1c008b537357fc92069b063d100ca96727f4c;hb=422b88abf96f4842a3d0999cd3b80d96f5a153d6;hp=d841d4c7ae8e4d482da039be118500368851c14e;hpb=d7f6139a91d7d9b0667a597584ae306d958bb2f4;p=sbcl.git diff --git a/src/runtime/bsd-os.c b/src/runtime/bsd-os.c index d841d4c..54a1c00 100644 --- a/src/runtime/bsd-os.c +++ b/src/runtime/bsd-os.c @@ -164,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) { @@ -226,27 +230,19 @@ memory_fault_handler(int signal, siginfo_t *siginfo, void *void_context) #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)"); - SHOW("**1"); /* REMOVEME */ -#if defined __FreeBSD__ - SHOW("**2"); /* REMOVEME */ - SHOW("__FreeBSD__ case"); - interrupt_install_low_level_handler(SIGBUS, memory_fault_handler); -#elif defined __OpenBSD__ - SHOW("**3"); /* REMOVEME */ - FSHOW((stderr, "/__OpenBSD__ case, SIGSEGV=%d\n", SIGSEGV)); - interrupt_install_low_level_handler(SIGSEGV, memory_fault_handler); -#else -#error unsupported BSD variant -#endif - SHOW("**4"); /* REMOVEME */ + undoably_install_low_level_interrupt_handler(SIG_MEMORY_FAULT, + memory_fault_handler); SHOW("leaving os_install_interrupt_handlers()"); }