⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 translate.h

📁 nachos系统作业 实现线程系统 实现一个电梯模拟 附实验报告
💻 H
字号:
// translate.h //	Data structures for managing the translation from //	virtual page # -> physical page #, used for managing//	physical memory on behalf of user programs.////	The data structures in this file are "dual-use" - they//	serve both as a page table entry, and as an entry in//	a software-managed translation lookaside buffer (TLB).//	Either way, each entry is of the form://	<virtual page #, physical page #>.//// DO NOT CHANGE -- part of the machine emulation//// Copyright (c) 1992-1993 The Regents of the University of California.// All rights reserved.  See copyright.h for copyright notice and limitation // of liability and disclaimer of warranty provisions.#ifndef TLB_H#define TLB_H#include "copyright.h"#include "utility.h"// The following class defines an entry in a translation table -- either// in a page table or a TLB.  Each entry defines a mapping from one // virtual page to one physical page.// In addition, there are some extra bits for access control (valid and // read-only) and some bits for usage information (use and dirty).class TranslationEntry {  public:    int virtualPage;  	// The page number in virtual memory.    int physicalPage;  	// The page number in real memory (relative to the			//  start of "mainMemory"    bool valid;         // If this bit is set, the translation is ignored.			// (In other words, the entry hasn't been initialized.)    bool readOnly;	// If this bit is set, the user program is not allowed			// to modify the contents of the page.    bool use;           // This bit is set by the hardware every time the			// page is referenced or modified.    bool dirty;         // This bit is set by the hardware every time the			// page is modified.};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -