Tue Oct 8 07:33:15 2019 UTC ()
steal an idea from uwe@ and implement gcc-8 function type cast
friendly methods for sys/conf.h that needs it.

one alias per return type and first function are are needed,
though they can be stubbed to existing code.  the only cost is
the symbol itself, the codegen it the same.


(mrg)
diff -r1.47 -r1.48 src/sys/kern/kern_stub.c
diff -r1.152 -r1.153 src/sys/sys/conf.h

cvs diff -r1.47 -r1.48 src/sys/kern/kern_stub.c (switch to unified diff)

--- src/sys/kern/kern_stub.c 2019/01/27 02:55:26 1.47
+++ src/sys/kern/kern_stub.c 2019/10/08 07:33:15 1.48
@@ -1,320 +1,330 @@ @@ -1,320 +1,330 @@
1/* $NetBSD: kern_stub.c,v 1.47 2019/01/27 02:55:26 christos Exp $ */ 1/* $NetBSD: kern_stub.c,v 1.48 2019/10/08 07:33:15 mrg Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc. 4 * Copyright (c) 2007, 2008 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
15 * 15 *
16 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 16 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29/* 29/*
30 * Copyright (c) 1982, 1986, 1991, 1993 30 * Copyright (c) 1982, 1986, 1991, 1993
31 * The Regents of the University of California. All rights reserved. 31 * The Regents of the University of California. All rights reserved.
32 * 32 *
33 * Redistribution and use in source and binary forms, with or without 33 * Redistribution and use in source and binary forms, with or without
34 * modification, are permitted provided that the following conditions 34 * modification, are permitted provided that the following conditions
35 * are met: 35 * are met:
36 * 1. Redistributions of source code must retain the above copyright 36 * 1. Redistributions of source code must retain the above copyright
37 * notice, this list of conditions and the following disclaimer. 37 * notice, this list of conditions and the following disclaimer.
38 * 2. Redistributions in binary form must reproduce the above copyright 38 * 2. Redistributions in binary form must reproduce the above copyright
39 * notice, this list of conditions and the following disclaimer in the 39 * notice, this list of conditions and the following disclaimer in the
40 * documentation and/or other materials provided with the distribution. 40 * documentation and/or other materials provided with the distribution.
41 * 3. Neither the name of the University nor the names of its contributors 41 * 3. Neither the name of the University nor the names of its contributors
42 * may be used to endorse or promote products derived from this software 42 * may be used to endorse or promote products derived from this software
43 * without specific prior written permission. 43 * without specific prior written permission.
44 * 44 *
45 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 45 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
46 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 46 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
47 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 47 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
48 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 48 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
49 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 49 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
50 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 50 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
51 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 51 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 52 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
53 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 53 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
54 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 54 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
55 * SUCH DAMAGE. 55 * SUCH DAMAGE.
56 * 56 *
57 * @(#)subr_xxx.c 8.3 (Berkeley) 3/29/95 57 * @(#)subr_xxx.c 8.3 (Berkeley) 3/29/95
58 */ 58 */
59 59
60/* 60/*
61 * Stubs for system calls and facilities not included in the system. 61 * Stubs for system calls and facilities not included in the system.
62 */ 62 */
63 63
64#include <sys/cdefs.h> 64#include <sys/cdefs.h>
65__KERNEL_RCSID(0, "$NetBSD: kern_stub.c,v 1.47 2019/01/27 02:55:26 christos Exp $"); 65__KERNEL_RCSID(0, "$NetBSD: kern_stub.c,v 1.48 2019/10/08 07:33:15 mrg Exp $");
66 66
67#ifdef _KERNEL_OPT 67#ifdef _KERNEL_OPT
68#include "opt_ktrace.h" 68#include "opt_ktrace.h"
69#include "opt_sysv.h" 69#include "opt_sysv.h"
70#include "opt_modular.h" 70#include "opt_modular.h"
71#endif 71#endif
72 72
73#include <sys/param.h> 73#include <sys/param.h>
74#include <sys/kernel.h> 74#include <sys/kernel.h>
75#include <sys/proc.h> 75#include <sys/proc.h>
76#include <sys/fstypes.h> 76#include <sys/fstypes.h>
77#include <sys/signalvar.h> 77#include <sys/signalvar.h>
78#include <sys/syscall.h> 78#include <sys/syscall.h>
79#include <sys/ktrace.h> 79#include <sys/ktrace.h>
80#include <sys/intr.h> 80#include <sys/intr.h>
81#include <sys/cpu.h> 81#include <sys/cpu.h>
82#include <sys/module.h> 82#include <sys/module.h>
83#include <sys/bus.h> 83#include <sys/bus.h>
84#include <sys/userconf.h> 84#include <sys/userconf.h>
85 85
86bool default_bus_space_is_equal(bus_space_tag_t, bus_space_tag_t); 86bool default_bus_space_is_equal(bus_space_tag_t, bus_space_tag_t);
87bool default_bus_space_handle_is_equal(bus_space_tag_t, bus_space_handle_t, 87bool default_bus_space_handle_is_equal(bus_space_tag_t, bus_space_handle_t,
88 bus_space_handle_t); 88 bus_space_handle_t);
89 89
90/* 90/*
91 * SYSV Semaphores, Shared Memory, Message Queues 91 * SYSV Semaphores, Shared Memory, Message Queues
92 */ 92 */
93#ifndef MODULAR 93#ifndef MODULAR
94#ifndef SYSVMSG 94#ifndef SYSVMSG
95__strong_alias(msgctl1,enosys); 95__strong_alias(msgctl1,enosys);
96#endif 96#endif
97#ifndef SYSVSHM 97#ifndef SYSVSHM
98__strong_alias(shmctl1,enosys); 98__strong_alias(shmctl1,enosys);
99#endif 99#endif
100#ifndef SYSVSEM 100#ifndef SYSVSEM
101 __strong_alias(semctl1,enosys); 101 __strong_alias(semctl1,enosys);
102#endif 102#endif
103#endif 103#endif
104 104
105/* 105/*
106 * ktrace stubs. ktruser() goes to enosys as we want to fail the syscall, 106 * ktrace stubs. ktruser() goes to enosys as we want to fail the syscall,
107 * but not kill the process: utrace() is a debugging feature. 107 * but not kill the process: utrace() is a debugging feature.
108 */ 108 */
109#ifndef KTRACE 109#ifndef KTRACE
110__strong_alias(ktr_csw,nullop); /* Probes */ 110__strong_alias(ktr_csw,nullop); /* Probes */
111__strong_alias(ktr_emul,nullop); 111__strong_alias(ktr_emul,nullop);
112__strong_alias(ktr_geniov,nullop); 112__strong_alias(ktr_geniov,nullop);
113__strong_alias(ktr_genio,nullop); 113__strong_alias(ktr_genio,nullop);
114__strong_alias(ktr_mibio,nullop); 114__strong_alias(ktr_mibio,nullop);
115__strong_alias(ktr_namei,nullop); 115__strong_alias(ktr_namei,nullop);
116__strong_alias(ktr_namei2,nullop); 116__strong_alias(ktr_namei2,nullop);
117__strong_alias(ktr_psig,nullop); 117__strong_alias(ktr_psig,nullop);
118__strong_alias(ktr_syscall,nullop); 118__strong_alias(ktr_syscall,nullop);
119__strong_alias(ktr_sysret,nullop); 119__strong_alias(ktr_sysret,nullop);
120__strong_alias(ktr_kuser,nullop); 120__strong_alias(ktr_kuser,nullop);
121__strong_alias(ktr_mib,nullop); 121__strong_alias(ktr_mib,nullop);
122__strong_alias(ktr_execarg,nullop); 122__strong_alias(ktr_execarg,nullop);
123__strong_alias(ktr_execenv,nullop); 123__strong_alias(ktr_execenv,nullop);
124__strong_alias(ktr_execfd,nullop); 124__strong_alias(ktr_execfd,nullop);
125 125
126__strong_alias(sys_fktrace,sys_nosys); /* Syscalls */ 126__strong_alias(sys_fktrace,sys_nosys); /* Syscalls */
127__strong_alias(sys_ktrace,sys_nosys); 127__strong_alias(sys_ktrace,sys_nosys);
128__strong_alias(sys_utrace,sys_nosys); 128__strong_alias(sys_utrace,sys_nosys);
129 129
130int ktrace_on; /* Misc */ 130int ktrace_on; /* Misc */
131__strong_alias(ktruser,enosys); 131__strong_alias(ktruser,enosys);
132__strong_alias(ktr_point,nullop); 132__strong_alias(ktr_point,nullop);
133#endif /* KTRACE */ 133#endif /* KTRACE */
134 134
135__weak_alias(device_register, voidop); 135__weak_alias(device_register, voidop);
136__weak_alias(device_register_post_config, voidop); 136__weak_alias(device_register_post_config, voidop);
137__weak_alias(spldebug_start, voidop); 137__weak_alias(spldebug_start, voidop);
138__weak_alias(spldebug_stop, voidop); 138__weak_alias(spldebug_stop, voidop);
139__weak_alias(machdep_init,nullop); 139__weak_alias(machdep_init,nullop);
140__weak_alias(pci_chipset_tag_create, eopnotsupp); 140__weak_alias(pci_chipset_tag_create, eopnotsupp);
141__weak_alias(pci_chipset_tag_destroy, voidop); 141__weak_alias(pci_chipset_tag_destroy, voidop);
142__weak_alias(bus_space_reserve, eopnotsupp); 142__weak_alias(bus_space_reserve, eopnotsupp);
143__weak_alias(bus_space_reserve_subregion, eopnotsupp); 143__weak_alias(bus_space_reserve_subregion, eopnotsupp);
144__weak_alias(bus_space_release, voidop); 144__weak_alias(bus_space_release, voidop);
145__weak_alias(bus_space_reservation_map, eopnotsupp); 145__weak_alias(bus_space_reservation_map, eopnotsupp);
146__weak_alias(bus_space_reservation_unmap, voidop); 146__weak_alias(bus_space_reservation_unmap, voidop);
147__weak_alias(bus_dma_tag_create, eopnotsupp); 147__weak_alias(bus_dma_tag_create, eopnotsupp);
148__weak_alias(bus_dma_tag_destroy, voidop); 148__weak_alias(bus_dma_tag_destroy, voidop);
149__weak_alias(bus_space_tag_create, eopnotsupp); 149__weak_alias(bus_space_tag_create, eopnotsupp);
150__weak_alias(bus_space_tag_destroy, voidop); 150__weak_alias(bus_space_tag_destroy, voidop);
151__strict_weak_alias(bus_space_is_equal, default_bus_space_is_equal); 151__strict_weak_alias(bus_space_is_equal, default_bus_space_is_equal);
152__strict_weak_alias(bus_space_handle_is_equal, 152__strict_weak_alias(bus_space_handle_is_equal,
153 default_bus_space_handle_is_equal); 153 default_bus_space_handle_is_equal);
154__weak_alias(userconf_bootinfo, voidop); 154__weak_alias(userconf_bootinfo, voidop);
155__weak_alias(userconf_init, voidop); 155__weak_alias(userconf_init, voidop);
156__weak_alias(userconf_prompt, voidop); 156__weak_alias(userconf_prompt, voidop);
157 157
158__weak_alias(kobj_renamespace, nullop); 158__weak_alias(kobj_renamespace, nullop);
159 159
160__weak_alias(interrupt_get_count, nullop); 160__weak_alias(interrupt_get_count, nullop);
161__weak_alias(interrupt_get_assigned, voidop); 161__weak_alias(interrupt_get_assigned, voidop);
162__weak_alias(interrupt_get_available, voidop); 162__weak_alias(interrupt_get_available, voidop);
163__weak_alias(interrupt_get_devname, voidop); 163__weak_alias(interrupt_get_devname, voidop);
164__weak_alias(interrupt_construct_intrids, nullret); 164__weak_alias(interrupt_construct_intrids, nullret);
165__weak_alias(interrupt_destruct_intrids, voidop); 165__weak_alias(interrupt_destruct_intrids, voidop);
166__weak_alias(interrupt_distribute, eopnotsupp); 166__weak_alias(interrupt_distribute, eopnotsupp);
167__weak_alias(interrupt_distribute_handler, eopnotsupp); 167__weak_alias(interrupt_distribute_handler, eopnotsupp);
168 168
169/* 169/*
170 * Scheduler activations system calls. These need to remain until libc's 170 * Scheduler activations system calls. These need to remain until libc's
171 * major version is bumped. 171 * major version is bumped.
172 */ 172 */
173__strong_alias(sys_sa_register,sys_nosys); 173__strong_alias(sys_sa_register,sys_nosys);
174__strong_alias(sys_sa_stacks,sys_nosys); 174__strong_alias(sys_sa_stacks,sys_nosys);
175__strong_alias(sys_sa_enable,sys_nosys); 175__strong_alias(sys_sa_enable,sys_nosys);
176__strong_alias(sys_sa_setconcurrency,sys_nosys); 176__strong_alias(sys_sa_setconcurrency,sys_nosys);
177__strong_alias(sys_sa_yield,sys_nosys); 177__strong_alias(sys_sa_yield,sys_nosys);
178__strong_alias(sys_sa_preempt,sys_nosys); 178__strong_alias(sys_sa_preempt,sys_nosys);
179__strong_alias(sys_sa_unblockyield,sys_nosys); 179__strong_alias(sys_sa_unblockyield,sys_nosys);
180 180
181/* 181/*
182 * Stubs for compat_netbsd32. 182 * Stubs for compat_netbsd32.
183 */ 183 */
184__strong_alias(dosa_register,sys_nosys); 184__strong_alias(dosa_register,sys_nosys);
185__strong_alias(sa_stacks1,sys_nosys); 185__strong_alias(sa_stacks1,sys_nosys);
186 186
187/* 187/*
 188 * Stubs for drivers. See sys/conf.h.
 189 */
 190__strong_alias(devenodev,enodev);
 191__strong_alias(deveopnotsupp,eopnotsupp);
 192__strong_alias(devnullop,nullop);
 193__strong_alias(ttyenodev,enodev);
 194__strong_alias(ttyvenodev,voidop);
 195__strong_alias(ttyvnullop,nullop);
 196
 197/*
188 * Stubs for architectures that do not support kernel preemption. 198 * Stubs for architectures that do not support kernel preemption.
189 */ 199 */
190#ifndef __HAVE_PREEMPTION 200#ifndef __HAVE_PREEMPTION
191bool 201bool
192cpu_kpreempt_enter(uintptr_t where, int s) 202cpu_kpreempt_enter(uintptr_t where, int s)
193{ 203{
194 204
195 return false; 205 return false;
196} 206}
197 207
198void 208void
199cpu_kpreempt_exit(uintptr_t where) 209cpu_kpreempt_exit(uintptr_t where)
200{ 210{
201 211
202} 212}
203 213
204bool 214bool
205cpu_kpreempt_disabled(void) 215cpu_kpreempt_disabled(void)
206{ 216{
207 217
208 return true; 218 return true;
209} 219}
210#else 220#else
211# ifndef MULTIPROCESSOR 221# ifndef MULTIPROCESSOR
212# error __HAVE_PREEMPTION requires MULTIPROCESSOR 222# error __HAVE_PREEMPTION requires MULTIPROCESSOR
213# endif 223# endif
214#endif /* !__HAVE_PREEMPTION */ 224#endif /* !__HAVE_PREEMPTION */
215 225
216int 226int
217sys_nosys(struct lwp *l, const void *v, register_t *retval) 227sys_nosys(struct lwp *l, const void *v, register_t *retval)
218{ 228{
219 229
220 mutex_enter(proc_lock); 230 mutex_enter(proc_lock);
221 psignal(l->l_proc, SIGSYS); 231 psignal(l->l_proc, SIGSYS);
222 mutex_exit(proc_lock); 232 mutex_exit(proc_lock);
223 return ENOSYS; 233 return ENOSYS;
224} 234}
225 235
226/* 236/*
227 * Unsupported device function (e.g. writing to read-only device). 237 * Unsupported device function (e.g. writing to read-only device).
228 */ 238 */
229int 239int
230enodev(void) 240enodev(void)
231{ 241{
232 242
233 return (ENODEV); 243 return (ENODEV);
234} 244}
235 245
236/* 246/*
237 * Unconfigured device function; driver not configured. 247 * Unconfigured device function; driver not configured.
238 */ 248 */
239int 249int
240enxio(void) 250enxio(void)
241{ 251{
242 252
243 return (ENXIO); 253 return (ENXIO);
244} 254}
245 255
246/* 256/*
247 * Unsupported ioctl function. 257 * Unsupported ioctl function.
248 */ 258 */
249int 259int
250enoioctl(void) 260enoioctl(void)
251{ 261{
252 262
253 return (ENOTTY); 263 return (ENOTTY);
254} 264}
255 265
256/* 266/*
257 * Unsupported system function. 267 * Unsupported system function.
258 * This is used for an otherwise-reasonable operation 268 * This is used for an otherwise-reasonable operation
259 * that is not supported by the current system binary. 269 * that is not supported by the current system binary.
260 */ 270 */
261int 271int
262enosys(void) 272enosys(void)
263{ 273{
264 274
265 return (ENOSYS); 275 return (ENOSYS);
266} 276}
267 277
268/* 278/*
269 * Return error for operation not supported 279 * Return error for operation not supported
270 * on a specific object or file type. 280 * on a specific object or file type.
271 */ 281 */
272int 282int
273eopnotsupp(void) 283eopnotsupp(void)
274{ 284{
275 285
276 return (EOPNOTSUPP); 286 return (EOPNOTSUPP);
277} 287}
278 288
279/* 289/*
280 * Generic null operation, void return value. 290 * Generic null operation, void return value.
281 */ 291 */
282void 292void
283voidop(void) 293voidop(void)
284{ 294{
285} 295}
286 296
287/* 297/*
288 * Generic null operation, always returns success. 298 * Generic null operation, always returns success.
289 */ 299 */
290int 300int
291nullop(void *v) 301nullop(void *v)
292{ 302{
293 303
294 return (0); 304 return (0);
295} 305}
296 306
297/* 307/*
298 * Generic null operation, always returns null. 308 * Generic null operation, always returns null.
299 */ 309 */
300void * 310void *
301nullret(void) 311nullret(void)
302{ 312{
303 313
304 return (NULL); 314 return (NULL);
305} 315}
306 316
307bool 317bool
308default_bus_space_handle_is_equal(bus_space_tag_t t, 318default_bus_space_handle_is_equal(bus_space_tag_t t,
309 bus_space_handle_t h1, bus_space_handle_t h2) 319 bus_space_handle_t h1, bus_space_handle_t h2)
310{ 320{
311 321
312 return memcmp(&h1, &h2, sizeof(h1)) == 0; 322 return memcmp(&h1, &h2, sizeof(h1)) == 0;
313} 323}
314 324
315bool 325bool
316default_bus_space_is_equal(bus_space_tag_t t1, bus_space_tag_t t2) 326default_bus_space_is_equal(bus_space_tag_t t1, bus_space_tag_t t2)
317{ 327{
318 328
319 return memcmp(&t1, &t2, sizeof(t1)) == 0; 329 return memcmp(&t1, &t2, sizeof(t1)) == 0;
320} 330}

