summaryrefslogtreecommitdiff
path: root/sys/src/boot/alphapc/dat.h
blob: d6d9f922ee1b1faeaad033c1f1c4404751b901dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
typedef struct Hwrpb	Hwrpb;
typedef struct Hwcpu	Hwcpu;
typedef struct Hwcrb	Hwcrb;
typedef struct Hwdsr	Hwdsr;
typedef struct Procdesc	Procdesc;
typedef struct Memdsc	Memdsc;
typedef struct Memclust	Memclust;
typedef struct PCB		PCB;

struct Hwrpb
{
	uvlong	phys;
	uvlong	sign;
	uvlong	rev;
	uvlong	size;
	uvlong	cpu0;
	uvlong	by2pg;
	uvlong	pabits;
	uvlong	maxasn;
	char		ssn[16];
	uvlong	systype;
	uvlong	sysvar;
	uvlong	sysrev;
	uvlong	ifreq;
	uvlong	cfreq;
	uvlong	vptb;
	uvlong	resv;
	uvlong	tbhint;
	uvlong	ncpu;
	uvlong	cpulen;
	uvlong	cpuoff;
	uvlong	nctb;
	uvlong	ctblen;
	uvlong	ctboff;
	uvlong	crboff;
	uvlong	memoff;
	uvlong	confoff;
	uvlong	fruoff;
	uvlong	termsaveva;
	uvlong	termsavex;
	uvlong	termrestva;
	uvlong	termrestx;
	uvlong	termresetva;
	uvlong	termresetx;
	uvlong	sysresv;
	uvlong	hardresv;
	uvlong	csum;
	uvlong	rxrdymsk;
	uvlong	txrdymsk;
	uvlong	dsroff;		/* rev 6 or higher */
};

extern Hwrpb* hwrpb;

struct Hwcpu
{
	uvlong	hwpcb[16];
	uvlong	state;
	uvlong	palmainlen;
	uvlong	palscratchlen;
	uvlong	palmainpa;
	uvlong	palscratchpa;
	uvlong	palrev;
	uvlong	cputype;
	uvlong	cpuvar;
	uvlong	cpurev;
	uvlong	serial[2];
	/* more crap ... */
};

struct Hwdsr
{
	vlong	smm;
	uvlong	lurtoff;
	uvlong	sysnameoff;
};

struct Hwcrb
{
	uvlong	dispatchva;
	uvlong	dispatchpa;
	uvlong	fixupva;
	uvlong	fixuppa;
	/* more, uninteresting crud */
};

struct Procdesc
{
	uvlong	bollocks;
	uvlong	addr;
};

struct Memclust
{
	uvlong	pfn;
	uvlong	npages;
	uvlong	ntest;
	uvlong	vabitm;
	uvlong	pabitm;
	uvlong	csumbitm;
	uvlong	usage;
};

struct Memdsc
{
	uvlong	csum;
	uvlong	opt;
	uvlong	nclust;
	Memclust	clust[1];
};

enum
{
	PRINTSIZE =	256,
	MB =		(1024*1024),
};

#define L_MAGIC		((((4*23)+0)*23)+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 */
};

enum {
	Eaddrlen	= 6,
	ETHERMINTU	= 60,		/* minimum transmit size */
	ETHERMAXTU	= 1514,		/* maximum transmit size */
	ETHERHDRSIZE	= 14,		/* size of an ethernet header */

	MaxEther	= 2,
};

typedef struct {
	uchar	d[Eaddrlen];
	uchar	s[Eaddrlen];
	uchar	type[2];
	uchar	data[1500];
	uchar	crc[4];
} Etherpkt;

/*
 *	Process Control Block, used by OSF/1 PALcode when we switch to it
 */
struct PCB {
	uvlong	ksp;
	uvlong	usp;
	uvlong	ptbr;
	ulong	asn;
	ulong	pcc;
	uvlong	unique;
	ulong	fen;
	ulong	dummy;
	uvlong	rsrv1;
	uvlong	rsrv2;
};


#include	"conf.h"

extern Bootconf	conf;