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

📄 dat.h

📁 著名操作系统Plan 9的第三版的部分核心源代码。现在很难找到了。Plan 9是bell实验室开发的Unix后继者。
💻 H
字号:
typedef struct List {	void	*next;} List;typedef struct Alarm {	List;	int	busy;	long	dt;	void	(*f)(void*);	void	*arg;} Alarm;typedef struct Block Block;struct Block {	Block*	next;	uchar*	rp;			/* first unconsumed byte */	uchar*	wp;			/* first empty byte */	uchar*	lim;			/* 1 past the end of the buffer */	uchar*	base;			/* start of the buffer */	ulong	flag;};#define BLEN(s)	((s)->wp - (s)->rp)typedef struct IOQ IOQ;typedef struct IOQ {	uchar	buf[4096];	uchar	*in;	uchar	*out;	int	state;	int	(*getc)(IOQ*);	int	(*putc)(IOQ*, int);	void	*ptr;};enum {	Eaddrlen	= 6,	ETHERMINTU	= 60,		/* minimum transmit size */	ETHERMAXTU	= 1514,		/* maximum transmit size */	ETHERHDRSIZE	= 14,		/* size of an ethernet header */	MaxEther	= 4,};typedef struct {	uchar	d[Eaddrlen];	uchar	s[Eaddrlen];	uchar	type[2];	uchar	data[1500];	uchar	crc[4];} Etherpkt;extern uchar broadcast[Eaddrlen];typedef struct Ureg Ureg;typedef struct Segdesc {	ulong	d0;	ulong	d1;} Segdesc;typedef struct Mach {	ulong	ticks;			/* of the clock since boot time */	void	*alarm;			/* alarms bound to this clock */} Mach;extern Mach *m;#define I_MAGIC		((((4*11)+0)*11)+7)typedef struct Exec Exec;struct	Exec{	uchar	magic[4];		/* magic number */	uchar	text[4];	 	/* size of text segment */	uchar	data[4];	 	/* size of initialized data */	uchar	bss[4];	  		/* size of uninitialized data */	uchar	syms[4];	 	/* size of symbol table */	uchar	entry[4];	 	/* entry point */	uchar	spsz[4];		/* size of sp/pc offset table */	uchar	pcsz[4];		/* size of pc/line number table */};/* *  a parsed .ini line */#define ISAOPTLEN	16#define NISAOPT		8typedef struct  ISAConf {	char	type[NAMELEN];	ulong	port;	ulong	irq;	ulong	mem;	ulong	size;	uchar	ea[6];	int	nopt;	char	opt[NISAOPT][ISAOPTLEN];} ISAConf;typedef struct Pcidev Pcidev;typedef struct PCMmap PCMmap;#define BOOTLINE	((char*)CONFADDR)enum {	MB =		(1024*1024),};#define ROUND(s, sz)	(((s)+((sz)-1))&~((sz)-1))typedef struct Type Type;typedef struct Medium Medium;typedef struct Boot Boot;enum {					/* type */	Tnil		= 0x00,	Tfloppy		= 0x01,	Tsd		= 0x02,	Tether		= 0x03,	Tany		= -1,};enum {					/* name and flag */	Fnone		= 0x00,	Ndos		= 0x00,	Fdos		= (1<<Ndos),	Nboot		= 0x01,	Fboot		= (1<<Nboot),	Nbootp		= 0x02,	Fbootp		= (1<<Nbootp),	NName		= 3,	Fany		= Fbootp|Fboot|Fdos,	Fini		= 0x10,	Fprobe		= 0x80,};typedef struct Type {	int	type;	int	flag;	int	(*init)(void);	void	(*initdev)(int, char*);	void* (*getdospart)(int, char*);	/* actually returns Dos* */	void	(*addconf)(int);	int	(*boot)(int, char*, Boot*);	int	mask;	Medium*	media;} Type;extern void (*etherdetach)(void);typedef struct Lock {	/* for ilock, iunlock */	int locked;	int spl;} Lock;enum {	/* returned by bootpass */	MORE, ENOUGH, FAIL};enum {	INITKERNEL,	READEXEC,	READTEXT,	READDATA,	READGZIP,	TRYBOOT,	INIT9LOAD,	READ9LOAD,	FAILED};struct Boot {	int state;	Exec exec;	char *bp;	/* base ptr */	char *wp;	/* write ptr */	char *ep;	/* end ptr */};extern int	debug;

⌨️ 快捷键说明

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