cvs diff -r1.152 -r1.153 src/sys/sys/conf.h (switch to unified diff)

--- src/sys/sys/conf.h 2019/10/08 07:16:25 1.152
+++ src/sys/sys/conf.h 2019/10/08 07:33:14 1.153
@@ -1,282 +1,289 @@ @@ -1,282 +1,289 @@
1/* $NetBSD: conf.h,v 1.152 2019/10/08 07:16:25 mrg Exp $ */ 1/* $NetBSD: conf.h,v 1.153 2019/10/08 07:33:14 mrg 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:
15 * 1. Redistributions of source code must retain the above copyright 15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer. 16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright 17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the 18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution. 19 * documentation and/or other materials provided with the distribution.
20 * 3. Neither the name of the University nor the names of its contributors 20 * 3. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software 21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission. 22 * without specific prior written permission.
23 * 23 *
24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
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> 46#include <sys/queue.h>
47#include <sys/device_if.h> 47#include <sys/device_if.h>
48 48
49struct buf; 49struct buf;
50struct knote; 50struct knote;
51struct lwp; 51struct lwp;
52struct tty; 52struct tty;
53struct uio; 53struct uio;
54struct vnode; 54struct vnode;
55 55
56/* 56/*
57 * Types for d_flag 57 * Types for d_flag
58 */ 58 */
59#define D_OTHER 0x0000 59#define D_OTHER 0x0000
60#define D_TAPE 0x0001 60#define D_TAPE 0x0001
61#define D_DISK 0x0002 61#define D_DISK 0x0002
62#define D_TTY 0x0003 62#define D_TTY 0x0003
63#define D_TYPEMASK 0x00ff 63#define D_TYPEMASK 0x00ff
64#define D_MPSAFE 0x0100 64#define D_MPSAFE 0x0100
65#define D_NEGOFFSAFE 0x0200 65#define D_NEGOFFSAFE 0x0200
66#define D_MCLOSE 0x0400 66#define D_MCLOSE 0x0400
67 67
68/* 68/*
69 * Block device switch table 69 * Block device switch table
70 */ 70 */
71struct bdevsw { 71struct bdevsw {
72 int (*d_open)(dev_t, int, int, struct lwp *); 72 int (*d_open)(dev_t, int, int, struct lwp *);
73 int (*d_close)(dev_t, int, int, struct lwp *); 73 int (*d_close)(dev_t, int, int, struct lwp *);
74 void (*d_strategy)(struct buf *); 74 void (*d_strategy)(struct buf *);
75 int (*d_ioctl)(dev_t, u_long, void *, int, struct lwp *); 75 int (*d_ioctl)(dev_t, u_long, void *, int, struct lwp *);
76 int (*d_dump)(dev_t, daddr_t, void *, size_t); 76 int (*d_dump)(dev_t, daddr_t, void *, size_t);
77 int (*d_psize)(dev_t); 77 int (*d_psize)(dev_t);
78 int (*d_discard)(dev_t, off_t, off_t); 78 int (*d_discard)(dev_t, off_t, off_t);
79 int d_flag; 79 int d_flag;
80}; 80};
81 81
82/* 82/*
83 * Character device switch table 83 * Character device switch table
84 */ 84 */
85struct cdevsw { 85struct cdevsw {
86 int (*d_open)(dev_t, int, int, struct lwp *); 86 int (*d_open)(dev_t, int, int, struct lwp *);
87 int (*d_close)(dev_t, int, int, struct lwp *); 87 int (*d_close)(dev_t, int, int, struct lwp *);
88 int (*d_read)(dev_t, struct uio *, int); 88 int (*d_read)(dev_t, struct uio *, int);
89 int (*d_write)(dev_t, struct uio *, int); 89 int (*d_write)(dev_t, struct uio *, int);
90 int (*d_ioctl)(dev_t, u_long, void *, int, struct lwp *); 90 int (*d_ioctl)(dev_t, u_long, void *, int, struct lwp *);
91 void (*d_stop)(struct tty *, int); 91 void (*d_stop)(struct tty *, int);
92 struct tty * (*d_tty)(dev_t); 92 struct tty * (*d_tty)(dev_t);
93 int (*d_poll)(dev_t, int, struct lwp *); 93 int (*d_poll)(dev_t, int, struct lwp *);
94 paddr_t (*d_mmap)(dev_t, off_t, int); 94 paddr_t (*d_mmap)(dev_t, off_t, int);
95 int (*d_kqfilter)(dev_t, struct knote *); 95 int (*d_kqfilter)(dev_t, struct knote *);
96 int (*d_discard)(dev_t, off_t, off_t); 96 int (*d_discard)(dev_t, off_t, off_t);
97 int d_flag; 97 int d_flag;
98}; 98};
99 99
100#ifdef _KERNEL 100#ifdef _KERNEL
101 101
102#include <sys/mutex.h> 102#include <sys/mutex.h>
103extern kmutex_t device_lock; 103extern kmutex_t device_lock;
104 104
105int devsw_attach(const char *, const struct bdevsw *, devmajor_t *, 105int devsw_attach(const char *, const struct bdevsw *, devmajor_t *,
106 const struct cdevsw *, devmajor_t *); 106 const struct cdevsw *, devmajor_t *);
107int devsw_detach(const struct bdevsw *, const struct cdevsw *); 107int devsw_detach(const struct bdevsw *, const struct cdevsw *);
108const struct bdevsw *bdevsw_lookup(dev_t); 108const struct bdevsw *bdevsw_lookup(dev_t);
109const struct cdevsw *cdevsw_lookup(dev_t); 109const struct cdevsw *cdevsw_lookup(dev_t);
110devmajor_t bdevsw_lookup_major(const struct bdevsw *); 110devmajor_t bdevsw_lookup_major(const struct bdevsw *);
111devmajor_t cdevsw_lookup_major(const struct cdevsw *); 111devmajor_t cdevsw_lookup_major(const struct cdevsw *);
112 112
113#define dev_type_open(n) int n (dev_t, int, int, struct lwp *) 113#define dev_type_open(n) int n (dev_t, int, int, struct lwp *)
114#define dev_type_close(n) int n (dev_t, int, int, struct lwp *) 114#define dev_type_close(n) int n (dev_t, int, int, struct lwp *)
115#define dev_type_read(n) int n (dev_t, struct uio *, int) 115#define dev_type_read(n) int n (dev_t, struct uio *, int)
116#define dev_type_write(n) int n (dev_t, struct uio *, int) 116#define dev_type_write(n) int n (dev_t, struct uio *, int)
117#define dev_type_ioctl(n) \ 117#define dev_type_ioctl(n) \
118 int n (dev_t, u_long, void *, int, struct lwp *) 118 int n (dev_t, u_long, void *, int, struct lwp *)
119#define dev_type_stop(n) void n (struct tty *, int) 119#define dev_type_stop(n) void n (struct tty *, int)
120#define dev_type_tty(n) struct tty * n (dev_t) 120#define dev_type_tty(n) struct tty * n (dev_t)
121#define dev_type_poll(n) int n (dev_t, int, struct lwp *) 121#define dev_type_poll(n) int n (dev_t, int, struct lwp *)
122#define dev_type_mmap(n) paddr_t n (dev_t, off_t, int) 122#define dev_type_mmap(n) paddr_t n (dev_t, off_t, int)
123#define dev_type_strategy(n) void n (struct buf *) 123#define dev_type_strategy(n) void n (struct buf *)
124#define dev_type_dump(n) int n (dev_t, daddr_t, void *, size_t) 124#define dev_type_dump(n) int n (dev_t, daddr_t, void *, size_t)
125#define dev_type_size(n) int n (dev_t) 125#define dev_type_size(n) int n (dev_t)
126#define dev_type_kqfilter(n) int n (dev_t, struct knote *) 126#define dev_type_kqfilter(n) int n (dev_t, struct knote *)
127#define dev_type_discard(n) int n (dev_t, off_t, off_t) 127#define dev_type_discard(n) int n (dev_t, off_t, off_t)
128 128
129#define noopen ((dev_type_open((*)))enodev) 129int devenodev(dev_t, ...);
130#define noclose ((dev_type_close((*)))enodev) 130int deveopnotsupp(dev_t, ...);
131#define noread ((dev_type_read((*)))enodev) 131int devnullop(dev_t, ...);
132#define nowrite ((dev_type_write((*)))enodev) 132int ttyenodev(struct tty *, ...);
133#define noioctl ((dev_type_ioctl((*)))enodev) 133void ttyvenodev(struct tty *, ...);
134#define nostop ((dev_type_stop((*)))enodev) 134void ttyvnullop(struct tty *, ...);
 135
 136#define noopen ((dev_type_open((*)))devenodev)
 137#define noclose ((dev_type_close((*)))devenodev)
 138#define noread ((dev_type_read((*)))devenodev)
 139#define nowrite ((dev_type_write((*)))devenodev)
 140#define noioctl ((dev_type_ioctl((*)))devenodev)
 141#define nostop ((dev_type_stop((*)))ttyvenodev)
