From b258512adbb5c75062b1fd7a9e8fc03c9d7484e5 Mon Sep 17 00:00:00 2001 From: "Guillermo J. Rozas" Date: Sat, 8 Jan 1994 17:02:13 +0000 Subject: [PATCH] Fix cache-flushing bugs manifested on the MIPS R4000: - The linker cannot use PUSH_D_CACHE_REGION on the block being linked if it is returning to it, it must use FLUSH_I_CACHE_REGION. --- v7/src/microcode/cmpint.c | 16 ++++++++++++---- v8/src/microcode/cmpint.c | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/v7/src/microcode/cmpint.c b/v7/src/microcode/cmpint.c index 69eebb45f..d981b1094 100644 --- a/v7/src/microcode/cmpint.c +++ b/v7/src/microcode/cmpint.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: cmpint.c,v 1.81 1993/12/07 20:35:55 gjr Exp $ +$Id: cmpint.c,v 1.82 1994/01/08 17:02:13 gjr Exp $ -Copyright (c) 1989-1993 Massachusetts Institute of Technology +Copyright (c) 1989-1994 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -1202,8 +1202,16 @@ DEFUN (link_cc_block, exit_proc: /* Rather than commit, since we want to undo */ transaction_abort (); - PUSH_D_CACHE_REGION (block_address, - (((unsigned long) (*block_address)) + 1)); + { + SCHEME_OBJECT * ret_add_block; + unsigned long block_len = (((unsigned long) (* block_address)) + 1); + + Get_Compiled_Block (ret_add_block, ret_add); + if (ret_add_block == block_address) + FLUSH_I_CACHE_REGION (block_address, block_len); + else + PUSH_D_CACHE_REGION (block_address, block_len); + } return (result); } diff --git a/v8/src/microcode/cmpint.c b/v8/src/microcode/cmpint.c index 69eebb45f..d981b1094 100644 --- a/v8/src/microcode/cmpint.c +++ b/v8/src/microcode/cmpint.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: cmpint.c,v 1.81 1993/12/07 20:35:55 gjr Exp $ +$Id: cmpint.c,v 1.82 1994/01/08 17:02:13 gjr Exp $ -Copyright (c) 1989-1993 Massachusetts Institute of Technology +Copyright (c) 1989-1994 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -1202,8 +1202,16 @@ DEFUN (link_cc_block, exit_proc: /* Rather than commit, since we want to undo */ transaction_abort (); - PUSH_D_CACHE_REGION (block_address, - (((unsigned long) (*block_address)) + 1)); + { + SCHEME_OBJECT * ret_add_block; + unsigned long block_len = (((unsigned long) (* block_address)) + 1); + + Get_Compiled_Block (ret_add_block, ret_add); + if (ret_add_block == block_address) + FLUSH_I_CACHE_REGION (block_address, block_len); + else + PUSH_D_CACHE_REGION (block_address, block_len); + } return (result); } -- 2.25.1