Interrupts that are out of range are now signalled through the last
authorChris Hanson <org/chris-hanson/cph>
Wed, 27 May 1987 14:50:43 +0000 (14:50 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 27 May 1987 14:50:43 +0000 (14:50 +0000)
slot in the interrupt vector.

v7/src/microcode/boot.c
v7/src/microcode/utils.c
v7/src/microcode/version.h
v8/src/microcode/version.h

index 33a8ff7b7b91b0668906f4f0ef44ee7ba7f41a78..9905858fec1faffa844e7e10d9dd7e34f6a4e699 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/boot.c,v 9.31 1987/04/29 15:39:14 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/boot.c,v 9.32 1987/05/27 14:50:14 cph Exp $
 
 Copyright (c) 1987 Massachusetts Institute of Technology
 
@@ -235,10 +235,10 @@ main(argc, argv)
           The_Queue, *Dummy_Hist, The_Utilities;                       \
   fast long i;                                                         \
        /* Interrupt vector */                                          \
-  Int_Vec = Make_Pointer(TC_VECTOR, Free);                             \
-  *Free++ = Make_Non_Pointer(TC_MANIFEST_VECTOR,                       \
-                            MAX_INTERRUPT_NUMBER + 1);                 \
-  for (i=0; i <= MAX_INTERRUPT_NUMBER; i++) *Free++ = NIL;             \
+  Int_Vec = (Make_Pointer (TC_VECTOR, Free));                          \
+  *Free++ = (Make_Non_Pointer (TC_MANIFEST_VECTOR,                     \
+                              (MAX_INTERRUPT_NUMBER + 2)));            \
+  for (i = 0; (i <= (MAX_INTERRUPT_NUMBER + 1)); i += 1) *Free++ = NIL;        \
        /* Error vector is not needed at boot time */                   \
   Error = NIL;                                                         \
        /* Dummy History Structure */                                   \
index d50f59339767fd86cd191d3de6b5f3feaab70829..5dd130b1f86bb00cf4c121a44b1a804be7cf7385 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/utils.c,v 9.28 1987/05/14 13:50:45 cph Exp $ */
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/utils.c,v 9.29 1987/05/27 14:50:43 cph Exp $ */
 
 /* This file contains utilities for interrupts, errors, etc. */
 
@@ -49,35 +49,48 @@ Setup_Interrupt (Masked_Interrupts)
      long Masked_Interrupts;
 {
   Pointer Int_Vector, Handler;
-  long i, Int_Number, The_Int_Code = IntCode, New_Int_Enb;
+  long i, Int_Number, The_Int_Code, New_Int_Enb;
   long Save_Space;
 
-  Int_Vector = Get_Fixed_Obj_Slot(System_Interrupt_Vector);
-
-  for (Int_Number=0, i=1;
-       Int_Number < MAX_INTERRUPT_NUMBER;
-       i = i<<1, Int_Number++)
-    if ((Masked_Interrupts & i) != 0)
-      goto OK;
-
-  fprintf(stderr, "\nInterrupts = 0x%x, Mask= 0x%x, Masked = 0x%x\n",
-         IntCode, IntEnb, Masked_Interrupts);
-  fprintf(stderr, "Int_Vector %x\n", Int_Vector);
-  Microcode_Termination(TERM_NO_INTERRUPT_HANDLER);
-
-OK:
-  New_Int_Enb = (1<<Int_Number) - 1;
-  Global_Interrupt_Hook();
-  if (Int_Number > Vector_Length(Int_Vector))
-  { fprintf(stderr,
-           "\nInterrupt out of range: 0x%x (vector length = 0x%x)\n",
-           Int_Number, Vector_Length(Int_Vector));
-    fprintf(stderr,
-           "Interrupts = 0x%x, Mask= 0x%x, Masked = 0x%x\n",
-           IntCode, IntEnb, Masked_Interrupts);
-    Microcode_Termination(TERM_NO_INTERRUPT_HANDLER);
-  }
-  else Handler = User_Vector_Ref(Int_Vector, Int_Number);
+  The_Int_Code = IntCode;
+  Int_Vector = (Get_Fixed_Obj_Slot (System_Interrupt_Vector));
+
+  /* The interrupt vector is normally of size (MAX_INTERRUPT_NUMBER + 1).
+     We signal all normal interrupts though the first MAX_INTERRUPT_NUMBER
+     slots, and any other (spurious) interrupts through the last slot. */
+
+  Int_Number = 0;
+  i = 1;
+  while (true)
+    {
+      if (Int_Number > MAX_INTERRUPT_NUMBER)
+       {
+         New_Int_Enb = IntEnb;
+         break;
+       }
+      if ((Masked_Interrupts & i) != 0)
+       {
+         New_Int_Enb = ((1 << Int_Number) - 1);
+         break;
+       }
+      Int_Number += 1;
+      i = (i << 1);
+    }
+
+  /* Handle case where interrupt vector is too small. */
+  if (Int_Number >= (Vector_Length (Int_Vector)))
+    {
+      fprintf (stderr,
+              "\nInterrupt out of range: 0x%x (vector length = 0x%x)\n",
+              Int_Number, (Vector_Length (Int_Vector)));
+      fprintf (stderr,
+              "Interrupts = 0x%x, Mask= 0x%x, Masked = 0x%x\n",
+              IntCode, IntEnb, Masked_Interrupts);
+      Microcode_Termination (TERM_NO_INTERRUPT_HANDLER);
+    }
+
+  Global_Interrupt_Hook ();
+  Handler = (User_Vector_Ref (Int_Vector, Int_Number));
 
 /* Setup_Interrupt continues on the next page */
 \f
index e54c1f357ed8cf067aae0fd42c5da19c4f9c7c7f..12e7d0e0772326e728362ebabda34aabdbad0b07 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/version.h,v 9.53 1987/05/21 18:06:14 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/version.h,v 9.54 1987/05/27 14:49:39 cph Exp $
 
 This file contains version information for the microcode. */
 \f
@@ -46,7 +46,7 @@ This file contains version information for the microcode. */
 #define VERSION                9
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     53
+#define SUBVERSION     54
 #endif
 
 #ifndef UCODE_TABLES_FILENAME
index 7b8f2b39ca667368817145b639230ab6529a14ab..381b9fba839b34adf4168e19a486d8f7c8451d30 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/v8/src/microcode/version.h,v 9.53 1987/05/21 18:06:14 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/version.h,v 9.54 1987/05/27 14:49:39 cph Exp $
 
 This file contains version information for the microcode. */
 \f
@@ -46,7 +46,7 @@ This file contains version information for the microcode. */
 #define VERSION                9
 #endif
 #ifndef SUBVERSION
-#define SUBVERSION     53
+#define SUBVERSION     54
 #endif
 
 #ifndef UCODE_TABLES_FILENAME