From ab266303672c61901e93bf76e716616e8167db30 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 11 Sep 1992 21:59:11 +0000 Subject: [PATCH] Move IntCode and IntEnb to the register block so that compiled code can access them. --- v7/src/microcode/const.h | 7 ++++--- v7/src/microcode/dosconio.c | 8 +------- v7/src/microcode/extern.h | 4 +--- v7/src/microcode/interp.c | 6 +++--- v7/src/microcode/intrpt.h | 34 +++++++++++++++++++++------------- v7/src/microcode/storage.c | 6 +----- v8/src/microcode/const.h | 7 ++++--- v8/src/microcode/interp.c | 6 +++--- 8 files changed, 38 insertions(+), 40 deletions(-) diff --git a/v7/src/microcode/const.h b/v7/src/microcode/const.h index 841cd1f3b..263d0183b 100644 --- a/v7/src/microcode/const.h +++ b/v7/src/microcode/const.h @@ -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 /* Codes specifying how to start scheme at boot time. */ diff --git a/v7/src/microcode/dosconio.c b/v7/src/microcode/dosconio.c index 73404a0cf..3cb890f0c 100644 --- a/v7/src/microcode/dosconio.c +++ b/v7/src/microcode/dosconio.c @@ -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" -/* 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 diff --git a/v7/src/microcode/extern.h b/v7/src/microcode/extern.h index 175f4a2ad..58efead27 100644 --- a/v7/src/microcode/extern.h +++ b/v7/src/microcode/extern.h @@ -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 */ diff --git a/v7/src/microcode/interp.c b/v7/src/microcode/interp.c index 92726f2ff..e6429bc56 100644 --- a/v7/src/microcode/interp.c +++ b/v7/src/microcode/interp.c @@ -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); diff --git a/v7/src/microcode/intrpt.h b/v7/src/microcode/intrpt.h index b28e77039..59e3a1772 100644 --- a/v7/src/microcode/intrpt.h +++ b/v7/src/microcode/intrpt.h @@ -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. */ +/* 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 diff --git a/v7/src/microcode/storage.c b/v7/src/microcode/storage.c index 60282584f..4f30ec27f 100644 --- a/v7/src/microcode/storage.c +++ b/v7/src/microcode/storage.c @@ -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 */ diff --git a/v8/src/microcode/const.h b/v8/src/microcode/const.h index d9a61f220..263d0183b 100644 --- a/v8/src/microcode/const.h +++ b/v8/src/microcode/const.h @@ -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 /* Codes specifying how to start scheme at boot time. */ diff --git a/v8/src/microcode/interp.c b/v8/src/microcode/interp.c index 0c064f061..e6429bc56 100644 --- a/v8/src/microcode/interp.c +++ b/v8/src/microcode/interp.c @@ -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); -- 2.25.1