Fix some problems with unix signals: (1) Emacs uses SIGHUP to kill a
authorChris Hanson <org/chris-hanson/cph>
Fri, 21 Oct 1988 00:13:07 +0000 (00:13 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 21 Oct 1988 00:13:07 +0000 (00:13 +0000)
process when its buffer is killed, so treat SIGHUP differently if
under Emacs -- also don't print messages in this case as the buffer is
dead; (2) don't ask for core dump if signal received.

Also define new primitive `clear-interrupts!'; change
`get-next-interrupt-character' and `setup-timer-interrupt' so they
don't clear the interrupt bit.  It is now the responsibility of the
runtime system to clear the bit when it gets the interrupt.

v7/src/microcode/boot.c
v7/src/microcode/dmpwrld.c
v7/src/microcode/hooks.c
v7/src/microcode/sysprim.c
v7/src/microcode/version.h
v8/src/microcode/version.h

index f98f382e831cf364f0f76ce2d1b016186682489a..7be71c857dd61cc3f31af2ef4a6d2f9064aac046 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/boot.c,v 9.51 1988/09/29 04:51:09 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/boot.c,v 9.52 1988/10/21 00:12:26 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -535,6 +535,9 @@ Enter_Interpreter()
   /*NOTREACHED*/
 }
 \f
+extern Boolean inhibit_termination_messages;
+Boolean inhibit_termination_messages = false;
+
 term_type
 Microcode_Termination(code)
      long code;
@@ -576,15 +579,14 @@ Microcode_Termination(code)
     }
   }
 
-  putchar('\n');
-  if ((code < 0) || (code > MAX_TERMINATION))
-  {
-    printf("Unknown termination code 0x%x\n", code);
-  }
-  else
-  {
-    printf("%s.\n", Term_Messages[code]);
-  }
+  if (! inhibit_termination_messages)
+    {
+      putchar('\n');
+      if ((code < 0) || (code > MAX_TERMINATION))
+       printf ("Unknown termination code 0x%x\n", code);
+      else
+       printf("%s.\n", Term_Messages [code]);
+    }
 
 /* Microcode_Termination continues on the next page */
 \f
@@ -604,14 +606,18 @@ Microcode_Termination(code)
       abnormal_p = false;
       break;
 
+#ifdef unix
     case TERM_SIGNAL:
     {
-      extern char *assassin_signal;
+      extern int assassin_signal;
+      extern char * find_signal_name ();
 
-      if (assassin_signal != ((char *) NULL))
-       printf("Killed by %s.\n", assassin_signal);
+      if ((! inhibit_termination_messages) &&
+         (assassin_signal != 0))
+       printf("Killed by %s.\n", (find_signal_name (assassin_signal)));
       goto normal_termination;
     }
+#endif
 
     case TERM_TRAP:
       /* This claims not to be abnormal so that the user will
@@ -664,11 +670,11 @@ Microcode_Termination(code)
       }
       break;
   }
-  OS_Flush_Output_Buffer();
-  OS_Quit(abnormal_p);
-  Reset_Memory();
-  Exit_Hook();
-  Exit_Scheme(value);
+  OS_Flush_Output_Buffer ();
+  OS_Quit (code, abnormal_p);
+  Reset_Memory ();
+  Exit_Hook ();
+  Exit_Scheme (value);
   /*NOTREACHED*/
 }
 \f
index e3e9c1bea5c8e8967c085c6f04570f426f5dc489..d9bcdbca1066b3017f0f79d400fb3393b05c2af2 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/dmpwrld.c,v 9.27 1988/08/15 20:45:01 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/dmpwrld.c,v 9.28 1988/10/21 00:12:33 cph Exp $
  *
  * This file contains a primitive to dump an executable version of Scheme.
  * It uses unexec.c from GNU Emacs.
@@ -218,7 +218,7 @@ DEFINE_PRIMITIVE ("DUMP-WORLD", Prim_dump_world, 1, 1, 0)
 
   Was_Scheme_Dumped = true;
   Val = SHARP_T;
-  OS_Quit();
+  OS_Quit (TERM_HALT, false);
   Pop_Primitive_Frame(1);
 
   /* Dump! */
index c715d7083033d00f124d3cd49f2e6582f2d699c9..90ffa32d301cedf731fa0d26b5d16e7e90bfd685 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/hooks.c,v 9.32 1988/08/15 20:49:05 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/hooks.c,v 9.33 1988/10/21 00:12:37 cph Exp $
  *
  * This file contains various hooks and handles which connect the
  * primitives with the main interpreter.
@@ -535,22 +535,17 @@ DEFINE_PRIMITIVE ("SCODE-EVAL", Prim_scode_eval, 2, 2, 0)
   /*NOTREACHED*/
 }
 
