X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Finterrupt.c;h=68c5fe06ca765ed31790a2991e5663e1e8b620c9;hb=3bbbfec26f90bc005c2ff5c8de0ceb0f95f1a52b;hp=3e308b164d587affcd1c4e6ca09d07bddb9b859f;hpb=1e4629723d19f96d752235ffde34fe58431431ae;p=sbcl.git diff --git a/src/runtime/interrupt.c b/src/runtime/interrupt.c index 3e308b1..68c5fe0 100644 --- a/src/runtime/interrupt.c +++ b/src/runtime/interrupt.c @@ -347,23 +347,12 @@ interrupt_handle_now(int signal, siginfo_t *info, void *void_context) #endif union interrupt_handler handler; - /* FIXME: The CMU CL we forked off of had this Linux-only - * operation here. Newer CMU CLs (e.g. 18c) have hairier - * Linux/i386-only logic here. SBCL seems to be more reliable - * without anything here. However, if we start supporting code - * which sets the rounding mode, then we may want to do something - * special to force the rounding mode back to some standard value - * here, so that ISRs can have a standard environment. (OTOH, if - * rounding modes are under user control, then perhaps we should - * leave this up to the user.) - * - * In the absence of a test case to show that this is really a - * problem, we just suppress this code completely (just like the - * parallel code in maybe_now_maybe_later). - * #ifdef __linux__ - * SET_FPU_CONTROL_WORD(context->__fpregs_mem.cw); - * #endif */ - +#ifdef LISP_FEATURE_LINUX + /* Under Linux, we appear to have to restore the fpu control word + from the context, as after the signal is delivered we appear to + have a null fpu control word. */ + os_restore_fp_control(context); +#endif handler = interrupt_handlers[signal]; if (ARE_SAME_HANDLER(handler.c, SIG_IGN)) { @@ -446,12 +435,12 @@ maybe_now_maybe_later(int signal, siginfo_t *info, void *void_context) * interrupt time which should be ported into SBCL. Also see the * analogous logic at the head of interrupt_handle_now for * more related FIXME stuff. - * - * For now, we just suppress this code completely. - * #ifdef __linux__ - * SET_FPU_CONTROL_WORD(context->__fpregs_mem.cw); - * #endif */ - + */ + +#ifdef LISP_FEATURE_LINUX + os_restore_fp_control(context); +#endif + /* see comments at top of code/signal.lisp for what's going on here * with INTERRUPTS_ENABLED/INTERRUPT_HANDLE_NOW */ @@ -497,7 +486,7 @@ maybe_now_maybe_later(int signal, siginfo_t *info, void *void_context) * stuff to detect and handle hitting the GC trigger */ -#ifndef INTERNAL_GC_TRIGGER +#ifndef GENCGC /* since GENCGC has its own way to record trigger */ static boolean gc_trigger_hit(int signal, siginfo_t *info, os_context_t *context) { @@ -525,11 +514,11 @@ interrupt_maybe_gc(int signal, siginfo_t *info, void *void_context) os_context_t *context=(os_context_t *) void_context; if (!foreign_function_call_active -#ifndef INTERNAL_GC_TRIGGER +#ifndef GENCGC /* since GENCGC has its own way to record trigger */ && gc_trigger_hit(signal, info, context) #endif ) { -#ifndef INTERNAL_GC_TRIGGER +#ifndef GENCGC /* since GENCGC has its own way to record trigger */ clear_auto_gc_trigger(); #endif @@ -561,9 +550,8 @@ interrupt_maybe_gc(int signal, siginfo_t *info, void *void_context) * have to do it ourselves. Add small amount of space * to tide us over while GC is inhibited */ - set_auto_gc_trigger((u32)dynamic_space_free_pointer - -(u32)current_dynamic_space - +(u32)os_vm_page_size); + set_auto_gc_trigger(DYNAMIC_SPACE_SIZE + -(u32)os_vm_page_size); } return 1; } else {