| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: conf.h,v 1.161 2022/03/28 12:39:18 riastradh Exp $ */ | | 1 | /* $NetBSD: conf.h,v 1.162 2024/04/17 18:01:29 riastradh Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1990, 1993 | | 4 | * Copyright (c) 1990, 1993 |
5 | * The Regents of the University of California. All rights reserved. | | 5 | * The Regents of the University of California. All rights reserved. |
6 | * (c) UNIX System Laboratories, Inc. | | 6 | * (c) UNIX System Laboratories, Inc. |
7 | * All or some portions of this file are derived from material licensed | | 7 | * All or some portions of this file are derived from material licensed |
8 | * to the University of California by American Telephone and Telegraph | | 8 | * to the University of California by American Telephone and Telegraph |
9 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with | | 9 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with |
10 | * the permission of UNIX System Laboratories, Inc. | | 10 | * the permission of UNIX System Laboratories, Inc. |
11 | * | | 11 | * |
12 | * Redistribution and use in source and binary forms, with or without | | 12 | * Redistribution and use in source and binary forms, with or without |
13 | * modification, are permitted provided that the following conditions | | 13 | * modification, are permitted provided that the following conditions |
14 | * are met: | | 14 | * are met: |
| @@ -33,28 +33,29 @@ | | | @@ -33,28 +33,29 @@ |
33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
34 | * SUCH DAMAGE. | | 34 | * SUCH DAMAGE. |
35 | * | | 35 | * |
36 | * @(#)conf.h 8.5 (Berkeley) 1/9/95 | | 36 | * @(#)conf.h 8.5 (Berkeley) 1/9/95 |
37 | */ | | 37 | */ |
38 | | | 38 | |
39 | #ifndef _SYS_CONF_H_ | | 39 | #ifndef _SYS_CONF_H_ |
40 | #define _SYS_CONF_H_ | | 40 | #define _SYS_CONF_H_ |
41 | | | 41 | |
42 | /* | | 42 | /* |
43 | * Definitions of device driver entry switches | | 43 | * Definitions of device driver entry switches |
44 | */ | | 44 | */ |
45 | | | 45 | |
46 | #include <sys/queue.h> | | | |
47 | #include <sys/device_if.h> | | 46 | #include <sys/device_if.h> |
| | | 47 | #include <sys/queue.h> |
| | | 48 | #include <sys/types.h> |
48 | | | 49 | |
49 | struct buf; | | 50 | struct buf; |
50 | struct knote; | | 51 | struct knote; |
51 | struct lwp; | | 52 | struct lwp; |
52 | struct tty; | | 53 | struct tty; |
53 | struct uio; | | 54 | struct uio; |
54 | struct vnode; | | 55 | struct vnode; |
55 | | | 56 | |
56 | /* | | 57 | /* |
57 | * Types for d_flag | | 58 | * Types for d_flag |
58 | */ | | 59 | */ |
59 | #define D_OTHER 0x0000 | | 60 | #define D_OTHER 0x0000 |
60 | #define D_TAPE 0x0001 | | 61 | #define D_TAPE 0x0001 |
| @@ -99,27 +100,27 @@ struct cdevsw { | | | @@ -99,27 +100,27 @@ struct cdevsw { |
99 | int (*d_kqfilter)(dev_t, struct knote *); | | 100 | int (*d_kqfilter)(dev_t, struct knote *); |
100 | int (*d_discard)(dev_t, off_t, off_t); | | 101 | int (*d_discard)(dev_t, off_t, off_t); |
101 | int (*d_devtounit)(dev_t); | | 102 | int (*d_devtounit)(dev_t); |
102 | struct cfdriver *d_cfdriver; | | 103 | struct cfdriver *d_cfdriver; |
103 | int d_flag; | | 104 | int d_flag; |
104 | }; | | 105 | }; |
105 | | | 106 | |
106 | #ifdef _KERNEL | | 107 | #ifdef _KERNEL |
107 | | | 108 | |
108 | #include <sys/mutex.h> | | 109 | #include <sys/mutex.h> |
109 | extern kmutex_t device_lock; | | 110 | extern kmutex_t device_lock; |
110 | | | 111 | |
111 | int devsw_attach(const char *, const struct bdevsw *, devmajor_t *, | | 112 | int devsw_attach(const char *, const struct bdevsw *, devmajor_t *, |
112 | const struct cdevsw *, devmajor_t *); | | 113 | const struct cdevsw *, devmajor_t *); |
113 | void devsw_detach(const struct bdevsw *, const struct cdevsw *); | | 114 | void devsw_detach(const struct bdevsw *, const struct cdevsw *); |
114 | const struct bdevsw *bdevsw_lookup(dev_t); | | 115 | const struct bdevsw *bdevsw_lookup(dev_t); |
115 | const struct cdevsw *cdevsw_lookup(dev_t); | | 116 | const struct cdevsw *cdevsw_lookup(dev_t); |
116 | devmajor_t bdevsw_lookup_major(const struct bdevsw *); | | 117 | devmajor_t bdevsw_lookup_major(const struct bdevsw *); |
117 | devmajor_t cdevsw_lookup_major(const struct cdevsw *); | | 118 | devmajor_t cdevsw_lookup_major(const struct cdevsw *); |
118 | | | 119 | |
119 | typedef int dev_open_t(dev_t, int, int, struct lwp *); | | 120 | typedef int dev_open_t(dev_t, int, int, struct lwp *); |
120 | typedef int dev_cancel_t(dev_t, int, int, struct lwp *); | | 121 | typedef int dev_cancel_t(dev_t, int, int, struct lwp *); |
121 | typedef int dev_close_t(dev_t, int, int, struct lwp *); | | 122 | typedef int dev_close_t(dev_t, int, int, struct lwp *); |
122 | typedef int dev_read_t(dev_t, struct uio *, int); | | 123 | typedef int dev_read_t(dev_t, struct uio *, int); |
123 | typedef int dev_write_t(dev_t, struct uio *, int); | | 124 | typedef int dev_write_t(dev_t, struct uio *, int); |
124 | typedef int dev_ioctl_t(dev_t, u_long, void *, int, struct lwp *); | | 125 | typedef int dev_ioctl_t(dev_t, u_long, void *, int, struct lwp *); |
125 | typedef void dev_stop_t(struct tty *, int); | | 126 | typedef void dev_stop_t(struct tty *, int); |