From ed34788bdbed878bead55016c17f81aa8e8e8bc2 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 3 Jul 2002 02:33:55 +0000 Subject: [PATCH] Eliminate `Regs' macro. --- v7/src/microcode/cmpint.c | 27 +++++++++++++-------------- v7/src/microcode/intercom.c | 4 ++-- v7/src/microcode/liarc.h | 8 ++++---- v7/src/microcode/nttrap.c | 6 +++--- v7/src/microcode/os2xcpt.c | 8 ++++---- v7/src/microcode/osscheme.c | 9 +++++---- v7/src/microcode/prim.h | 9 +++++---- v7/src/microcode/prims.h | 4 ++-- v7/src/microcode/prmcon.c | 10 +++++----- v7/src/microcode/utils.c | 16 ++++++++-------- v7/src/microcode/uxtrap.c | 14 +++++++------- 11 files changed, 58 insertions(+), 57 deletions(-) diff --git a/v7/src/microcode/cmpint.c b/v7/src/microcode/cmpint.c index e657f98a0..6a449c3b4 100644 --- a/v7/src/microcode/cmpint.c +++ b/v7/src/microcode/cmpint.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: cmpint.c,v 1.97 2002/07/02 20:49:11 cph Exp $ +$Id: cmpint.c,v 1.98 2002/07/03 02:32:45 cph Exp $ Copyright (c) 1989-2002 Massachusetts Institute of Technology @@ -796,7 +796,7 @@ static utility_result #define INVOKE_RETURN_ADDRESS() do \ { \ if (((long) (ADDR_TO_SCHEME_ADDR (Free))) \ - >= ((long) (Regs[REGBLOCK_MEMTOP]))) \ + >= ((long) (Registers[REGBLOCK_MEMTOP]))) \ return (compiler_interrupt_common (0, val_register)); \ else \ RETURN_TO_SCHEME (OBJECT_ADDRESS (STACK_POP ())); \ @@ -841,7 +841,7 @@ DEFNX (comutil_primitive_lexpr_apply, AND long ignore_2 AND long ignore_3 AND long ignore_4) { PRIMITIVE_APPLY (val_register, primitive); - POP_PRIMITIVE_FRAME (((long) Regs[REGBLOCK_LEXPR_ACTUALS])); + POP_PRIMITIVE_FRAME (((long) (Registers[REGBLOCK_LEXPR_ACTUALS]))); INVOKE_RETURN_ADDRESS (); } @@ -932,7 +932,7 @@ loop: goto callee_is_interpreted; /* "Lexpr" primitive. */ - Regs[REGBLOCK_LEXPR_ACTUALS] = ((SCHEME_OBJECT) (nactuals - 1)); + (Registers[REGBLOCK_LEXPR_ACTUALS]) = ((SCHEME_OBJECT) (nactuals - 1)); return (comutil_primitive_lexpr_apply (procedure, 0, 0, 0)); } @@ -1388,7 +1388,7 @@ DEFNX (comutil_operator_lexpr_trap, TRAMPOLINE_K_LEXPR_PRIMITIVE */ - Regs[REGBLOCK_LEXPR_ACTUALS] = + (Registers[REGBLOCK_LEXPR_ACTUALS]) = ((SCHEME_OBJECT) ((OBJECT_DATUM (tramp_data[1])) - 1)); return (comutil_primitive_lexpr_apply ((tramp_data[0]), 0, 0, 0)); } @@ -3021,7 +3021,7 @@ DEFNX (comutil_reflect_to_interface, /* Attempt to process interrupts before really proceeding. */ if (((long) (ADDR_TO_SCHEME_ADDR (Free))) - >= ((long) (Regs[REGBLOCK_MEMTOP]))) + >= ((long) (Registers[REGBLOCK_MEMTOP]))) { STACK_PUSH (FIXNUM_ZERO + REFLECT_CODE_CC_BKPT); STACK_PUSH (reflect_to_interface); @@ -3491,8 +3491,7 @@ SCHEME_OBJECT return_to_interpreter; #if !defined(REGBLOCK_ALLOCATED_BY_INTERFACE) && !defined(__WIN32__) -SCHEME_OBJECT - Registers[REGBLOCK_LENGTH]; +SCHEME_OBJECT Registers [REGBLOCK_LENGTH]; #endif static void @@ -3514,9 +3513,9 @@ DEFUN_VOID (compiler_reset_internal) (ENTRY_TO_OBJECT (((char *) block) + ((unsigned long) (block [len])))); - Regs[REGBLOCK_CLOSURE_FREE] = ((SCHEME_OBJECT) NULL); - Regs[REGBLOCK_CLOSURE_SPACE] = ((SCHEME_OBJECT) 0); - Regs[REGBLOCK_REFLECT_TO_INTERFACE] = reflect_to_interface; + (Registers[REGBLOCK_CLOSURE_FREE]) = ((SCHEME_OBJECT) NULL); + (Registers[REGBLOCK_CLOSURE_SPACE]) = ((SCHEME_OBJECT) 0); + (Registers[REGBLOCK_REFLECT_TO_INTERFACE]) = reflect_to_interface; ASM_RESET_HOOK(); @@ -3532,7 +3531,7 @@ DEFUN (compiler_initialize, (fasl_p), long fasl_p) { /* Start-up of whole interpreter */ - Regs[REGBLOCK_PRIMITIVE] = SHARP_F; + (Registers[REGBLOCK_PRIMITIVE]) = SHARP_F; compiler_processor_type = COMPILER_PROCESSOR_TYPE; compiler_interface_version = COMPILER_INTERFACE_VERSION; if (fasl_p) @@ -3724,7 +3723,7 @@ extern void EXFUN (bkpt_remove, (PTR, SCHEME_OBJECT)); SCHEME_OBJECT #ifndef __WIN32__ - Registers[REGBLOCK_MINIMUM_LENGTH], + Registers [REGBLOCK_MINIMUM_LENGTH], #endif compiler_utilities, return_to_interpreter; @@ -3971,7 +3970,7 @@ DEFUN (compiler_reset, (new_block), SCHEME_OBJECT new_block) void DEFUN (compiler_initialize, (fasl_p), long fasl_p) { - Regs[REGBLOCK_PRIMITIVE] = SHARP_F; + (Registers[REGBLOCK_PRIMITIVE]) = SHARP_F; compiler_processor_type = 0; compiler_interface_version = 0; compiler_utilities = SHARP_F; diff --git a/v7/src/microcode/intercom.c b/v7/src/microcode/intercom.c index 9a0d71eb6..ee37d25d9 100644 --- a/v7/src/microcode/intercom.c +++ b/v7/src/microcode/intercom.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: intercom.c,v 9.32 2002/07/02 20:49:58 cph Exp $ +$Id: intercom.c,v 9.33 2002/07/03 02:32:52 cph Exp $ Copyright (c) 1987-1999, 2002 Massachusetts Institute of Technology @@ -164,7 +164,7 @@ DEFINE_PRIMITIVE ("GET-WORK", Prim_get_work, 1, 1, 0) { SCHEME_OBJECT thunk = (ARG_REF (1)); /* This gets this primitive's code which is in the expression register. */ - SCHEME_OBJECT primitive = (Regs [REGBLOCK_PRIMITIVE]); + SCHEME_OBJECT primitive = (Registers[REGBLOCK_PRIMITIVE]); SCHEME_OBJECT queue = (Get_Fixed_Obj_Slot (The_Work_Queue)); SCHEME_OBJECT queue_head = ((queue == EMPTY_LIST) ? EMPTY_LIST : (PAIR_CAR (queue))); diff --git a/v7/src/microcode/liarc.h b/v7/src/microcode/liarc.h index c46f305ca..9ae6c5429 100644 --- a/v7/src/microcode/liarc.h +++ b/v7/src/microcode/liarc.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: liarc.h,v 1.18 2002/07/02 20:50:13 cph Exp $ +$Id: liarc.h,v 1.19 2002/07/03 02:32:58 cph Exp $ Copyright (c) 1992-2002 Massachusetts Institute of Technology @@ -64,7 +64,7 @@ USA. extern PTR dstack_position; extern SCHEME_OBJECT * Free; extern SCHEME_OBJECT * sp_register; -extern SCHEME_OBJECT Registers[]; +extern SCHEME_OBJECT Registers []; union machine_word_u { @@ -144,7 +144,7 @@ typedef union machine_word_u machine_word; #define Rvl val_register #define Rhp Free -#define Rrb Regs +#define Rrb Registers #define Rsp sp_register #define DECLARE_VARIABLES() int unsed_variable_to_keep_C_happy @@ -155,7 +155,7 @@ typedef union machine_word_u machine_word; #define REGISTER register -#define Rrb Regs +#define Rrb Registers #define DECLARE_VARIABLES() \ REGISTER SCHEME_OBJECT Rvl = val_register; \ diff --git a/v7/src/microcode/nttrap.c b/v7/src/microcode/nttrap.c index c1450aea6..a38246111 100644 --- a/v7/src/microcode/nttrap.c +++ b/v7/src/microcode/nttrap.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: nttrap.c,v 1.22 2002/07/02 20:50:23 cph Exp $ +$Id: nttrap.c,v 1.23 2002/07/03 02:33:06 cph Exp $ Copyright (c) 1992-2002 Massachusetts Institute of Technology @@ -758,7 +758,7 @@ pc_in_hyperspace: { /* In the interpreter, a primitive, or a compiled code utility. */ - SCHEME_OBJECT primitive = (Regs[REGBLOCK_PRIMITIVE]); + SCHEME_OBJECT primitive = (Registers[REGBLOCK_PRIMITIVE]); if (pc_in_utility) { @@ -778,7 +778,7 @@ pc_in_hyperspace: (trinfo . state) = STATE_PRIMITIVE; (trinfo . pc_info_1) = primitive; (trinfo . pc_info_2) = - (LONG_TO_UNSIGNED_FIXNUM (Regs[REGBLOCK_LEXPR_ACTUALS])); + (LONG_TO_UNSIGNED_FIXNUM (Registers[REGBLOCK_LEXPR_ACTUALS])); } if ((new_stack_pointer == 0) || ((((unsigned long) Free) & SCHEME_ALIGNMENT_MASK) != 0) diff --git a/v7/src/microcode/os2xcpt.c b/v7/src/microcode/os2xcpt.c index b4274bd5a..382d9d064 100644 --- a/v7/src/microcode/os2xcpt.c +++ b/v7/src/microcode/os2xcpt.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: os2xcpt.c,v 1.12 2002/07/02 20:50:28 cph Exp $ +$Id: os2xcpt.c,v 1.13 2002/07/03 02:33:14 cph Exp $ Copyright (c) 1994-2002 Massachusetts Institute of Technology @@ -419,7 +419,7 @@ continue_from_trap (PEXCEPTIONREPORTRECORD report, PCONTEXTRECORD context) pc_location = pc_in_builtin; else if ((pc_to_utility_index (pc)) != (-1)) pc_location = pc_in_utility; - else if (PRIMITIVE_P (Regs [REGBLOCK_PRIMITIVE])) + else if (PRIMITIVE_P (Registers[REGBLOCK_PRIMITIVE])) pc_location = pc_in_primitive; else pc_location = pc_in_c; @@ -496,9 +496,9 @@ continue_from_trap (PEXCEPTIONREPORTRECORD report, PCONTEXTRECORD context) break; case pc_in_primitive: (trinfo . state) = STATE_PRIMITIVE; - (trinfo . pc_info_1) = (Regs [REGBLOCK_PRIMITIVE]); + (trinfo . pc_info_1) = (Registers[REGBLOCK_PRIMITIVE]); (trinfo . pc_info_2) - = (LONG_TO_UNSIGNED_FIXNUM (Regs [REGBLOCK_LEXPR_ACTUALS])); + = (LONG_TO_UNSIGNED_FIXNUM (Registers[REGBLOCK_LEXPR_ACTUALS])); Free = ((new_sp == 0) ? MemTop : (interpreter_free (0))); break; default: diff --git a/v7/src/microcode/osscheme.c b/v7/src/microcode/osscheme.c index 76408d4f3..423b0b706 100644 --- a/v7/src/microcode/osscheme.c +++ b/v7/src/microcode/osscheme.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: osscheme.c,v 1.11 2000/12/05 21:23:47 cph Exp $ +$Id: osscheme.c,v 1.12 2002/07/03 02:33:21 cph Exp $ -Copyright (c) 1990-2000 Massachusetts Institute of Technology +Copyright (c) 1990-2000, 2002 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +USA. */ #include "scheme.h" @@ -53,7 +54,7 @@ DEFUN_VOID (error_floating_point_exception) int DEFUN_VOID (executing_scheme_primitive_p) { - return (PRIMITIVE_P (Regs [REGBLOCK_PRIMITIVE])); + return (PRIMITIVE_P (Registers[REGBLOCK_PRIMITIVE])); } #ifdef __OS2__ diff --git a/v7/src/microcode/prim.h b/v7/src/microcode/prim.h index f82920812..04beca0e3 100644 --- a/v7/src/microcode/prim.h +++ b/v7/src/microcode/prim.h @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: prim.h,v 9.46 2001/03/08 18:00:26 cph Exp $ +$Id: prim.h,v 9.47 2002/07/03 02:33:27 cph Exp $ -Copyright (c) 1987-2001 Massachusetts Institute of Technology +Copyright (c) 1987-2002 Massachusetts Institute of Technology This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +USA. */ /* Primitive declarations. @@ -69,7 +70,7 @@ extern SCHEME_OBJECT EXFUN (Prim_unimplemented, (void)); #define PRIMITIVE_N_ARGUMENTS(prim) \ (((PRIMITIVE_ARITY (prim)) == LEXPR_PRIMITIVE_ARITY) \ - ? ((long) (Regs[REGBLOCK_LEXPR_ACTUALS])) \ + ? ((long) (Registers[REGBLOCK_LEXPR_ACTUALS])) \ : (PRIMITIVE_ARITY (prim))) #endif /* SCM_PRIM_H */ diff --git a/v7/src/microcode/prims.h b/v7/src/microcode/prims.h index 26969f9a9..61426980b 100644 --- a/v7/src/microcode/prims.h +++ b/v7/src/microcode/prims.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: prims.h,v 9.49 2002/07/02 20:50:33 cph Exp $ +$Id: prims.h,v 9.50 2002/07/03 02:33:35 cph Exp $ Copyright (c) 1987-2002 Massachusetts Institute of Technology @@ -74,7 +74,7 @@ extern void EXFUN (canonicalize_primitive_context, (void)); #define ARG_LOC(argument) (STACK_LOC (argument - 1)) #define ARG_REF(argument) (STACK_REF (argument - 1)) -#define LEXPR_N_ARGUMENTS() (Regs [REGBLOCK_LEXPR_ACTUALS]) +#define LEXPR_N_ARGUMENTS() (Registers[REGBLOCK_LEXPR_ACTUALS]) extern void EXFUN (signal_error_from_primitive, (long error_code)); extern void EXFUN (signal_interrupt_from_primitive, (void)); diff --git a/v7/src/microcode/prmcon.c b/v7/src/microcode/prmcon.c index ad9cad1b7..a32891abc 100644 --- a/v7/src/microcode/prmcon.c +++ b/v7/src/microcode/prmcon.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: prmcon.c,v 1.4 2002/07/02 20:50:38 cph Exp $ +$Id: prmcon.c,v 1.5 2002/07/03 02:33:41 cph Exp $ Copyright (c) 1990-1999, 2002 Massachusetts Institute of Technology @@ -43,7 +43,7 @@ DEFUN (suspend_primitive, /* NOTREACHED */ } - primitive = (Regs[REGBLOCK_PRIMITIVE]); + primitive = (Registers[REGBLOCK_PRIMITIVE]); if (!PRIMITIVE_P (primitive)) { outf_fatal ("\nsuspend_primitive invoked when not in primitive!\n"); @@ -131,12 +131,12 @@ DEFUN_VOID (continue_primitive) STACK_PUSH (LONG_TO_UNSIGNED_FIXNUM (nargs)); immediate_error (ERR_WRONG_NUMBER_OF_ARGUMENTS); } - Regs[REGBLOCK_LEXPR_ACTUALS] = ((SCHEME_OBJECT) nargs); + (Registers[REGBLOCK_LEXPR_ACTUALS]) = ((SCHEME_OBJECT) nargs); } exp_register = primitive; - Regs[REGBLOCK_PRIMITIVE] = primitive; + (Registers[REGBLOCK_PRIMITIVE]) = primitive; result = (*(continuation_procedures[continuation]))(buffer); - Regs[REGBLOCK_PRIMITIVE] = SHARP_F; + (Registers[REGBLOCK_PRIMITIVE]) = SHARP_F; POP_PRIMITIVE_FRAME (nargs); return (result); } diff --git a/v7/src/microcode/utils.c b/v7/src/microcode/utils.c index 337e42623..1f31f8c53 100644 --- a/v7/src/microcode/utils.c +++ b/v7/src/microcode/utils.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: utils.c,v 9.82 2002/07/02 20:51:09 cph Exp $ +$Id: utils.c,v 9.83 2002/07/03 02:33:49 cph Exp $ Copyright (c) 1987-2002 Massachusetts Institute of Technology @@ -239,7 +239,7 @@ DEFUN_VOID (back_out_of_primitive_internal) /* Setup a continuation to return to compiled code if the primitive is restarted and completes successfully. */ - primitive = (Regs [REGBLOCK_PRIMITIVE]); + primitive = (Registers[REGBLOCK_PRIMITIVE]); if (! (PRIMITIVE_P (primitive))) { outf_fatal( @@ -255,7 +255,7 @@ DEFUN_VOID (back_out_of_primitive_internal) val_register = SHARP_F; Store_Return (RC_INTERNAL_APPLY); exp_register = SHARP_F; - (Regs [REGBLOCK_PRIMITIVE]) = SHARP_F; + (Registers[REGBLOCK_PRIMITIVE]) = SHARP_F; return; } @@ -281,7 +281,7 @@ DEFUN_VOID (canonicalize_primitive_context) long nargs; SCHEME_OBJECT primitive; - primitive = (Regs [REGBLOCK_PRIMITIVE]); + primitive = (Registers[REGBLOCK_PRIMITIVE]); if (! (PRIMITIVE_P (primitive))) { outf_fatal @@ -1116,8 +1116,8 @@ DEFUN (C_call_scheme, (proc, nargs, argvec), #endif #endif { - primitive = (Regs [REGBLOCK_PRIMITIVE]); - prim_lexpr = (Regs [REGBLOCK_LEXPR_ACTUALS]); + primitive = (Registers[REGBLOCK_PRIMITIVE]); + prim_lexpr = (Registers[REGBLOCK_LEXPR_ACTUALS]); callers_last_return_code = last_return_code; if (! (PRIMITIVE_P (primitive))) @@ -1150,8 +1150,8 @@ DEFUN (C_call_scheme, (proc, nargs, argvec), /*NOTREACHED*/ last_return_code = callers_last_return_code; - Regs [REGBLOCK_LEXPR_ACTUALS] = prim_lexpr; - Regs [REGBLOCK_PRIMITIVE] = primitive; + Registers[REGBLOCK_LEXPR_ACTUALS] = prim_lexpr; + Registers[REGBLOCK_PRIMITIVE] = primitive; } #ifdef __IA32__ #ifdef CL386 diff --git a/v7/src/microcode/uxtrap.c b/v7/src/microcode/uxtrap.c index 9e3303218..f2856ee5f 100644 --- a/v7/src/microcode/uxtrap.c +++ b/v7/src/microcode/uxtrap.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: uxtrap.c,v 1.34 2002/07/02 20:51:14 cph Exp $ +$Id: uxtrap.c,v 1.35 2002/07/03 02:33:55 cph Exp $ Copyright (c) 1990-2002 Massachusetts Institute of Technology @@ -367,12 +367,12 @@ DEFUN_VOID (soft_reset) (((sp_register <= Stack_Top) && (sp_register > Stack_Guard)) ? sp_register : 0); - if ((Regs[REGBLOCK_PRIMITIVE]) != SHARP_F) + if ((Registers[REGBLOCK_PRIMITIVE]) != SHARP_F) { (trinfo . state) = STATE_PRIMITIVE; - (trinfo . pc_info_1) = (Regs[REGBLOCK_PRIMITIVE]); + (trinfo . pc_info_1) = (Registers[REGBLOCK_PRIMITIVE]); (trinfo . pc_info_2) = - (LONG_TO_UNSIGNED_FIXNUM (Regs[REGBLOCK_LEXPR_ACTUALS])); + (LONG_TO_UNSIGNED_FIXNUM (Registers[REGBLOCK_LEXPR_ACTUALS])); (trinfo . extra_trap_info) = SHARP_F; } else @@ -565,7 +565,7 @@ DEFUN (continue_from_trap, (signo, info, scp), { /* In the interpreter, a primitive, or a compiled code utility. */ - SCHEME_OBJECT primitive = (Regs[REGBLOCK_PRIMITIVE]); + SCHEME_OBJECT primitive = (Registers[REGBLOCK_PRIMITIVE]); if (pc_in_utility) { @@ -585,7 +585,7 @@ DEFUN (continue_from_trap, (signo, info, scp), (trinfo . state) = STATE_PRIMITIVE; (trinfo . pc_info_1) = primitive; (trinfo . pc_info_2) = - (LONG_TO_UNSIGNED_FIXNUM (Regs[REGBLOCK_LEXPR_ACTUALS])); + (LONG_TO_UNSIGNED_FIXNUM (Registers[REGBLOCK_LEXPR_ACTUALS])); } if ((new_stack_pointer == 0) || ((((unsigned long) Free) & SCHEME_ALIGNMENT_MASK) != 0) @@ -835,7 +835,7 @@ DEFUN (find_ccblock, (the_pc), { /* In the interpreter, a primitive, or a compiled code utility. */ - SCHEME_OBJECT primitive = (Regs[REGBLOCK_PRIMITIVE]); + SCHEME_OBJECT primitive = (Registers[REGBLOCK_PRIMITIVE]); if (pc_in_utility) { -- 2.25.1