-/* (GET-INTERRUPT-ENABLES)
-   Returns the current interrupt mask.  */
-
-DEFINE_PRIMITIVE ("GET-INTERRUPT-ENABLES", Prim_get_interrupt_enables, 0, 0, 0)
+DEFINE_PRIMITIVE ("GET-INTERRUPT-ENABLES", Prim_get_interrupt_enables, 0, 0,
+  "Returns the current interrupt mask.")
 {
   PRIMITIVE_HEADER (0);
 
   PRIMITIVE_RETURN (MAKE_UNSIGNED_FIXNUM (FETCH_INTERRUPT_MASK ()));
 }
 
-/* (SET-INTERRUPT-ENABLES! NEW-INT-ENABLES)
-   Changes the enabled interrupt bits to NEW-INT-ENABLES and
-   returns the previous value.  See MASK_INTERRUPT_ENABLES for more
-   information on interrupts.  */
-
-DEFINE_PRIMITIVE ("SET-INTERRUPT-ENABLES!", Prim_set_interrupt_enables, 1, 1, 0)
+DEFINE_PRIMITIVE ("SET-INTERRUPT-ENABLES!", Prim_set_interrupt_enables, 1, 1,
+  "Sets the interrupt mask to NEW-INT-ENABLES; returns previous mask value.\n\
+See `mask_interrupt_enables' for more information on interrupts.")
 {
   long previous;
   PRIMITIVE_HEADER (1);
@@ -559,6 +554,16 @@ DEFINE_PRIMITIVE ("SET-INTERRUPT-ENABLES!", Prim_set_interrupt_enables, 1, 1, 0)
   SET_INTERRUPT_MASK ((FIXNUM_ARG (1)) & INT_Mask);
   PRIMITIVE_RETURN (MAKE_UNSIGNED_FIXNUM (previous));
 }
+
+DEFINE_PRIMITIVE ("CLEAR-INTERRUPTS!", Prim_clear_interrupts, 1, 1, 
+  "Clears the interrupt bits in the MASK argument.
+The bits in MASK are interpreted as for `get-interrupt-enables'.")
+{
+  PRIMITIVE_HEADER (1);
+
+  CLEAR_INTERRUPT ((FIXNUM_ARG (1)) & INT_Mask);
+  PRIMITIVE_RETURN (SHARP_F);
+}
 \f
 /* (GET-FLUID-BINDINGS)
    Gets the microcode fluid-bindings variable.  */
index b8351fa1c7b7254cc52e8e6b5e65f345541caec0..613f372bf586f5d0eb1852c680e4acf517ccad85 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/sysprim.c,v 9.30 1988/08/15 20:56:21 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/sysprim.c,v 9.31 1988/10/21 00:12:44 cph Exp $
  *
  * Random system primitives.  Most are implemented in terms of
  * utilities in os.c
@@ -64,7 +64,6 @@ DEFINE_PRIMITIVE ("GET-NEXT-INTERRUPT-CHARACTER", Prim_get_next_interrupt_char,
       Primitive_Error (ERR_EXTERNAL_RETURN);
       /*NOTREACHED*/
     }
-  CLEAR_INTERRUPT (INT_Character);
   PRIMITIVE_RETURN (MAKE_UNSIGNED_FIXNUM (result));
 }
 \f
@@ -101,7 +100,6 @@ DEFINE_PRIMITIVE ("SETUP-TIMER-INTERRUPT", Prim_setup_timer_interrupt, 2, 2, 0)
     Sign_Extend(Arg2, Centi_Seconds);
     Set_Int_Timer(Days, Centi_Seconds);
   }
-  CLEAR_INTERRUPT(INT_Timer);
   PRIMITIVE_RETURN(NIL);
 }
 \f
index 04e4aa4f923bffb18354a9d8f8c23a5461414438..67e5653df3744e74362ea5d3298edbad4cdd5c63 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 10.54 1988/10/20 11:00:23 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 10.55 1988/10/21 00:13:07 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -46,7 +46,7 @@ MIT in each case. */
 #define VERSION                10
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     54
+#define SUBVERSION     55
 #endif
 
 #ifndef UCODE_TABLES_FILENAME
index da3b4d33d7f8e6210978159a114083b8d9d5ba2c..c45f7497045bbd0c90187f848f708805e60139c0 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 10.54 1988/10/20 11:00:23 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 10.55 1988/10/21 00:13:07 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -46,7 +46,7 @@ MIT in each case. */
 #define VERSION                10
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     54
+#define SUBVERSION     55
 #endif
 
 #ifndef UCODE_TABLES_FILENAME