xref: /original-bsd/sys/i386/stand/confxx.c (revision ba762ddc)
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.redist.c%
9  *
10  *	@(#)confxx.c	7.2 (Berkeley) 04/28/91
11  */
12 
13 #include "param.h"
14 #include "saio.h"
15 
16 devread(io)
17 	register struct iob *io;
18 {
19 	int cc;
20 
21 	io->i_flgs |= F_RDDATA;
22 	io->i_error = 0;
23 	cc = (*devsw[0].dv_strategy)(io, READ);
24 	io->i_flgs &= ~F_TYPEMASK;
25 	return (cc);
26 }
27 
28 devwrite(io)
29 	register struct iob *io;
30 {
31 	int cc;
32 
33 	io->i_flgs |= F_WRDATA;
34 	io->i_error = 0;
35 	cc = (*devsw[0].dv_strategy)(io, WRITE);
36 	io->i_flgs &= ~F_TYPEMASK;
37 	return (cc);
38 }
39 
40 devopen(io)
41 	register struct iob *io;
42 {
43 
44 	(*devsw[0].dv_open)(io);
45 }
46 
47 devclose(io)
48 	register struct iob *io;
49 {
50 
51 	(*devsw[0].dv_close)(io);
52 }
53 
54 devioctl(io, cmd, arg)
55 	register struct iob *io;
56 	int cmd;
57 	caddr_t arg;
58 {
59 
60 	return ((*devsw[0].dv_ioctl)(io, cmd, arg));
61 }
62 
63 /*ARGSUSED*/
64 nullsys(io)
65 	struct iob *io;
66 {
67 
68 	;
69 }
70 
71 /*ARGSUSED*/
72 nullioctl(io, cmd, arg)
73 	struct iob *io;
74 	int cmd;
75 	caddr_t arg;
76 {
77 
78 	return (ECMD);
79 }
80 
81 int	nullsys(), nullioctl();
82 int	xxstrategy(), xxopen()/*, xxioctl()*/;
83 
84 struct devsw devsw[] = {
85 	{ "XX",	xxstrategy,	xxopen,		nullsys,	/*xxioctl*/ }
86 };
87 int ndevs = 1 ;
88