亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? machine.h

?? LINUX 下NACHOS 系統的頁面調度算法的實現
?? H
字號:
// machine.h //	Data structures for simulating the execution of user programs//	running on top of Nachos.////	User programs are loaded into "mainMemory"; to Nachos,//	this looks just like an array of bytes.  Of course, the Nachos//	kernel is in memory too -- but as in most machines these days,//	the kernel is loaded into a separate memory region from user//	programs, and accesses to kernel memory are not translated or paged.////	In Nachos, user programs are executed one instruction at a time, //	by the simulator.  Each memory reference is translated, checked//	for errors, etc.////  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 MACHINE_H#define MACHINE_H#include "copyright.h"#include "utility.h"#include "translate.h"#include "memmanager.h"#include "disk.h"// Definitions related to the size, and format of user memory#define PageSize 	SectorSize 	// set the page size equal to					// the disk sector size, for					// simplicity#define NumPhysPages    20 #define MemorySize 	(NumPhysPages * PageSize)#define TLBSize		4		// if there is a TLB, make it smallenum ExceptionType { NoException,           // Everything ok!		     SyscallException,      // A program executed a system call.		     PageFaultException,    // No valid translation found		     ReadOnlyException,     // Write attempted to page marked 					    // "read-only"		     BusErrorException,     // Translation resulted in an 					    // invalid physical address		     AddressErrorException, // Unaligned reference or one that					    // was beyond the end of the					    // address space		     OverflowException,     // Integer overflow in add or sub.		     IllegalInstrException, // Unimplemented or reserved instr.		     		     NumExceptionTypes};// User program CPU state.  The full set of MIPS registers, plus a few// more because we need to be able to start/stop a user program between// any two instructions (thus we need to keep track of things like load// delay slots, etc.)#define StackReg	29	// User's stack pointer#define RetAddrReg	31	// Holds return address for procedure calls#define NumGPRegs	32	// 32 general purpose registers on MIPS#define HiReg		32	// Double register to hold multiply result#define LoReg		33#define PCReg		34	// Current program counter#define NextPCReg	35	// Next program counter (for branch delay) #define PrevPCReg	36	// Previous program counter (for debugging)#define LoadReg		37	// The register target of a delayed load.#define LoadValueReg 	38	// The value to be loaded by a delayed load.#define BadVAddrReg	39	// The failing virtual address on an exception#define NumTotalRegs 	40// The following class defines an instruction, represented in both// 	undecoded binary form//      decoded to identify//	    operation to do//	    registers to act on//	    any immediate operand valueclass Instruction {  public:    void Decode();	// decode the binary representation of the instruction    unsigned int value; // binary representation of the instruction    char opCode;     // Type of instruction.  This is NOT the same as the    		     // opcode field from the instruction: see defs in mips.h    char rs, rt, rd; // Three registers from instruction.    int extra;       // Immediate or target or shamt field or offset.                     // Immediates are sign-extended.};// The following class defines the simulated host workstation hardware, as // seen by user programs -- the CPU registers, main memory, etc.// User programs shouldn't be able to tell that they are running on our // simulator or on the real hardware, except //	we don't support floating point instructions//	the system call interface to Nachos is not the same as UNIX //	  (10 system calls in Nachos vs. 200 in UNIX!)// If we were to implement more of the UNIX system calls, we ought to be// able to run Nachos on top of Nachos!//// The procedures in this class are defined in machine.cc, mipssim.cc, and// translate.cc.class Machine {  public:    // Initialize the simulation of the hardware    // for running user programs    Machine(bool debug, int pbuffer, int hbits);	    ~Machine();			// De-allocate the data structures    // Routines callable by the Nachos kernel    void Run();	 		// Run a user program    int ReadRegister(int num);	// read the contents of a CPU register    void WriteRegister(int num, int value);				// store a value into a CPU register// Routines internal to the machine simulation -- DO NOT call these     void OneInstruction(Instruction *instr); 	    				// Run one instruction of a user program.    void DelayedLoad(int nextReg, int nextVal);  					// Do a pending delayed load (modifying a reg)        bool ReadMem(int addr, int size, int* value);    bool WriteMem(int addr, int size, int value);    				// Read or write 1, 2, or 4 bytes of virtual 				// memory (at addr).  Return FALSE if a 				// correct translation couldn't be found.        ExceptionType Translate(int virtAddr, int* physAddr, int size,bool writing);    				// Translate an address, and check for 				// alignment.  Set the use and dirty bits in 				// the translation entry appropriately,    				// and return an exception code if the 				// translation couldn't be completed.    void RaiseException(ExceptionType which, int badVAddr);				// Trap to the Nachos kernel, because of a				// system call or other exception.      void Debugger();		// invoke the user program debugger    void DumpState();		// print the user CPU and memory state // Data structures -- all of these are accessible to Nachos kernel code.// "public" for convenience.//// Note that *all* communication between the user program and the kernel // are in terms of these data structures.    char *mainMemory;		// physical memory to store user program,				// code and data, while executing    MemManager *memManager;     // the physical memory manager.    int registers[NumTotalRegs]; // CPU registers, for executing user programs// NOTE: the hardware translation of virtual addresses in the user program// to physical addresses (relative to the beginning of "mainMemory")// can be controlled by one of://	a traditional linear page table//  	a software-loaded translation lookaside buffer (tlb) -- a cache of //	  mappings of virtual page #'s to physical page #'s//// If "tlb" is NULL, the linear page table is used// If "tlb" is non-NULL, the Nachos kernel is responsible for managing//	the contents of the TLB.  But the kernel can use any data structure//	it wants (eg, segmented paging) for handling TLB cache misses.// // For simplicity, both the page table pointer and the TLB pointer are// public.  However, while there can be multiple page tables (one per address// space, stored in memory), there is only one TLB (implemented in hardware).// Thus the TLB pointer should be considered as *read-only*, although // the contents of the TLB are free to be modified by the kernel software.    TranslationEntry *tlb;		// this pointer should be considered 					// "read-only" to Nachos kernel code    TranslationEntry *pageTable;    unsigned int pageTableSize;  private:    bool singleStep;		// drop back into the debugger after each				// simulated instruction    int runUntilTime;		// drop back into the debugger when simulated				// time reaches this value};extern void ExceptionHandler(ExceptionType which);				// Entry point into Nachos for handling				// user system calls and exceptions				// Defined in exception.cc// Routines for converting Words and Short Words to and from the// simulated machine's format of little endian.  If the host machine// is little endian (DEC and Intel), these end up being NOPs.//// What is stored in each format://	host byte ordering://	   kernel data structures//	   user registers//	simulated machine byte ordering://	   contents of main memoryunsigned int WordToHost(unsigned int word);unsigned short ShortToHost(unsigned short shortword);unsigned int WordToMachine(unsigned int word);unsigned short ShortToMachine(unsigned short shortword);#endif // MACHINE_H

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆精品视频在线观看| 亚洲精选一二三| 国产伦精品一区二区三区视频青涩| 8x福利精品第一导航| 美日韩黄色大片| 久久精品亚洲乱码伦伦中文 | 久久色在线观看| 国产成人午夜电影网| 国产精品素人一区二区| 91污片在线观看| 亚洲国产日韩av| 精品福利一二区| 成人中文字幕电影| 亚洲精品国产精华液| 91精品国产一区二区三区香蕉| 黄一区二区三区| 亚洲人午夜精品天堂一二香蕉| 91黄色免费版| 国内一区二区在线| 亚洲日本韩国一区| 欧美一区二区三区公司| 成人午夜大片免费观看| 天天操天天干天天综合网| 精品国精品国产| 日本韩国一区二区三区| 久久精品国产99国产| 最新欧美精品一区二区三区| 在线91免费看| 97精品久久久久中文字幕| 日韩国产欧美在线播放| 亚洲欧洲国产专区| 精品国产凹凸成av人导航| 色一情一乱一乱一91av| 国产美女精品在线| 香蕉加勒比综合久久| 国产精品久久久久久久久免费相片 | 91精品国产手机| 成人永久看片免费视频天堂| 日本视频免费一区| 一区二区三区国产豹纹内裤在线| 精品欧美乱码久久久久久1区2区 | 亚洲国产毛片aaaaa无费看| 久久一二三国产| 在线国产电影不卡| 国产成a人亚洲精品| 午夜电影一区二区| 自拍视频在线观看一区二区| 精品成人私密视频| 欧美精品久久99久久在免费线 | 亚洲专区一二三| 久久精品一区二区三区不卡牛牛| 欧美日韩激情一区二区三区| 成人av先锋影音| 久久er99精品| 日本成人中文字幕| 亚洲妇熟xx妇色黄| 有码一区二区三区| 亚洲男人的天堂网| 中文字幕制服丝袜成人av| 精品国产乱码久久久久久闺蜜| 欧美丝袜丝交足nylons| 95精品视频在线| 成人a级免费电影| 成人看片黄a免费看在线| 国产精品中文字幕日韩精品| 久久精品国产99国产精品| 国产精品白丝jk白祙喷水网站| 日本中文一区二区三区| 午夜影院在线观看欧美| 亚洲专区一二三| 亚洲美女免费在线| 亚洲人被黑人高潮完整版| 中文字幕中文在线不卡住| 日本一区二区综合亚洲| 欧美精品一区二区不卡| 26uuuu精品一区二区| 精品国产91久久久久久久妲己| 欧美一级免费大片| 91精品国产色综合久久不卡蜜臀| 欧美精品久久99| 日韩一本二本av| 欧美成人性福生活免费看| 精品免费日韩av| 久久久久久久久久久久久夜| 国产午夜亚洲精品不卡| 久久久不卡影院| 国产精品久久久久久久蜜臀| 亚洲少妇最新在线视频| 一区二区在线观看不卡| 亚洲高清视频的网址| 舔着乳尖日韩一区| 久久 天天综合| 国产成人综合网站| 91美女福利视频| 欧洲精品在线观看| 欧美在线观看视频一区二区三区| 欧美日韩色综合| 日韩免费成人网| 国产精品看片你懂得| 一区二区三区高清不卡| 天堂午夜影视日韩欧美一区二区| 麻豆国产精品官网| 粉嫩蜜臀av国产精品网站| 色综合中文综合网| 亚洲精品欧美专区| 午夜久久电影网| 国产一区亚洲一区| 91日韩精品一区| 日韩欧美色综合| 中文字幕亚洲欧美在线不卡| 午夜日韩在线电影| 国产一区二区美女诱惑| www.久久久久久久久| 欧美人与性动xxxx| 欧美国产精品久久| 日韩在线一区二区| www.av精品| 日韩精品中文字幕在线一区| 中文字幕亚洲欧美在线不卡| 首页亚洲欧美制服丝腿| 成人美女在线视频| 欧美一二三四区在线| 最新久久zyz资源站| 精品亚洲国产成人av制服丝袜 | 91福利视频网站| 精品国产91久久久久久久妲己| 亚洲美女免费在线| 国产精品正在播放| 7777女厕盗摄久久久| 国产精品久久久久三级| 麻豆精品在线观看| 欧美在线播放高清精品| 久久久亚洲高清| 免费在线观看成人| 色婷婷综合久久久中文字幕| 久久久久久久性| 另类的小说在线视频另类成人小视频在线 | 欧美精品在线一区二区三区| 国产精品乱码妇女bbbb| 日本vs亚洲vs韩国一区三区| 色婷婷综合久久久久中文一区二区| 久久婷婷国产综合国色天香 | 国产精品久久久久久久久免费相片| 美女在线观看视频一区二区| 精品视频在线看| 亚洲欧美日韩在线播放| 粉嫩绯色av一区二区在线观看| 日韩亚洲欧美成人一区| 亚洲午夜电影在线| 日本韩国精品一区二区在线观看| 国产精品乱码人人做人人爱| 国产成人精品三级| 久久久五月婷婷| 黑人巨大精品欧美黑白配亚洲| 在线成人小视频| 国产成人免费视| 久久综合狠狠综合久久综合88| 免费人成黄页网站在线一区二区| 日本道色综合久久| 亚洲另类在线一区| 成人国产亚洲欧美成人综合网 | 综合激情网...| 波多野结衣视频一区| 国产欧美日本一区二区三区| 国产真实精品久久二三区| 精品av综合导航| 国产麻豆午夜三级精品| 久久午夜电影网| 国产传媒久久文化传媒| 欧美国产激情二区三区| 成人av电影观看| 亚洲欧美日韩国产成人精品影院| 91色porny蝌蚪| 亚洲一区二区三区免费视频| 欧美日韩精品免费| 美女网站色91| 久久综合色天天久久综合图片| 国产麻豆成人精品| 国产精品三级视频| 日本福利一区二区| 日韩不卡免费视频| 久久你懂得1024| 成人性生交大片免费看在线播放 | 欧美猛男男办公室激情| 日本不卡中文字幕| 日韩一区二区免费电影| 美女视频网站黄色亚洲| 久久久精品黄色| 91啪九色porn原创视频在线观看| 一区二区三区欧美日韩| 欧美日韩国产高清一区二区三区| 日本中文字幕一区二区视频| 久久麻豆一区二区| 91久久精品网| 奇米综合一区二区三区精品视频 | 欧美欧美午夜aⅴ在线观看| 蜜臀av在线播放一区二区三区| 久久先锋影音av| 色素色在线综合| 久久99精品视频|