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

📄 types.hh

📁 一个mips虚拟机非常好代码,使用C++来编写的,希望大家多学学,
💻 HH
字号:
#ifndef mips64_types_hh_included#define mips64_types_hh_included#include <device.hh>#include <inttypes.hh>#include <object.hh>// A collection of some fundamental MIPS64 types.class MIPS64Types    : public Object{public:    // Fundamental types.    typedef UInt64 VA;		// Virtual address    typedef UInt64 PA;		// Physical address    typedef UInt32 Instr;	// Instruction    // Width of the MIPS64 address space.    static const int paddr_width = 36;    // Caching algorithm numbers.    enum {	noncoherent_write_through	= 0,	noncoherent_write_allocate	= 1,	uncached			= 2,	noncoherent_write_back		= 3,	exclusive			= 4,	exclusive_on_write		= 5,	update_on_write			= 6    };    // The caching algorithm is stored as part of the physical address,    // using the same encoding as that of XKPHYS address space region.    static int coherency_algorithm(PA pa)	{ return bits(pa, 61, 59); }    static PA physical_address(PA pa)	{ return bits(pa, paddr_width, 0); }    static PA make_physical_address(PA pa, PA ca)	{ return pa | (ca << 59); }    // Hardware data types.    enum {	byte,	halfword,	triplebyte,	word,	quintibyte,	sextibyte,	septibyte,	doubleword    };};#endif // mips64_types_hh_included

⌨️ 快捷键说明

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