Merge commit 'fdfb62c8fbf6e03ca943243b626360bede206f18'
[unleashed.git] / arch / x86 / kernel / ml / modstubs.s
blob6379499eeb52d5448249613c0888b77a99074753
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 2017, Joyent, Inc. All rights reserved.
27 #include <sys/asm_linkage.h>
30 #include "assym.h"
32 #define STRINGIFY(x) #x
35 * !!!!!!!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!!!!!!
37 * For functions which are either STUBs or WSTUBs the actual function
38 * need to be called using 'call' instruction because of preamble and
39 * postamble (i.e mod_hold_stub and mod_release_stub) around the
40 * function call. Due to this we need to copy arguments for the
41 * real function. On Intel we can't tell how many arguments are there
42 * on the stack so we have to either copy everything between esp and
43 * ebp or copy only a fixed number (MAXNARG - defined here) for
44 * all the stub functions. Currently we are using MAXNARG (it is a kludge
45 * but worth it?!).
47 * NOTE: Use NO_UNLOAD_STUBs if the module is NOT unloadable once it is
48 * loaded.
50 #define MAXNARG 10
53 * WARNING: there is no check for forgetting to write END_MODULE,
54 * and if you do, the kernel will most likely crash. Be careful
56 * This file assumes that all of the contributions to the data segment
57 * will be contiguous in the output file, even though they are separated
58 * by pieces of text. This is safe for all assemblers I know of now...
62 * This file uses ansi preprocessor features:
64 * 1. #define mac(a) extra_ ## a --> mac(x) expands to extra_x
66 * 2. #define mac(a) #a --> mac(x) expands to "x"
70 * This file contains the stubs routines for modules which can be autoloaded.
73 #if defined(__amd64)
76 * See the 'struct mod_modinfo' definition to see what this declaration
77 * is trying to achieve here.
79 #define MODULE(module,namespace) \
80 .data; \
81 module##_modname: \
82 .string STRINGIFY(namespace/module); \
83 SET_SIZE(module##_modname); \
84 .align CPTRSIZE; \
85 .globl module##_modinfo; \
86 .type module##_modinfo, @object; \
87 module##_modinfo: \
88 .quad module##_modname; \
89 .quad 0 /* storage for modctl pointer */
91 /* then mod_stub_info structures follow until a mods_func_adr is 0 */
93 /* this puts a 0 where the next mods_func_adr would be */
94 #define END_MODULE(module) \
95 .data; \
96 .align CPTRSIZE; \
97 .quad 0; \
98 SET_SIZE(module##_modinfo)
101 * The data section in the stub_common macro is the
102 * mod_stub_info structure for the stub function
105 #define STUB_COMMON(module, fcnname, install_fcn, retfcn, weak) \
106 ENTRY(fcnname); \
107 leaq fcnname##_info(%rip), %rax; \
108 cmpl $0, MODS_FLAG(%rax); /* weak? */ \
109 je stubs_common_code; /* not weak */ \
110 testb $MODS_INSTALLED, MODS_FLAG(%rax); /* installed? */ \
111 jne stubs_common_code; /* yes, do the mod_hold */ \
112 jmp *MODS_RETFCN(%rax); /* no, jump to retfcn */ \
113 SET_SIZE(fcnname); \
114 .data; \
115 .align CPTRSIZE; \
116 .type fcnname##_info, @object; \
117 fcnname##_info: \
118 .quad install_fcn; /* 0 */ \
119 .quad module##_modinfo; /* 0x8 */ \
120 .quad fcnname; /* 0x10 */ \
121 .quad retfcn; /* 0x18 */ \
122 .long weak; /* 0x20 */ \
123 SET_SIZE(fcnname##_info)
125 #define STUB_NO_UNLOADABLE(module, fcnname, install_fcn, retfcn, weak) \
126 ENTRY(fcnname); \
127 leaq fcnname##_info(%rip), %rax; \
128 testb $MODS_INSTALLED, MODS_FLAG(%rax); /* installed? */ \
129 je 5f; /* no */ \
130 jmp *(%rax); /* yes, jump to install_fcn */ \
131 5: testb $MODS_WEAK, MODS_FLAG(%rax); /* weak? */ \
132 je stubs_common_code; /* no, do mod load */ \
133 jmp *MODS_RETFCN(%rax); /* yes, jump to retfcn */ \
134 SET_SIZE(fcnname); \
135 .data; \
136 .align CPTRSIZE; \
137 .type fcnname##_info, @object; \
138 fcnname##_info: \
139 .quad install_fcn; /* 0 */ \
140 .quad module##_modinfo; /* 0x8 */ \
141 .quad fcnname; /* 0x10 */ \
142 .quad retfcn; /* 0x18 */ \
143 .long weak; /* 0x20 */ \
144 SET_SIZE(fcnname##_info)
147 * We branch here with the fcnname_info pointer in %rax
149 ENTRY_NP(stubs_common_code)
150 .globl mod_hold_stub
151 .globl mod_release_stub
152 pushq %rbp
153 movq %rsp, %rbp
154 subq $0x10, %rsp
155 movq %r15, (%rsp) /* (caller saved) */
156 movq %rax, %r15 /* stash the fcnname_info pointer */
158 * save incoming register arguments
160 pushq %rdi
161 pushq %rsi
162 pushq %rdx
163 pushq %rcx
164 pushq %r8
165 pushq %r9
166 /* (next 4 args, if any, are already on the stack above %rbp) */
167 movq %r15, %rdi
168 call mod_hold_stub /* mod_hold_stub(mod_stub_info *) */
169 cmpl $-1, %eax /* error? */
170 jne .L1
171 movq 0x18(%r15), %rax
172 call *%rax
173 addq $0x30, %rsp
174 jmp .L2
175 .L1:
177 * copy MAXNARG == 10 incoming arguments
179 popq %r9
180 popq %r8
181 popq %rcx
182 popq %rdx
183 popq %rsi
184 popq %rdi
186 * stack:
187 * arg9 0x38(%rsp)
188 * arg8 0x30(%rsp)
189 * arg7 0x28(%rsp)
190 * arg6 0x20(%rsp)
191 * saved %rip 0x18(%rsp)
192 * saved %rbp 0x10(%rsp)
193 * <pad> 0x8(%rsp)
194 * saved %r15 0x0(%rsp)
196 movl $MAXNARG - 6 + 3, %r11d
197 pushq (%rsp, %r11, 8)
198 pushq (%rsp, %r11, 8)
199 pushq (%rsp, %r11, 8)
200 pushq (%rsp, %r11, 8)
201 call *(%r15) /* call the stub fn(arg, ..) */
202 addq $0x20, %rsp /* pop off last 4 args */
203 pushq %rax /* save any return values */
204 pushq %rdx
205 movq %r15, %rdi
206 call mod_release_stub /* release hold on module */
207 popq %rdx /* restore return values */
208 popq %rax
209 .L2:
210 popq %r15
211 leave
213 SET_SIZE(stubs_common_code)
215 #elif defined(__i386)
218 * See the 'struct mod_modinfo' definition to see what this declaration
219 * is trying to achieve here.
221 #define MODULE(module,namespace) \
222 .data; \
223 module##_modname: \
224 .string STRINGIFY(namespace/module); \
225 SET_SIZE(module##_modname); \
226 .align CPTRSIZE; \
227 .globl module##_modinfo; \
228 .type module##_modinfo, @object; \
229 module##_modinfo: \
230 .long module##_modname; \
231 .long 0 /* storage for modctl pointer */
233 /* then mod_stub_info structures follow until a mods_func_adr is 0 */
235 /* this puts a 0 where the next mods_func_adr would be */
236 #define END_MODULE(module) \
237 .data; \
238 .align CPTRSIZE; \
239 .long 0; \
240 SET_SIZE(module##_modinfo)
243 * The data section in the stub_common macro is the
244 * mod_stub_info structure for the stub function
248 * The flag MODS_INSTALLED is stored in the stub data and is used to
249 * indicate if a module is installed and initialized. This flag is used
250 * instead of the mod_stub_info->mods_modinfo->mod_installed flag
251 * to minimize the number of pointer de-references for each function
252 * call (and also to avoid possible TLB misses which could be induced
253 * by dereferencing these pointers.)
256 #define STUB_COMMON(module, fcnname, install_fcn, retfcn, weak) \
257 ENTRY(fcnname); \
258 leal fcnname##_info, %eax; \
259 cmpl $0, MODS_FLAG(%eax); /* weak? */ \
260 je stubs_common_code; /* not weak */ \
261 testb $MODS_INSTALLED, MODS_FLAG(%eax); /* installed? */ \
262 jne stubs_common_code; /* yes, do the mod_hold */ \
263 jmp *MODS_RETFCN(%eax); /* no, just jump to retfcn */ \
264 SET_SIZE(fcnname); \
265 .data; \
266 .align CPTRSIZE; \
267 .type fcnname##_info, @object; \
268 fcnname##_info: \
269 .long install_fcn; \
270 .long module##_modinfo; \
271 .long fcnname; \
272 .long retfcn; \
273 .long weak; \
274 SET_SIZE(fcnname##_info)
276 #define STUB_NO_UNLOADABLE(module, fcnname, install_fcn, retfcn, weak) \
277 ENTRY(fcnname); \
278 leal fcnname##_info, %eax; \
279 testb $MODS_INSTALLED, MODS_FLAG(%eax); /* installed? */ \
280 je 5f; /* no */ \
281 jmp *(%eax); /* yes, just jump to install_fcn */ \
282 5: testb $MODS_WEAK, MODS_FLAG(%eax); /* weak? */ \
283 je stubs_common_code; /* no, do mod load */ \
284 jmp *MODS_RETFCN(%eax); /* yes, just jump to retfcn */ \
285 SET_SIZE(fcnname); \
286 .data; \
287 .align CPTRSIZE; \
288 .type fcnname##_info, @object; \
289 fcnname##_info: \
290 .long install_fcn; /* 0 */ \
291 .long module##_modinfo; /* 0x4 */ \
292 .long fcnname; /* 0x8 */ \
293 .long retfcn; /* 0xc */ \
294 .long weak; /* 0x10 */ \
295 SET_SIZE(fcnname##_info)
298 * We branch here with the fcnname_info pointer in %eax
300 ENTRY_NP(stubs_common_code)
301 .globl mod_hold_stub
302 .globl mod_release_stub
303 pushl %esi
304 movl %eax, %esi / save the info pointer
305 pushl %eax
306 call mod_hold_stub / mod_hold_stub(mod_stub_info *)
307 popl %ecx
308 cmpl $-1, %eax / error?
309 jne .L1
310 movl MODS_RETFCN(%esi), %eax
311 call *%eax
312 popl %esi / yes, return error (panic?)
314 .L1:
315 movl $MAXNARG+1, %ecx
316 / copy incoming arguments
317 pushl (%esp, %ecx, 4) / push MAXNARG times
318 pushl (%esp, %ecx, 4)
319 pushl (%esp, %ecx, 4)
320 pushl (%esp, %ecx, 4)
321 pushl (%esp, %ecx, 4)
322 pushl (%esp, %ecx, 4)
323 pushl (%esp, %ecx, 4)
324 pushl (%esp, %ecx, 4)
325 pushl (%esp, %ecx, 4)
326 pushl (%esp, %ecx, 4)
327 call *(%esi) / call the stub function(arg1,arg2, ...)
328 add $_MUL(MAXNARG, 4), %esp / pop off MAXNARG arguments
329 pushl %eax / save any return values from the stub
330 pushl %edx
331 pushl %esi
332 call mod_release_stub / release hold on module
333 addl $4, %esp
334 popl %edx / restore return values
335 popl %eax
336 .L2:
337 popl %esi
339 SET_SIZE(stubs_common_code)
341 #endif /* __i386 */
343 #define STUB(module, fcnname, retfcn) \
344 STUB_COMMON(module, fcnname, mod_hold_stub, retfcn, 0)
347 * "weak stub", don't load on account of this call
349 #define WSTUB(module, fcnname, retfcn) \
350 STUB_COMMON(module, fcnname, retfcn, retfcn, MODS_WEAK)
353 * "non-unloadable stub", don't bother 'holding' module if it's already loaded
354 * since the module cannot be unloaded.
356 * User *MUST* guarantee the module is not unloadable (no _fini routine).
358 #define NO_UNLOAD_STUB(module, fcnname, retfcn) \
359 STUB_NO_UNLOADABLE(module, fcnname, retfcn, retfcn, MODS_NOUNLOAD)
362 * "weak stub" for non-unloadable module, don't load on account of this call
364 #define NO_UNLOAD_WSTUB(module, fcnname, retfcn) \
365 STUB_NO_UNLOADABLE(module, fcnname, retfcn, retfcn, MODS_NOUNLOAD|MODS_WEAK)
368 * this is just a marker for the beginning area of text that contains stubs
370 ENTRY_NP(stubs_base)
374 * WARNING WARNING WARNING!!!!!!
376 * On the MODULE macro you MUST NOT use any spaces!!! They are
377 * significant to the preprocessor. With ansi c there is a way around this
378 * but for some reason (yet to be investigated) ansi didn't work for other
379 * reasons!
381 * When zero is used as the return function, the system will call
382 * panic if the stub can't be resolved.
386 * Stubs for devfs. A non-unloadable module.
389 #ifndef DEVFS_MODULE
390 MODULE(devfs,fs);
391 NO_UNLOAD_STUB(devfs, devfs_clean, nomod_minus_one);
392 NO_UNLOAD_STUB(devfs, devfs_lookupname, nomod_minus_one);
393 NO_UNLOAD_STUB(devfs, devfs_walk, nomod_minus_one);
394 NO_UNLOAD_STUB(devfs, devfs_devpolicy, nomod_minus_one);
395 NO_UNLOAD_STUB(devfs, devfs_reset_perm, nomod_minus_one);
396 NO_UNLOAD_STUB(devfs, devfs_remdrv_cleanup, nomod_minus_one);
397 END_MODULE(devfs);
398 #endif
400 #ifndef DEV_MODULE
401 MODULE(dev,fs);
402 NO_UNLOAD_STUB(dev, sdev_modctl_readdir, nomod_minus_one);
403 NO_UNLOAD_STUB(dev, sdev_modctl_readdir_free, nomod_minus_one);
404 NO_UNLOAD_STUB(dev, devname_filename_register, nomod_minus_one);
405 NO_UNLOAD_STUB(dev, sdev_modctl_devexists, nomod_minus_one);
406 NO_UNLOAD_STUB(dev, devname_profile_update, nomod_minus_one);
407 NO_UNLOAD_STUB(dev, sdev_devstate_change, nomod_minus_one);
408 NO_UNLOAD_STUB(dev, devvt_getvnodeops, nomod_minus_one);
409 NO_UNLOAD_STUB(dev, devpts_getvnodeops, nomod_zero);
410 END_MODULE(dev);
411 #endif
414 * Stubs for specfs. A non-unloadable module.
417 #ifndef SPEC_MODULE
418 MODULE(specfs,fs);
419 NO_UNLOAD_STUB(specfs, common_specvp, nomod_zero);
420 NO_UNLOAD_STUB(specfs, makectty, nomod_zero);
421 NO_UNLOAD_STUB(specfs, makespecvp, nomod_zero);
422 NO_UNLOAD_STUB(specfs, smark, nomod_zero);
423 NO_UNLOAD_STUB(specfs, spec_segmap, nomod_einval);
424 NO_UNLOAD_STUB(specfs, specfind, nomod_zero);
425 NO_UNLOAD_STUB(specfs, specvp, nomod_zero);
426 NO_UNLOAD_STUB(specfs, devi_stillreferenced, nomod_zero);
427 NO_UNLOAD_STUB(specfs, spec_getvnodeops, nomod_zero);
428 NO_UNLOAD_STUB(specfs, spec_char_map, nomod_zero);
429 NO_UNLOAD_STUB(specfs, specvp_devfs, nomod_zero);
430 NO_UNLOAD_STUB(specfs, spec_assoc_vp_with_devi, nomod_void);
431 NO_UNLOAD_STUB(specfs, spec_hold_devi_by_vp, nomod_zero);
432 NO_UNLOAD_STUB(specfs, spec_snode_walk, nomod_void);
433 NO_UNLOAD_STUB(specfs, spec_devi_open_count, nomod_minus_one);
434 NO_UNLOAD_STUB(specfs, spec_is_clone, nomod_zero);
435 NO_UNLOAD_STUB(specfs, spec_is_selfclone, nomod_zero);
436 NO_UNLOAD_STUB(specfs, spec_fence_snode, nomod_minus_one);
437 NO_UNLOAD_STUB(specfs, spec_unfence_snode, nomod_minus_one);
438 END_MODULE(specfs);
439 #endif
443 * Stubs for sockfs. A non-unloadable module.
445 #ifndef SOCK_MODULE
446 MODULE(sockfs,fs);
447 NO_UNLOAD_STUB(sockfs, so_socket, nomod_zero);
448 NO_UNLOAD_STUB(sockfs, so_socketpair, nomod_zero);
449 NO_UNLOAD_STUB(sockfs, bind, nomod_zero);
450 NO_UNLOAD_STUB(sockfs, listen, nomod_zero);
451 NO_UNLOAD_STUB(sockfs, accept, nomod_zero);
452 NO_UNLOAD_STUB(sockfs, connect, nomod_zero);
453 NO_UNLOAD_STUB(sockfs, shutdown, nomod_zero);
454 NO_UNLOAD_STUB(sockfs, recv, nomod_zero);
455 NO_UNLOAD_STUB(sockfs, recvfrom, nomod_zero);
456 NO_UNLOAD_STUB(sockfs, recvmsg, nomod_zero);
457 NO_UNLOAD_STUB(sockfs, send, nomod_zero);
458 NO_UNLOAD_STUB(sockfs, sendmsg, nomod_zero);
459 NO_UNLOAD_STUB(sockfs, sendto, nomod_zero);
460 #ifdef _SYSCALL32_IMPL
461 NO_UNLOAD_STUB(sockfs, recv32, nomod_zero);
462 NO_UNLOAD_STUB(sockfs, recvfrom32, nomod_zero);
463 NO_UNLOAD_STUB(sockfs, send32, nomod_zero);
464 NO_UNLOAD_STUB(sockfs, sendto32, nomod_zero);
465 #endif /* _SYSCALL32_IMPL */
466 NO_UNLOAD_STUB(sockfs, getpeername, nomod_zero);
467 NO_UNLOAD_STUB(sockfs, getsockname, nomod_zero);
468 NO_UNLOAD_STUB(sockfs, getsockopt, nomod_zero);
469 NO_UNLOAD_STUB(sockfs, setsockopt, nomod_zero);
470 NO_UNLOAD_STUB(sockfs, sockconfig, nomod_zero);
471 NO_UNLOAD_STUB(sockfs, sock_getmsg, nomod_zero);
472 NO_UNLOAD_STUB(sockfs, sock_putmsg, nomod_zero);
473 NO_UNLOAD_STUB(sockfs, sosendfile64, nomod_zero);
474 NO_UNLOAD_STUB(sockfs, snf_segmap, nomod_einval);
475 NO_UNLOAD_STUB(sockfs, sock_getfasync, nomod_zero);
476 NO_UNLOAD_STUB(sockfs, sotpi_sototpi, nomod_zero);
477 NO_UNLOAD_STUB(sockfs, socket_sendmblk, nomod_zero);
478 NO_UNLOAD_STUB(sockfs, socket_setsockopt, nomod_zero);
479 END_MODULE(sockfs);
480 #endif
483 * IPsec stubs.
486 #ifndef IPSECAH_MODULE
487 MODULE(ipsecah,drv);
488 WSTUB(ipsecah, ipsec_construct_inverse_acquire, nomod_zero);
489 WSTUB(ipsecah, sadb_acquire, nomod_zero);
490 WSTUB(ipsecah, ipsecah_algs_changed, nomod_zero);
491 WSTUB(ipsecah, sadb_alg_update, nomod_zero);
492 WSTUB(ipsecah, sadb_unlinkassoc, nomod_zero);
493 WSTUB(ipsecah, sadb_insertassoc, nomod_zero);
494 WSTUB(ipsecah, ipsecah_in_assocfailure, nomod_zero);
495 WSTUB(ipsecah, sadb_set_lpkt, nomod_zero);
496 WSTUB(ipsecah, ipsecah_icmp_error, nomod_zero);
497 END_MODULE(ipsecah);
498 #endif
500 #ifndef IPSECESP_MODULE
501 MODULE(ipsecesp,drv);
502 WSTUB(ipsecesp, ipsecesp_fill_defs, nomod_zero);
503 WSTUB(ipsecesp, ipsecesp_algs_changed, nomod_zero);
504 WSTUB(ipsecesp, ipsecesp_in_assocfailure, nomod_zero);
505 WSTUB(ipsecesp, ipsecesp_init_funcs, nomod_zero);
506 WSTUB(ipsecesp, ipsecesp_icmp_error, nomod_zero);
507 WSTUB(ipsecesp, ipsecesp_send_keepalive, nomod_zero);
508 END_MODULE(ipsecesp);
509 #endif
511 #ifndef KEYSOCK_MODULE
512 MODULE(keysock, drv);
513 WSTUB(keysock, keysock_spdsock_wput_iocdata, nomod_void);
514 WSTUB(keysock, keysock_plumb_ipsec, nomod_zero);
515 WSTUB(keysock, keysock_extended_reg, nomod_zero);
516 WSTUB(keysock, keysock_next_seq, nomod_zero);
517 END_MODULE(keysock);
518 #endif
520 #ifndef SPDSOCK_MODULE
521 MODULE(spdsock,drv);
522 WSTUB(spdsock, spdsock_update_pending_algs, nomod_zero);
523 END_MODULE(spdsock);
524 #endif
527 * Stubs for nfs common code.
528 * XXX nfs_getvnodeops should go away with removal of kludge in vnode.c
530 #ifndef NFS_MODULE
531 MODULE(nfs,fs);
532 WSTUB(nfs, nfs_getvnodeops, nomod_zero);
533 WSTUB(nfs, nfs_perror, nomod_zero);
534 WSTUB(nfs, nfs_cmn_err, nomod_zero);
535 WSTUB(nfs, clcleanup_zone, nomod_zero);
536 WSTUB(nfs, clcleanup4_zone, nomod_zero);
537 END_MODULE(nfs);
538 #endif
542 * Stubs for nfs_dlboot (diskless booting).
544 #ifndef NFS_DLBOOT_MODULE
545 MODULE(nfs_dlboot,misc);
546 STUB(nfs_dlboot, mount_root, nomod_minus_one);
547 STUB(nfs_dlboot, dhcpinit, nomod_minus_one);
548 END_MODULE(nfs_dlboot);
549 #endif
552 * Stubs for nfs server-only code.
554 #ifndef NFSSRV_MODULE
555 MODULE(nfssrv,misc);
556 STUB(nfssrv, exportfs, nomod_minus_one);
557 STUB(nfssrv, nfs_getfh, nomod_minus_one);
558 STUB(nfssrv, nfsl_flush, nomod_minus_one);
559 STUB(nfssrv, rfs4_check_delegated, nomod_zero);
560 STUB(nfssrv, mountd_args, nomod_minus_one);
561 NO_UNLOAD_STUB(nfssrv, rdma_start, nomod_zero);
562 NO_UNLOAD_STUB(nfssrv, nfs_svc, nomod_zero);
563 END_MODULE(nfssrv);
564 #endif
567 * Stubs for kernel lock manager.
569 #ifndef KLM_MODULE
570 MODULE(klmmod,misc);
571 NO_UNLOAD_STUB(klmmod, lm_svc, nomod_zero);
572 NO_UNLOAD_STUB(klmmod, lm_shutdown, nomod_zero);
573 NO_UNLOAD_STUB(klmmod, lm_unexport, nomod_zero);
574 NO_UNLOAD_STUB(klmmod, lm_cprresume, nomod_zero);
575 NO_UNLOAD_STUB(klmmod, lm_cprsuspend, nomod_zero);
576 NO_UNLOAD_STUB(klmmod, lm_safelock, nomod_zero);
577 NO_UNLOAD_STUB(klmmod, lm_safemap, nomod_zero);
578 NO_UNLOAD_STUB(klmmod, lm_has_sleep, nomod_zero);
579 NO_UNLOAD_STUB(klmmod, lm_free_config, nomod_zero);
580 NO_UNLOAD_STUB(klmmod, lm_vp_active, nomod_zero);
581 NO_UNLOAD_STUB(klmmod, lm_get_sysid, nomod_zero);
582 NO_UNLOAD_STUB(klmmod, lm_rel_sysid, nomod_zero);
583 NO_UNLOAD_STUB(klmmod, lm_alloc_sysidt, nomod_minus_one);
584 NO_UNLOAD_STUB(klmmod, lm_free_sysidt, nomod_zero);
585 NO_UNLOAD_STUB(klmmod, lm_sysidt, nomod_minus_one);
586 END_MODULE(klmmod);
587 #endif
589 #ifndef KLMOPS_MODULE
590 MODULE(klmops,misc);
591 NO_UNLOAD_STUB(klmops, lm_frlock, nomod_zero);
592 NO_UNLOAD_STUB(klmops, lm4_frlock, nomod_zero);
593 NO_UNLOAD_STUB(klmops, lm_shrlock, nomod_zero);
594 NO_UNLOAD_STUB(klmops, lm4_shrlock, nomod_zero);
595 NO_UNLOAD_STUB(klmops, lm_nlm_dispatch, nomod_zero);
596 NO_UNLOAD_STUB(klmops, lm_nlm4_dispatch, nomod_zero);
597 NO_UNLOAD_STUB(klmops, lm_nlm_reclaim, nomod_zero);
598 NO_UNLOAD_STUB(klmops, lm_nlm4_reclaim, nomod_zero);
599 NO_UNLOAD_STUB(klmops, lm_register_lock_locally, nomod_zero);
600 END_MODULE(klmops);
601 #endif
604 * Stubs for kernel TLI module
605 * XXX currently we never allow this to unload
607 #ifndef TLI_MODULE
608 MODULE(tlimod,misc);
609 NO_UNLOAD_STUB(tlimod, t_kopen, nomod_minus_one);
610 NO_UNLOAD_STUB(tlimod, t_kunbind, nomod_zero);
611 NO_UNLOAD_STUB(tlimod, t_kadvise, nomod_zero);
612 NO_UNLOAD_STUB(tlimod, t_krcvudata, nomod_zero);
613 NO_UNLOAD_STUB(tlimod, t_ksndudata, nomod_zero);
614 NO_UNLOAD_STUB(tlimod, t_kalloc, nomod_zero);
615 NO_UNLOAD_STUB(tlimod, t_kbind, nomod_zero);
616 NO_UNLOAD_STUB(tlimod, t_kclose, nomod_zero);
617 NO_UNLOAD_STUB(tlimod, t_kspoll, nomod_zero);
618 NO_UNLOAD_STUB(tlimod, t_kfree, nomod_zero);
619 NO_UNLOAD_STUB(tlimod, t_koptmgmt, nomod_zero);
620 END_MODULE(tlimod);
621 #endif
624 * Stubs for kernel RPC module
625 * XXX currently we never allow this to unload
627 #ifndef RPC_MODULE
628 MODULE(rpcmod,strmod);
629 NO_UNLOAD_STUB(rpcmod, clnt_tli_kcreate, nomod_minus_one);
630 NO_UNLOAD_STUB(rpcmod, svc_tli_kcreate, nomod_minus_one);
631 NO_UNLOAD_STUB(rpcmod, bindresvport, nomod_minus_one);
632 NO_UNLOAD_STUB(rpcmod, rdma_register_mod, nomod_minus_one);
633 NO_UNLOAD_STUB(rpcmod, rdma_unregister_mod, nomod_minus_one);
634 NO_UNLOAD_STUB(rpcmod, svc_queuereq, nomod_minus_one);
635 NO_UNLOAD_STUB(rpcmod, clist_add, nomod_minus_one);
636 END_MODULE(rpcmod);
637 #endif
640 * Stubs for des
642 #ifndef DES_MODULE
643 MODULE(des,misc);
644 STUB(des, cbc_crypt, nomod_zero);
645 STUB(des, ecb_crypt, nomod_zero);
646 STUB(des, _des_crypt, nomod_zero);
647 END_MODULE(des);
648 #endif
651 * Stubs for procfs. A non-unloadable module.
653 #ifndef PROC_MODULE
654 MODULE(procfs,fs);
655 NO_UNLOAD_STUB(procfs, prfree, nomod_zero);
656 NO_UNLOAD_STUB(procfs, prexit, nomod_zero);
657 NO_UNLOAD_STUB(procfs, prlwpfree, nomod_zero);
658 NO_UNLOAD_STUB(procfs, prlwpexit, nomod_zero);
659 NO_UNLOAD_STUB(procfs, prinvalidate, nomod_zero);
660 NO_UNLOAD_STUB(procfs, prnsegs, nomod_zero);
661 NO_UNLOAD_STUB(procfs, prgetcred, nomod_zero);
662 NO_UNLOAD_STUB(procfs, prgetpriv, nomod_zero);
663 NO_UNLOAD_STUB(procfs, prgetprivsize, nomod_zero);
664 NO_UNLOAD_STUB(procfs, prgetsecflags, nomod_zero);
665 NO_UNLOAD_STUB(procfs, prgetstatus, nomod_zero);
666 NO_UNLOAD_STUB(procfs, prgetlwpstatus, nomod_zero);
667 NO_UNLOAD_STUB(procfs, prgetpsinfo, nomod_zero);
668 NO_UNLOAD_STUB(procfs, prgetlwpsinfo, nomod_zero);
669 NO_UNLOAD_STUB(procfs, oprgetstatus, nomod_zero);
670 NO_UNLOAD_STUB(procfs, oprgetpsinfo, nomod_zero);
671 #ifdef _SYSCALL32_IMPL
672 NO_UNLOAD_STUB(procfs, prgetstatus32, nomod_zero);
673 NO_UNLOAD_STUB(procfs, prgetlwpstatus32, nomod_zero);
674 NO_UNLOAD_STUB(procfs, prgetpsinfo32, nomod_zero);
675 NO_UNLOAD_STUB(procfs, prgetlwpsinfo32, nomod_zero);
676 NO_UNLOAD_STUB(procfs, oprgetstatus32, nomod_zero);
677 NO_UNLOAD_STUB(procfs, oprgetpsinfo32, nomod_zero);
678 NO_UNLOAD_STUB(procfs, psinfo_kto32, nomod_zero);
679 NO_UNLOAD_STUB(procfs, lwpsinfo_kto32, nomod_zero);
680 #endif /* _SYSCALL32_IMPL */
681 NO_UNLOAD_STUB(procfs, prnotify, nomod_zero);
682 NO_UNLOAD_STUB(procfs, prexecstart, nomod_zero);
683 NO_UNLOAD_STUB(procfs, prexecend, nomod_zero);
684 NO_UNLOAD_STUB(procfs, prrelvm, nomod_zero);
685 NO_UNLOAD_STUB(procfs, prbarrier, nomod_zero);
686 NO_UNLOAD_STUB(procfs, estimate_msacct, nomod_zero);
687 NO_UNLOAD_STUB(procfs, pr_getprot, nomod_zero);
688 NO_UNLOAD_STUB(procfs, pr_getprot_done, nomod_zero);
689 NO_UNLOAD_STUB(procfs, pr_getsegsize, nomod_zero);
690 NO_UNLOAD_STUB(procfs, pr_isobject, nomod_zero);
691 NO_UNLOAD_STUB(procfs, pr_isself, nomod_zero);
692 NO_UNLOAD_STUB(procfs, pr_allstopped, nomod_zero);
693 NO_UNLOAD_STUB(procfs, pr_free_watched_pages, nomod_zero);
694 END_MODULE(procfs);
695 #endif
698 * Stubs for fifofs
700 #ifndef FIFO_MODULE
701 MODULE(fifofs,fs);
702 NO_UNLOAD_STUB(fifofs, fifovp, nomod_zero);
703 NO_UNLOAD_STUB(fifofs, fifo_getinfo, nomod_zero);
704 NO_UNLOAD_STUB(fifofs, fifo_vfastoff, nomod_zero);
705 END_MODULE(fifofs);
706 #endif
709 * Stubs for ufs
711 * This is needed to support the old quotactl system call.
712 * When the old sysent stuff goes away, this will need to be revisited.
714 #ifndef UFS_MODULE
715 MODULE(ufs,fs);
716 STUB(ufs, quotactl, nomod_minus_one);
717 END_MODULE(ufs);
718 #endif
721 * Stubs for zfs
723 #ifndef ZFS_MODULE
724 MODULE(zfs,fs);
725 STUB(zfs, dsl_prop_get, nomod_minus_one);
726 STUB(zfs, spa_boot_init, nomod_minus_one);
727 STUB(zfs, zfs_prop_to_name, nomod_zero);
728 END_MODULE(zfs);
729 #endif
732 * Stubs for dcfs
734 #ifndef DCFS_MODULE
735 MODULE(dcfs,fs);
736 STUB(dcfs, decompvp, 0);
737 END_MODULE(dcfs);
738 #endif
741 * Stubs for namefs
743 #ifndef NAMEFS_MODULE
744 MODULE(namefs,fs);
745 STUB(namefs, nm_unmountall, 0);
746 END_MODULE(namefs);
747 #endif
750 * Stubs for sysdc
752 #ifndef SDC_MODULE
753 MODULE(SDC,sched);
754 NO_UNLOAD_STUB(SDC, sysdc_thread_enter, nomod_zero);
755 END_MODULE(SDC);
756 #endif
759 * Stubs for ts_dptbl
761 #ifndef TS_DPTBL_MODULE
762 MODULE(TS_DPTBL,sched);
763 STUB(TS_DPTBL, ts_getdptbl, 0);
764 STUB(TS_DPTBL, ts_getkmdpris, 0);
765 STUB(TS_DPTBL, ts_getmaxumdpri, 0);
766 END_MODULE(TS_DPTBL);
767 #endif
770 * Stubs for rt_dptbl
772 #ifndef RT_DPTBL_MODULE
773 MODULE(RT_DPTBL,sched);
774 STUB(RT_DPTBL, rt_getdptbl, 0);
775 END_MODULE(RT_DPTBL);
776 #endif
779 * Stubs for ia_dptbl
781 #ifndef IA_DPTBL_MODULE
782 MODULE(IA_DPTBL,sched);
783 STUB(IA_DPTBL, ia_getdptbl, nomod_zero);
784 STUB(IA_DPTBL, ia_getkmdpris, nomod_zero);
785 STUB(IA_DPTBL, ia_getmaxumdpri, nomod_zero);
786 END_MODULE(IA_DPTBL);
787 #endif
790 * Stubs for FSS scheduler
792 #ifndef FSS_MODULE
793 MODULE(FSS,sched);
794 WSTUB(FSS, fss_allocbuf, nomod_zero);
795 WSTUB(FSS, fss_freebuf, nomod_zero);
796 WSTUB(FSS, fss_changeproj, nomod_zero);
797 WSTUB(FSS, fss_changepset, nomod_zero);
798 END_MODULE(FSS);
799 #endif
802 * Stubs for fx_dptbl
804 #ifndef FX_DPTBL_MODULE
805 MODULE(FX_DPTBL,sched);
806 STUB(FX_DPTBL, fx_getdptbl, 0);
807 STUB(FX_DPTBL, fx_getmaxumdpri, 0);
808 END_MODULE(FX_DPTBL);
809 #endif
812 * Stubs for bootdev
814 #ifndef BOOTDEV_MODULE
815 MODULE(bootdev,misc);
816 STUB(bootdev, i_promname_to_devname, 0);
817 STUB(bootdev, i_convert_boot_device_name, 0);
818 END_MODULE(bootdev);
819 #endif
822 * stubs for strplumb...
824 #ifndef STRPLUMB_MODULE
825 MODULE(strplumb,misc);
826 STUB(strplumb, strplumb, 0);
827 STUB(strplumb, strplumb_load, 0);
828 STUB(strplumb, strplumb_get_netdev_path, 0);
829 END_MODULE(strplumb);
830 #endif
833 * Stubs for console configuration module
835 #ifndef CONSCONFIG_MODULE
836 MODULE(consconfig,misc);
837 STUB(consconfig, consconfig, 0);
838 STUB(consconfig, consconfig_get_usb_kb_path, 0);
839 STUB(consconfig, consconfig_get_usb_ms_path, 0);
840 STUB(consconfig, consconfig_get_plat_fbpath, 0);
841 STUB(consconfig, consconfig_console_is_ready, 0);
842 END_MODULE(consconfig);
843 #endif
846 * Stubs for accounting.
848 #ifndef SYSACCT_MODULE
849 MODULE(sysacct,sys);
850 NO_UNLOAD_WSTUB(sysacct, acct, nomod_zero);
851 NO_UNLOAD_WSTUB(sysacct, acct_fs_in_use, nomod_zero);
852 END_MODULE(sysacct);
853 #endif
856 * Stubs for semaphore routines. sem.c
858 #ifndef SEMSYS_MODULE
859 MODULE(semsys,sys);
860 NO_UNLOAD_WSTUB(semsys, semexit, nomod_zero);
861 END_MODULE(semsys);
862 #endif
865 * Stubs for shmem routines. shm.c
867 #ifndef SHMSYS_MODULE
868 MODULE(shmsys,sys);
869 NO_UNLOAD_WSTUB(shmsys, shmexit, nomod_zero);
870 NO_UNLOAD_WSTUB(shmsys, shmfork, nomod_zero);
871 NO_UNLOAD_WSTUB(shmsys, shmgetid, nomod_minus_one);
872 END_MODULE(shmsys);
873 #endif
876 * Stubs for doors
878 #ifndef DOOR_MODULE
879 MODULE(doorfs,sys);
880 NO_UNLOAD_WSTUB(doorfs, door_slam, nomod_zero);
881 NO_UNLOAD_WSTUB(doorfs, door_exit, nomod_zero);
882 NO_UNLOAD_WSTUB(doorfs, door_revoke_all, nomod_zero);
883 NO_UNLOAD_WSTUB(doorfs, door_fork, nomod_zero);
884 NO_UNLOAD_STUB(doorfs, door_upcall, nomod_einval);
885 NO_UNLOAD_STUB(doorfs, door_ki_create, nomod_einval);
886 NO_UNLOAD_STUB(doorfs, door_ki_open, nomod_einval);
887 NO_UNLOAD_STUB(doorfs, door_ki_lookup, nomod_zero);
888 NO_UNLOAD_WSTUB(doorfs, door_ki_upcall, nomod_einval);
889 NO_UNLOAD_WSTUB(doorfs, door_ki_upcall_limited, nomod_einval);
890 NO_UNLOAD_WSTUB(doorfs, door_ki_hold, nomod_zero);
891 NO_UNLOAD_WSTUB(doorfs, door_ki_rele, nomod_zero);
892 NO_UNLOAD_WSTUB(doorfs, door_ki_info, nomod_einval);
893 END_MODULE(doorfs);
894 #endif
897 * Stubs for MD5
899 #ifndef MD5_MODULE
900 MODULE(md5,misc);
901 WSTUB(md5, MD5Init, nomod_zero);
902 WSTUB(md5, MD5Update, nomod_zero);
903 WSTUB(md5, MD5Final, nomod_zero);
904 END_MODULE(md5);
905 #endif
908 * Stubs for idmap
910 #ifndef IDMAP_MODULE
911 MODULE(idmap,misc);
912 STUB(idmap, kidmap_batch_getgidbysid, nomod_zero);
913 STUB(idmap, kidmap_batch_getpidbysid, nomod_zero);
914 STUB(idmap, kidmap_batch_getsidbygid, nomod_zero);
915 STUB(idmap, kidmap_batch_getsidbyuid, nomod_zero);
916 STUB(idmap, kidmap_batch_getuidbysid, nomod_zero);
917 STUB(idmap, kidmap_get_create, nomod_zero);
918 STUB(idmap, kidmap_get_destroy, nomod_zero);
919 STUB(idmap, kidmap_get_mappings, nomod_zero);
920 STUB(idmap, kidmap_getgidbysid, nomod_zero);
921 STUB(idmap, kidmap_getpidbysid, nomod_zero);
922 STUB(idmap, kidmap_getsidbygid, nomod_zero);
923 STUB(idmap, kidmap_getsidbyuid, nomod_zero);
924 STUB(idmap, kidmap_getuidbysid, nomod_zero);
925 STUB(idmap, idmap_get_door, nomod_einval);
926 STUB(idmap, idmap_unreg_dh, nomod_einval);
927 STUB(idmap, idmap_reg_dh, nomod_einval);
928 STUB(idmap, idmap_purge_cache, nomod_einval);
929 END_MODULE(idmap);
930 #endif
933 * Stubs for auditing.
935 #ifndef C2AUDIT_MODULE
936 MODULE(c2audit,sys);
937 NO_UNLOAD_STUB(c2audit, audit_init_module, nomod_zero);
938 NO_UNLOAD_STUB(c2audit, audit_start, nomod_zero);
939 NO_UNLOAD_STUB(c2audit, audit_finish, nomod_zero);
940 NO_UNLOAD_STUB(c2audit, audit, nomod_zero);
941 NO_UNLOAD_STUB(c2audit, auditdoor, nomod_zero);
942 NO_UNLOAD_STUB(c2audit, audit_closef, nomod_zero);
943 NO_UNLOAD_STUB(c2audit, audit_core_start, nomod_zero);
944 NO_UNLOAD_STUB(c2audit, audit_core_finish, nomod_zero);
945 NO_UNLOAD_STUB(c2audit, audit_strputmsg, nomod_zero);
946 NO_UNLOAD_STUB(c2audit, audit_savepath, nomod_zero);
947 NO_UNLOAD_STUB(c2audit, audit_anchorpath, nomod_zero);
948 NO_UNLOAD_STUB(c2audit, audit_exit, nomod_zero);
949 NO_UNLOAD_STUB(c2audit, audit_exec, nomod_zero);
950 NO_UNLOAD_STUB(c2audit, audit_symlink, nomod_zero);
951 NO_UNLOAD_STUB(c2audit, audit_symlink_create, nomod_zero);
952 NO_UNLOAD_STUB(c2audit, audit_vncreate_start, nomod_zero);
953 NO_UNLOAD_STUB(c2audit, audit_vncreate_finish, nomod_zero);
954 NO_UNLOAD_STUB(c2audit, audit_enterprom, nomod_zero);
955 NO_UNLOAD_STUB(c2audit, audit_exitprom, nomod_zero);
956 NO_UNLOAD_STUB(c2audit, audit_chdirec, nomod_zero);
957 NO_UNLOAD_STUB(c2audit, audit_setf, nomod_zero);
958 NO_UNLOAD_STUB(c2audit, audit_sock, nomod_zero);
959 NO_UNLOAD_STUB(c2audit, audit_strgetmsg, nomod_zero);
960 NO_UNLOAD_STUB(c2audit, audit_ipc, nomod_zero);
961 NO_UNLOAD_STUB(c2audit, audit_ipcget, nomod_zero);
962 NO_UNLOAD_STUB(c2audit, audit_fdsend, nomod_zero);
963 NO_UNLOAD_STUB(c2audit, audit_fdrecv, nomod_zero);
964 NO_UNLOAD_STUB(c2audit, audit_priv, nomod_zero);
965 NO_UNLOAD_STUB(c2audit, audit_setppriv, nomod_zero);
966 NO_UNLOAD_STUB(c2audit, audit_psecflags, nomod_zero);
967 NO_UNLOAD_STUB(c2audit, audit_devpolicy, nomod_zero);
968 NO_UNLOAD_STUB(c2audit, audit_setfsat_path, nomod_zero);
969 NO_UNLOAD_STUB(c2audit, audit_cryptoadm, nomod_zero);
970 NO_UNLOAD_STUB(c2audit, audit_pf_policy, nomod_zero);
971 NO_UNLOAD_STUB(c2audit, au_doormsg, nomod_zero);
972 NO_UNLOAD_STUB(c2audit, au_uwrite, nomod_zero);
973 NO_UNLOAD_STUB(c2audit, au_to_arg32, nomod_zero);
974 NO_UNLOAD_STUB(c2audit, au_free_rec, nomod_zero);
975 END_MODULE(c2audit);
976 #endif
979 * Stubs for kernel rpc security service module
981 #ifndef RPCSEC_MODULE
982 MODULE(rpcsec,misc);
983 NO_UNLOAD_STUB(rpcsec, sec_clnt_revoke, nomod_zero);
984 NO_UNLOAD_STUB(rpcsec, authkern_create, nomod_zero);
985 NO_UNLOAD_STUB(rpcsec, sec_svc_msg, nomod_zero);
986 NO_UNLOAD_STUB(rpcsec, sec_svc_control, nomod_zero);
987 END_MODULE(rpcsec);
988 #endif
991 * Stubs for rpc RPCSEC_GSS security service module
993 #ifndef RPCSEC_GSS_MODULE
994 MODULE(rpcsec_gss,misc);
995 NO_UNLOAD_STUB(rpcsec_gss, __svcrpcsec_gss, nomod_zero);
996 NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_getcred, nomod_zero);
997 NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_set_callback, nomod_zero);
998 NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_secget, nomod_zero);
999 NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_secfree, nomod_zero);
1000 NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_seccreate, nomod_zero);
1001 NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_set_defaults, nomod_zero);
1002 NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_revauth, nomod_zero);
1003 NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_secpurge, nomod_zero);
1004 NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_cleanup, nomod_zero);
1005 NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_get_versions, nomod_zero);
1006 NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_max_data_length, nomod_zero);
1007 NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_svc_max_data_length, nomod_zero);
1008 NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_get_service_type, nomod_zero);
1009 END_MODULE(rpcsec_gss);
1010 #endif
1013 * Stubs for PCI configurator module (misc/pcicfg).
1015 #ifndef PCICFG_MODULE
1016 MODULE(pcicfg,misc);
1017 STUB(pcicfg, pcicfg_configure, 0);
1018 STUB(pcicfg, pcicfg_unconfigure, 0);
1019 END_MODULE(pcicfg);
1020 #endif
1023 * Stubs for pcieb nexus driver.
1025 #ifndef PCIEB_MODULE
1026 MODULE(pcieb,drv);
1027 STUB(pcieb, pcieb_intel_error_workaround, 0);
1028 END_MODULE(pcieb);
1029 #endif
1031 #ifndef IWSCN_MODULE
1032 MODULE(iwscn,drv);
1033 STUB(iwscn, srpop, 0);
1034 END_MODULE(iwscn);
1035 #endif
1038 * Stubs for checkpoint-resume module
1040 #ifndef CPR_MODULE
1041 MODULE(cpr,misc);
1042 STUB(cpr, cpr, 0);
1043 END_MODULE(cpr);
1044 #endif
1047 * Stubs for kernel probes (tnf module). Not unloadable.
1049 #ifndef TNF_MODULE
1050 MODULE(tnf,drv);
1051 NO_UNLOAD_STUB(tnf, tnf_ref32_1, nomod_zero);
1052 NO_UNLOAD_STUB(tnf, tnf_string_1, nomod_zero);
1053 NO_UNLOAD_STUB(tnf, tnf_opaque_array_1, nomod_zero);
1054 NO_UNLOAD_STUB(tnf, tnf_struct_tag_1, nomod_zero);
1055 NO_UNLOAD_STUB(tnf, tnf_allocate, nomod_zero);
1056 END_MODULE(tnf);
1057 #endif
1060 * Stubs for kernel cryptographic framework module (misc/kcf).
1062 #ifndef KCF_MODULE
1063 MODULE(kcf,misc);
1064 NO_UNLOAD_STUB(kcf, crypto_mech2id, nomod_minus_one);
1065 NO_UNLOAD_STUB(kcf, crypto_register_provider, nomod_minus_one);
1066 NO_UNLOAD_STUB(kcf, crypto_unregister_provider, nomod_minus_one);
1067 NO_UNLOAD_STUB(kcf, crypto_provider_notification, nomod_minus_one);
1068 NO_UNLOAD_STUB(kcf, crypto_op_notification, nomod_minus_one);
1069 NO_UNLOAD_STUB(kcf, crypto_kmflag, nomod_minus_one);
1070 NO_UNLOAD_STUB(kcf, crypto_digest, nomod_minus_one);
1071 NO_UNLOAD_STUB(kcf, crypto_digest_prov, nomod_minus_one);
1072 NO_UNLOAD_STUB(kcf, crypto_digest_init, nomod_minus_one);
1073 NO_UNLOAD_STUB(kcf, crypto_digest_init_prov, nomod_minus_one);
1074 NO_UNLOAD_STUB(kcf, crypto_digest_update, nomod_minus_one);
1075 NO_UNLOAD_STUB(kcf, crypto_digest_final, nomod_minus_one);
1076 NO_UNLOAD_STUB(kcf, crypto_digest_key_prov, nomod_minus_one);
1077 NO_UNLOAD_STUB(kcf, crypto_encrypt, nomod_minus_one);
1078 NO_UNLOAD_STUB(kcf, crypto_encrypt_prov, nomod_minus_one);
1079 NO_UNLOAD_STUB(kcf, crypto_encrypt_init, nomod_minus_one);
1080 NO_UNLOAD_STUB(kcf, crypto_encrypt_init_prov, nomod_minus_one);
1081 NO_UNLOAD_STUB(kcf, crypto_encrypt_update, nomod_minus_one);
1082 NO_UNLOAD_STUB(kcf, crypto_encrypt_final, nomod_minus_one);
1083 NO_UNLOAD_STUB(kcf, crypto_decrypt, nomod_minus_one);
1084 NO_UNLOAD_STUB(kcf, crypto_decrypt_prov, nomod_minus_one);
1085 NO_UNLOAD_STUB(kcf, crypto_decrypt_init, nomod_minus_one);
1086 NO_UNLOAD_STUB(kcf, crypto_decrypt_init_prov, nomod_minus_one);
1087 NO_UNLOAD_STUB(kcf, crypto_decrypt_update, nomod_minus_one);
1088 NO_UNLOAD_STUB(kcf, crypto_decrypt_final, nomod_minus_one);
1089 NO_UNLOAD_STUB(kcf, crypto_get_all_mech_info, nomod_minus_one);
1090 NO_UNLOAD_STUB(kcf, crypto_key_check, nomod_minus_one);
1091 NO_UNLOAD_STUB(kcf, crypto_key_check_prov, nomod_minus_one);
1092 NO_UNLOAD_STUB(kcf, crypto_key_derive, nomod_minus_one);
1093 NO_UNLOAD_STUB(kcf, crypto_key_generate, nomod_minus_one);
1094 NO_UNLOAD_STUB(kcf, crypto_key_generate_pair, nomod_minus_one);
1095 NO_UNLOAD_STUB(kcf, crypto_key_unwrap, nomod_minus_one);
1096 NO_UNLOAD_STUB(kcf, crypto_key_wrap, nomod_minus_one);
1097 NO_UNLOAD_STUB(kcf, crypto_mac, nomod_minus_one);
1098 NO_UNLOAD_STUB(kcf, crypto_mac_prov, nomod_minus_one);
1099 NO_UNLOAD_STUB(kcf, crypto_mac_verify, nomod_minus_one);
1100 NO_UNLOAD_STUB(kcf, crypto_mac_verify_prov, nomod_minus_one);
1101 NO_UNLOAD_STUB(kcf, crypto_mac_init, nomod_minus_one);
1102 NO_UNLOAD_STUB(kcf, crypto_mac_init_prov, nomod_minus_one);
1103 NO_UNLOAD_STUB(kcf, crypto_mac_update, nomod_minus_one);
1104 NO_UNLOAD_STUB(kcf, crypto_mac_final, nomod_minus_one);
1105 NO_UNLOAD_STUB(kcf, crypto_mac_decrypt, nomod_minus_one);
1106 NO_UNLOAD_STUB(kcf, crypto_mac_decrypt_prov, nomod_minus_one);
1107 NO_UNLOAD_STUB(kcf, crypto_mac_verify_decrypt, nomod_minus_one);
1108 NO_UNLOAD_STUB(kcf, crypto_mac_verify_decrypt_prov, nomod_minus_one);
1109 NO_UNLOAD_STUB(kcf, crypto_mac_decrypt_init, nomod_minus_one);
1110 NO_UNLOAD_STUB(kcf, crypto_mac_decrypt_init_prov, nomod_minus_one);
1111 NO_UNLOAD_STUB(kcf, crypto_mac_decrypt_update, nomod_minus_one);
1112 NO_UNLOAD_STUB(kcf, crypto_mac_decrypt_final, nomod_minus_one);
1113 NO_UNLOAD_STUB(kcf, crypto_object_copy, nomod_minus_one);
1114 NO_UNLOAD_STUB(kcf, crypto_object_create, nomod_minus_one);
1115 NO_UNLOAD_STUB(kcf, crypto_object_destroy, nomod_minus_one);
1116 NO_UNLOAD_STUB(kcf, crypto_object_find_final, nomod_minus_one);
1117 NO_UNLOAD_STUB(kcf, crypto_object_find_init, nomod_minus_one);
1118 NO_UNLOAD_STUB(kcf, crypto_object_find, nomod_minus_one);
1119 NO_UNLOAD_STUB(kcf, crypto_object_get_attribute_value, nomod_minus_one);
1120 NO_UNLOAD_STUB(kcf, crypto_object_get_size, nomod_minus_one);
1121 NO_UNLOAD_STUB(kcf, crypto_object_set_attribute_value, nomod_minus_one);
1122 NO_UNLOAD_STUB(kcf, crypto_session_close, nomod_minus_one);
1123 NO_UNLOAD_STUB(kcf, crypto_session_login, nomod_minus_one);
1124 NO_UNLOAD_STUB(kcf, crypto_session_logout, nomod_minus_one);
1125 NO_UNLOAD_STUB(kcf, crypto_session_open, nomod_minus_one);
1126 NO_UNLOAD_STUB(kcf, crypto_encrypt_mac, nomod_minus_one);
1127 NO_UNLOAD_STUB(kcf, crypto_encrypt_mac_prov, nomod_minus_one);
1128 NO_UNLOAD_STUB(kcf, crypto_encrypt_mac_init, nomod_minus_one);
1129 NO_UNLOAD_STUB(kcf, crypto_encrypt_mac_init_prov, nomod_minus_one);
1130 NO_UNLOAD_STUB(kcf, crypto_encrypt_mac_update, nomod_minus_one);
1131 NO_UNLOAD_STUB(kcf, crypto_encrypt_mac_final, nomod_minus_one);
1132 NO_UNLOAD_STUB(kcf, crypto_create_ctx_template, nomod_minus_one);
1133 NO_UNLOAD_STUB(kcf, crypto_destroy_ctx_template, nomod_minus_one);
1134 NO_UNLOAD_STUB(kcf, crypto_get_mech_list, nomod_minus_one);
1135 NO_UNLOAD_STUB(kcf, crypto_free_mech_list, nomod_minus_one);
1136 NO_UNLOAD_STUB(kcf, crypto_cancel_req, nomod_minus_one);
1137 NO_UNLOAD_STUB(kcf, crypto_cancel_ctx, nomod_minus_one);
1138 NO_UNLOAD_STUB(kcf, crypto_bufcall_alloc, nomod_minus_one);
1139 NO_UNLOAD_STUB(kcf, crypto_bufcall_free, nomod_minus_one);
1140 NO_UNLOAD_STUB(kcf, crypto_bufcall, nomod_minus_one);
1141 NO_UNLOAD_STUB(kcf, crypto_unbufcall, nomod_minus_one);
1142 NO_UNLOAD_STUB(kcf, crypto_notify_events, nomod_minus_one);
1143 NO_UNLOAD_STUB(kcf, crypto_unnotify_events, nomod_minus_one);
1144 NO_UNLOAD_STUB(kcf, crypto_get_provider, nomod_minus_one);
1145 NO_UNLOAD_STUB(kcf, crypto_get_provinfo, nomod_minus_one);
1146 NO_UNLOAD_STUB(kcf, crypto_release_provider, nomod_minus_one);
1147 NO_UNLOAD_STUB(kcf, crypto_sign, nomod_minus_one);
1148 NO_UNLOAD_STUB(kcf, crypto_sign_prov, nomod_minus_one);
1149 NO_UNLOAD_STUB(kcf, crypto_sign_init, nomod_minus_one);
1150 NO_UNLOAD_STUB(kcf, crypto_sign_init_prov, nomod_minus_one);
1151 NO_UNLOAD_STUB(kcf, crypto_sign_update, nomod_minus_one);
1152 NO_UNLOAD_STUB(kcf, crypto_sign_final, nomod_minus_one);
1153 NO_UNLOAD_STUB(kcf, crypto_sign_recover, nomod_minus_one);
1154 NO_UNLOAD_STUB(kcf, crypto_sign_recover_prov, nomod_minus_one);
1155 NO_UNLOAD_STUB(kcf, crypto_sign_recover_init_prov, nomod_minus_one);
1156 NO_UNLOAD_STUB(kcf, crypto_verify, nomod_minus_one);
1157 NO_UNLOAD_STUB(kcf, crypto_verify_prov, nomod_minus_one);
1158 NO_UNLOAD_STUB(kcf, crypto_verify_init, nomod_minus_one);
1159 NO_UNLOAD_STUB(kcf, crypto_verify_init_prov, nomod_minus_one);
1160 NO_UNLOAD_STUB(kcf, crypto_verify_update, nomod_minus_one);
1161 NO_UNLOAD_STUB(kcf, crypto_verify_final, nomod_minus_one);
1162 NO_UNLOAD_STUB(kcf, crypto_verify_recover, nomod_minus_one);
1163 NO_UNLOAD_STUB(kcf, crypto_verify_recover_prov, nomod_minus_one);
1164 NO_UNLOAD_STUB(kcf, crypto_verify_recover_init_prov, nomod_minus_one);
1165 NO_UNLOAD_STUB(kcf, random_add_entropy, nomod_minus_one);
1166 NO_UNLOAD_STUB(kcf, random_add_pseudo_entropy, nomod_minus_one);
1167 NO_UNLOAD_STUB(kcf, random_get_blocking_bytes, nomod_minus_one);
1168 NO_UNLOAD_STUB(kcf, random_get_bytes, nomod_minus_one);
1169 NO_UNLOAD_STUB(kcf, random_get_pseudo_bytes, nomod_minus_one);
1170 END_MODULE(kcf);
1171 #endif
1174 * Stubs for sha1. A non-unloadable module.
1176 #ifndef SHA1_MODULE
1177 MODULE(sha1,crypto);
1178 NO_UNLOAD_STUB(sha1, SHA1Init, nomod_void);
1179 NO_UNLOAD_STUB(sha1, SHA1Update, nomod_void);
1180 NO_UNLOAD_STUB(sha1, SHA1Final, nomod_void);
1181 END_MODULE(sha1);
1182 #endif
1185 * The following stubs are used by the mac module.
1186 * Since dld already depends on mac, these
1187 * stubs are needed to avoid circular dependencies.
1189 #ifndef DLD_MODULE
1190 MODULE(dld,drv);
1191 STUB(dld, dld_init_ops, nomod_void);
1192 STUB(dld, dld_fini_ops, nomod_void);
1193 STUB(dld, dld_devt_to_instance, nomod_minus_one);
1194 STUB(dld, dld_autopush, nomod_minus_one);
1195 STUB(dld, dld_ioc_register, nomod_einval);
1196 STUB(dld, dld_ioc_unregister, nomod_void);
1197 END_MODULE(dld);
1198 #endif
1201 * The following stubs are used by the mac module.
1202 * Since dls already depends on mac, these
1203 * stubs are needed to avoid circular dependencies.
1205 #ifndef DLS_MODULE
1206 MODULE(dls,misc);
1207 STUB(dls, dls_devnet_mac, nomod_zero);
1208 STUB(dls, dls_devnet_hold_tmp, nomod_einval);
1209 STUB(dls, dls_devnet_rele_tmp, nomod_void);
1210 STUB(dls, dls_devnet_hold_link, nomod_einval);
1211 STUB(dls, dls_devnet_rele_link, nomod_void);
1212 STUB(dls, dls_devnet_prop_task_wait, nomod_void);
1213 STUB(dls, dls_mgmt_get_linkid, nomod_einval);
1214 STUB(dls, dls_devnet_macname2linkid, nomod_einval);
1215 STUB(dls, dls_mgmt_get_linkinfo, nomod_einval);
1216 END_MODULE(dls);
1217 #endif
1219 #ifndef SOFTMAC_MODULE
1220 MODULE(softmac,drv);
1221 STUB(softmac, softmac_hold_device, nomod_einval);
1222 STUB(softmac, softmac_rele_device, nomod_void);
1223 STUB(softmac, softmac_recreate, nomod_void);
1224 END_MODULE(softmac);
1225 #endif
1227 #ifndef IPTUN_MODULE
1228 MODULE(iptun,drv);
1229 STUB(iptun, iptun_create, nomod_einval);
1230 STUB(iptun, iptun_delete, nomod_einval);
1231 STUB(iptun, iptun_set_policy, nomod_void) ;
1232 END_MODULE(iptun);
1233 #endif
1236 * Stubs for dcopy, for Intel IOAT KAPIs
1238 #ifndef DCOPY_MODULE
1239 MODULE(dcopy,misc);
1240 NO_UNLOAD_STUB(dcopy, dcopy_query, nomod_minus_one);
1241 NO_UNLOAD_STUB(dcopy, dcopy_query_channel, nomod_minus_one);
1242 NO_UNLOAD_STUB(dcopy, dcopy_alloc, nomod_minus_one);
1243 NO_UNLOAD_STUB(dcopy, dcopy_free, nomod_minus_one);
1244 NO_UNLOAD_STUB(dcopy, dcopy_cmd_alloc, nomod_minus_one);
1245 NO_UNLOAD_STUB(dcopy, dcopy_cmd_free, nomod_void);
1246 NO_UNLOAD_STUB(dcopy, dcopy_cmd_post, nomod_minus_one);
1247 NO_UNLOAD_STUB(dcopy, dcopy_cmd_poll, nomod_minus_one);
1248 END_MODULE(dcopy);
1249 #endif
1252 * Stubs for acpica
1254 #ifndef ACPICA_MODULE
1255 MODULE(acpica,misc);
1256 NO_UNLOAD_STUB(acpica, AcpiOsReadPort, nomod_minus_one) ;
1257 NO_UNLOAD_STUB(acpica, AcpiOsWritePort, nomod_minus_one) ;
1258 NO_UNLOAD_STUB(acpica, AcpiInstallNotifyHandler, nomod_minus_one) ;
1259 NO_UNLOAD_STUB(acpica, AcpiRemoveNotifyHandler, nomod_minus_one) ;
1260 NO_UNLOAD_STUB(acpica, AcpiEvaluateObject, nomod_minus_one) ;
1261 NO_UNLOAD_STUB(acpica, AcpiEvaluateObjectTyped, nomod_minus_one) ;
1262 NO_UNLOAD_STUB(acpica, AcpiWriteBitRegister, nomod_minus_one) ;
1263 NO_UNLOAD_STUB(acpica, AcpiReadBitRegister, nomod_minus_one) ;
1264 NO_UNLOAD_STUB(acpica, AcpiOsFree, nomod_minus_one) ;
1265 NO_UNLOAD_STUB(acpica, acpica_get_handle_cpu, nomod_minus_one) ;
1266 NO_UNLOAD_STUB(acpica, acpica_get_global_FADT, nomod_minus_one) ;
1267 NO_UNLOAD_STUB(acpica, acpica_write_cpupm_capabilities,
1268 nomod_minus_one) ;
1269 NO_UNLOAD_STUB(acpica, __acpi_wbinvd, nomod_minus_one) ;
1270 NO_UNLOAD_STUB(acpica, acpi_reset_system, nomod_minus_one) ;
1271 END_MODULE(acpica);
1272 #endif
1275 * Stubs for acpidev
1277 #ifndef ACPIDEV_MODULE
1278 MODULE(acpidev,misc);
1279 NO_UNLOAD_STUB(acpidev, acpidev_dr_get_cpu_numa_info, nomod_minus_one) ;
1280 NO_UNLOAD_STUB(acpidev, acpidev_dr_free_cpu_numa_info,
1281 nomod_minus_one) ;
1282 END_MODULE(acpidev);
1283 #endif
1285 #ifndef IPNET_MODULE
1286 MODULE(ipnet,drv);
1287 STUB(ipnet, ipnet_if_getdev, nomod_zero);
1288 STUB(ipnet, ipnet_walk_if, nomod_zero);
1289 END_MODULE(ipnet);
1290 #endif
1292 #ifndef IOMMULIB_MODULE
1293 MODULE(iommulib,misc);
1294 STUB(iommulib, iommulib_nex_close, nomod_void);
1295 END_MODULE(iommulib);
1296 #endif
1299 * Stubs for rootnex nexus driver.
1301 #ifndef ROOTNEX_MODULE
1302 MODULE(rootnex,drv);
1303 STUB(rootnex, immu_init, 0);
1304 STUB(rootnex, immu_startup, 0);
1305 STUB(rootnex, immu_physmem_update, 0);
1306 END_MODULE(rootnex);
1307 #endif
1310 * Stubs for kernel socket, for iscsi
1312 #ifndef KSOCKET_MODULE
1313 MODULE(ksocket, misc);
1314 NO_UNLOAD_STUB(ksocket, ksocket_setsockopt, nomod_minus_one);
1315 NO_UNLOAD_STUB(ksocket, ksocket_getsockopt, nomod_minus_one);
1316 NO_UNLOAD_STUB(ksocket, ksocket_getpeername, nomod_minus_one);
1317 NO_UNLOAD_STUB(ksocket, ksocket_getsockname, nomod_minus_one);
1318 NO_UNLOAD_STUB(ksocket, ksocket_socket, nomod_minus_one);
1319 NO_UNLOAD_STUB(ksocket, ksocket_bind, nomod_minus_one);
1320 NO_UNLOAD_STUB(ksocket, ksocket_listen, nomod_minus_one);
1321 NO_UNLOAD_STUB(ksocket, ksocket_accept, nomod_minus_one);
1322 NO_UNLOAD_STUB(ksocket, ksocket_connect, nomod_minus_one);
1323 NO_UNLOAD_STUB(ksocket, ksocket_recv, nomod_minus_one);
1324 NO_UNLOAD_STUB(ksocket, ksocket_recvfrom, nomod_minus_one);
1325 NO_UNLOAD_STUB(ksocket, ksocket_recvmsg, nomod_minus_one);
1326 NO_UNLOAD_STUB(ksocket, ksocket_send, nomod_minus_one);
1327 NO_UNLOAD_STUB(ksocket, ksocket_sendto, nomod_minus_one);
1328 NO_UNLOAD_STUB(ksocket, ksocket_sendmsg, nomod_minus_one);
1329 NO_UNLOAD_STUB(ksocket, ksocket_ioctl, nomod_minus_one);
1330 NO_UNLOAD_STUB(ksocket, ksocket_setcallbacks, nomod_minus_one);
1331 NO_UNLOAD_STUB(ksocket, ksocket_hold, nomod_minus_one);
1332 NO_UNLOAD_STUB(ksocket, ksocket_rele, nomod_minus_one);
1333 NO_UNLOAD_STUB(ksocket, ksocket_shutdown, nomod_minus_one);
1334 NO_UNLOAD_STUB(ksocket, ksocket_close, nomod_minus_one);
1335 END_MODULE(ksocket);
1336 #endif
1339 * Stubs for elfexec
1341 #ifndef ELFEXEC_MODULE
1342 MODULE(elfexec,exec);
1343 STUB(elfexec, elfexec, nomod_einval);
1344 STUB(elfexec, mapexec_brand, nomod_einval);
1345 #if defined(__amd64)
1346 STUB(elfexec, elf32exec, nomod_einval);
1347 STUB(elfexec, mapexec32_brand, nomod_einval);
1348 #endif
1349 END_MODULE(elfexec);
1350 #endif
1353 * Stub(s) for APIX module.
1355 #ifndef APIX_MODULE
1356 MODULE(apix,mach);
1357 WSTUB(apix, apix_loaded, nomod_zero);
1358 END_MODULE(apix);
1359 #endif
1361 / this is just a marker for the area of text that contains stubs
1363 ENTRY_NP(stubs_end)