xref: /original-bsd/sys/i386/stand/confxx.c (revision da818fbb)
1 /*-
2  * Copyright (c) 1990 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * William Jolitz.
7  *
8  * %sccs.include.noredist.c%
9  *
10  *	@(#)confxx.c	7.1 (Berkeley) 04/24/90
11  */
12 
13 #include "../machine/pte.h"
14 
15 #include "../h/param.h"
16 #include "../h/inode.h"
17 #include "../h/fs.h"
18 #include "saio.h"
19 
20 devread(io)
21 	register struct iob *io;
22 {
23 	int cc;
24 
25 	io->i_flgs |= F_RDDATA;
26 	io->i_error = 0;
27 	cc = (*devsw[0].dv_strategy)(io, READ);
28 	io->i_flgs &= ~F_TYPEMASK;
29 	return (cc);
30 }
31 
32 devwrite(io)
33 	register struct iob *io;
34 {
35 	int cc;
36 
37 	io->i_flgs |= F_WRDATA;
38 	io->i_error = 0;
39 	cc = (*devsw[0].dv_strategy)(io, WRITE);
40 	io->i_flgs &= ~F_TYPEMASK;
41 	return (cc);
42 }
43 
44 devopen(io)
45 	register struct iob *io;
46 {
47 
48 	(*devsw[0].dv_open)(io);
49 }
50 
51 devclose(io)
52 	register struct iob *io;
53 {
54 
55 	(*devsw[0].dv_close)(io);
56 }
57 
58 devioctl(io, cmd, arg)
59 	register struct iob *io;
60 	int cmd;
61 	caddr_t arg;
62 {
63 
64 	return ((*devsw[0].dv_ioctl)(io, cmd, arg));
65 }
66 
67 /*ARGSUSED*/
68 nullsys(io)
69 	struct iob *io;
70 {
71 
72 	;
73 }
74 
75 /*ARGSUSED*/
76 nullioctl(io, cmd, arg)
77 	struct iob *io;
78 	int cmd;
79 	caddr_t arg;
80 {
81 
82 	return (ECMD);
83 }
84 
85 int	nullsys(), nullioctl();
86 int	xxstrategy(), xxopen()/*, xxioctl()*/;
87 
88 struct devsw devsw[] = {
89 	{ "XX",	xxstrategy,	xxopen,		nullsys,	/*xxioctl*/ },
90 	{ 0, 0, 0, 0, 0 }
91 };
92 #ifdef	TP
93 char	bootprog[] = "XX0b:" ;
94 #else
95 char	bootprog[] = "XX0a:/boot" ;
96 #endif
97 int ndevs = 1 ;
98