Commit | Line | Data |
---|---|---|
75f313ad | 1 | /* confxx.c 4.3 82/12/30 */ |
faeec66d SL |
2 | |
3 | #include "../machine/pte.h" | |
667c50a7 RE |
4 | |
5 | #include "../h/param.h" | |
6 | #include "../h/inode.h" | |
667c50a7 RE |
7 | #include "../h/fs.h" |
8 | #include "saio.h" | |
9 | ||
10 | devread(io) | |
11 | register struct iob *io; | |
12 | { | |
75f313ad | 13 | int error; |
667c50a7 | 14 | |
75f313ad SL |
15 | io->i_flgs |= F_RDDATA; |
16 | error = (*devsw[io->i_ino.i_dev].dv_strategy)(io, READ); | |
17 | io->i_flgs &= ~F_TYPEMASK; | |
18 | return (error); | |
667c50a7 RE |
19 | } |
20 | ||
21 | devwrite(io) | |
22 | register struct iob *io; | |
23 | { | |
75f313ad | 24 | int error; |
667c50a7 | 25 | |
75f313ad SL |
26 | io->i_flgs |= F_WRDATA; |
27 | error = (*devsw[io->i_ino.i_dev].dv_strategy)(io, WRITE); | |
28 | io->i_flgs &= ~F_TYPEMASK; | |
29 | return (error); | |
667c50a7 RE |
30 | } |
31 | ||
32 | devopen(io) | |
33 | register struct iob *io; | |
34 | { | |
35 | ||
36 | (*devsw[io->i_ino.i_dev].dv_open)(io); | |
37 | } | |
38 | ||
39 | devclose(io) | |
40 | register struct iob *io; | |
41 | { | |
42 | ||
43 | (*devsw[io->i_ino.i_dev].dv_close)(io); | |
44 | } | |
45 | ||
75f313ad SL |
46 | devioctl(io, cmd, arg) |
47 | register struct iob *io; | |
48 | int cmd; | |
49 | caddr_t arg; | |
50 | { | |
51 | ||
52 | return ((*devsw[io->i_ino.i_dev].dv_ioctl)(io, cmd, arg)); | |
53 | } | |
54 | ||
55 | /*ARGSUSED*/ | |
56 | nullsys(io) | |
57 | struct iob *io; | |
667c50a7 RE |
58 | { |
59 | ||
60 | ; | |
61 | } | |
62 | ||
75f313ad SL |
63 | /*ARGSUSED*/ |
64 | nullioctl(io, cmd, arg) | |
65 | struct iob *io; | |
66 | int cmd; | |
67 | caddr_t arg; | |
68 | { | |
69 | ||
70 | return (ECMD); | |
71 | } | |
72 | ||
73 | int nullsys(), nullioctl(); | |
74 | int xxstrategy(), xxopen(), xxioctl(); | |
667c50a7 RE |
75 | |
76 | struct devsw devsw[] = { | |
75f313ad SL |
77 | { "XX", xxstrategy, xxopen, nullsys, xxioctl }, |
78 | { 0, 0, 0, 0, 0 } | |
667c50a7 | 79 | }; |