📄 dat.h
字号:
/* dat.h: include file for vblade AoE target */#define nil ((void *)0)/* * tunable variables */enum { VBLADE_VERSION = 15, // Firmware version FWV = 0x4000 + VBLADE_VERSION,};#undef major#undef minor#undef makedev#define major(x) ((x) >> 24 & 0xFF)#define minor(x) ((x) & 0xffffff)#define makedev(x, y) ((x) << 24 | (y))typedef unsigned char uchar;//typedef unsigned short ushort;#ifdef __FreeBSD__typedef unsigned long ulong;#else//typedef unsigned long ulong;#endiftypedef long long vlong;typedef struct Aoehdr Aoehdr;typedef struct Ata Ata;typedef struct Conf Conf;typedef struct Ataregs Ataregs;struct Ataregs{ vlong lba; uchar cmd; uchar status; uchar err; uchar feature; uchar sectors;};struct Aoehdr{ uchar dst[6]; uchar src[6]; ushort type; uchar flags; uchar error; ushort maj; uchar min; uchar cmd; uchar tag[4];};struct Ata{ Aoehdr h; uchar aflag; uchar err; uchar sectors; uchar cmd; uchar lba[6]; uchar resvd[2];};struct Conf{ Aoehdr h; ushort bufcnt; ushort firmware; uchar scnt; uchar vercmd; ushort len; uchar data[1024];};enum { AoEver = 1, ATAcmd = 0, // command codes Config, Resp = (1<<3), // flags Error = (1<<2), BadCmd = 1, BadArg, DevUnavailable, ConfigErr, BadVersion, Write = (1<<0), Async = (1<<1), Device = (1<<4), Extend = (1<<6), Qread = 0, Qtest, Qprefix, Qset, Qfset, Nretries = 3, Nconfig = 1024, Bufcount = 16,};int shelf, slot;ulong aoetag;uchar mac[6];int bfd; // block file descriptorint sfd; // socket file descriptorvlong size; // size of vbladechar *progname;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -