qc.h
985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* 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