From: Chris Hanson Date: Sun, 16 Dec 2001 06:01:33 +0000 (+0000) Subject: Add explicit cache synchronization support to work around a bug in the X-Git-Tag: 20090517-FFI~2406 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=1a816019b086bcf29203eedd8edb97c06d41c197;p=mit-scheme.git Add explicit cache synchronization support to work around a bug in the Athlon. --- diff --git a/v7/src/compiler/base/make.scm b/v7/src/compiler/base/make.scm index d64933c90..c002e3ace 100644 --- a/v7/src/compiler/base/make.scm +++ b/v7/src/compiler/base/make.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: make.scm,v 4.115 2001/11/05 19:46:24 cph Exp $ +$Id: make.scm,v 4.116 2001/12/16 06:01:31 cph Exp $ Copyright (c) 1988-1999, 2001 Massachusetts Institute of Technology @@ -34,4 +34,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA (load-option 'HASH-TABLE) (load-option 'RB-TREE) (load-package-set "compiler"))) - (add-identification! (string-append "Liar (" architecture-name ")") 4 113)) \ No newline at end of file + (add-identification! (string-append "Liar (" architecture-name ")") 4 114)) \ No newline at end of file diff --git a/v7/src/compiler/machines/i386/dassm3.scm b/v7/src/compiler/machines/i386/dassm3.scm index 9464b1b52..f4553e97f 100644 --- a/v7/src/compiler/machines/i386/dassm3.scm +++ b/v7/src/compiler/machines/i386/dassm3.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: dassm3.scm,v 1.6 1999/01/02 06:06:43 cph Exp $ +$Id: dassm3.scm,v 1.7 2001/12/16 06:01:31 cph Exp $ -Copyright (c) 1992, 1999 Massachusetts Institute of Technology +Copyright (c) 1992, 1999, 2001 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. |# ;;;; Intel i386 Disassembler: Internals @@ -677,7 +678,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (dispatch-on-low-nibble ; A (simple-inst '(PUSH FS)) (simple-inst '(POP FS)) - unknown-inst + (simple-inst '(CPUID)) (decode-E/G '(BT)) (decode-E/G/I '(SHLD) immediate-byte) (decode-E/G/I '(SHLD) (lambda () '(R 1))) diff --git a/v7/src/compiler/machines/i386/instr1.scm b/v7/src/compiler/machines/i386/instr1.scm index 89ada40a0..b7b06e01a 100644 --- a/v7/src/compiler/machines/i386/instr1.scm +++ b/v7/src/compiler/machines/i386/instr1.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: instr1.scm,v 1.11 1999/01/02 06:06:43 cph Exp $ +$Id: instr1.scm,v 1.12 2001/12/16 06:01:31 cph Exp $ -Copyright (c) 1992, 1999 Massachusetts Institute of Technology +Copyright (c) 1992, 1999, 2001 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. |# ;;;; Intel i386 Instruction Set, part I @@ -249,6 +250,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (8 #xa6)) (ModR/M reg target))) +(define-trivial-instruction CPUID #x0F #xA2) + (define-trivial-instruction CWD #x99) (define-trivial-instruction CDQ #x99) (define-trivial-instruction DAA #x27) diff --git a/v7/src/compiler/machines/i386/lapgen.scm b/v7/src/compiler/machines/i386/lapgen.scm index eb44bb37e..8abfd2cc8 100644 --- a/v7/src/compiler/machines/i386/lapgen.scm +++ b/v7/src/compiler/machines/i386/lapgen.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: lapgen.scm,v 1.27 1999/01/02 06:06:43 cph Exp $ +$Id: lapgen.scm,v 1.28 2001/12/16 06:01:31 cph Exp $ -Copyright (c) 1992-1999 Massachusetts Institute of Technology +Copyright (c) 1992-1999, 2001 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. |# ;;;; RTL Rules utilities for i386 and family. @@ -662,7 +663,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. shortcircuit-apply-size-6 shortcircuit-apply-size-7 shortcircuit-apply-size-8 - interrupt-continuation-2)) + interrupt-continuation-2 + conditionally-serialize)) ;; Operation tables diff --git a/v7/src/compiler/machines/i386/rules3.scm b/v7/src/compiler/machines/i386/rules3.scm index 57e2173ab..85e04dd4e 100644 --- a/v7/src/compiler/machines/i386/rules3.scm +++ b/v7/src/compiler/machines/i386/rules3.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: rules3.scm,v 1.34 1999/01/02 06:06:43 cph Exp $ +$Id: rules3.scm,v 1.35 2001/12/16 06:01:32 cph Exp $ -Copyright (c) 1992-1999 Massachusetts Institute of Technology +Copyright (c) 1992-1999, 2001 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. |# ;;;; LAP Generation Rules: Invocations and Entries @@ -684,7 +685,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ,mtarget ,(make-non-pointer-literal (ucode-type compiled-entry) 0))) - (MOV W (@RO B ,regnum:free-pointer -4) ,temp)))) + (MOV W (@RO B ,regnum:free-pointer -4) ,temp) + ,@(invoke-hook/call entry:compiler-conditionally-serialize)))) (define (generate/cons-multiclosure target nentries size entries) (let* ((mtarget (target-register target)) @@ -728,7 +730,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ,mtarget ,(make-non-pointer-literal (ucode-type compiled-entry) 0))) - (MOV W (@RO B ,regnum:free-pointer -4) ,temp)))))) + (MOV W (@RO B ,regnum:free-pointer -4) ,temp) + ,@(invoke-hook/call entry:compiler-conditionally-serialize)))))) (define closure-share-names '#(closure-0-interrupt closure-1-interrupt closure-2-interrupt diff --git a/v7/src/microcode/bchdmp.c b/v7/src/microcode/bchdmp.c index 6a7b45de9..fdccec5f8 100644 --- a/v7/src/microcode/bchdmp.c +++ b/v7/src/microcode/bchdmp.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: bchdmp.c,v 9.89 2001/08/07 01:25:20 cph Exp $ +$Id: bchdmp.c,v 9.90 2001/12/16 06:01:32 cph Exp $ Copyright (c) 1987-2001 Massachusetts Institute of Technology @@ -1007,10 +1007,7 @@ DEFUN (dump_loop, (scan, free_ptr, new_address_ptr), if (count > 0) compiled_code_present_p = true; - /* MANIFEST_CLOSURE_END assumes that one will be added to - result, so do that now. */ - closure_end - = ((char *) ((MANIFEST_CLOSURE_END (scan, count)) + 1)); + closure_end = ((char *) (MANIFEST_CLOSURE_END (scan, count))); /* The closures are copied sequentially, but extra hair is required because the code-entry pointers are encoded as diff --git a/v7/src/microcode/bchgcl.c b/v7/src/microcode/bchgcl.c index 71f662061..70dec08a8 100644 --- a/v7/src/microcode/bchgcl.c +++ b/v7/src/microcode/bchgcl.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: bchgcl.c,v 9.53 2001/08/07 01:25:26 cph Exp $ +$Id: bchgcl.c,v 9.54 2001/12/16 06:01:32 cph Exp $ Copyright (c) 1987-2001 Massachusetts Institute of Technology @@ -629,10 +629,7 @@ DEFUN (gc_loop, scan = ((SCHEME_OBJECT *) (count_end - delta)); } - /* MANIFEST_CLOSURE_END assumes that one will be added to - result, so do that now. */ - closure_end - = ((char *) ((MANIFEST_CLOSURE_END (scan, count)) + 1)); + closure_end = ((char *) (MANIFEST_CLOSURE_END (scan, count))); /* The closures are copied sequentially, but extra hair is required because the code-entry pointers are encoded as diff --git a/v7/src/microcode/bintopsb.c b/v7/src/microcode/bintopsb.c index a119d0dc8..dcb4a8f79 100644 --- a/v7/src/microcode/bintopsb.c +++ b/v7/src/microcode/bintopsb.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: bintopsb.c,v 9.73 2001/08/07 01:25:37 cph Exp $ +$Id: bintopsb.c,v 9.74 2001/12/16 06:01:32 cph Exp $ Copyright (c) 1987-2001 Massachusetts Institute of Technology @@ -1276,7 +1276,7 @@ DEFUN (Process_Area, (Code, Area, Bound, Obj, FObj), scan = (i_scan + 1); count = (MANIFEST_CLOSURE_COUNT (scan)); word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (scan)); - area_end = (MANIFEST_CLOSURE_END (scan, count)); + area_end = ((MANIFEST_CLOSURE_END (scan, count)) - 1); while ((--count) >= 0) { @@ -1782,7 +1782,7 @@ DEFUN (print_objects, (from, to), nentries = (MANIFEST_CLOSURE_COUNT (from)); entry = ((SCHEME_OBJECT *) (FIRST_MANIFEST_CLOSURE_ENTRY (from))); - area_end = (MANIFEST_CLOSURE_END (from, nentries)); + area_end = ((MANIFEST_CLOSURE_END (from, nentries)) - 1); if (entry != (from + 1)) fprintf (portable_file, "%02x %lx %lx\n", diff --git a/v7/src/microcode/cmpauxmd/i386.m4 b/v7/src/microcode/cmpauxmd/i386.m4 index 559f6b5b4..8829c37dc 100644 --- a/v7/src/microcode/cmpauxmd/i386.m4 +++ b/v7/src/microcode/cmpauxmd/i386.m4 @@ -1,8 +1,8 @@ ### -*-Midas-*- ### -### $Id: i386.m4,v 1.50 2000/02/07 04:42:14 cph Exp $ +### $Id: i386.m4,v 1.51 2001/12/16 06:01:33 cph Exp $ ### -### Copyright (c) 1992-2000 Massachusetts Institute of Technology +### Copyright (c) 1992-2001 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 @@ -16,15 +16,15 @@ ### ### 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. -### Intel i386 assembly language part of the compiled code interface. +### Intel IA-32 assembly language part of the compiled code interface. ### See cmpint.txt, cmpint.c, cmpint-mc68k.h, and cmpgc.h for more ### documentation. ### -### This m4 source expands into either Unix (gas) source or DOS -### (masm) source. +### This m4 source expands into either Unix (gas) source or PC +### (masm/wasm) source. ### ### NOTE: ### Assumptions: @@ -62,8 +62,6 @@ ### C), two word structures are returned by returning in %eax the ### address of a structure allocated statically. If the Scheme ### system ever becomes reentrant, this will have to change. -### Note the assumption below is that all DOS compilers are -### compatible with MicroSoft C. ### ### 6) Floating point registers are not preserved by this ### interface. The interface is only called from the Scheme @@ -96,12 +94,8 @@ ### Microsoft assembler (MASM) and Watcom assembler (WASM). ### Otherwise, expand to AT&T syntax, used by GAS. ### -### DOS -### If defined, expand to run under DOS; implies DASM. ### WIN32 ### If defined, expand to run under Win32; implies DASM. -### Previously, this was defined in conjunction with DOS, but now -### DOS must not be defined! ### OS2 ### If defined, expand to run under OS/2. This macro does nothing ### more than define SUPPRESS_LEADING_UNDERSCORE and @@ -109,7 +103,7 @@ ### call OS/2 API procedures; note that EMX/GCC doesn't define ### these symbols because it thinks it's running under unix. ### -### If none of { DOS, WIN32, OS2 } is defined, expansion is for unix. +### If none of { WIN32, OS2 } is defined, expansion is for unix. ### ### SUPPRESS_LEADING_UNDERSCORE ### If defined, external symbol names are generated as written; @@ -132,11 +126,6 @@ ### WCC386R ### Should be defined when using Watcom assembler and generating ### code to use the Watcom register-based argument conventions. -### HACK_SEGMENT_REGS -### If defined, two code/data segments are maintained, one for C -### code and one for Scheme code, and the segment registers are -### switched between the two automatically. Currently works only -### for Win32s. ### LINUX_ELF ### If defined, expand to run under Linux ELF. ### TYPE_CODE_LENGTH @@ -147,14 +136,6 @@ #### Utility macros and definitions -ifdef(`DOS', - `define(IFDOS,`$1')', - `define(IFDOS,`')') - -ifdef(`DOS', - `define(IFNDOS,`')', - `define(IFNDOS,`$1')') - ifdef(`WIN32', `define(IF_WIN32,`$1')', `define(IF_WIN32,`')') @@ -175,7 +156,6 @@ ifdef(`DISABLE_387', `define(IFN387,`$1')', `define(IFN387,`')') -IFDOS(`define(DASM,1)') IF_WIN32(`define(DASM,1)') ifdef(`WCC386R',`define(WCC386,1)') @@ -201,6 +181,10 @@ ifdef(`DASM', IFNDASM(` .file "cmpaux-i386.s"') +# GAS doesn't implement pushfd/popfd, for no obvious reason. +IFNDASM(`define(pushfd,`pushf')') +IFNDASM(`define(popfd,`popf')') + IFOS2(`define(`SUPPRESS_LEADING_UNDERSCORE',1)') IF_LINUX_ELF(`define(`SUPPRESS_LEADING_UNDERSCORE',1)') @@ -245,11 +229,9 @@ ifdef(`DASM', `define(DECLARE_CODE_SEGMENT,` .code')', `define(DECLARE_CODE_SEGMENT,` .text')') -ifdef(`DOS', - `define(declare_alignment,`')', -`ifdef(`DASM', +ifdef(`DASM', `define(declare_alignment,` align $1')', - `define(declare_alignment,` .align $1')')') + `define(declare_alignment,` .align $1')') ifdef(`DASM', `define(allocate_word,`EVR($1) dw 0')', @@ -358,21 +340,19 @@ define(REGBLOCK_SIZE_IN_OBJECTS, +(COMPILER_REGBLOCK_N_TEMPS*COMPILER_TEMP_SIZE))) # Define the floating-point processor control word. Always set -# round-to-even and double precision. Under DOS and Win32, mask all +# round-to-even and double precision. Under Win32, mask all # exceptions. Under unix and OS/2, mask only the inexact result # exception. -ifdef(`DOS', +ifdef(`WIN32', `define(FP_CONTROL_WORD,HEX(023f))', - `ifdef(`WIN32', - `define(FP_CONTROL_WORD,HEX(023f))', - `define(FP_CONTROL_WORD,HEX(0220))')') + `define(FP_CONTROL_WORD,HEX(0220))') define(regs,REG(esi)) define(rfree,REG(edi)) define(rmask,REG(ebp)) IFDASM(`.386p -.model ifdef(`DOS',`tiny',`flat')') +.model flat') DECLARE_DATA_SEGMENT() declare_alignment(2) @@ -383,8 +363,6 @@ use_external_data(EVR(utility_table)) ifdef(`WIN32',` use_external_data(EVR(RegistersPtr)) -',`ifdef(`DOS',` -use_external_data(EVR(Registers)) ',` define_data(Regstart) allocate_space(Regstart,128) @@ -392,9 +370,6 @@ allocate_space(Regstart,128) define_data(Registers) allocate_space(Registers,eval(REGBLOCK_SIZE_IN_OBJECTS*4)) ') -') - -ifdef(`HACK_SEGMENT_REGS',`use_external_data(EVR(winnt_address_delta))') define_data(i387_presence) allocate_longword(i387_presence) @@ -405,50 +380,16 @@ allocate_longword(C_Stack_Pointer) define_data(C_Frame_Pointer) allocate_longword(C_Frame_Pointer) -ifdef(`HACK_SEGMENT_REGS',` - -define_data(Scheme_Transfer_Address) -allocate_longword(Scheme_Transfer_Address) - -define_data(Scheme_Code_Segment_Selector) -allocate_word(Scheme_Code_Segment_Selector) - -define_data(Scheme_Data_Segment_Selector) -allocate_word(Scheme_Data_Segment_Selector) - -define_data(Scheme_Stack_Segment_Selector) -allocate_word(Scheme_Stack_Segment_Selector) - -define_data(C_Code_Segment_Selector) -allocate_word(C_Code_Segment_Selector) - -define_data(C_Data_Segment_Selector) -allocate_word(C_Data_Segment_Selector) - -define_data(C_Extra_Segment_Selector) -allocate_word(C_Extra_Segment_Selector) - -define_data(C_Stack_Segment_Selector) -allocate_word(C_Stack_Segment_Selector) - -IF_WIN32(`define(LRET,`db 0cbh')') -IF_WIN32(`define(SEGMENT_DELTA,`EVR(winnt_address_delta)')') - -',`IFDOS(` - -define_data(C_Stack_Segment_Selector) -allocate_word(C_Stack_Segment_Selector) - -define_data(Scheme_Stack_Segment_Selector) -allocate_word(Scheme_Stack_Segment_Selector) - -')') - IFOS2(`define(CALLER_ALLOCS_STRUCT_RETURN,1)') IF_LINUX_ELF(`define(CALLER_ALLOCS_STRUCT_RETURN,1)') -IFDOS(`define(`STATIC_STRUCT_RETURN',1)') IF_WIN32(`ifdef(`WCC386', `define(`STATIC_STRUCT_RETURN',1)')') + +define_data(ia32_cpuid_supported) +allocate_longword(ia32_cpuid_supported) + +define_data(ia32_cpuid_needed) +allocate_longword(ia32_cpuid_needed) DECLARE_CODE_SEGMENT() declare_alignment(2) @@ -456,42 +397,6 @@ declare_alignment(2) define_c_label(i386_interface_initialize) OP(push,l) REG(ebp) OP(mov,l) TW(REG(esp),REG(ebp)) - - # Initialize selectors -ifdef(`HACK_SEGMENT_REGS',` - OP(lea,l) TW(ABS(cross_segment_transfer_point),REG(eax)) - OP(mov,l) TW(REG(eax),EVR(Scheme_Transfer_Address)) - OP(mov,w) TW(REG(es),EVR(C_Extra_Segment_Selector)) # This assumes it is constant - - OP(mov,w) TW(REG(cs),EVR(C_Code_Segment_Selector)) - OP(mov,w) TW(EVR(Scheme_Code_Segment_Selector),REG(ax)) - OP(cmp,w) TW(IMM(0),REG(ax)) - jne skip_code_assignment - OP(mov,w) TW(REG(cs),EVR(Scheme_Code_Segment_Selector)) -skip_code_assignment: - - OP(mov,w) TW(REG(ds),EVR(C_Data_Segment_Selector)) - OP(mov,w) TW(EVR(Scheme_Data_Segment_Selector),REG(ax)) - OP(cmp,w) TW(IMM(0),REG(ax)) - jne skip_data_assignment - OP(mov,w) TW(REG(ds),EVR(Scheme_Data_Segment_Selector)) -skip_data_assignment: - - OP(mov,w) TW(REG(ss),EVR(C_Stack_Segment_Selector)) - OP(mov,w) TW(EVR(Scheme_Stack_Segment_Selector),REG(ax)) - OP(cmp,w) TW(IMM(0),REG(ax)) - jne skip_stack_assignment - OP(mov,w) TW(REG(ds),EVR(Scheme_Stack_Segment_Selector)) -skip_stack_assignment: -',`IFDOS(` - OP(mov,w) TW(REG(ss),EVR(C_Stack_Segment_Selector)) - OP(mov,w) TW(EVR(Scheme_Stack_Segment_Selector),REG(ax)) - OP(cmp,w) TW(IMM(0),REG(ax)) - jne skip_stack_assignment - OP(mov,w) TW(REG(ds),EVR(Scheme_Stack_Segment_Selector)) -skip_stack_assignment: -') -') OP(xor,l) TW(REG(eax),REG(eax)) # No 387 available # Unfortunately, the `movl cr0,ecx' instruction is privileged. @@ -514,6 +419,102 @@ IF387(` i386_initialize_no_fp: ') OP(mov,l) TW(REG(eax),ABS(EVR(i387_presence))) + +# Do a bunch of hair to determine if we need to do cache synchronization. +# First, test to see if the CPUID instruction is supported. + + OP(xor,l) TW(REG(eax),REG(eax)) + OP(mov,l) TW(REG(eax),ABS(EVR(ia32_cpuid_supported))) + OP(mov,l) TW(REG(eax),ABS(EVR(ia32_cpuid_needed))) + pushfd + OP(pop,l) REG(eax) + OP(mov,l) TW(REG(eax),REG(ecx)) + OP(xor,l) TW(IMM(HEX(00040000)),REG(eax)) + OP(push,l) REG(eax) + popfd + pushfd + OP(pop,l) REG(eax) + OP(xor,l) TW(REG(ecx),REG(eax)) + jz no_cpuid_instr + +# Restore original EFLAGS. + + OP(push,l) REG(ecx) + popfd + +# Now we know that cpuid is supported. + + OP(mov,l) TW(IMM(HEX(00000001)),ABS(EVR(ia32_cpuid_supported))) + +# By default, use CPUID for synchronization. +# We will disable this for known processors. + + OP(mov,l) TW(IMM(HEX(00000001)),ABS(EVR(ia32_cpuid_needed))) + +# Next, use the CPUID instruction to determine the processor type. + + OP(push,l) REG(ebx) + OP(xor,l) TW(REG(eax),REG(eax)) + cpuid + +# Check that CPUID accepts argument 1. + + OP(cmp,l) TW(IMM(HEX(00000001)),REG(eax)) + jl done_setting_up_cpuid + +# Detect "GenuineIntel". + + OP(cmp,l) TW(IMM(HEX(756e6547)),REG(ebx)) + jne not_intel_cpu + OP(cmp,l) TW(IMM(HEX(49656e69)),REG(edx)) + jne not_intel_cpu + OP(cmp,l) TW(IMM(HEX(6c65746e)),REG(ecx)) + jne not_intel_cpu + +# For CPU families 4 (486), 5 (Pentium), or 6 (Pentium Pro, Pentium +# II, Pentium III), don't use CPUID synchronization. + + OP(mov,l) TW(IMM(HEX(01)),REG(eax)) + cpuid + OP(shr,l) TW(IMM(HEX(08)),REG(eax)) + OP(and,l) TW(IMM(HEX(0000000F)),REG(eax)) + OP(cmp,l) TW(IMM(HEX(4)),REG(eax)) + jl done_setting_up_cpuid + OP(cmp,l) TW(IMM(HEX(6)),REG(eax)) + jg done_setting_up_cpuid + + jmp cpuid_not_needed + +not_intel_cpu: + +# Detect "AuthenticAMD". + + OP(cmp,l) TW(IMM(HEX(68747541)),REG(ebx)) + jne not_amd_cpu + OP(cmp,l) TW(IMM(HEX(69746e65)),REG(edx)) + jne not_amd_cpu + OP(cmp,l) TW(IMM(HEX(444d4163)),REG(ecx)) + jne not_amd_cpu + +# For CPU families 4 (Am486, Am586) or 5 (K5, K6), don't use CPUID +# synchronization. + + OP(mov,l) TW(IMM(HEX(01)),REG(eax)) + cpuid + OP(shr,l) TW(IMM(HEX(08)),REG(eax)) + OP(and,l) TW(IMM(HEX(0000000F)),REG(eax)) + OP(cmp,l) TW(IMM(HEX(4)),REG(eax)) + jl done_setting_up_cpuid + OP(cmp,l) TW(IMM(HEX(5)),REG(eax)) + jg done_setting_up_cpuid + +cpuid_not_needed: + OP(mov,l) TW(IMM(HEX(00000000)),ABS(EVR(ia32_cpuid_needed))) + +not_amd_cpu: +done_setting_up_cpuid: + OP(pop,l) REG(ebx) +no_cpuid_instr: leave ret @@ -534,8 +535,6 @@ define_c_label(C_to_interface) ifdef(`WIN32', ` OP(mov,l) TW(ABS(EVR(RegistersPtr)),regs)', ` OP(lea,l) TW(ABS(EVR(Registers)),regs)') -ifdef(`HACK_SEGMENT_REGS', -` OP(sub,l) TW(SEGMENT_DELTA,regs)') jmp EPFR(interface_to_scheme) define_hook_label(trampoline_to_interface) @@ -564,50 +563,9 @@ IF387(` ffree ST(7) scheme_to_interface_proceed: ') -ifdef(`HACK_SEGMENT_REGS', -` OP(push,l) LOF(36,regs) # 4th utility arg - OP(push,l) REG(eax) # Save utility index - - OP(mov,w) TW(REG(es),REG(ax)) # C ds - OP(mov,w) TW(REG(ax),REG(ds)) - - OP(mov,w) TW(EVR(C_Extra_Segment_Selector),REG(ax)) # C es - OP(mov,w) TW(REG(ax),REG(es)) - -# Map Free to C data space - OP(add,l) TW(SEGMENT_DELTA,rfree) + OP(mov,l) TW(REG(esp),EVR(Ext_Stack_Pointer)) OP(mov,l) TW(rfree,EVR(Free)) -# Map SP to C data space - OP(mov,l) TW(REG(esp),REG(eax)) - OP(add,l) TW(SEGMENT_DELTA,REG(eax)) - OP(mov,l) TW(REG(eax),EVR(Ext_Stack_Pointer)) - -# Switch stack segment - OP(mov,w) TW(EVR(C_Stack_Segment_Selector),REG(ss)) - OP(mov,l) TW(EVR(C_Stack_Pointer),REG(esp)) - OP(mov,l) TW(EVR(C_Frame_Pointer),REG(ebp)) - - OP(xor,l) TW(REG(eax),REG(eax)) - OP(mov,w) TW(EVR(C_Code_Segment_Selector),REG(ax)) - OP(push,l) REG(eax) - OP(push,l) EVR(Scheme_Transfer_Address) - LRET - -cross_segment_transfer_point: -ifdef(`CALLER_ALLOCS_STRUCT_RETURN',` - OP(sub,l) TW(IMM(8),REG(esp)) # alloc space for struct return -') - OP(mov,l) TW(EVR(Ext_Stack_Pointer),REG(eax)) - OP(push,l) LOF(4,REG(eax)) # 4th utility arg - OP(add,l) TW(IMM(8),EVR(Ext_Stack_Pointer)) - OP(mov,l) TW(IND(REG(eax)),REG(eax)) # utility index -', -` OP(mov,l) TW(REG(esp),EVR(Ext_Stack_Pointer)) - OP(mov,l) TW(rfree,EVR(Free)) - -IFDOS(` OP(mov,w) TW(EVR(C_Stack_Segment_Selector),REG(ss))') # Swap stack segments - OP(mov,l) TW(EVR(C_Stack_Pointer),REG(esp)) OP(mov,l) TW(EVR(C_Frame_Pointer),REG(ebp)) @@ -615,7 +573,7 @@ ifdef(`CALLER_ALLOCS_STRUCT_RETURN',` OP(sub,l) TW(IMM(8),REG(esp)) # alloc space for struct return ') OP(push,l) LOF(REGBLOCK_UTILITY_ARG4(),regs) # Utility args -') + OP(push,l) REG(ebx) OP(push,l) REG(edx) OP(push,l) REG(ecx) @@ -663,45 +621,15 @@ IF387(` ffree ST(7) interface_to_scheme_proceed: ') -ifdef(`HACK_SEGMENT_REGS', -` OP(mov,l) TW(EVR(Free),rfree) - OP(sub,l) TW(SEGMENT_DELTA,rfree) - OP(mov,l) TW(IMM(ADDRESS_MASK),rmask) - - OP(mov,l) TW(EVR(Ext_Stack_Pointer),REG(eax)) # Switch stacks - OP(sub,l) TW(SEGMENT_DELTA,REG(eax)) - OP(mov,w) TW(EVR(Scheme_Stack_Segment_Selector),REG(ss)) - OP(mov,l) TW(REG(eax),REG(esp)) - - OP(sub,l) TW(SEGMENT_DELTA,REG(edx)) # Entry point to new space - OP(xor,l) TW(REG(ecx),REG(ecx)) # Setup cross-segment jump - OP(mov,w) TW(EVR(Scheme_Code_Segment_Selector),REG(cx)) - - OP(mov,w) TW(REG(ds),REG(ax)) # Store C ds in es, - OP(mov,w) TW(REG(ax),REG(es)) # unused by Scheme. - OP(mov,w) TW(EVR(Scheme_Data_Segment_Selector),REG(ax)) # Switch data segments - OP(mov,w) TW(REG(ax),REG(ds)) - - OP(push,l) REG(ecx) - OP(push,l) REG(edx) - - OP(mov,l) TW(LOF(REGBLOCK_VAL(),regs),REG(eax)) # Value/dynamic link - OP(mov,l) TW(REG(eax),REG(ecx)) # Preserve if used - OP(and,l) TW(rmask,REG(ecx)) # Restore potential dynamic link - OP(mov,l) TW(REG(ecx),LOF(REGBLOCK_DLINK(),regs)) - LRET # Perform cross-segment jump -', -` OP(mov,l) TW(EVR(Free),rfree) # Free pointer = %edi + OP(mov,l) TW(EVR(Free),rfree) # Free pointer = %edi OP(mov,l) TW(LOF(REGBLOCK_VAL(),regs),REG(eax)) # Value/dynamic link OP(mov,l) TW(IMM(ADDRESS_MASK),rmask) # = %ebp -IFDOS(` OP(mov,w) TW(EVR(Scheme_Stack_Segment_Selector),REG(ss))') # Swap stack segments - OP(mov,l) TW(EVR(Ext_Stack_Pointer),REG(esp)) OP(mov,l) TW(REG(eax),REG(ecx)) # Preserve if used OP(and,l) TW(rmask,REG(ecx)) # Restore potential dynamic link OP(mov,l) TW(REG(ecx),LOF(REGBLOCK_DLINK(),regs)) - jmp IJMP(REG(edx))') + jmp IJMP(REG(edx)) IF_WIN32(` use_external_code(EFR(WinntExceptionTransferHook)) @@ -731,6 +659,28 @@ interface_to_C_proceed:') leave ret +define_c_label(ia32_cache_synchronize) + OP(push,l) REG(ebp) + OP(mov,l) TW(REG(esp),REG(ebp)) + OP(push,l) REG(ebx) + OP(xor,l) TW(REG(eax),REG(eax)) + cpuid + OP(pop,l) REG(ebx) + leave + ret + +### Conditionally run the CPUID instruction for serialization. + +define_hook_label(conditionally_serialize) + OP(cmp,l) TW(IMM(0),ABS(EVR(ia32_cpuid_needed))) + je asm_conditionally_serialize_done + pusha + OP(xor,l) TW(REG(eax),REG(eax)) + cpuid + popa +asm_conditionally_serialize_done: + ret + ### Assembly language hooks used to reduce code size. ### There is no time advantage to using these over using ### scheme_to_interface (or scheme_to_interface_call), but the diff --git a/v7/src/microcode/cmpgc.h b/v7/src/microcode/cmpgc.h index 0c39165de..8c8253283 100644 --- a/v7/src/microcode/cmpgc.h +++ b/v7/src/microcode/cmpgc.h @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: cmpgc.h,v 1.31 2000/12/05 21:23:43 cph Exp $ +$Id: cmpgc.h,v 1.32 2001/12/16 06:01:32 cph Exp $ -Copyright (c) 1989-2000 Massachusetts Institute of Technology +Copyright (c) 1989-2001 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. */ /* @@ -290,20 +291,16 @@ MAKE_POINTER_OBJECT ((OBJECT_TYPE (object)), \ #define CHAR_TO_SCHEME_OBJECT(chars) \ (((chars) + ((sizeof (SCHEME_OBJECT)) - 1)) / (sizeof (SCHEME_OBJECT))) -/* This takes into account the fact that the relocation loop increments - by 1 on each major iteration. - Note: It also assumes that closures with exactly one entry point - are always represented in short format. - */ +/* This assumes that closures with exactly one entry point + are always represented in short format. */ #ifndef MANIFEST_CLOSURE_END #define MANIFEST_CLOSURE_END(start, count) \ (((SCHEME_OBJECT *) (start)) \ - + ((CHAR_TO_SCHEME_OBJECT (((count) * COMPILED_CLOSURE_ENTRY_SIZE) \ - + (((count) == 1) \ - ? 0 \ - : (2 * sizeof(format_word))))) \ - - 1)) + + (CHAR_TO_SCHEME_OBJECT (((count) * COMPILED_CLOSURE_ENTRY_SIZE) \ + + (((count) == 1) \ + ? 0 \ + : (2 * sizeof(format_word)))))) #endif /* Linkage sections */ diff --git a/v7/src/microcode/cmpint.c b/v7/src/microcode/cmpint.c index f9d7650ca..d0b620645 100644 --- a/v7/src/microcode/cmpint.c +++ b/v7/src/microcode/cmpint.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: cmpint.c,v 1.94 2001/08/07 01:25:51 cph Exp $ +$Id: cmpint.c,v 1.95 2001/12/16 06:01:32 cph Exp $ Copyright (c) 1989-2001 Massachusetts Institute of Technology @@ -1014,7 +1014,7 @@ DEFUN (compiler_link_closure_pattern, (distance, block, offset), closptr ++; count = (MANIFEST_CLOSURE_COUNT (closptr)); word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (closptr)); - area_end = (MANIFEST_CLOSURE_END (closptr, count)); + area_end = ((MANIFEST_CLOSURE_END (closptr, count)) - 1); while ((--count) >= 0) { closptr = ((SCHEME_OBJECT *) word_ptr); diff --git a/v7/src/microcode/cmpintmd/alpha.h b/v7/src/microcode/cmpintmd/alpha.h index 6a7243ea5..7e1c48d84 100644 --- a/v7/src/microcode/cmpintmd/alpha.h +++ b/v7/src/microcode/cmpintmd/alpha.h @@ -1,8 +1,8 @@ /* -*- C -*- -$Id: alpha.h,v 1.5 1993/06/24 04:02:18 gjr Exp $ +$Id: alpha.h,v 1.6 2001/12/16 06:01:33 cph Exp $ -Copyright (c) 1992-1993 Digital Equipment Corporation (D.E.C.) +Copyright (c) 1992-1993, 2001 Digital Equipment Corporation (D.E.C.) This software was developed at the Digital Equipment Corporation Cambridge Research Laboratory. Permission to copy this software, to @@ -273,8 +273,8 @@ do { \ /* Override the default definition of MANIFEST_CLOSURE_END in cmpgc.h */ #define MANIFEST_CLOSURE_END(start, count) \ -(((SCHEME_OBJECT *) (start)) + \ - ((CHAR_TO_SCHEME_OBJECT (((count) * COMPILED_CLOSURE_ENTRY_SIZE)))-1)) +(((SCHEME_OBJECT *) (start)) \ + + (CHAR_TO_SCHEME_OBJECT (((count) * COMPILED_CLOSURE_ENTRY_SIZE)))) /* Manifest closure entry destructuring. diff --git a/v7/src/microcode/cmpintmd/i386.h b/v7/src/microcode/cmpintmd/i386.h index 3fa970870..cb4ac56f2 100644 --- a/v7/src/microcode/cmpintmd/i386.h +++ b/v7/src/microcode/cmpintmd/i386.h @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: i386.h,v 1.32 2000/12/05 21:23:50 cph Exp $ +$Id: i386.h,v 1.33 2001/12/16 06:01:33 cph Exp $ -Copyright (c) 1992-2000 Massachusetts Institute of Technology +Copyright (c) 1992-2001 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. */ /* @@ -48,6 +49,15 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # endif #endif +extern void EXFUN (ia32_cache_synchronize, (void)); +extern int ia32_cpuid_needed; + +#define IA32_CACHE_SYNCHRONIZE() \ +{ \ + if (ia32_cpuid_needed) \ + ia32_cache_synchronize (); \ +} + /* Problems with i386 ISA (instruction set architecture) @@ -447,6 +457,7 @@ extern long i386_pc_displacement_relocation; *PC++ = 0xff; /* CALL */ \ *PC++ = 0x96; /* /2 disp32(ESI) */ \ (* ((unsigned long *) PC)) = ESI_TRAMPOLINE_TO_INTERFACE_OFFSET; \ + IA32_CACHE_SYNCHRONIZE (); \ } while (0) #define TRAMPOLINE_ENTRY_POINT(tramp_block) \ @@ -455,6 +466,22 @@ extern long i386_pc_displacement_relocation; #define TRAMPOLINE_STORAGE(tramp_entry) \ ((((SCHEME_OBJECT *) (tramp_entry)) - TRAMPOLINE_BLOCK_TO_ENTRY) + \ (2 + TRAMPOLINE_ENTRY_SIZE)) + +#define FLUSH_I_CACHE() do \ +{ \ + IA32_CACHE_SYNCHRONIZE (); \ +} while (0) + +#define FLUSH_I_CACHE_REGION(address, nwords) do \ +{ \ + IA32_CACHE_SYNCHRONIZE (); \ +} while (0) + +#define PUSH_D_CACHE_REGION(address, nwords) do \ +{ \ + IA32_CACHE_SYNCHRONIZE (); \ +} while (0) + /* These must aggree with cmpaux-i386.m4! The register block is actually allocated there. @@ -604,6 +631,7 @@ DEFUN_VOID (i386_reset_hook) SETUP_REGISTER (asm_sc_apply_size_7); /* -10 */ SETUP_REGISTER (asm_sc_apply_size_8); /* -9 */ SETUP_REGISTER (asm_interrupt_continuation_2); /* -8 */ + SETUP_REGISTER (asm_conditionally_serialize); /* -7 */ #ifdef _MACH_UNIX { diff --git a/v7/src/microcode/fasdump.c b/v7/src/microcode/fasdump.c index d1b14c0ca..fb8764e3b 100644 --- a/v7/src/microcode/fasdump.c +++ b/v7/src/microcode/fasdump.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: fasdump.c,v 9.65 2001/08/07 01:25:59 cph Exp $ +$Id: fasdump.c,v 9.66 2001/12/16 06:01:32 cph Exp $ Copyright (c) 1987-2001 Massachusetts Institute of Technology @@ -200,7 +200,7 @@ DEFUN (DumpLoop, (Scan, mode), fast SCHEME_OBJECT * Scan AND int mode) Scan += 1; count = (MANIFEST_CLOSURE_COUNT (Scan)); word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (Scan)); - area_end = (MANIFEST_CLOSURE_END (Scan, count)); + area_end = ((MANIFEST_CLOSURE_END (Scan, count)) - 1); while ((--count) >= 0) { diff --git a/v7/src/microcode/fasload.c b/v7/src/microcode/fasload.c index 4d40fba68..93f200ce8 100644 --- a/v7/src/microcode/fasload.c +++ b/v7/src/microcode/fasload.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: fasload.c,v 9.90 2001/08/07 01:26:05 cph Exp $ +$Id: fasload.c,v 9.91 2001/12/16 06:01:32 cph Exp $ Copyright (c) 1987-2001 Massachusetts Institute of Technology @@ -535,7 +535,7 @@ DEFUN (Relocate_Block, (Scan, Stop_At), Scan += 1; count = (MANIFEST_CLOSURE_COUNT (Scan)); word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (Scan)); - area_end = (MANIFEST_CLOSURE_END (Scan, count)); + area_end = ((MANIFEST_CLOSURE_END (Scan, count)) - 1); while ((--count) >= 0) { diff --git a/v7/src/microcode/gcloop.c b/v7/src/microcode/gcloop.c index 6e2a11abe..9811f6ec2 100644 --- a/v7/src/microcode/gcloop.c +++ b/v7/src/microcode/gcloop.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: gcloop.c,v 9.48 2001/08/07 01:26:14 cph Exp $ +$Id: gcloop.c,v 9.49 2001/12/16 06:01:32 cph Exp $ Copyright (c) 1987-1999, 2001 Massachusetts Institute of Technology @@ -238,7 +238,7 @@ DEFUN (GCLoop, Scan += 1; count = (MANIFEST_CLOSURE_COUNT (Scan)); word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (Scan)); - area_end = (MANIFEST_CLOSURE_END (Scan, count)); + area_end = ((MANIFEST_CLOSURE_END (Scan, count)) - 1); while ((--count) >= 0) { diff --git a/v7/src/microcode/nttrap.c b/v7/src/microcode/nttrap.c index 1c7d52239..6c6d7be0c 100644 --- a/v7/src/microcode/nttrap.c +++ b/v7/src/microcode/nttrap.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: nttrap.c,v 1.18 2000/12/05 21:23:46 cph Exp $ +$Id: nttrap.c,v 1.19 2001/12/16 06:01:32 cph Exp $ -Copyright (c) 1992-2000 Massachusetts Institute of Technology +Copyright (c) 1992-2001 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 @@ -936,7 +937,7 @@ DEFUN (find_block_address_in_area, (pc_value, area_start), area += 1; { long count = (MANIFEST_CLOSURE_COUNT (area)); - area = ((MANIFEST_CLOSURE_END (area, count)) + 1); + area = (MANIFEST_CLOSURE_END (area, count)); } break; } diff --git a/v7/src/microcode/os2xcpt.c b/v7/src/microcode/os2xcpt.c index 9f7d76690..ed4bcd142 100644 --- a/v7/src/microcode/os2xcpt.c +++ b/v7/src/microcode/os2xcpt.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: os2xcpt.c,v 1.8 2000/12/05 21:23:46 cph Exp $ +$Id: os2xcpt.c,v 1.9 2001/12/16 06:01:32 cph Exp $ -Copyright (c) 1994-2000 Massachusetts Institute of Technology +Copyright (c) 1994-2001 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 @@ -683,7 +684,7 @@ find_block_address_in_area (char * pc_value, SCHEME_OBJECT * area_start) area += 1; { long count = (MANIFEST_CLOSURE_COUNT (area)); - area = ((MANIFEST_CLOSURE_END (area, count)) + 1); + area = (MANIFEST_CLOSURE_END (area, count)); } break; case TC_MANIFEST_NM_VECTOR: diff --git a/v7/src/microcode/purify.c b/v7/src/microcode/purify.c index 499e2b997..b64533254 100644 --- a/v7/src/microcode/purify.c +++ b/v7/src/microcode/purify.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: purify.c,v 9.60 2001/08/07 01:27:03 cph Exp $ +$Id: purify.c,v 9.61 2001/12/16 06:01:33 cph Exp $ Copyright (c) 1988-1999, 2001 Massachusetts Institute of Technology @@ -218,7 +218,7 @@ DEFUN (purifyloop, (Scan, To_Pointer, GC_Mode), Scan += 1; count = (MANIFEST_CLOSURE_COUNT (Scan)); word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (Scan)); - area_end = (MANIFEST_CLOSURE_END (Scan, count)); + area_end = ((MANIFEST_CLOSURE_END (Scan, count)) - 1); while ((--count) >= 0) { diff --git a/v7/src/microcode/purutl.c b/v7/src/microcode/purutl.c index 1704c7c4a..e954a3d6f 100644 --- a/v7/src/microcode/purutl.c +++ b/v7/src/microcode/purutl.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: purutl.c,v 9.51 2000/12/05 21:23:48 cph Exp $ +$Id: purutl.c,v 9.52 2001/12/16 06:01:33 cph Exp $ -Copyright (c) 1987-2000 Massachusetts Institute of Technology +Copyright (c) 1987-2001 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. */ /* Pure/Constant space utilities. */ @@ -94,7 +95,7 @@ DEFUN (update, (From, To, Was, Will_Be), From += 1; count = (MANIFEST_CLOSURE_COUNT (From)); - From = (MANIFEST_CLOSURE_END (From, count)); + From = ((MANIFEST_CLOSURE_END (From, count)) - 1); break; } diff --git a/v7/src/microcode/uxtrap.c b/v7/src/microcode/uxtrap.c index bbebcc8d4..b304ad8a5 100644 --- a/v7/src/microcode/uxtrap.c +++ b/v7/src/microcode/uxtrap.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: uxtrap.c,v 1.30 2000/12/05 21:23:49 cph Exp $ +$Id: uxtrap.c,v 1.31 2001/12/16 06:01:33 cph Exp $ -Copyright (c) 1990-2000 Massachusetts Institute of Technology +Copyright (c) 1990-2001 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" @@ -719,7 +720,7 @@ DEFUN (find_block_address_in_area, (pc_value, area_start), area += 1; { long count = (MANIFEST_CLOSURE_COUNT (area)); - area = ((MANIFEST_CLOSURE_END (area, count)) + 1); + area = (MANIFEST_CLOSURE_END (area, count)); } break; } diff --git a/v7/src/microcode/version.h b/v7/src/microcode/version.h index 46cd76aae..309258c23 100644 --- a/v7/src/microcode/version.h +++ b/v7/src/microcode/version.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: version.h,v 11.181 2001/08/02 18:29:33 cph Exp $ +$Id: version.h,v 11.182 2001/12/16 06:01:33 cph Exp $ Copyright (c) 1988-2001 Massachusetts Institute of Technology @@ -34,5 +34,5 @@ USA. #define SCHEME_VERSION 14 #endif #ifndef SCHEME_SUBVERSION -#define SCHEME_SUBVERSION 5 +#define SCHEME_SUBVERSION 7 #endif diff --git a/v7/src/microcode/wabbit.c b/v7/src/microcode/wabbit.c index 49215d6ab..7e7e39132 100644 --- a/v7/src/microcode/wabbit.c +++ b/v7/src/microcode/wabbit.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: wabbit.c,v 1.8 2000/12/05 21:23:49 cph Exp $ +$Id: wabbit.c,v 1.9 2001/12/16 06:01:33 cph Exp $ -Copyright (c) 1994-2000 Massachusetts Institute of Technology +Copyright (c) 1994-2001 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. */ /* @@ -505,7 +506,7 @@ repeat_dispatch: scan += 1; count = (MANIFEST_CLOSURE_COUNT (scan)); word_ptr = (FIRST_MANIFEST_CLOSURE_ENTRY (scan)); - area_end = (MANIFEST_CLOSURE_END (scan, count)); + area_end = ((MANIFEST_CLOSURE_END (scan, count)) - 1); while ((--count) >= 0) {