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

📄 ide_types.hh

📁 一个mips虚拟机非常好代码,使用C++来编写的,希望大家多学学,
💻 HH
字号:
/* the endian format need to be cleared and identified,  */#ifndef _IDE_DEVICE_TYPES_H_#define _IDE_DEVICE_TYPES_H_#define MAXFEATURE 50struct dide_data_s{#if BYTE_ORDER == LITTLE_ENDIAN#else#endif};union dide_data{	struct dide_data_s r;	UInt16 data;};struct dide_err_s{#if BYTE_ORDER == LITTLE_ENDIAN	UInt8 padding0 : 1;	UInt8 nm : 1;	UInt8 abrt : 1;	UInt8 mcr : 1;	UInt8 idnf : 1;	UInt8 mc : 1;	UInt8 unc : 1;	UInt8 icrc : 1;#else	UInt8 icrc : 1;	UInt8 unc : 1;	UInt8 mc : 1;	UInt8 idnf : 1;	UInt8 mcr : 1;	UInt8 abrt : 1;	UInt8 nm : 1;#endif};union dide_err{	struct dide_err_s r;	UInt8 data;};struct dide_feature_s{#if BYTE_ORDER == LITTLE_ENDIAN#else#endif};union dide_feature{	struct dide_feature_s r;	UInt8 data;};struct dide_sectorcount_s{#if BYTE_ORDER == LITTLE_ENDIAN#else#endif};union dide_sectorcount{	struct dide_sectorcount_s r;	UInt8 data;};struct dide_lbal_s{#if BYTE_ORDER == LITTLE_ENDIAN#else#endif};union dide_lbal{	struct dide_lbal_s r;	UInt8 data;};struct dide_lbam_s{#if BYTE_ORDER == LITTLE_ENDIAN#else#endif};union dide_lbam{	struct dide_lbam_s r;	UInt8 data;};struct dide_lbah_s{#if BYTE_ORDER == LITTLE_ENDIAN#else#endif};union dide_lbah{	struct dide_lbah_s r;	UInt8 data;};struct dide_dev_s{#if BYTE_ORDER == LITTLE_ENDIAN	UInt8 sector_hi : 4;	UInt8 dev : 1;	UInt8 padding0 : 1;	UInt8 lba : 1;#else	UInt8 padding0 : 1;	UInt8 lba : 1;	UInt8 padding1 : 1;	UInt8 dev : 1;	UInt8 sector_hi : 4;#endif};union dide_dev{	struct dide_dev_s r;	UInt8 data;};struct dide_comm_s{#if BYTE_ORDER == LITTLE_ENDIAN#else#endif};union dide_comm{	struct dide_comm_s r;	UInt8 data;};struct dide_stat_s{#if BYTE_ORDER == LITTLE_ENDIAN	UInt8 err : 1;	UInt8 padding0 : 2;	UInt8 drq : 1;	UInt8 padding1 : 1;	UInt8 df : 1;	UInt8 drdy : 1;	UInt8 bsy : 1;#else	UInt8 bsy : 1;	UInt8 drdy : 1;	UInt8 df : 1;	UInt8 padding0 : 1;	UInt8 drq : 1;	UInt8 padding1 : 2;	UInt8 err : 1;#endif};union dide_stat{	struct dide_stat_s r;	UInt8 data;};struct dide_astat_s{#if BYTE_ORDER == LITTLE_ENDIAN	UInt8 err : 1;	UInt8 padding0 : 2;	UInt8 drq : 1;	UInt8 padding1 : 1;	UInt8 df : 1;	UInt8 drdy : 1;	UInt8 bsy : 1;#else	UInt8 bsy : 1;	UInt8 drdy : 1;	UInt8 df : 1;	UInt8 padding0 : 1;	UInt8 drq : 1;	UInt8 padding1 : 2;	UInt8 err : 1;#endif};union dide_astat{	struct dide_astat_s r;	UInt8 data;};struct dide_devcon_s{#if BYTE_ORDER == LITTLE_ENDIAN	UInt8 padding0 : 1;	UInt8 nien : 1;	UInt8 srst : 1;	UInt8 padding1 : 4;	UInt8 hob : 1;#else	UInt8 hob : 1;	UInt8 padding0 : 4;	UInt8 srst : 1;	UInt8 nien : 1;#endif};union dide_devcon{	struct dide_devcon_s r;	UInt8 data;};struct bmide_comm_s{#if BYTE_ORDER == LITTLE_ENDIAN	UInt8 start_stop : 1;	UInt8 padding0 : 2;	UInt8 read_write : 1;#else	UInt8 padding0 : 4;	UInt8 read_write : 1;	UInt8 padding1 : 2;	UInt8 start_stop : 1;#endif};union bmide_comm{	struct bmide_comm_s r;	UInt8 data;};struct bmide_stat_s{#if BYTE_ORDER == LITTLE_ENDIAN	UInt8 active : 1;	UInt8 error : 1;	UInt8 interrupt : 1;	UInt8 padding0 : 2;	UInt8 capable0 : 1;	UInt8 capable1 : 1;	UInt8 simplexonly : 1;#else	UInt8 simplexonly : 1;	UInt8 capable1 : 1;	UInt8 capable0 : 1;	UInt8 padding0 : 2;	UInt8 interrupt : 1;	UInt8 error : 1;	UInt8 active : 1;#endif};union bmide_stat{	struct bmide_stat_s r;	UInt8 data;};struct bmide_dtpr_s{#if BYTE_ORDER == LITTLE_ENDIAN	UInt32 padding0 : 2;	UInt32 baseaddr : 30;#else	UInt32 baseaddr : 30;#endif};union bmide_dtpr{	struct bmide_dtpr_s r;	UInt32 data;};/*for featres set */struct features     {    	UInt8 com[MAXFEATURE];	UInt8 subcom[MAXFEATURE];	UInt8 c;    }; //for PRD descriptor struct    struct idedma_descriptor_t {      UInt64 mem_paddr : 32;      UInt64 mbyte_count : 16;      UInt64 padding0 : 15;      UInt64 eot : 1;    };   union idedma_descriptor {    struct idedma_descriptor_t r;    UInt64 data;  };#endif //_IDE_DEVICE_TYPES_H_ 

⌨️ 快捷键说明

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