From b1c3787fd39f8c1bb5066649deae7af861298060 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 19 Dec 2001 19:53:46 +0000 Subject: [PATCH] Change cache serialization to do condition testing once when Scheme is started rather each time a closure is created. --- v7/src/microcode/cmpauxmd/i386.m4 | 14 ++++++++------ v7/src/microcode/cmpintmd/i386.h | 12 ++++++++++-- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/v7/src/microcode/cmpauxmd/i386.m4 b/v7/src/microcode/cmpauxmd/i386.m4 index 58a86ef74..940f9c259 100644 --- a/v7/src/microcode/cmpauxmd/i386.m4 +++ b/v7/src/microcode/cmpauxmd/i386.m4 @@ -1,6 +1,6 @@ ### -*-Midas-*- ### -### $Id: i386.m4,v 1.55 2001/12/17 22:05:33 cph Exp $ +### $Id: i386.m4,v 1.56 2001/12/19 19:53:35 cph Exp $ ### ### Copyright (c) 1992-2001 Massachusetts Institute of Technology ### @@ -670,16 +670,18 @@ define_code_label(EFR(ia32_cache_synchronize)) leave ret -### Conditionally run the CPUID instruction for serialization. +### 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 +define_hook_label(serialize_cache) pusha OP(xor,l) TW(REG(eax),REG(eax)) cpuid popa -asm_conditionally_serialize_done: + ret + +### Stub to be used in place of above on machines that don't need it. + +define_hook_label(dont_serialize_cache) ret ### Assembly language hooks used to reduce code size. diff --git a/v7/src/microcode/cmpintmd/i386.h b/v7/src/microcode/cmpintmd/i386.h index cb4ac56f2..b95b69327 100644 --- a/v7/src/microcode/cmpintmd/i386.h +++ b/v7/src/microcode/cmpintmd/i386.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: i386.h,v 1.33 2001/12/16 06:01:33 cph Exp $ +$Id: i386.h,v 1.34 2001/12/19 19:53:46 cph Exp $ Copyright (c) 1992-2001 Massachusetts Institute of Technology @@ -540,6 +540,7 @@ DEFUN_VOID (i386_reset_hook) { extern int EXFUN (ASM_ENTRY_POINT(i386_interface_initialize), (void)); extern void EXFUN (declare_builtin, (unsigned long, char *)); + extern int ia32_cpuid_needed; int offset = (COMPILER_REGBLOCK_N_FIXED * (sizeof (SCHEME_OBJECT))); unsigned char * esi_value = ((unsigned char *) (&Registers[0])); int fp_support_present = (i386_interface_initialize ()); @@ -631,7 +632,14 @@ 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 */ + if (ia32_cpuid_needed) + { + SETUP_REGISTER (asm_serialize_cache); /* -7 */ + } + else + { + SETUP_REGISTER (asm_dont_serialize_cache); /* -7 */ + } #ifdef _MACH_UNIX { -- 2.25.1