X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fruntime%2Finterrupt.h;h=8a99fd4b2abd7b72255b7cf4fcd089d30020462d;hb=7cca1cabd213d38218a40e973b06ca11c8546396;hp=11eca74cd61b38e84e1112615d368e0aa0019d85;hpb=dcf5978d9d33098e868ae6eea28e1b310038c03d;p=sbcl.git diff --git a/src/runtime/interrupt.h b/src/runtime/interrupt.h index 11eca74..8a99fd4 100644 --- a/src/runtime/interrupt.h +++ b/src/runtime/interrupt.h @@ -14,6 +14,23 @@ #include +/* + * This is a workaround for some slightly silly Linux/GNU Libc + * behaviour: glibc defines sigset_t to support 1024 signals, which is + * more than the kernel. This is usually not a problem, but becomes + * one when we want to save a signal mask from a ucontext, and restore + * it later into another ucontext: the ucontext is allocated on the + * stack by the kernel, so copying a libc-sized sigset_t into it will + * overflow and cause other data on the stack to be corrupted */ +/* FIXME: do not rely on NSIG being a multiple of 8 */ +#define REAL_SIGSET_SIZE_BYTES ((NSIG/8)) + +static inline void +sigcopyset(sigset_t *new, sigset_t *old) +{ + memcpy(new, old, REAL_SIGSET_SIZE_BYTES); +} + /* maximum signal nesting depth * * Note: In CMU CL, this was 4096, but there was no explanation given, @@ -44,15 +61,17 @@ struct interrupt_data { extern void interrupt_init(); extern void fake_foreign_function_call(os_context_t* context); extern void undo_fake_foreign_function_call(os_context_t* context); +extern void arrange_return_to_lisp_function(os_context_t *, lispobj); extern void interrupt_handle_now(int, siginfo_t*, void*); extern void interrupt_handle_pending(os_context_t*); extern void interrupt_internal_error(int, siginfo_t*, os_context_t*, boolean continuable); -extern boolean handle_control_stack_guard_triggered(os_context_t *,void *); +extern boolean handle_guard_page_triggered(os_context_t *,void *); extern boolean interrupt_maybe_gc(int, siginfo_t*, void*); #ifdef LISP_FEATURE_SB_THREAD extern void interrupt_thread_handler(int, siginfo_t*, void*); extern void sig_stop_for_gc_handler(int, siginfo_t*, void*); +extern void thread_exit_handler(int, siginfo_t*, void*); #endif extern void undoably_install_low_level_interrupt_handler (int signal, void