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