135#define notty NULL 142#define notty NULL
136#define nopoll seltrue 143#define nopoll seltrue
137paddr_t nommap(dev_t, off_t, int); 144paddr_t nommap(dev_t, off_t, int);
138#define nodump ((dev_type_dump((*)))enodev) 145#define nodump ((dev_type_dump((*)))devenodev)
139#define nosize NULL 146#define nosize NULL
140#define nokqfilter seltrue_kqfilter 147#define nokqfilter seltrue_kqfilter
141#define nodiscard ((dev_type_discard((*)))enodev) 148#define nodiscard ((dev_type_discard((*)))devenodev)
142 149
143#define nullopen ((dev_type_open((*)))nullop) 150#define nullopen ((dev_type_open((*)))devnullop)
144#define nullclose ((dev_type_close((*)))nullop) 151#define nullclose ((dev_type_close((*)))devnullop)
145#define nullread ((dev_type_read((*)))nullop) 152#define nullread ((dev_type_read((*)))devnullop)
146#define nullwrite ((dev_type_write((*)))nullop) 153#define nullwrite ((dev_type_write((*)))devnullop)
147#define nullioctl ((dev_type_ioctl((*)))nullop) 154#define nullioctl ((dev_type_ioctl((*)))devnullop)
148#define nullstop ((dev_type_stop((*)))nullop) 155#define nullstop ((dev_type_stop((*)))ttyvnullop)
149#define nullpoll ((dev_type_poll((*)))nullop) 156#define nullpoll ((dev_type_poll((*)))devnullop)
150#define nulldump ((dev_type_dump((*)))nullop) 157#define nulldump ((dev_type_dump((*)))devnullop)
151#define nullkqfilter ((dev_type_kqfilter((*)))eopnotsupp) 158#define nullkqfilter ((dev_type_kqfilter((*)))deveopnotsupp)
152#define nulldiscard ((dev_type_discard((*)))nullop) 159#define nulldiscard ((dev_type_discard((*)))devnullop)
153 160
154/* device access wrappers. */ 161/* device access wrappers. */
155 162
156dev_type_open(bdev_open); 163dev_type_open(bdev_open);
157dev_type_close(bdev_close); 164dev_type_close(bdev_close);
158dev_type_strategy(bdev_strategy); 165dev_type_strategy(bdev_strategy);
159dev_type_ioctl(bdev_ioctl); 166dev_type_ioctl(bdev_ioctl);
160dev_type_dump(bdev_dump); 167dev_type_dump(bdev_dump);
161dev_type_size(bdev_size); 168dev_type_size(bdev_size);
162dev_type_discard(bdev_discard); 169dev_type_discard(bdev_discard);
163 170
164dev_type_open(cdev_open); 171dev_type_open(cdev_open);
165dev_type_close(cdev_close); 172dev_type_close(cdev_close);
166dev_type_read(cdev_read); 173dev_type_read(cdev_read);
167dev_type_write(cdev_write); 174dev_type_write(cdev_write);
168dev_type_ioctl(cdev_ioctl); 175dev_type_ioctl(cdev_ioctl);
169dev_type_stop(cdev_stop); 176dev_type_stop(cdev_stop);
170dev_type_tty(cdev_tty); 177dev_type_tty(cdev_tty);
171dev_type_poll(cdev_poll); 178dev_type_poll(cdev_poll);
172dev_type_mmap(cdev_mmap); 179dev_type_mmap(cdev_mmap);
173dev_type_kqfilter(cdev_kqfilter); 180dev_type_kqfilter(cdev_kqfilter);
174dev_type_discard(cdev_discard); 181dev_type_discard(cdev_discard);
175 182
176int cdev_type(dev_t); 183int cdev_type(dev_t);
177int cdev_flags(dev_t); 184int cdev_flags(dev_t);
178int bdev_type(dev_t); 185int bdev_type(dev_t);
179int bdev_flags(dev_t); 186int bdev_flags(dev_t);
180 187
181/* symbolic sleep message strings */ 188/* symbolic sleep message strings */
182extern const char devopn[], devio[], devwait[], devin[], devout[]; 189extern const char devopn[], devio[], devwait[], devin[], devout[];
183extern const char devioc[], devcls[]; 190extern const char devioc[], devcls[];
184 191
185#endif /* _KERNEL */ 192#endif /* _KERNEL */
186 193
187/* 194/*
188 * Line discipline switch table 195 * Line discipline switch table
189 */ 196 */
190struct linesw { 197struct linesw {
191 const char *l_name; /* Linesw name */ 198 const char *l_name; /* Linesw name */
192 199
193 LIST_ENTRY(linesw) l_list; 200 LIST_ENTRY(linesw) l_list;
194 u_int l_refcnt; /* locked by ttyldisc_list_slock */ 201 u_int l_refcnt; /* locked by ttyldisc_list_slock */
195 int l_no; /* legacy discipline number (for TIOCGETD) */ 202 int l_no; /* legacy discipline number (for TIOCGETD) */
196 203
197 int (*l_open) (dev_t, struct tty *); 204 int (*l_open) (dev_t, struct tty *);
198 int (*l_close) (struct tty *, int); 205 int (*l_close) (struct tty *, int);
199 int (*l_read) (struct tty *, struct uio *, int); 206 int (*l_read) (struct tty *, struct uio *, int);
200 int (*l_write) (struct tty *, struct uio *, int); 207 int (*l_write) (struct tty *, struct uio *, int);
201 int (*l_ioctl) (struct tty *, u_long, void *, int, 208 int (*l_ioctl) (struct tty *, u_long, void *, int,
202 struct lwp *); 209 struct lwp *);
203 int (*l_rint) (int, struct tty *); 210 int (*l_rint) (int, struct tty *);
204 int (*l_start) (struct tty *); 211 int (*l_start) (struct tty *);
205 int (*l_modem) (struct tty *, int); 212 int (*l_modem) (struct tty *, int);
206 int (*l_poll) (struct tty *, int, struct lwp *); 213 int (*l_poll) (struct tty *, int, struct lwp *);
207}; 214};
208 215
209#ifdef _KERNEL 216#ifdef _KERNEL
210void ttyldisc_init(void); 217void ttyldisc_init(void);
211int ttyldisc_attach(struct linesw *); 218int ttyldisc_attach(struct linesw *);
212int ttyldisc_detach(struct linesw *); 219int ttyldisc_detach(struct linesw *);
213struct linesw *ttyldisc_lookup(const char *); 220struct linesw *ttyldisc_lookup(const char *);
214struct linesw *ttyldisc_lookup_bynum(int); 221struct linesw *ttyldisc_lookup_bynum(int);
215struct linesw *ttyldisc_default(void); 222struct linesw *ttyldisc_default(void);
216void ttyldisc_release(struct linesw *); 223void ttyldisc_release(struct linesw *);
217 224
218/* For those defining their own line disciplines: */ 225/* For those defining their own line disciplines: */
219#define ttynodisc ((int (*)(dev_t, struct tty *))enodev) 226#define ttynodisc ((int (*)(dev_t, struct tty *))enodev)
220#define ttyerrclose ((int (*)(struct tty *, int))enodev) 227#define ttyerrclose ((int (*)(struct tty *, int))enodev)
221#define ttyerrio ((int (*)(struct tty *, struct uio *, int))enodev) 228#define ttyerrio ((int (*)(struct tty *, struct uio *, int))enodev)
222#define ttyerrstart ((int (*)(struct tty *))enodev) 229#define ttyerrstart ((int (*)(struct tty *))enodev)
223 230
224int ttyerrpoll (struct tty *, int, struct lwp *); 231int ttyerrpoll (struct tty *, int, struct lwp *);
225int ttynullioctl(struct tty *, u_long, void *, int, struct lwp *); 232int ttynullioctl(struct tty *, u_long, void *, int, struct lwp *);
226 233
227int iskmemdev(dev_t); 234int iskmemdev(dev_t);
228int seltrue_kqfilter(dev_t, struct knote *); 235int seltrue_kqfilter(dev_t, struct knote *);
229#endif 236#endif
230 237
231#ifdef _KERNEL 238#ifdef _KERNEL
232 239
233#define DEV_MEM 0 /* minor device 0 is physical memory */ 240#define DEV_MEM 0 /* minor device 0 is physical memory */
234#define DEV_KMEM 1 /* minor device 1 is kernel memory */ 241#define DEV_KMEM 1 /* minor device 1 is kernel memory */
235#define DEV_NULL 2 /* minor device 2 is EOF/rathole */ 242#define DEV_NULL 2 /* minor device 2 is EOF/rathole */
236#ifdef COMPAT_16 243#ifdef COMPAT_16
237#define _DEV_ZERO_oARM 3 /* reserved: old ARM /dev/zero minor */ 244#define _DEV_ZERO_oARM 3 /* reserved: old ARM /dev/zero minor */
238#endif 245#endif
239#define DEV_FULL 11 /* minor device 11 is '\0'/ENOSPC */ 246#define DEV_FULL 11 /* minor device 11 is '\0'/ENOSPC */
240#define DEV_ZERO 12 /* minor device 12 is '\0'/rathole */ 247#define DEV_ZERO 12 /* minor device 12 is '\0'/rathole */
241 248
242enum devnode_class { 249enum devnode_class {
243 DEVNODE_DONTBOTHER, 250 DEVNODE_DONTBOTHER,
244 DEVNODE_SINGLE, 251 DEVNODE_SINGLE,
245 DEVNODE_VECTOR, 252 DEVNODE_VECTOR,
246}; 253};
247#define DEVNODE_FLAG_LINKZERO 0x01 /* create name -> name0 link */ 254#define DEVNODE_FLAG_LINKZERO 0x01 /* create name -> name0 link */
248#define DEVNODE_FLAG_ISMINOR0 0x02 /* vector[0] specifies minor */ 255#define DEVNODE_FLAG_ISMINOR0 0x02 /* vector[0] specifies minor */
249#ifdef notyet 256#ifdef notyet
250#define DEVNODE_FLAG_ISMINOR1 0x04 /* vector[1] specifies starting minor */ 257#define DEVNODE_FLAG_ISMINOR1 0x04 /* vector[1] specifies starting minor */
251#endif 258#endif
252 259
253struct devsw_conv { 260struct devsw_conv {
254 const char *d_name; 261 const char *d_name;
255 devmajor_t d_bmajor; 262 devmajor_t d_bmajor;
256 devmajor_t d_cmajor; 263 devmajor_t d_cmajor;
257 264
258 /* information about /dev nodes related to the device */ 265 /* information about /dev nodes related to the device */
259 enum devnode_class d_class; 266 enum devnode_class d_class;
260 int d_flags; 267 int d_flags;
261 int d_vectdim[2]; 268 int d_vectdim[2];
262}; 269};
263 270
264void devsw_init(void); 271void devsw_init(void);
265const char *devsw_blk2name(devmajor_t); 272const char *devsw_blk2name(devmajor_t);
266const char *cdevsw_getname(devmajor_t); 273const char *cdevsw_getname(devmajor_t);
267const char *bdevsw_getname(devmajor_t); 274const char *bdevsw_getname(devmajor_t);
268devmajor_t devsw_name2blk(const char *, char *, size_t); 275devmajor_t devsw_name2blk(const char *, char *, size_t);
269devmajor_t devsw_name2chr(const char *, char *, size_t); 276devmajor_t devsw_name2chr(const char *, char *, size_t);
270dev_t devsw_chr2blk(dev_t); 277dev_t devsw_chr2blk(dev_t);
271dev_t devsw_blk2chr(dev_t); 278dev_t devsw_blk2chr(dev_t);
272 279
273void mm_init(void); 280void mm_init(void);
274#endif /* _KERNEL */ 281#endif /* _KERNEL */
275 282
276#ifdef _KERNEL 283#ifdef _KERNEL
277void setroot(device_t, int); 284void setroot(device_t, int);
278void rootconf(void); 285void rootconf(void);
279void swapconf(void); 286void swapconf(void);
280#endif /* _KERNEL */ 287#endif /* _KERNEL */
281 288
282#endif /* !_SYS_CONF_H_ */ 289#endif /* !_SYS_CONF_H_ */