summaryrefslogtreecommitdiff
path: root/i386/i386at/conf.c
blob: 2bd2d2af4f71919c2733d983767ad83692fc8861 (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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
/* 
 * Mach Operating System
 * Copyright (c) 1993-1989 Carnegie Mellon University
 * All Rights Reserved.
 * 
 * Permission to use, copy, modify and distribute this software and its
 * documentation is hereby granted, provided that both the copyright
 * notice and this permission notice appear in all copies of the
 * software, derivative works or modified versions, and any portions
 * thereof, and that both notices appear in supporting documentation.
 * 
 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
 * 
 * Carnegie Mellon requests users of this software to return to
 * 
 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
 *  School of Computer Science
 *  Carnegie Mellon University
 *  Pittsburgh PA 15213-3890
 * 
 * any improvements or extensions that they make and grant Carnegie Mellon
 * the rights to redistribute these changes.
 */
/*
 * Device switch for i386 AT bus.
 */

#include <mach/machine/vm_types.h>
#include <device/conf.h>

extern vm_offset_t block_io_mmap();

extern int	timeopen(), timeclose();
extern vm_offset_t timemmap();
#define	timename		"time"

#include <hd.h>
#if	NHD > 0
extern int	hdopen(), hdclose(), hdread(), hdwrite();
extern int	hdgetstat(), hdsetstat(), hddevinfo();
#define	hdname			"hd"

#if 0
extern int      pchdopen(),pchdread(),pchdwrite(),pchdgetstat(),pchdsetstat();
#define pchdname                "pchd"
#endif

#endif	NHD > 0

#include <aha.h>
#if	NAHA > 0
int     rz_open(), rz_close(), rz_read(), rz_write();
int     rz_get_status(), rz_set_status(), rz_devinfo();
int	cd_open(), cd_close(), cd_read(), cd_write();
#define rzname "sd"
#define	tzname "st"
#define	scname "sc"	/* processors */
#define cdname	"cd_audio"	/* CD-ROM DA */

#endif	/*NAHA > 0*/

#include <fd.h>
#if	NFD > 0
extern int	fdopen(), fdclose(), fdread(), fdwrite();
extern int	fdgetstat(), fdsetstat(), fddevinfo();
#define	fdname			"fd"
#endif	NFD > 0

#include <wt.h>
#if	NWT > 0
extern int	wtopen(), wtread(), wtwrite(), wtclose();
#define	wtname			"wt"
#endif	NWT > 0

#include <pc586.h>
#if	NPC586 > 0
extern int	pc586open(), pc586output(), pc586getstat(), pc586setstat(),
		pc586setinput();
#define	pc586name		"pc"
#endif NPC586 > 0

#include <ne.h>
#if     NNE > 0
extern int      neopen(), neoutput(), negetstat(), nesetstat(), nesetinput();
#ifdef FIPC
extern int      nefoutput();
#endif /* FIPC */
#define nename                  "ne"
#endif  NNE > 0

#include <ns8390.h>
#if	NNS8390 > 0
extern int	wd8003open(), eliiopen();
extern int	ns8390output(), ns8390getstat(), ns8390setstat(), 
		ns8390setinput();
#define	ns8390wdname		"wd"
#define	ns8390elname		"el"
#endif NNS8390 > 0

#include <at3c501.h>
#if	NAT3C501 > 0
extern int	at3c501open(), at3c501output(),
		at3c501getstat(), at3c501setstat(),
		at3c501setinput();
#define	at3c501name		"et"
#endif NAT3C501 > 0

#include <ul.h>
#if NUL > 0
extern int    ulopen(), uloutput(), ulgetstat(), ulsetstat(),
               ulsetinput();
#define ulname                        "ul"
#endif NUL > 0

#include <wd.h>
#if NWD > 0
extern int    wdopen(), wdoutput(), wdgetstat(), wdsetstat(),
              wdsetinput();
#define wdname                        "wd"
#endif NWD > 0

#include <hpp.h>
#if NHPP > 0
extern int    hppopen(), hppoutput(), hppgetstat(), hppsetstat(),
               hppsetinput();
#define hppname                       "hpp"
#endif /* NHPP > 0 */

#include <par.h>
#if	NPAR > 0
extern int	paropen(), paroutput(), pargetstat(), parsetstat(),
		parsetinput();
#define	parname		"par"
#endif NPAR > 0

#include <de6c.h>
#if	NDE6C > 0
extern int	de6copen(), de6coutput(), de6cgetstat(), de6csetstat(),
		de6csetinput();
#define	de6cname		"de"
#endif NDE6C > 0

extern int	kdopen(), kdclose(), kdread(), kdwrite();
extern int	kdgetstat(), kdsetstat(), kdportdeath();
extern vm_offset_t kdmmap();
#define	kdname			"kd"

#include <com.h>
#if	NCOM > 0
extern int	comopen(), comclose(), comread(), comwrite();
extern int	comgetstat(), comsetstat(), comportdeath();
#define	comname			"com"
#endif	NCOM > 0

#include <lpr.h>
#if	NLPR > 0
extern int	lpropen(), lprclose(), lprread(), lprwrite();
extern int	lprgetstat(), lprsetstat(), lprportdeath();
#define	lprname			"lpr"
#endif	NLPR > 0

#include <blit.h>
#if NBLIT > 0
extern int	blitopen(), blitclose(), blit_get_stat();
extern vm_offset_t blitmmap();
#define	blitname		"blit"

extern int	mouseinit(), mouseopen(), mouseclose();
extern int	mouseioctl(), mouseselect(), mouseread();
#endif

extern int	kbdopen(), kbdclose(), kbdread();
extern int	kbdgetstat(), kbdsetstat();
#define	kbdname			"kbd"

extern int	mouseopen(), mouseclose(), mouseread();
#define	mousename		"mouse"

extern int	ioplopen(), ioplclose();
extern vm_offset_t ioplmmap();
#define	ioplname		"iopl"

/*
 * List of devices - console must be at slot 0
 */
struct dev_ops	dev_name_list[] =
{
	/*name,		open,		close,		read,
	  write,	getstat,	setstat,	mmap,
	  async_in,	reset,		port_death,	subdev,
	  dev_info */

	/* We don't assign a console here, when we find one via
	   cninit() we stick something appropriate here through the
	   indirect list */
	{ "cn",		nulldev,	nulldev,	nulldev,
	  nulldev,	nulldev,	nulldev,	nulldev,
	  nodev,	nulldev,	nulldev,	0,
	  nodev },

	{ kdname,	kdopen,		kdclose,	kdread,
	  kdwrite,	kdgetstat,	kdsetstat,	kdmmap,
	  nodev,	nulldev,	kdportdeath,	0,
	  nodev },

	{ timename,	timeopen,	timeclose,	nulldev,
	  nulldev,	nulldev,	nulldev,	timemmap,
	  nodev,	nulldev,	nulldev,	0,
	  nodev },

#ifndef LINUX_DEV
#if	NHD > 0
	{ hdname,	hdopen,		hdclose,	hdread,
	  hdwrite,	hdgetstat,	hdsetstat,	nomap,
	  nodev,	nulldev,	nulldev,	1024,
	  hddevinfo },
#endif	NHD > 0

#if	NAHA > 0
	{ rzname,	rz_open,	rz_close,	rz_read,
	  rz_write,	rz_get_status,	rz_set_status,	nomap,
	  nodev,	nulldev,	nulldev,	1024, /* 8 */
	  rz_devinfo },

	{ tzname,	rz_open,	rz_close,	rz_read,
	  rz_write,	rz_get_status,	rz_set_status,	nomap,
	  nodev,	nulldev,	nulldev,	8,
	  nodev },

	{ cdname,	cd_open,	cd_close,	cd_read,
	  cd_write,	nodev,		nodev,		nomap,
	  nodev,	nulldev,	nulldev,	8,
	  nodev },

	{ scname,	rz_open,	rz_close,	rz_read,
	  rz_write,	rz_get_status,	rz_set_status,	nomap,
	  nodev,	nulldev,	nulldev,	8,
	  nodev },

#endif	/*NAHA > 0*/

#if	NFD > 0
	{ fdname,	fdopen,		fdclose,	fdread,
	  fdwrite,	fdgetstat,	fdsetstat,	nomap,
	  nodev,	nulldev,	nulldev,	64,
	  fddevinfo },
#endif	NFD > 0

#if	NWT > 0
	{ wtname,	wtopen,		wtclose,	wtread,
	  wtwrite,	nulldev,	nulldev,	nomap,
	  nodev,	nulldev,	nulldev,	0,
	  nodev },
#endif	NWT > 0

#if	NPC586 > 0
	{ pc586name,	pc586open,	nulldev,	nulldev,
	  pc586output,	pc586getstat,	pc586setstat,	nomap,
	  pc586setinput,nulldev,	nulldev, 	0,
	  nodev },
#endif

#if     NNE > 0
        { nename,       neopen,         nulldev,        nulldev,
          neoutput,     negetstat,      nesetstat,      nulldev,
#ifdef FIPC
          nesetinput,   nulldev,        nefoutput,      0,
#else
          nesetinput,   nulldev,        nulldev,        0,
#endif /* FIPC */
          nodev },
#endif

#if	NAT3C501 > 0
	{ at3c501name,	at3c501open,	nulldev,	nulldev,
	  at3c501output,at3c501getstat,	at3c501setstat,	nomap,
	  at3c501setinput, nulldev,	nulldev, 	0,
	  nodev },
#endif

#if	NNS8390 > 0
	{ ns8390wdname,	wd8003open,	nulldev,	nulldev,
	  ns8390output, ns8390getstat,	ns8390setstat,	nomap,
	  ns8390setinput, nulldev,	nulldev,	0,
	  nodev },

	{ ns8390elname,	eliiopen,	nulldev,	nulldev,
	  ns8390output, ns8390getstat,	ns8390setstat,	nomap,
	  ns8390setinput, nulldev,	nulldev,	0,
	  nodev },
#endif

#if   	NUL > 0
        { ulname,       ulopen,         nulldev,        nulldev,
          uloutput,     ulgetstat,      ulsetstat,      nulldev,
          ulsetinput,   nulldev,        nulldev,        0,
          nodev },
#endif

#if   	NWD > 0
	{ wdname,       wdopen,         nulldev,        nulldev,
          wdoutput,     wdgetstat,      wdsetstat,      nulldev,
          wdsetinput,   nulldev,        nulldev,        0,
	  nodev },
#endif

#if   	NHPP > 0
	{ hppname,      hppopen,        nulldev,        nulldev,
	  hppoutput,  hppgetstat,     hppsetstat,     nulldev,
	  hppsetinput,  nulldev,        nulldev,        0,
          nodev },
#endif

#if	NPAR > 0
	{ parname,	paropen,	nulldev,	nulldev,
	  paroutput,	pargetstat,	parsetstat,	nomap,
	  parsetinput,	nulldev,	nulldev, 	0,
	  nodev },
#endif

#if	NDE6C > 0
	{ de6cname,	de6copen,	nulldev,	nulldev,
	  de6coutput,	de6cgetstat,	de6csetstat,	nomap,
	  de6csetinput,	nulldev,	nulldev, 	0,
	  nodev },
#endif
#endif /* ! LINUX_DEV */

#if	NCOM > 0
	{ comname,	comopen,	comclose,	comread,
	  comwrite,	comgetstat,	comsetstat,	nomap,
	  nodev,	nulldev,	comportdeath,	0,
	  nodev },
#endif

#ifndef LINUX_DEV
#if	NLPR > 0
	{ lprname,	lpropen,	lprclose,	lprread,
	  lprwrite,	lprgetstat,	lprsetstat,	nomap,
	  nodev,	nulldev,	lprportdeath,	0,
	  nodev },
#endif
#endif /* ! LINUX_DEV */

#if	NBLIT > 0
	{ blitname,	blitopen,	blitclose,	nodev,
	  nodev,	blit_get_stat,	nodev,		blitmmap,
	  nodev,	nodev,		nodev,		0,
	  nodev },
#endif

	{ mousename,	mouseopen,	mouseclose,	mouseread,
	  nodev,	nulldev,	nulldev,	nomap,
	  nodev,	nulldev,	nulldev,	0,
	  nodev },

	{ kbdname,	kbdopen,	kbdclose,	kbdread,
	  nodev,	kbdgetstat,	kbdsetstat,	nomap,
	  nodev,	nulldev,	nulldev,	0,
	  nodev },

	{ ioplname,	ioplopen,	ioplclose,	nodev,
	  nodev,	nodev,		nodev,		ioplmmap,
	  nodev,	nulldev,	nulldev,	0,
	  nodev },

#if 0
#if	NHD > 0
	{ pchdname,     pchdopen,      	hdclose,	pchdread,
	  pchdwrite,	pchdgetstat,	pchdsetstat,	nomap,
	  nodev,	nulldev,	nulldev,	16,
	  hddevinfo },
#endif	NHD > 0
#endif

#if 0
#if     NHD > 0
        { hdname,       hdopen,         hdclose,        hdread,
          hdwrite,      hdgetstat,      hdsetstat,      nomap,
          nodev,        nulldev,        nulldev,        16,
          hddevinfo },
#endif  NHD > 0
#endif 0 /* Kevin doesn't know why this was here. */

};
int	dev_name_count = sizeof(dev_name_list)/sizeof(dev_name_list[0]);

/*
 * Indirect list.
 */
struct dev_indirect dev_indirect_list[] = {

	/* console */
	{ "console",	&dev_name_list[0],	0 }
};
int	dev_indirect_count = sizeof(dev_indirect_list)
				/ sizeof(dev_indirect_list[0]);