Move IntCode and IntEnb to the register block so that compiled code
authorChris Hanson <org/chris-hanson/cph>
Fri, 11 Sep 1992 21:59:11 +0000 (21:59 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 11 Sep 1992 21:59:11 +0000 (21:59 +0000)
can access them.

v7/src/microcode/const.h
v7/src/microcode/dosconio.c
v7/src/microcode/extern.h
v7/src/microcode/interp.c
v7/src/microcode/intrpt.h
v7/src/microcode/storage.c
v8/src/microcode/const.h
v8/src/microcode/interp.c

index 841cd1f3bf3f82a80efe126e60437b58f283daba..263d0183b6e2809d90b50b8f785aa94685791290 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/const.h,v 9.40 1992/07/29 19:54:52 cph Exp $
+$Id: const.h,v 9.41 1992/09/11 21:58:14 cph Exp $
 
 Copyright (c) 1987-92 Massachusetts Institute of Technology
 
@@ -166,7 +166,7 @@ MIT in each case. */
    All other entries are used only by the compiled code interface. */
 
 #define REGBLOCK_MEMTOP                        0
-#define REGBLOCK_STACKGUARD            1
+#define REGBLOCK_INT_MASK              1
 #define REGBLOCK_VAL                   2
 #define REGBLOCK_ENV                   3
 #define REGBLOCK_COMPILER_TEMP         4       /* For use by compiler */
@@ -177,7 +177,8 @@ MIT in each case. */
 #define REGBLOCK_CLOSURE_FREE          9       /* For use by compiler */
 #define REGBLOCK_CLOSURE_SPACE         10      /* For use by compiler */
 #define REGBLOCK_STACK_GUARD           11
-#define REGBLOCK_MINIMUM_LENGTH                12
+#define REGBLOCK_INT_CODE              12
+#define REGBLOCK_MINIMUM_LENGTH                13
 \f
 /* Codes specifying how to start scheme at boot time. */
 
index 73404a0cffa77ad5d96e0e265ad8fe3f9da45caf..3cb890f0c39aace41bdc0cee9714e73eacdc5f94 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Id: dosconio.c,v 1.5 1992/09/07 04:28:17 jinx Exp $
+$Id: dosconio.c,v 1.6 1992/09/11 21:57:29 cph Exp $
 
 Copyright (c) 1992 Massachusetts Institute of Technology
 
@@ -42,12 +42,6 @@ MIT in each case. */
 #include "dossys.h"
 #include "intrpt.h"
 \f
-/* This is really not set up to include Scheme level headers, so we
-   fake them here. */
-extern long
-  IntCode,             /* Interrupts requesting */
-  IntEnb;              /* Interrupts enabled */
-
 #ifdef __STDC__
 #define fileno(fp)     ((fp)->_file)
 #endif
index 175f4a2adf4a4854ce5a11f5b412f1a454c21725..58efead27632498c9703081cf3a6a2a863b1e2bb 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Id: extern.h,v 9.46 1992/08/29 12:59:13 jinx Exp $
+$Id: extern.h,v 9.47 1992/09/11 21:59:11 cph Exp $
 
 Copyright (c) 1987-1992 Massachusetts Institute of Technology
 
@@ -118,8 +118,6 @@ extern SCHEME_OBJECT return_to_interpreter;
 extern Declare_Fixed_Objects ();
 
 extern long
-  IntCode,             /* Interrupts requesting */
-  IntEnb,              /* Interrupts enabled */
   temp_long,           /* temporary for sign extension */
   GC_Reserve,          /* Scheme pointer overflow space in heap */
   GC_Space_Needed;     /* Amount of space needed when GC triggered */
index 92726f2fff03a790c449fdb343d6449247b0f3aa..e6429bc56fafa68e49af33602b3ba7d61a5cbd35 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/interp.c,v 9.66 1992/02/08 14:54:07 cph Exp $
+$Id: interp.c,v 9.67 1992/09/11 21:58:33 cph Exp $
 
 Copyright (c) 1988-92 Massachusetts Institute of Technology
 
@@ -403,9 +403,9 @@ DEFUN (abort_to_interpreter, (argument), int argument)
   interpreter_throw_argument = argument;
   {
     long old_mask = IntEnb;
-    IntEnb = 0;
+    set_IntEnb = 0;
     dstack_set_position (interpreter_catch_dstack_position);
-    IntEnb = old_mask;
+    set_IntEnb = old_mask;
   }
   obstack_free ((&scratch_obstack), 0);
   obstack_init (&scratch_obstack);
index b28e77039a04e34be10e9c7bea80275e9cc23d9c..59e3a1772850f8b21c82953830132ee89cf69b35 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/intrpt.h,v 1.8 1990/06/20 17:41:26 cph Rel $
+$Id: intrpt.h,v 1.9 1992/09/11 21:59:03 cph Exp $
 
-Copyright (c) 1987, 1988, 1989, 1990 Massachusetts Institute of Technology
+Copyright (c) 1987-92 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -34,6 +34,14 @@ MIT in each case. */
 
 /* Interrupt manipulation utilities. */
 \f
+/* The interrupt control registers. */
+
+#define IntCode ((long) (Regs[REGBLOCK_INT_CODE])) /* interrupts requesting */
+#define IntEnb ((long) (Regs[REGBLOCK_INT_MASK])) /* interrupts enabled */
+
+#define set_IntCode(code) (Regs[REGBLOCK_INT_CODE]) = ((SCHEME_OBJECT) (code))
+#define set_IntEnb(mask) (Regs[REGBLOCK_INT_MASK]) = ((SCHEME_OBJECT) (mask))
+
 /* Interrupt bits -- scanned from LSB (1) to MSB (16) */
 
 #define INT_Stack_Overflow     1       /* Local interrupt */
@@ -78,32 +86,32 @@ MIT in each case. */
 
 #define SET_INTERRUPT_MASK(mask)                                       \
 {                                                                      \
-  IntEnb = (mask);                                                     \
-  COMPILER_SETUP_INTERRUPT();                                          \
+  set_IntEnb (mask);                                                   \
+  COMPILER_SETUP_INTERRUPT ();                                         \
 }
 
 #define FETCH_INTERRUPT_CODE()         (IntCode)
 
 #define CLEAR_INTERRUPT(code)                                          \
 {                                                                      \
-  IntCode &= ~(code);                                                  \
-  COMPILER_SETUP_INTERRUPT();                                          \
+  set_IntCode (IntCode &~ (code));                                     \
+  COMPILER_SETUP_INTERRUPT ();                                         \
 }
 
 #define REQUEST_INTERRUPT(code)                                                \
 {                                                                      \
-  IntCode |= (code);                                                   \
-  COMPILER_SETUP_INTERRUPT();                                          \
+  set_IntCode (IntCode | (code));                                      \
+  COMPILER_SETUP_INTERRUPT ();                                         \
 }
 
 #define INITIALIZE_INTERRUPTS()                                                \
 {                                                                      \
-  IntEnb = 0;                                                          \
-  IntCode = 0;                                                         \
-  SET_INTERRUPT_MASK(INT_Mask);                                                \
-  CLEAR_INTERRUPT(INT_Mask);                                           \
+  set_IntEnb (0);                                                      \
+  set_IntCode (0);                                                     \
+  SET_INTERRUPT_MASK (INT_Mask);                                       \
+  CLEAR_INTERRUPT (INT_Mask);                                          \
 }
 
 /* Compatibility */
 
-#define COMPILER_SET_MEMTOP()  COMPILER_SETUP_INTERRUPT()
+#define COMPILER_SET_MEMTOP COMPILER_SETUP_INTERRUPT
index 60282584f18b129917b43781c76ef52764db6ce5..4f30ec27fdceb37a07526a3c3da3e020faa59245 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/storage.c,v 9.50 1992/07/29 19:54:55 cph Exp $
+$Id: storage.c,v 9.51 1992/09/11 21:58:44 cph Exp $
 
 Copyright (c) 1987-92 Massachusetts Institute of Technology
 
@@ -66,10 +66,6 @@ SCHEME_OBJECT
                           *** This must be changed when stacklets are used. */
 
 long
-#ifndef DOS386
-  IntCode,             /* Interrupts requesting */
-  IntEnb,              /* Interrupts enabled */
-#endif /* DOS386 */
   temp_long,           /* temporary for sign extension */
   GC_Reserve,          /* Scheme pointer overflow space in heap */
   GC_Space_Needed;     /* Amount of space needed when GC triggered */
index d9a61f220f86cbb4629531428608f46e883134e3..263d0183b6e2809d90b50b8f785aa94685791290 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/const.h,v 9.40 1992/07/29 19:54:52 cph Exp $
+$Id: const.h,v 9.41 1992/09/11 21:58:14 cph Exp $
 
 Copyright (c) 1987-92 Massachusetts Institute of Technology
 
@@ -166,7 +166,7 @@ MIT in each case. */
    All other entries are used only by the compiled code interface. */
 
 #define REGBLOCK_MEMTOP                        0
-#define REGBLOCK_STACKGUARD            1
+#define REGBLOCK_INT_MASK              1
 #define REGBLOCK_VAL                   2
 #define REGBLOCK_ENV                   3
 #define REGBLOCK_COMPILER_TEMP         4       /* For use by compiler */
@@ -177,7 +177,8 @@ MIT in each case. */
 #define REGBLOCK_CLOSURE_FREE          9       /* For use by compiler */
 #define REGBLOCK_CLOSURE_SPACE         10      /* For use by compiler */
 #define REGBLOCK_STACK_GUARD           11
-#define REGBLOCK_MINIMUM_LENGTH                12
+#define REGBLOCK_INT_CODE              12
+#define REGBLOCK_MINIMUM_LENGTH                13
 \f
 /* Codes specifying how to start scheme at boot time. */
 
index 0c064f06171d85a0f91e8978ba6fa2e3e7ad0691..e6429bc56fafa68e49af33602b3ba7d61a5cbd35 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/interp.c,v 9.66 1992/02/08 14:54:07 cph Exp $
+$Id: interp.c,v 9.67 1992/09/11 21:58:33 cph Exp $
 
 Copyright (c) 1988-92 Massachusetts Institute of Technology
 
@@ -403,9 +403,9 @@ DEFUN (abort_to_interpreter, (argument), int argument)
   interpreter_throw_argument = argument;
   {
     long old_mask = IntEnb;
-    IntEnb = 0;
+    set_IntEnb = 0;
     dstack_set_position (interpreter_catch_dstack_position);
-    IntEnb = old_mask;
+    set_IntEnb = old_mask;
   }
   obstack_free ((&scratch_obstack), 0);
   obstack_init (&scratch_obstack);