qc.h 985 Bytes
/*
 * Copyright (C) 1998 by the Board of Trustees
 *    of Leland Stanford Junior University.
 * Copyright (C) 1998 Digital Equipment Corporation
 *
 * This file is part of the SimOS distribution.
 * See LICENSE file for terms of the license.
 *
 */



#ifndef QC_H
#define QC_H




#define QC_ASSOC   1
#define QC_INDEX   (8*1024)

#define QC_WRITEABLE(_mAddr) ((uint64)(_mAddr)&1)
#define QC_TO_MEMADDR(_mAddr) ((MA)((_mAddr) & ~1))

#define QC_HASH(_tag) ( (_tag) &(QC_INDEX-1))


typedef struct QCTable {
   struct QCEntry{ 
      Reg vpn;
      uint64 mAddrWr;
   } e[ QC_INDEX];
} QCTable;


extern QCTable *QCInit(int isWriteable);

extern MA   QCLookup( QCTable *table, VA vAddr, int write);
extern void QCDowngrade(int cpuNum, Reg tag); /* all cpus of the machine */

extern void QCInsert( QCTable *table, int cpuNum,Reg tag, PA pAddr, int writeable);
extern void QCRemove( QCTable *table, Reg tag);

extern void QCConsistencyCheck(AlphaState *, QCTable *,int type);

#endif