From f8630a727a78a90686329943eccb7c8c27b05c04 Mon Sep 17 00:00:00 2001 From: "Guillermo J. Rozas" Date: Fri, 17 Aug 1990 23:39:55 +0000 Subject: [PATCH] Split cache flusing code from STORE_EXECUTE_CACHE_ADDRESS, since it is not needed at GC time. The flushing code is now in FLUSH_I_CACHE_REGION, used explicitly by store_uuo_link in cmpint.c --- v7/src/microcode/cmpintmd/hppa.h | 33 ++++++++++++++++++++++---------- v8/src/microcode/cmpintmd/hppa.h | 33 ++++++++++++++++++++++---------- 2 files changed, 46 insertions(+), 20 deletions(-) diff --git a/v7/src/microcode/cmpintmd/hppa.h b/v7/src/microcode/cmpintmd/hppa.h index ffe3b23f8..bee2d3466 100644 --- a/v7/src/microcode/cmpintmd/hppa.h +++ b/v7/src/microcode/cmpintmd/hppa.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/cmpintmd/hppa.h,v 1.15 1990/08/16 14:45:24 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/cmpintmd/hppa.h,v 1.16 1990/08/17 23:39:55 jinx Exp $ Copyright (c) 1989, 1990 Massachusetts Institute of Technology @@ -545,11 +545,7 @@ do { \ #define STORE_EXECUTE_CACHE_ADDRESS(address, entry) \ { \ - extern void cache_flush_region (); \ - void *instr_addr = ((void *) (entry)); \ - \ - STORE_ABSOLUTE_ADDRESS(instr_addr, address, true); \ - cache_flush_region (instr_addr, EXECUTE_CACHE_ENTRY_SIZE); \ + STORE_ABSOLUTE_ADDRESS(entry, address, true); \ } /* This stores the fixed part of the instructions leaving the @@ -566,10 +562,12 @@ do { \ { \ } -/* This flushes the I-cache after a GC or disk-restore. It's needed - because the GC has moved code around, and in addition, closures and - execute cache cells have absolute addresses that the processor - might have old copies of. +/* This is supposed to flush the Scheme portion of the I-cache. + It flushes the entire I-cache instead, since it is easier. + It is used after a GC or disk-restore. + It's needed because the GC has moved code around, and closures + and execute cache cells have absolute addresses that the + processor might have old copies of. */ #define FLUSH_I_CACHE() \ @@ -579,6 +577,21 @@ do { \ flush_i_cache (); \ } while (0) +/* This flushes a region of the I-cache. + It is used after updating an execute cache while running. + Not needed during GC because FLUSH_I_CACHE will be used. + */ + +#define FLUSH_I_CACHE_REGION(address, nwords) \ +do { \ + extern void cache_flush_region (); \ + \ + cache_flush_region (((void *) (address)), nwords); \ +} while (0) + +/* This loads the cache information structure for use by flush_i_cache. + */ + #define ASM_RESET_HOOK() \ do { \ if ((flush_i_cache_initialize ()) < 0) \ diff --git a/v8/src/microcode/cmpintmd/hppa.h b/v8/src/microcode/cmpintmd/hppa.h index e2a9403c7..654ee25f9 100644 --- a/v8/src/microcode/cmpintmd/hppa.h +++ b/v8/src/microcode/cmpintmd/hppa.h @@ -1,6 +1,6 @@ /* -*-C-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/cmpintmd/hppa.h,v 1.15 1990/08/16 14:45:24 jinx Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/cmpintmd/hppa.h,v 1.16 1990/08/17 23:39:55 jinx Exp $ Copyright (c) 1989, 1990 Massachusetts Institute of Technology @@ -545,11 +545,7 @@ do { \ #define STORE_EXECUTE_CACHE_ADDRESS(address, entry) \ { \ - extern void cache_flush_region (); \ - void *instr_addr = ((void *) (entry)); \ - \ - STORE_ABSOLUTE_ADDRESS(instr_addr, address, true); \ - cache_flush_region (instr_addr, EXECUTE_CACHE_ENTRY_SIZE); \ + STORE_ABSOLUTE_ADDRESS(entry, address, true); \ } /* This stores the fixed part of the instructions leaving the @@ -566,10 +562,12 @@ do { \ { \ } -/* This flushes the I-cache after a GC or disk-restore. It's needed - because the GC has moved code around, and in addition, closures and - execute cache cells have absolute addresses that the processor - might have old copies of. +/* This is supposed to flush the Scheme portion of the I-cache. + It flushes the entire I-cache instead, since it is easier. + It is used after a GC or disk-restore. + It's needed because the GC has moved code around, and closures + and execute cache cells have absolute addresses that the + processor might have old copies of. */ #define FLUSH_I_CACHE() \ @@ -579,6 +577,21 @@ do { \ flush_i_cache (); \ } while (0) +/* This flushes a region of the I-cache. + It is used after updating an execute cache while running. + Not needed during GC because FLUSH_I_CACHE will be used. + */ + +#define FLUSH_I_CACHE_REGION(address, nwords) \ +do { \ + extern void cache_flush_region (); \ + \ + cache_flush_region (((void *) (address)), nwords); \ +} while (0) + +/* This loads the cache information structure for use by flush_i_cache. + */ + #define ASM_RESET_HOOK() \ do { \ if ((flush_i_cache_initialize ()) < 0) \ -- 2.25.1