📄 cache.h
字号:
/* * 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. * */#ifndef CACHE_H#define CACHE_H#ifndef _LANGUAGE_ASSEMBLY/* Our miss handling table is very simple, it only allows 1 *//* outstanding reference. It could be extended to model a write *//* buffer, but outstanding loads seems undoable because of the *//* difficulty of register interlocks */typedef struct { EventCallbackHdr evthdr; /* So we can make this an event callback */ PA pAddr; VA vAddr; PA pcPAddr; int state; int smht_flags; int64 iCount;#if ROYG VA vpc; SimTime startTime; SimTime endTime;#endif}EmSMHT;extern EmSMHT* emSMHT;#define SMHT_NOTACTIVE 0x0#define SMHT_ACTIVE 0x1#define SMHT_UPGRADE 0x2#define SMHT_PCCONFLICT 0x4#define SMHT_SC 0x8#define SMHT_DOUBLECOUNT 0x10#define SMHT_INSTRUCTION 0x20/* Just for efficiently */#define SMHT_BD 0x40#define SMHT_NLISL 0x80#define CACHE_TAG_SIZE (LINES_PER_CACHE * sizeof(PLN))extern void Cache_Init( int cpuNum );extern void Cache_Clobber( int machine, int cpuNum, PA pAddr, Dir_Entry cpu_bits, EmVQCMemState state );extern void UPCache_Ref( int cpuNum, PA pAddr, VA vAddr, EmVQCMemState state);extern void MPCache_Ref( int cpuNum, PA pAddr, VA vAddr, EmVQCMemState state);extern void MPinUPCache_Ref( int cpuNum, PA pAddr, VA vAddr, EmVQCMemState state );/* Debugging functions */extern int cache_verify_excl( int cpuNum, PLN pline );extern int cache_verify_shared( int cpuNum, PLN pline );/* Even at 16 byte lines, this limits us to 16GB *//* Top Bit is valid/invalid. Second top bit is shared/excl */#define INVALID_TAG 0x80000000/* Our cache tags carry extra info like if line is excl or shared */#define CACHE_PLINE(_cline) ((uint)(_cline) & 0xbFFFFFFF)#define CACHE_EXCL(_cline) ((uint)(_cline) & 0x40000000)#define CACHE_SET_EXCL(_cline) ((uint)(_cline) | 0x40000000)#define CACHE_SHARED(_cline) (!CACHE_EXCL(_cline))#define CACHE_SET_SHARED(_cline) ((uint)(_cline) & 0xbFFFFFFF)#define CACHE_INVALID(_cline) ((uint)(_cline) & INVALID_TAG)#define CACHE_VALID(_cline) (!((uint)(_cline) & INVALID_TAG))#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -