tc.h 1.4 KB
/*
 * Copyright (C) 1996-1998 by the Board of Trustees
 *    of Leland Stanford Junior University.
 * 
 * This file is part of the SimOS distribution. 
 * See LICENSE file for terms of the license. 
 *
 */

/****************************************************************
 * tc.h - Translation cache 
 * 
 * 
 * $Author: blythe $
 * $Date: 2002/05/29 01:09:09 $
 *****************************************************************/

#ifndef TC_H
#define TC_H

#ifndef _LANGUAGE_ASSEMBLY

/* ****************************************************************
 * Translation Cache Address
 * ****************************************************************/

#ifdef SIM_ALPHA
#include <alpha/inst.h>
typedef union alpha_instruction * TCA;
#else
typedef Inst * TCA;
#endif

#define TCFLUSH_ALL -1
#define TC_MAX_CACHES 4


/*
 * The functions operating on the Tc
 */
extern int tcGenNumber; 
extern void TC_init     (int numCaches, int size[], int pctcSize[], int annotationSize[], Inst breakOp );
extern void TC_flush    (int cache);
extern TCA  TC_GetTCPtr (int cache);
extern void TC_SetTCNext(int cache,TCA, TCA );
extern int  TC_Is_Room  (int len, int cache );
extern int  TC_InTC     (int cache,TCA addr );
extern void TC_IncrementSize(int cache, int length);

extern void TC_PCInsert (int code, TCA tca, VA vAddr, MA mAddr);
extern TCA  TC_PCLookup (int code, VA vAddr, MA mAddr);

#endif /* LANGUAGE_ASSEMBLY */

#endif /* TC_H */