* mask ought to be clear anyway most of the time, but may be non-zero
* if we were interrupted e.g. while waiting for a queue. */
-void reset_signal_mask ()
+void reset_signal_mask(void)
{
sigset_t new;
sigemptyset(&new);
thread_sigmask(SIG_SETMASK,&new,0);
}
-void block_blockable_signals ()
+void block_blockable_signals(void)
{
sigset_t block;
- sigemptyset(&block);
- sigaddset_blockable(&block);
+ sigcopyset(&block, &blockable_sigset);
thread_sigmask(SIG_BLOCK, &block, 0);
}
* utility routines used by various signal handlers
*/
-void
+static void
build_fake_control_stack_frames(struct thread *th,os_context_t *context)
{
#ifndef LISP_FEATURE_C_STACK_IS_CONTROL_STACK
{
lispobj context_sap = 0;
- check_blockables_blocked_or_lose();
fake_foreign_function_call(context);
+ if (!internal_errors_enabled) {
+ describe_internal_error(context);
+ /* There's no good way to recover from an internal error
+ * before the Lisp error handling mechanism is set up. */
+ lose("internal error too early in init, can't recover");
+ }
+
/* Allocate the SAP object while the interrupts are still
* disabled. */
- if (internal_errors_enabled) {
- context_sap = alloc_sap(context);
- }
+ context_sap = alloc_sap(context);
thread_sigmask(SIG_SETMASK, os_context_sigmask_addr(context), 0);
- if (internal_errors_enabled) {
- SHOW("in interrupt_internal_error");
+ SHOW("in interrupt_internal_error");
#ifdef QSHOW
- /* Display some rudimentary debugging information about the
- * error, so that even if the Lisp error handler gets badly
- * confused, we have a chance to determine what's going on. */
- describe_internal_error(context);
+ /* Display some rudimentary debugging information about the
+ * error, so that even if the Lisp error handler gets badly
+ * confused, we have a chance to determine what's going on. */
+ describe_internal_error(context);
#endif
- funcall2(SymbolFunction(INTERNAL_ERROR), context_sap,
- continuable ? T : NIL);
- } else {
- describe_internal_error(context);
- /* There's no good way to recover from an internal error
- * before the Lisp error handling mechanism is set up. */
- lose("internal error too early in init, can't recover");
- }
+ funcall2(SymbolFunction(INTERNAL_ERROR), context_sap,
+ continuable ? T : NIL);
+
undo_fake_foreign_function_call(context); /* blocks signals again */
if (continuable) {
arch_skip_instruction(context);
/* need the context stored so it can have registers scavenged */
fake_foreign_function_call(context);
- sigemptyset(&ss);
- for(i=1;i<NSIG;i++) sigaddset(&ss,i); /* Block everything. */
+ sigfillset(&ss); /* Block everything. */
thread_sigmask(SIG_BLOCK,&ss,0);
/* The GC can't tell if a thread is a zombie, so this would be a
os_context_t *context=(os_context_t *) void_context;
struct thread *thread=arch_os_get_current_thread();
- check_blockables_blocked_or_lose();
fake_foreign_function_call(context);
/* SUB-GC may return without GCing if *GC-INHIBIT* is set, in
else
sa.sa_sigaction = handler;
- sigemptyset(&sa.sa_mask);
- sigaddset_blockable(&sa.sa_mask);
+ sigcopyset(&sa.sa_mask, &blockable_sigset);
sa.sa_flags = SA_SIGINFO | SA_RESTART;
#ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK
if((signal==SIG_MEMORY_FAULT)
|| (signal==SIG_INTERRUPT_THREAD)
#endif
)
- sa.sa_flags|= SA_ONSTACK;
+ sa.sa_flags |= SA_ONSTACK;
#endif
sigaction(signal, &sa, NULL);
sa.sa_sigaction = interrupt_handle_now_handler;
}
- sigemptyset(&sa.sa_mask);
- sigaddset_blockable(&sa.sa_mask);
+ sigcopyset(&sa.sa_mask, &blockable_sigset);
sa.sa_flags = SA_SIGINFO | SA_RESTART;
sigaction(signal, &sa, NULL);
}