xref: /titanic_44/usr/src/uts/intel/ia32/ml/modstubs.s (revision 28167c24ba5be8b7c1d05e02d053f4a55cd21cc9)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License").  You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22/*
23 * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24 * Use is subject to license terms.
25 */
26
27#pragma ident	"%Z%%M%	%I%	%E% SMI"
28
29#include <sys/asm_linkage.h>
30
31#if defined(__lint)
32
33char stubs_base[1], stubs_end[1];
34
35#else	/* __lint */
36
37#include "assym.h"
38
39/*
40 * !!!!!!!! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! !!!!!!!!
41 *
42 *	For functions which are either STUBs or WSTUBs the actual function
43 *	need to be called using 'call' instruction because of preamble and
44 *	postamble (i.e mod_hold_stub and mod_release_stub) around the
45 *	function call. Due to this we need to copy arguments for the
46 *	real function. On Intel we can't tell how many arguments are there
47 *	on the stack so we have to either copy everything between esp and
48 *	ebp or copy only a fixed number (MAXNARG - defined here) for
49 *	all the stub functions. Currently we are using MAXNARG (it is a kludge
50 *	but worth it?!).
51 *
52 *	NOTE: Use NO_UNLOAD_STUBs if the module is NOT unloadable once it is
53 *	      loaded.
54 */
55#define	MAXNARG	10
56
57/*
58 * WARNING: there is no check for forgetting to write END_MODULE,
59 * and if you do, the kernel will most likely crash.  Be careful
60 *
61 * This file assumes that all of the contributions to the data segment
62 * will be contiguous in the output file, even though they are separated
63 * by pieces of text.  This is safe for all assemblers I know of now...
64 */
65
66/*
67 * This file uses ansi preprocessor features:
68 *
69 * 1. 	#define mac(a) extra_ ## a     -->   mac(x) expands to extra_a
70 * The old version of this is
71 *      #define mac(a) extra_/.*.*./a
72 * but this fails if the argument has spaces "mac ( x )"
73 * (Ignore the dots above, I had to put them in to keep this a comment.)
74 *
75 * 2.   #define mac(a) #a             -->    mac(x) expands to "x"
76 * The old version is
77 *      #define mac(a) "a"
78 *
79 * For some reason, the 5.0 preprocessor isn't happy with the above usage.
80 * For now, we're not using these ansi features.
81 *
82 * The reason is that "the 5.0 ANSI preprocessor" is built into the compiler
83 * and is a tokenizing preprocessor. This means, when confronted by something
84 * other than C token generation rules, strange things occur. In this case,
85 * when confronted by an assembly file, it would turn the token ".globl" into
86 * two tokens "." and "globl". For this reason, the traditional, non-ANSI
87 * preprocessor is used on assembly files.
88 *
89 * It would be desirable to have a non-tokenizing cpp (accp?) to use for this.
90 */
91
92/*
93 * This file contains the stubs routines for modules which can be autoloaded.
94 */
95
96#if defined(__amd64)
97
98/*
99 * See the 'struct mod_modinfo' definition to see what this declaration
100 * is trying to achieve here.
101 */
102#define	MODULE(module,namespace)	\
103	.data;				\
104module/**/_modname:			\
105	.string	"namespace/module";	\
106	SET_SIZE(module/**/_modname);	\
107	.align	CPTRSIZE;		\
108	.globl	module/**/_modinfo;	\
109	.type	module/**/_modinfo, @object;	\
110module/**/_modinfo:			\
111	.quad	module/**/_modname;	\
112	.quad	0	/* storage for modctl pointer */
113
114	/* then mod_stub_info structures follow until a mods_func_adr is 0 */
115
116/* this puts a 0 where the next mods_func_adr would be */
117#define	END_MODULE(module)		\
118	.data;				\
119	.align	CPTRSIZE;		\
120	.quad 0;			\
121	SET_SIZE(module/**/_modinfo)
122
123/*
124 * The data section in the stub_common macro is the
125 * mod_stub_info structure for the stub function
126 */
127
128#define STUB_COMMON(module, fcnname, install_fcn, retfcn, weak)		\
129	ENTRY(fcnname);							\
130	leaq	fcnname/**/_info(%rip), %rax;				\
131	cmpl	$0, MODS_FLAG(%rax);			/* weak? */	\
132	je	stubs_common_code;			/* not weak */	\
133	testb	$MODS_INSTALLED, MODS_FLAG(%rax);	/* installed? */ \
134	jne	stubs_common_code;		/* yes, do the mod_hold */ \
135	jmp	*MODS_RETFCN(%rax);		/* no, jump to retfcn */ \
136	SET_SIZE(fcnname);						\
137	.data;								\
138	.align	 CPTRSIZE;						\
139	.type	fcnname/**/_info, @object;				\
140fcnname/**/_info:							\
141	.quad	install_fcn;		/* 0 */				\
142	.quad	module/**/_modinfo;	/* 0x8 */			\
143	.quad	fcnname;		/* 0x10 */			\
144	.quad	retfcn;			/* 0x18 */			\
145	.long	weak;			/* 0x20 */			\
146	SET_SIZE(fcnname/**/_info)
147
148#define STUB_UNLOADABLE(module, fcnname, install_fcn, retfcn, weak)	\
149	ENTRY(fcnname);							\
150	leaq	fcnname/**/_info(%rip), %rax;				\
151	testb	$MODS_INSTALLED, MODS_FLAG(%rax); /* installed? */	\
152	je	5f;			/* no */			\
153	jmp	*(%rax);		/* yes, jump to install_fcn */	\
1545:	testb	$MODS_WEAK, MODS_FLAG(%rax);	/* weak? */		\
155	je	stubs_common_code;	/* no, do mod load */		\
156	jmp	*MODS_RETFCN(%rax);	/* yes, jump to retfcn */	\
157	SET_SIZE(fcnname);						\
158	.data;								\
159	.align	CPTRSIZE;						\
160	.type	fcnname/**/_info, @object;				\
161fcnname/**/_info:							\
162	.quad	install_fcn;		/* 0 */				\
163	.quad	module/**/_modinfo;	/* 0x8 */			\
164	.quad	fcnname;		/* 0x10 */			\
165	.quad	retfcn;			/* 0x18 */			\
166	.long   weak;			/* 0x20 */			\
167	SET_SIZE(fcnname/**/_info)
168
169/*
170 * We branch here with the fcnname_info pointer in %rax
171 */
172	ENTRY_NP(stubs_common_code)
173	.globl	mod_hold_stub
174	.globl	mod_release_stub
175	pushq	%rbp
176	movq	%rsp, %rbp
177	subq	$0x10, %rsp
178	movq	%r15, (%rsp)		/* (caller saved) */
179	movq	%rax, %r15		/* stash the fcnname_info pointer */
180	/*
181	 * save incoming register arguments
182	 */
183	pushq	%rdi
184	pushq	%rsi
185	pushq	%rdx
186	pushq	%rcx
187	pushq	%r8
188	pushq	%r9
189	/* (next 4 args, if any, are already on the stack above %rbp) */
190	movq	%r15, %rdi
191	call	mod_hold_stub		/* mod_hold_stub(mod_stub_info *) */
192	cmpl	$-1, %eax		/* error? */
193	jne	.L1
194	movq	0x18(%r15), %rax
195	call	*%rax
196	addq	$0x30, %rsp
197	jmp	.L2
198.L1:
199	/*
200	 * copy MAXNARG == 10 incoming arguments
201	 */
202	popq	%r9
203	popq	%r8
204	popq	%rcx
205	popq	%rdx
206	popq	%rsi
207	popq	%rdi
208	/*
209	 * stack:
210	 *	arg9		0x38(%rsp)
211	 *	arg8		0x30(%rsp)
212	 *	arg7		0x28(%rsp)
213	 *	arg6		0x20(%rsp)
214	 *	saved %rip	0x18(%rsp)
215	 *	saved %rbp	0x10(%rsp)
216	 *	<pad>		0x8(%rsp)
217	 *	saved %r15	0x0(%rsp)
218	 */
219	movl	$MAXNARG - 6 + 3, %r11d
220	pushq	(%rsp, %r11, 8)
221	pushq	(%rsp, %r11, 8)
222	pushq	(%rsp, %r11, 8)
223	pushq	(%rsp, %r11, 8)
224	call	*(%r15)			/* call the stub fn(arg, ..) */
225	addq	$0x20, %rsp		/* pop off last 4 args */
226	pushq	%rax			/* save any return values */
227	pushq	%rdx
228	movq	%r15, %rdi
229	call	mod_release_stub	/* release hold on module */
230	popq	%rdx			/* restore return values */
231	popq	%rax
232.L2:
233	popq	%r15
234	leave
235	ret
236	SET_SIZE(stubs_common_code)
237
238#elif defined(__i386)
239
240/*
241 * See the 'struct mod_modinfo' definition to see what this declaration
242 * is trying to achieve here.
243 */
244#define MODULE(module,namespace)	\
245	.data;				\
246module/**/_modname:			\
247	.string	"namespace/module";	\
248	SET_SIZE(module/**/_modname);	\
249	.align	CPTRSIZE;		\
250	.globl	module/**/_modinfo;	\
251	.type	module/**/_modinfo, @object;	\
252module/**/_modinfo:			\
253	.long	module/**/_modname;	\
254	.long	0	/* storage for modctl pointer */
255
256	/* then mod_stub_info structures follow until a mods_func_adr is 0 */
257
258/* this puts a 0 where the next mods_func_adr would be */
259#define END_MODULE(module)		\
260	.data;				\
261	.align	CPTRSIZE;		\
262	.long 0;			\
263	SET_SIZE(module/**/_modinfo)
264
265/*
266 * The data section in the stub_common macro is the
267 * mod_stub_info structure for the stub function
268 */
269
270/*
271 * The flag MODS_INSTALLED is stored in the stub data and is used to
272 * indicate if a module is installed and initialized.  This flag is used
273 * instead of the mod_stub_info->mods_modinfo->mod_installed flag
274 * to minimize the number of pointer de-references for each function
275 * call (and also to avoid possible TLB misses which could be induced
276 * by dereferencing these pointers.)
277 */
278
279#define STUB_COMMON(module, fcnname, install_fcn, retfcn, weak)		\
280	ENTRY(fcnname);							\
281	leal	fcnname/**/_info, %eax;					\
282	cmpl	$0, MODS_FLAG(%eax);	/* weak? */			\
283	je	stubs_common_code;	/* not weak */			\
284	testb	$MODS_INSTALLED, MODS_FLAG(%eax); /* installed? */	\
285	jne	stubs_common_code;	/* yes, do the mod_hold */	\
286	jmp	*MODS_RETFCN(%eax);	/* no, just jump to retfcn */	\
287	SET_SIZE(fcnname);						\
288	.data;								\
289	.align	 CPTRSIZE;						\
290	.type	fcnname/**/_info, @object;				\
291fcnname/**/_info:							\
292	.long	install_fcn;						\
293	.long	module/**/_modinfo;					\
294	.long	fcnname;						\
295	.long	retfcn;							\
296	.long   weak;							\
297	SET_SIZE(fcnname/**/_info)
298
299#define STUB_UNLOADABLE(module, fcnname, install_fcn, retfcn, weak)	\
300	ENTRY(fcnname);							\
301	leal	fcnname/**/_info, %eax;					\
302	testb	$MODS_INSTALLED, MODS_FLAG(%eax); /* installed? */	\
303	je	5f;		/* no */				\
304	jmp	*(%eax);	/* yes, just jump to install_fcn */	\
3055:	testb	$MODS_WEAK, MODS_FLAG(%eax);	/* weak? */		\
306	je	stubs_common_code;	/* no, do mod load */		\
307	jmp	*MODS_RETFCN(%eax);	/* yes, just jump to retfcn */ 	\
308	SET_SIZE(fcnname);						\
309	.data;								\
310	.align	CPTRSIZE;						\
311	.type	fcnname/**/_info, @object;				\
312fcnname/**/_info:							\
313	.long	install_fcn;		/* 0 */				\
314	.long	module/**/_modinfo;	/* 0x4 */			\
315	.long	fcnname;		/* 0x8 */			\
316	.long	retfcn;			/* 0xc */			\
317	.long   weak;			/* 0x10 */			\
318	SET_SIZE(fcnname/**/_info)
319
320/*
321 * We branch here with the fcnname_info pointer in %eax
322 */
323	ENTRY_NP(stubs_common_code)
324	.globl	mod_hold_stub
325	.globl	mod_release_stub
326	pushl	%esi
327	movl	%eax, %esi		/ save the info pointer
328	pushl	%eax
329	call	mod_hold_stub		/ mod_hold_stub(mod_stub_info *)
330	popl	%ecx
331	cmpl	$-1, %eax		/ error?
332	jne	.L1
333	movl	MODS_RETFCN(%esi), %eax
334	call    *%eax
335	popl	%esi			/ yes, return error (panic?)
336	ret
337.L1:
338	movl	$MAXNARG+1, %ecx
339	/ copy incoming arguments
340	pushl	(%esp, %ecx, 4)		/ push MAXNARG times
341	pushl	(%esp, %ecx, 4)
342	pushl	(%esp, %ecx, 4)
343	pushl	(%esp, %ecx, 4)
344	pushl	(%esp, %ecx, 4)
345	pushl	(%esp, %ecx, 4)
346	pushl	(%esp, %ecx, 4)
347	pushl	(%esp, %ecx, 4)
348	pushl	(%esp, %ecx, 4)
349	pushl	(%esp, %ecx, 4)
350	call	*(%esi)			/ call the stub function(arg1,arg2, ...)
351	add	$_MUL(MAXNARG, 4), %esp	/ pop off MAXNARG arguments
352	pushl	%eax			/ save any return values from the stub
353	pushl	%edx
354	pushl	%esi
355	call	mod_release_stub	/ release hold on module
356	addl	$4, %esp
357	popl	%edx			/ restore return values
358	popl	%eax
359.L2:
360	popl	%esi
361	ret
362	SET_SIZE(stubs_common_code)
363
364#endif	/* __i386 */
365
366#define STUB(module, fcnname, retfcn)	\
367    STUB_COMMON(module, fcnname, mod_hold_stub, retfcn, 0)
368
369/*
370 * "weak stub", don't load on account of this call
371 */
372#define WSTUB(module, fcnname, retfcn)	\
373    STUB_COMMON(module, fcnname, retfcn, retfcn, MODS_WEAK)
374
375/*
376 * "non-unloadable stub", don't bother 'holding' module if it's already loaded
377 * since the module cannot be unloaded.
378 *
379 * User *MUST* guarantee the module is not unloadable (no _fini routine).
380 */
381#define NO_UNLOAD_STUB(module, fcnname, retfcn) \
382    STUB_UNLOADABLE(module, fcnname,  retfcn, retfcn, MODS_NOUNLOAD)
383
384/*
385 * "weak stub" for non-unloadable module, don't load on account of this call
386 */
387#define NO_UNLOAD_WSTUB(module, fcnname, retfcn) \
388    STUB_UNLOADABLE(module, fcnname, retfcn, retfcn, MODS_NOUNLOAD|MODS_WEAK)
389
390/*
391 * this is just a marker for the beginning area of text that contains stubs
392 */
393	ENTRY_NP(stubs_base)
394	nop
395
396/*
397 * WARNING WARNING WARNING!!!!!!
398 *
399 * On the MODULE macro you MUST NOT use any spaces!!! They are
400 * significant to the preprocessor.  With ansi c there is a way around this
401 * but for some reason (yet to be investigated) ansi didn't work for other
402 * reasons!
403 *
404 * When zero is used as the return function, the system will call
405 * panic if the stub can't be resolved.
406 */
407
408/*
409 * Stubs for devfs. A non-unloadable module.
410 */
411
412#ifndef	DEVFS_MODULE
413	MODULE(devfs,fs);
414	NO_UNLOAD_STUB(devfs, devfs_clean,		nomod_minus_one);
415	NO_UNLOAD_STUB(devfs, devfs_lookupname,		nomod_minus_one);
416	NO_UNLOAD_STUB(devfs, devfs_walk,		nomod_minus_one);
417	NO_UNLOAD_STUB(devfs, devfs_devpolicy,		nomod_minus_one);
418	NO_UNLOAD_STUB(devfs, devfs_reset_perm,		nomod_minus_one);
419	NO_UNLOAD_STUB(devfs, devfs_remdrv_cleanup,	nomod_minus_one);
420	END_MODULE(devfs);
421#endif
422
423/*
424 * Stubs for specfs. A non-unloadable module.
425 */
426
427#ifndef SPEC_MODULE
428	MODULE(specfs,fs);
429	NO_UNLOAD_STUB(specfs, common_specvp,		nomod_zero);
430	NO_UNLOAD_STUB(specfs, makectty,		nomod_zero);
431	NO_UNLOAD_STUB(specfs, makespecvp,     		nomod_zero);
432	NO_UNLOAD_STUB(specfs, smark,          		nomod_zero);
433	NO_UNLOAD_STUB(specfs, spec_segmap,    		nomod_einval);
434	NO_UNLOAD_STUB(specfs, specfind,       		nomod_zero);
435	NO_UNLOAD_STUB(specfs, specvp,         		nomod_zero);
436	NO_UNLOAD_STUB(specfs, devi_stillreferenced,	nomod_zero);
437	NO_UNLOAD_STUB(specfs, spec_getvnodeops,	nomod_zero);
438	NO_UNLOAD_STUB(specfs, spec_char_map,		nomod_zero);
439	NO_UNLOAD_STUB(specfs, specvp_devfs,  		nomod_zero);
440	NO_UNLOAD_STUB(specfs, spec_assoc_vp_with_devi,	nomod_void);
441	NO_UNLOAD_STUB(specfs, spec_hold_devi_by_vp,	nomod_zero);
442	NO_UNLOAD_STUB(specfs, spec_snode_walk,		nomod_void);
443	NO_UNLOAD_STUB(specfs, spec_devi_open_count,	nomod_minus_one);
444	NO_UNLOAD_STUB(specfs, spec_is_clone,		nomod_zero);
445	NO_UNLOAD_STUB(specfs, spec_is_selfclone,	nomod_zero);
446	END_MODULE(specfs);
447#endif
448
449
450/*
451 * Stubs for sockfs. A non-unloadable module.
452 */
453#ifndef SOCK_MODULE
454	MODULE(sockfs,fs);
455	NO_UNLOAD_STUB(sockfs, so_socket,  	nomod_zero);
456	NO_UNLOAD_STUB(sockfs, so_socketpair,	nomod_zero);
457	NO_UNLOAD_STUB(sockfs, bind,  		nomod_zero);
458	NO_UNLOAD_STUB(sockfs, listen,  	nomod_zero);
459	NO_UNLOAD_STUB(sockfs, accept,  	nomod_zero);
460	NO_UNLOAD_STUB(sockfs, connect,  	nomod_zero);
461	NO_UNLOAD_STUB(sockfs, shutdown,  	nomod_zero);
462	NO_UNLOAD_STUB(sockfs, recv,  		nomod_zero);
463	NO_UNLOAD_STUB(sockfs, recvfrom,  	nomod_zero);
464	NO_UNLOAD_STUB(sockfs, recvmsg,  	nomod_zero);
465	NO_UNLOAD_STUB(sockfs, send,  		nomod_zero);
466	NO_UNLOAD_STUB(sockfs, sendmsg,  	nomod_zero);
467	NO_UNLOAD_STUB(sockfs, sendto,  	nomod_zero);
468#ifdef _SYSCALL32_IMPL
469	NO_UNLOAD_STUB(sockfs, recv32,		nomod_zero);
470	NO_UNLOAD_STUB(sockfs, recvfrom32,	nomod_zero);
471	NO_UNLOAD_STUB(sockfs, send32,		nomod_zero);
472	NO_UNLOAD_STUB(sockfs, sendto32,	nomod_zero);
473#endif	/* _SYSCALL32_IMPL */
474	NO_UNLOAD_STUB(sockfs, getpeername,  	nomod_zero);
475	NO_UNLOAD_STUB(sockfs, getsockname,  	nomod_zero);
476	NO_UNLOAD_STUB(sockfs, getsockopt,  	nomod_zero);
477	NO_UNLOAD_STUB(sockfs, setsockopt,  	nomod_zero);
478	NO_UNLOAD_STUB(sockfs, sockconfig,  	nomod_zero);
479	NO_UNLOAD_STUB(sockfs, nca_sendfilev,  	nomod_zero);
480	NO_UNLOAD_STUB(sockfs, sock_getmsg,  	nomod_zero);
481	NO_UNLOAD_STUB(sockfs, sock_putmsg,  	nomod_zero);
482	NO_UNLOAD_STUB(sockfs, sosendfile64,  	nomod_zero);
483	NO_UNLOAD_STUB(sockfs, sock_getfasync,  nomod_zero);
484	NO_UNLOAD_STUB(sockfs, nl7c_sendfilev,  nomod_zero);
485	NO_UNLOAD_STUB(sockfs, sostream_direct,	nomod_zero);
486	END_MODULE(sockfs);
487#endif
488
489/*
490 * IPsec stubs.
491 */
492
493#ifndef	IPSECAH_MODULE
494	MODULE(ipsecah,drv);
495	WSTUB(ipsecah,	ipsec_construct_inverse_acquire,	nomod_zero);
496	WSTUB(ipsecah,	sadb_acquire,		nomod_zero);
497	WSTUB(ipsecah,	sadb_ill_download,	nomod_zero);
498	WSTUB(ipsecah,	ipsecah_algs_changed,	nomod_zero);
499	WSTUB(ipsecah,	sadb_alg_update,	nomod_zero);
500	WSTUB(ipsecah,	sadb_unlinkassoc,	nomod_zero);
501	WSTUB(ipsecah,	sadb_insertassoc,	nomod_zero);
502	WSTUB(ipsecah,	ipsecah_rl_strlog,	nomod_zero);
503	WSTUB(ipsecah,	ipsecah_in_assocfailure,	nomod_zero);
504	WSTUB(ipsecah,	sadb_set_lpkt,		nomod_zero);
505	WSTUB(ipsecah,	ipsecah_icmp_error,	nomod_zero);
506	END_MODULE(ipsecah);
507#endif
508
509#ifndef	IPSECESP_MODULE
510	MODULE(ipsecesp,drv);
511	WSTUB(ipsecesp,	ipsecesp_fill_defs,	nomod_zero);
512	WSTUB(ipsecesp,	ipsecesp_algs_changed,	nomod_zero);
513	WSTUB(ipsecesp, ipsecesp_in_assocfailure,	nomod_zero);
514	WSTUB(ipsecesp, ipsecesp_init_funcs,	nomod_zero);
515	WSTUB(ipsecesp,	ipsecesp_icmp_error,	nomod_zero);
516	END_MODULE(ipsecesp);
517#endif
518
519#ifndef	KEYSOCK_MODULE
520	MODULE(keysock,	drv);
521	WSTUB(keysock,	keysock_plumb_ipsec,	nomod_zero);
522	WSTUB(keysock,	keysock_extended_reg,	nomod_zero);
523	WSTUB(keysock,	keysock_next_seq,	nomod_zero);
524	END_MODULE(keysock);
525#endif
526
527#ifndef SPDSOCK_MODULE
528	MODULE(spdsock,drv);
529	WSTUB(spdsock,	spdsock_update_pending_algs,	nomod_zero);
530	END_MODULE(spdsock);
531#endif
532
533#ifndef NATTYMOD_MODULE
534	MODULE(nattymod, strmod);
535	WSTUB(nattymod, nattymod_clean_ipif, nomod_zero);
536	END_MODULE(nattymod);
537#endif
538
539/*
540 * Stubs for nfs common code.
541 * XXX nfs_getvnodeops should go away with removal of kludge in vnode.c
542 */
543#ifndef NFS_MODULE
544	MODULE(nfs,fs);
545	WSTUB(nfs,	nfs_getvnodeops,	nomod_zero);
546	WSTUB(nfs,	nfs_perror,		nomod_zero);
547	WSTUB(nfs,	nfs_cmn_err,		nomod_zero);
548	WSTUB(nfs,	clcleanup_zone,		nomod_zero);
549	WSTUB(nfs,	clcleanup4_zone,	nomod_zero);
550	END_MODULE(nfs);
551#endif
552
553
554/*
555 * Stubs for nfs_dlboot (diskless booting).
556 */
557#ifndef NFS_DLBOOT_MODULE
558	MODULE(nfs_dlboot,misc);
559	STUB(nfs_dlboot,	mount_root,	nomod_minus_one);
560	STUB(nfs_dlboot,	dhcpinit,	nomod_minus_one);
561	END_MODULE(nfs_dlboot);
562#endif
563
564/*
565 * Stubs for nfs server-only code.
566 */
567#ifndef NFSSRV_MODULE
568	MODULE(nfssrv,misc);
569	STUB(nfssrv,		lm_nfs3_fhtovp,	nomod_minus_one);
570	STUB(nfssrv,		lm_fhtovp,	nomod_minus_one);
571	STUB(nfssrv,		exportfs,	nomod_minus_one);
572	STUB(nfssrv,		nfs_getfh,	nomod_minus_one);
573	STUB(nfssrv,		nfsl_flush,	nomod_minus_one);
574	STUB(nfssrv,		rfs4_check_delegated, nomod_zero) ;
575	NO_UNLOAD_STUB(nfssrv,	rdma_start,	nomod_zero);
576	NO_UNLOAD_STUB(nfssrv,	nfs_svc,	nomod_zero);
577	END_MODULE(nfssrv);
578#endif
579
580/*
581 * Stubs for kernel lock manager.
582 */
583#ifndef KLM_MODULE
584	MODULE(klmmod,misc);
585	NO_UNLOAD_STUB(klmmod, lm_svc,		nomod_zero);
586	NO_UNLOAD_STUB(klmmod, lm_shutdown,	nomod_zero);
587	NO_UNLOAD_STUB(klmmod, lm_unexport,	nomod_zero);
588	NO_UNLOAD_STUB(klmmod, lm_safelock, nomod_zero);
589	NO_UNLOAD_STUB(klmmod, lm_safemap, nomod_zero);
590	NO_UNLOAD_STUB(klmmod, lm_has_sleep, nomod_zero);
591	NO_UNLOAD_STUB(klmmod, lm_free_config, nomod_zero);
592	NO_UNLOAD_STUB(klmmod, lm_vp_active, nomod_zero);
593	NO_UNLOAD_STUB(klmmod, lm_get_sysid, nomod_zero);
594	NO_UNLOAD_STUB(klmmod, lm_rel_sysid, nomod_zero);
595	NO_UNLOAD_STUB(klmmod, lm_alloc_sysidt, nomod_minus_one);
596	NO_UNLOAD_STUB(klmmod, lm_free_sysidt, nomod_zero);
597	NO_UNLOAD_STUB(klmmod, lm_sysidt, nomod_minus_one);
598	END_MODULE(klmmod);
599#endif
600
601#ifndef KLMOPS_MODULE
602	MODULE(klmops,misc);
603	NO_UNLOAD_STUB(klmops, lm_frlock,	nomod_zero);
604	NO_UNLOAD_STUB(klmops, lm4_frlock,	nomod_zero);
605	NO_UNLOAD_STUB(klmops, lm_shrlock,	nomod_zero);
606	NO_UNLOAD_STUB(klmops, lm4_shrlock,	nomod_zero);
607	NO_UNLOAD_STUB(klmops, lm_nlm_dispatch,	nomod_zero);
608	NO_UNLOAD_STUB(klmops, lm_nlm4_dispatch,	nomod_zero);
609	NO_UNLOAD_STUB(klmops, lm_nlm_reclaim,	nomod_zero);
610	NO_UNLOAD_STUB(klmops, lm_nlm4_reclaim,	nomod_zero);
611	NO_UNLOAD_STUB(klmops, lm_register_lock_locally, nomod_zero);
612	END_MODULE(klmops);
613#endif
614
615/*
616 * Stubs for kernel TLI module
617 *   XXX currently we never allow this to unload
618 */
619#ifndef TLI_MODULE
620	MODULE(tlimod,misc);
621	NO_UNLOAD_STUB(tlimod,	t_kopen,		nomod_minus_one);
622	NO_UNLOAD_STUB(tlimod,	t_kunbind,		nomod_zero);
623	NO_UNLOAD_STUB(tlimod,	t_kadvise,		nomod_zero);
624	NO_UNLOAD_STUB(tlimod,	t_krcvudata,		nomod_zero);
625	NO_UNLOAD_STUB(tlimod,	t_ksndudata,		nomod_zero);
626	NO_UNLOAD_STUB(tlimod,	t_kalloc,		nomod_zero);
627	NO_UNLOAD_STUB(tlimod,	t_kbind,		nomod_zero);
628	NO_UNLOAD_STUB(tlimod,	t_kclose,		nomod_zero);
629	NO_UNLOAD_STUB(tlimod,	t_kspoll,		nomod_zero);
630	NO_UNLOAD_STUB(tlimod,	t_kfree,		nomod_zero);
631	END_MODULE(tlimod);
632#endif
633
634/*
635 * Stubs for kernel RPC module
636 *   XXX currently we never allow this to unload
637 */
638#ifndef RPC_MODULE
639	MODULE(rpcmod,strmod);
640	NO_UNLOAD_STUB(rpcmod,	clnt_tli_kcreate,	nomod_minus_one);
641	NO_UNLOAD_STUB(rpcmod,	svc_tli_kcreate,	nomod_minus_one);
642	NO_UNLOAD_STUB(rpcmod,	bindresvport,		nomod_minus_one);
643	NO_UNLOAD_STUB(rpcmod, rdma_register_mod,	nomod_minus_one);
644	NO_UNLOAD_STUB(rpcmod, rdma_unregister_mod,	nomod_minus_one);
645	NO_UNLOAD_STUB(rpcmod, svc_queuereq,		nomod_minus_one);
646	NO_UNLOAD_STUB(rpcmod, clist_add,		nomod_minus_one);
647	END_MODULE(rpcmod);
648#endif
649
650/*
651 * Stubs for des
652 */
653#ifndef DES_MODULE
654	MODULE(des,misc);
655	STUB(des, cbc_crypt, 	 	nomod_zero);
656	STUB(des, ecb_crypt, 		nomod_zero);
657	STUB(des, _des_crypt,		nomod_zero);
658	END_MODULE(des);
659#endif
660
661/*
662 * Stubs for procfs. A non-unloadable module.
663 */
664#ifndef PROC_MODULE
665	MODULE(procfs,fs);
666	NO_UNLOAD_STUB(procfs, prfree,		nomod_zero);
667	NO_UNLOAD_STUB(procfs, prexit,		nomod_zero);
668	NO_UNLOAD_STUB(procfs, prlwpfree,	nomod_zero);
669	NO_UNLOAD_STUB(procfs, prlwpexit,	nomod_zero);
670	NO_UNLOAD_STUB(procfs, prinvalidate,	nomod_zero);
671	NO_UNLOAD_STUB(procfs, prnsegs,		nomod_zero);
672	NO_UNLOAD_STUB(procfs, prgetcred,	nomod_zero);
673	NO_UNLOAD_STUB(procfs, prgetpriv,	nomod_zero);
674	NO_UNLOAD_STUB(procfs, prgetprivsize,	nomod_zero);
675	NO_UNLOAD_STUB(procfs, prgetstatus,	nomod_zero);
676	NO_UNLOAD_STUB(procfs, prgetlwpstatus,	nomod_zero);
677	NO_UNLOAD_STUB(procfs, prgetpsinfo,	nomod_zero);
678	NO_UNLOAD_STUB(procfs, prgetlwpsinfo,	nomod_zero);
679	NO_UNLOAD_STUB(procfs, oprgetstatus,	nomod_zero);
680	NO_UNLOAD_STUB(procfs, oprgetpsinfo,	nomod_zero);
681#ifdef _SYSCALL32_IMPL
682	NO_UNLOAD_STUB(procfs, prgetstatus32,	nomod_zero);
683	NO_UNLOAD_STUB(procfs, prgetlwpstatus32, nomod_zero);
684	NO_UNLOAD_STUB(procfs, prgetpsinfo32,	nomod_zero);
685	NO_UNLOAD_STUB(procfs, prgetlwpsinfo32,	nomod_zero);
686	NO_UNLOAD_STUB(procfs, oprgetstatus32,	nomod_zero);
687	NO_UNLOAD_STUB(procfs, oprgetpsinfo32,	nomod_zero);
688#endif	/* _SYSCALL32_IMPL */
689	NO_UNLOAD_STUB(procfs, prnotify,	nomod_zero);
690	NO_UNLOAD_STUB(procfs, prexecstart,	nomod_zero);
691	NO_UNLOAD_STUB(procfs, prexecend,	nomod_zero);
692	NO_UNLOAD_STUB(procfs, prrelvm,		nomod_zero);
693	NO_UNLOAD_STUB(procfs, prbarrier,	nomod_zero);
694	NO_UNLOAD_STUB(procfs, estimate_msacct,	nomod_zero);
695	NO_UNLOAD_STUB(procfs, pr_getprot,	nomod_zero);
696	NO_UNLOAD_STUB(procfs, pr_getprot_done,	nomod_zero);
697	NO_UNLOAD_STUB(procfs, pr_getsegsize,	nomod_zero);
698	NO_UNLOAD_STUB(procfs, pr_isobject,	nomod_zero);
699	NO_UNLOAD_STUB(procfs, pr_isself,	nomod_zero);
700	NO_UNLOAD_STUB(procfs, pr_allstopped,	nomod_zero);
701	NO_UNLOAD_STUB(procfs, pr_free_watched_pages, nomod_zero);
702	END_MODULE(procfs);
703#endif
704
705/*
706 * Stubs for fifofs
707 */
708#ifndef FIFO_MODULE
709	MODULE(fifofs,fs);
710	STUB(fifofs, fifovp,      	0);
711	STUB(fifofs, fifo_getinfo,	0);
712	STUB(fifofs, fifo_vfastoff,	0);
713	END_MODULE(fifofs);
714#endif
715
716/*
717 * Stubs for ufs
718 *
719 * This is needed to support the old quotactl system call.
720 * When the old sysent stuff goes away, this will need to be revisited.
721 */
722#ifndef UFS_MODULE
723	MODULE(ufs,fs);
724	STUB(ufs, quotactl, nomod_minus_one);
725	END_MODULE(ufs);
726#endif
727
728/*
729 * Stubs for namefs
730 */
731#ifndef NAMEFS_MODULE
732	MODULE(namefs,fs);
733	STUB(namefs, nm_unmountall, 	0);
734	END_MODULE(namefs);
735#endif
736
737/*
738 * Stubs for ts_dptbl
739 */
740#ifndef TS_DPTBL_MODULE
741	MODULE(TS_DPTBL,sched);
742	STUB(TS_DPTBL, ts_getdptbl,		0);
743	STUB(TS_DPTBL, ts_getkmdpris,		0);
744	STUB(TS_DPTBL, ts_getmaxumdpri,	0);
745	END_MODULE(TS_DPTBL);
746#endif
747
748/*
749 * Stubs for rt_dptbl
750 */
751#ifndef RT_DPTBL_MODULE
752	MODULE(RT_DPTBL,sched);
753	STUB(RT_DPTBL, rt_getdptbl,		0);
754	END_MODULE(RT_DPTBL);
755#endif
756
757/*
758 * Stubs for ia_dptbl
759 */
760#ifndef IA_DPTBL_MODULE
761	MODULE(IA_DPTBL,sched);
762	STUB(IA_DPTBL, ia_getdptbl,		nomod_zero);
763	STUB(IA_DPTBL, ia_getkmdpris,		nomod_zero);
764	STUB(IA_DPTBL, ia_getmaxumdpri,	nomod_zero);
765	END_MODULE(IA_DPTBL);
766#endif
767
768/*
769 * Stubs for FSS scheduler
770 */
771#ifndef FSS_MODULE
772	MODULE(FSS,sched);
773	WSTUB(FSS, fss_allocbuf,		nomod_zero);
774	WSTUB(FSS, fss_freebuf,			nomod_zero);
775	WSTUB(FSS, fss_changeproj,		nomod_zero);
776	WSTUB(FSS, fss_changepset,		nomod_zero);
777	END_MODULE(FSS);
778#endif
779
780/*
781 * Stubs for fx_dptbl
782 */
783#ifndef FX_DPTBL_MODULE
784	MODULE(FX_DPTBL,sched);
785	STUB(FX_DPTBL, fx_getdptbl,		0);
786	STUB(FX_DPTBL, fx_getmaxumdpri,		0);
787	END_MODULE(FX_DPTBL);
788#endif
789
790/*
791 * Stubs for bootdev
792 */
793#ifndef BOOTDEV_MODULE
794	MODULE(bootdev,misc);
795	STUB(bootdev, i_promname_to_devname, 0);
796	STUB(bootdev, i_convert_boot_device_name, 0);
797	END_MODULE(bootdev);
798#endif
799
800/*
801 * stubs for strplumb...
802 */
803#ifndef STRPLUMB_MODULE
804	MODULE(strplumb,misc);
805	STUB(strplumb, strplumb,     0);
806	STUB(strplumb, strplumb_load, 0);
807	STUB(strplumb, strplumb_get_netdev_path, 0);
808	END_MODULE(strplumb);
809#endif
810
811/*
812 * Stubs for console configuration module
813 */
814#ifndef CONSCONFIG_MODULE
815	MODULE(consconfig,misc);
816	STUB(consconfig, consconfig,	0);
817	STUB(consconfig, consconfig_get_usb_kb_path,	0);
818	STUB(consconfig, consconfig_get_usb_ms_path,	0);
819	END_MODULE(consconfig);
820#endif
821
822/*
823 * Stubs for accounting.
824 */
825#ifndef SYSACCT_MODULE
826	MODULE(sysacct,sys);
827	WSTUB(sysacct, acct,  		nomod_zero);
828	WSTUB(sysacct, acct_fs_in_use, 	nomod_zero);
829	END_MODULE(sysacct);
830#endif
831
832/*
833 * Stubs for semaphore routines. sem.c
834 */
835#ifndef SEMSYS_MODULE
836	MODULE(semsys,sys);
837	WSTUB(semsys, semexit,		nomod_zero);
838	END_MODULE(semsys);
839#endif
840
841/*
842 * Stubs for shmem routines. shm.c
843 */
844#ifndef SHMSYS_MODULE
845	MODULE(shmsys,sys);
846	WSTUB(shmsys, shmexit,		nomod_zero);
847	WSTUB(shmsys, shmfork,		nomod_zero);
848	WSTUB(shmsys, shmgetid,		nomod_minus_one);
849	END_MODULE(shmsys);
850#endif
851
852/*
853 * Stubs for doors
854 */
855#ifndef DOOR_MODULE
856	MODULE(doorfs,sys);
857	WSTUB(doorfs, door_slam,			nomod_zero);
858	WSTUB(doorfs, door_exit,			nomod_zero);
859	WSTUB(doorfs, door_revoke_all,			nomod_zero);
860	WSTUB(doorfs, door_fork,			nomod_zero);
861	NO_UNLOAD_STUB(doorfs, door_upcall,		nomod_einval);
862	NO_UNLOAD_STUB(doorfs, door_ki_create,		nomod_einval);
863	NO_UNLOAD_STUB(doorfs, door_ki_open,		nomod_einval);
864	NO_UNLOAD_STUB(doorfs, door_ki_lookup,		nomod_zero);
865	WSTUB(doorfs, door_ki_upcall,			nomod_einval);
866	WSTUB(doorfs, door_ki_hold,			nomod_zero);
867	WSTUB(doorfs, door_ki_rele,			nomod_zero);
868	WSTUB(doorfs, door_ki_info,			nomod_einval);
869	END_MODULE(doorfs);
870#endif
871
872/*
873 * Stubs for auditing.
874 */
875#ifndef C2AUDIT_MODULE
876	MODULE(c2audit,sys);
877	STUB(c2audit,  audit_init,			nomod_zero);
878	STUB(c2audit,  _auditsys,			nomod_zero);
879	NO_UNLOAD_STUB(c2audit, audit_free,		nomod_zero);
880	NO_UNLOAD_STUB(c2audit, audit_start, 		nomod_zero);
881	NO_UNLOAD_STUB(c2audit, audit_finish,		nomod_zero);
882	NO_UNLOAD_STUB(c2audit, audit_newproc,		nomod_zero);
883	NO_UNLOAD_STUB(c2audit, audit_pfree,		nomod_zero);
884	NO_UNLOAD_STUB(c2audit, audit_thread_free,	nomod_zero);
885	NO_UNLOAD_STUB(c2audit, audit_thread_create,	nomod_zero);
886	NO_UNLOAD_STUB(c2audit, audit_falloc,		nomod_zero);
887	NO_UNLOAD_STUB(c2audit, audit_unfalloc,		nomod_zero);
888	NO_UNLOAD_STUB(c2audit, audit_closef,		nomod_zero);
889	NO_UNLOAD_STUB(c2audit, audit_copen,		nomod_zero);
890	NO_UNLOAD_STUB(c2audit, audit_core_start,	nomod_zero);
891	NO_UNLOAD_STUB(c2audit, audit_core_finish,	nomod_zero);
892	NO_UNLOAD_STUB(c2audit, audit_stropen,		nomod_zero);
893	NO_UNLOAD_STUB(c2audit, audit_strclose,		nomod_zero);
894	NO_UNLOAD_STUB(c2audit, audit_strioctl,		nomod_zero);
895	NO_UNLOAD_STUB(c2audit, audit_strputmsg,	nomod_zero);
896	NO_UNLOAD_STUB(c2audit, audit_c2_revoke,	nomod_zero);
897	NO_UNLOAD_STUB(c2audit, audit_savepath,		nomod_zero);
898	NO_UNLOAD_STUB(c2audit, audit_anchorpath,	nomod_zero);
899	NO_UNLOAD_STUB(c2audit, audit_addcomponent,	nomod_zero);
900	NO_UNLOAD_STUB(c2audit, audit_exit,		nomod_zero);
901	NO_UNLOAD_STUB(c2audit, audit_exec,		nomod_zero);
902	NO_UNLOAD_STUB(c2audit, audit_symlink,		nomod_zero);
903	NO_UNLOAD_STUB(c2audit, audit_symlink_create,	nomod_zero);
904	NO_UNLOAD_STUB(c2audit, audit_vncreate_start,	nomod_zero);
905	NO_UNLOAD_STUB(c2audit, audit_vncreate_finish,	nomod_zero);
906	NO_UNLOAD_STUB(c2audit, audit_enterprom,	nomod_zero);
907	NO_UNLOAD_STUB(c2audit, audit_exitprom,		nomod_zero);
908	NO_UNLOAD_STUB(c2audit, audit_chdirec,		nomod_zero);
909	NO_UNLOAD_STUB(c2audit, audit_getf,		nomod_zero);
910	NO_UNLOAD_STUB(c2audit, audit_setf,		nomod_zero);
911	NO_UNLOAD_STUB(c2audit, audit_sock,		nomod_zero);
912	NO_UNLOAD_STUB(c2audit, audit_strgetmsg,	nomod_zero);
913	NO_UNLOAD_STUB(c2audit, audit_ipc,		nomod_zero);
914	NO_UNLOAD_STUB(c2audit, audit_ipcget,		nomod_zero);
915	NO_UNLOAD_STUB(c2audit, audit_lookupname,	nomod_zero);
916	NO_UNLOAD_STUB(c2audit, audit_pathcomp,		nomod_zero);
917	NO_UNLOAD_STUB(c2audit, audit_fdsend,		nomod_zero);
918	NO_UNLOAD_STUB(c2audit, audit_fdrecv,		nomod_zero);
919	NO_UNLOAD_STUB(c2audit, audit_priv,		nomod_zero);
920	NO_UNLOAD_STUB(c2audit, audit_setppriv,		nomod_zero);
921	NO_UNLOAD_STUB(c2audit, audit_devpolicy,	nomod_zero);
922	NO_UNLOAD_STUB(c2audit, audit_setfsat_path,	nomod_zero);
923	NO_UNLOAD_STUB(c2audit, audit_cryptoadm,	nomod_zero);
924	NO_UNLOAD_STUB(c2audit, audit_update_context,	nomod_zero);
925	NO_UNLOAD_STUB(c2audit, audit_kssl,		nomod_zero);
926	END_MODULE(c2audit);
927#endif
928
929/*
930 * Stubs for kernel rpc security service module
931 */
932#ifndef RPCSEC_MODULE
933	MODULE(rpcsec,misc);
934	NO_UNLOAD_STUB(rpcsec, sec_clnt_revoke,		nomod_zero);
935	NO_UNLOAD_STUB(rpcsec, authkern_create,		nomod_zero);
936	NO_UNLOAD_STUB(rpcsec, sec_svc_msg,		nomod_zero);
937	NO_UNLOAD_STUB(rpcsec, sec_svc_control,		nomod_zero);
938	END_MODULE(rpcsec);
939#endif
940
941/*
942 * Stubs for rpc RPCSEC_GSS security service module
943 */
944#ifndef RPCSEC_GSS_MODULE
945	MODULE(rpcsec_gss,misc);
946	NO_UNLOAD_STUB(rpcsec_gss, __svcrpcsec_gss,		nomod_zero);
947	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_getcred,		nomod_zero);
948	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_set_callback,	nomod_zero);
949	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_secget,		nomod_zero);
950	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_secfree,		nomod_zero);
951	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_seccreate,		nomod_zero);
952	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_set_defaults,	nomod_zero);
953	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_revauth,		nomod_zero);
954	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_secpurge,		nomod_zero);
955	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_cleanup,		nomod_zero);
956	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_get_versions,	nomod_zero);
957	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_max_data_length,	nomod_zero);
958	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_svc_max_data_length,	nomod_zero);
959	END_MODULE(rpcsec_gss);
960#endif
961
962#ifndef SAD_MODULE
963	MODULE(sad,drv);
964	STUB(sad, sadinit, 0);
965	STUB(sad, ap_free, 0);
966	END_MODULE(sad);
967#endif
968
969/*
970 * Stubs for PCI configurator module (misc/pcicfg).
971 */
972#ifndef PCICFG_MODULE
973	MODULE(pcicfg,misc);
974	STUB(pcicfg, pcicfg_configure, 0);
975	STUB(pcicfg, pcicfg_unconfigure, 0);
976	END_MODULE(pcicfg);
977#endif
978
979/*
980 * Stubs for PCIEHPC (pci-ex hot plug support) module (misc/pciehpc).
981 */
982#ifndef	PCIEHPC_MODULE
983	MODULE(pciehpc,misc);
984	STUB(pciehpc, pciehpc_init, 0);
985	STUB(pciehpc, pciehpc_uninit, 0);
986	WSTUB(pciehpc, pciehpc_intr, nomod_zero);
987	END_MODULE(pciehpc);
988#endif
989
990#ifndef WC_MODULE
991	MODULE(wc,drv);
992	STUB(wc, wcvnget, 0);
993	STUB(wc, wcvnrele, 0);
994	END_MODULE(wc);
995#endif
996
997#ifndef IWSCN_MODULE
998	MODULE(iwscn,drv);
999	STUB(iwscn, srpop, 0);
1000	END_MODULE(iwscn);
1001#endif
1002
1003/*
1004 * Stubs for checkpoint-resume module
1005 */
1006#ifndef CPR_MODULE
1007        MODULE(cpr,misc);
1008        STUB(cpr, cpr, 0);
1009        END_MODULE(cpr);
1010#endif
1011
1012/*
1013 * Stubs for kernel probes (tnf module).  Not unloadable.
1014 */
1015#ifndef TNF_MODULE
1016	MODULE(tnf,drv);
1017	NO_UNLOAD_STUB(tnf, tnf_ref32_1,	nomod_zero);
1018	NO_UNLOAD_STUB(tnf, tnf_string_1,	nomod_zero);
1019	NO_UNLOAD_STUB(tnf, tnf_opaque_array_1,	nomod_zero);
1020	NO_UNLOAD_STUB(tnf, tnf_struct_tag_1,	nomod_zero);
1021	NO_UNLOAD_STUB(tnf, tnf_allocate,	nomod_zero);
1022	END_MODULE(tnf);
1023#endif
1024
1025/*
1026 * Clustering: stubs for bootstrapping.
1027 */
1028#ifndef CL_BOOTSTRAP
1029	MODULE(cl_bootstrap,misc);
1030	NO_UNLOAD_WSTUB(cl_bootstrap, clboot_modload, nomod_minus_one);
1031	NO_UNLOAD_WSTUB(cl_bootstrap, clboot_loadrootmodules, nomod_zero);
1032	NO_UNLOAD_WSTUB(cl_bootstrap, clboot_rootconf, nomod_zero);
1033	NO_UNLOAD_WSTUB(cl_bootstrap, clboot_mountroot, nomod_zero);
1034	NO_UNLOAD_WSTUB(cl_bootstrap, clconf_init, nomod_zero);
1035	NO_UNLOAD_WSTUB(cl_bootstrap, clconf_get_nodeid, nomod_zero);
1036	NO_UNLOAD_WSTUB(cl_bootstrap, clconf_maximum_nodeid, nomod_zero);
1037	NO_UNLOAD_WSTUB(cl_bootstrap, cluster, nomod_zero);
1038	END_MODULE(cl_bootstrap);
1039#endif
1040
1041/*
1042 * Clustering: stubs for cluster infrastructure.
1043 */
1044#ifndef CL_COMM_MODULE
1045	MODULE(cl_comm,misc);
1046	NO_UNLOAD_STUB(cl_comm, cladmin, nomod_minus_one);
1047	END_MODULE(cl_comm);
1048#endif
1049
1050/*
1051 * Clustering: stubs for global file system operations.
1052 */
1053#ifndef PXFS_MODULE
1054	MODULE(pxfs,fs);
1055	NO_UNLOAD_WSTUB(pxfs, clpxfs_aio_read, nomod_zero);
1056	NO_UNLOAD_WSTUB(pxfs, clpxfs_aio_write, nomod_zero);
1057	NO_UNLOAD_WSTUB(pxfs, cl_flk_state_transition_notify, nomod_zero);
1058	END_MODULE(pxfs);
1059#endif
1060
1061/*
1062 * Stubs for kernel cryptographic framework module (misc/kcf).
1063 */
1064#ifndef KCF_MODULE
1065	MODULE(kcf,misc);
1066	NO_UNLOAD_STUB(kcf, crypto_mech2id, nomod_minus_one);
1067	NO_UNLOAD_STUB(kcf, crypto_register_provider, nomod_minus_one);
1068	NO_UNLOAD_STUB(kcf, crypto_unregister_provider, nomod_minus_one);
1069	NO_UNLOAD_STUB(kcf, crypto_provider_notification, nomod_minus_one);
1070	NO_UNLOAD_STUB(kcf, crypto_op_notification, nomod_minus_one);
1071	NO_UNLOAD_STUB(kcf, crypto_kmflag, nomod_minus_one);
1072	NO_UNLOAD_STUB(kcf, crypto_digest, nomod_minus_one);
1073	NO_UNLOAD_STUB(kcf, crypto_digest_prov, nomod_minus_one);
1074	NO_UNLOAD_STUB(kcf, crypto_digest_init, nomod_minus_one);
1075	NO_UNLOAD_STUB(kcf, crypto_digest_init_prov, nomod_minus_one);
1076	NO_UNLOAD_STUB(kcf, crypto_digest_update, nomod_minus_one);
1077	NO_UNLOAD_STUB(kcf, crypto_digest_final, nomod_minus_one);
1078	NO_UNLOAD_STUB(kcf, crypto_digest_key_prov, nomod_minus_one);
1079	NO_UNLOAD_STUB(kcf, crypto_encrypt, nomod_minus_one);
1080	NO_UNLOAD_STUB(kcf, crypto_encrypt_prov, nomod_minus_one);
1081	NO_UNLOAD_STUB(kcf, crypto_encrypt_init, nomod_minus_one);
1082	NO_UNLOAD_STUB(kcf, crypto_encrypt_init_prov, nomod_minus_one);
1083	NO_UNLOAD_STUB(kcf, crypto_encrypt_update, nomod_minus_one);
1084	NO_UNLOAD_STUB(kcf, crypto_encrypt_final, nomod_minus_one);
1085	NO_UNLOAD_STUB(kcf, crypto_decrypt, nomod_minus_one);
1086	NO_UNLOAD_STUB(kcf, crypto_decrypt_prov, nomod_minus_one);
1087	NO_UNLOAD_STUB(kcf, crypto_decrypt_init, nomod_minus_one);
1088	NO_UNLOAD_STUB(kcf, crypto_decrypt_init_prov, nomod_minus_one);
1089	NO_UNLOAD_STUB(kcf, crypto_decrypt_update, nomod_minus_one);
1090	NO_UNLOAD_STUB(kcf, crypto_decrypt_final, nomod_minus_one);
1091	NO_UNLOAD_STUB(kcf, crypto_get_all_mech_info, nomod_minus_one);
1092	NO_UNLOAD_STUB(kcf, crypto_key_check, nomod_minus_one);
1093	NO_UNLOAD_STUB(kcf, crypto_key_check_prov, nomod_minus_one);
1094	NO_UNLOAD_STUB(kcf, crypto_key_derive, nomod_minus_one);
1095	NO_UNLOAD_STUB(kcf, crypto_key_generate, nomod_minus_one);
1096	NO_UNLOAD_STUB(kcf, crypto_key_generate_pair, nomod_minus_one);
1097	NO_UNLOAD_STUB(kcf, crypto_key_unwrap, nomod_minus_one);
1098	NO_UNLOAD_STUB(kcf, crypto_key_wrap, nomod_minus_one);
1099	NO_UNLOAD_STUB(kcf, crypto_mac, nomod_minus_one);
1100	NO_UNLOAD_STUB(kcf, crypto_mac_prov, nomod_minus_one);
1101	NO_UNLOAD_STUB(kcf, crypto_mac_verify, nomod_minus_one);
1102	NO_UNLOAD_STUB(kcf, crypto_mac_verify_prov, nomod_minus_one);
1103	NO_UNLOAD_STUB(kcf, crypto_mac_init, nomod_minus_one);
1104	NO_UNLOAD_STUB(kcf, crypto_mac_init_prov, nomod_minus_one);
1105	NO_UNLOAD_STUB(kcf, crypto_mac_update, nomod_minus_one);
1106	NO_UNLOAD_STUB(kcf, crypto_mac_final, nomod_minus_one);
1107	NO_UNLOAD_STUB(kcf, crypto_mac_decrypt, nomod_minus_one);
1108	NO_UNLOAD_STUB(kcf, crypto_mac_decrypt_prov, nomod_minus_one);
1109	NO_UNLOAD_STUB(kcf, crypto_mac_verify_decrypt, nomod_minus_one);
1110	NO_UNLOAD_STUB(kcf, crypto_mac_verify_decrypt_prov, nomod_minus_one);
1111	NO_UNLOAD_STUB(kcf, crypto_mac_decrypt_init, nomod_minus_one);
1112	NO_UNLOAD_STUB(kcf, crypto_mac_decrypt_init_prov, nomod_minus_one);
1113	NO_UNLOAD_STUB(kcf, crypto_mac_decrypt_update, nomod_minus_one);
1114	NO_UNLOAD_STUB(kcf, crypto_mac_decrypt_final, nomod_minus_one);
1115	NO_UNLOAD_STUB(kcf, crypto_object_copy, nomod_minus_one);
1116	NO_UNLOAD_STUB(kcf, crypto_object_create, nomod_minus_one);
1117	NO_UNLOAD_STUB(kcf, crypto_object_destroy, nomod_minus_one);
1118	NO_UNLOAD_STUB(kcf, crypto_object_find_final, nomod_minus_one);
1119	NO_UNLOAD_STUB(kcf, crypto_object_find_init, nomod_minus_one);
1120	NO_UNLOAD_STUB(kcf, crypto_object_find, nomod_minus_one);
1121	NO_UNLOAD_STUB(kcf, crypto_object_get_attribute_value, nomod_minus_one);
1122	NO_UNLOAD_STUB(kcf, crypto_object_get_size, nomod_minus_one);
1123	NO_UNLOAD_STUB(kcf, crypto_object_set_attribute_value, nomod_minus_one);
1124	NO_UNLOAD_STUB(kcf, crypto_session_close, nomod_minus_one);
1125	NO_UNLOAD_STUB(kcf, crypto_session_login, nomod_minus_one);
1126	NO_UNLOAD_STUB(kcf, crypto_session_logout, nomod_minus_one);
1127	NO_UNLOAD_STUB(kcf, crypto_session_open, nomod_minus_one);
1128	NO_UNLOAD_STUB(kcf, crypto_encrypt_mac, nomod_minus_one);
1129	NO_UNLOAD_STUB(kcf, crypto_encrypt_mac_prov, nomod_minus_one);
1130	NO_UNLOAD_STUB(kcf, crypto_encrypt_mac_init, nomod_minus_one);
1131	NO_UNLOAD_STUB(kcf, crypto_encrypt_mac_init_prov, nomod_minus_one);
1132	NO_UNLOAD_STUB(kcf, crypto_encrypt_mac_update, nomod_minus_one);
1133	NO_UNLOAD_STUB(kcf, crypto_encrypt_mac_final, nomod_minus_one);
1134	NO_UNLOAD_STUB(kcf, crypto_create_ctx_template, nomod_minus_one);
1135	NO_UNLOAD_STUB(kcf, crypto_destroy_ctx_template, nomod_minus_one);
1136	NO_UNLOAD_STUB(kcf, crypto_get_mech_list, nomod_minus_one);
1137	NO_UNLOAD_STUB(kcf, crypto_free_mech_list, nomod_minus_one);
1138	NO_UNLOAD_STUB(kcf, crypto_cancel_req, nomod_minus_one);
1139	NO_UNLOAD_STUB(kcf, crypto_cancel_ctx, nomod_minus_one);
1140	NO_UNLOAD_STUB(kcf, crypto_bufcall_alloc, nomod_minus_one);
1141	NO_UNLOAD_STUB(kcf, crypto_bufcall_free, nomod_minus_one);
1142	NO_UNLOAD_STUB(kcf, crypto_bufcall, nomod_minus_one);
1143	NO_UNLOAD_STUB(kcf, crypto_unbufcall, nomod_minus_one);
1144	NO_UNLOAD_STUB(kcf, crypto_notify_events, nomod_minus_one);
1145	NO_UNLOAD_STUB(kcf, crypto_unnotify_events, nomod_minus_one);
1146	NO_UNLOAD_STUB(kcf, crypto_get_provider, nomod_minus_one);
1147	NO_UNLOAD_STUB(kcf, crypto_release_provider, nomod_minus_one);
1148	NO_UNLOAD_STUB(kcf, crypto_sign, nomod_minus_one);
1149	NO_UNLOAD_STUB(kcf, crypto_sign_prov, nomod_minus_one);
1150	NO_UNLOAD_STUB(kcf, crypto_sign_init, nomod_minus_one);
1151	NO_UNLOAD_STUB(kcf, crypto_sign_init_prov, nomod_minus_one);
1152	NO_UNLOAD_STUB(kcf, crypto_sign_update, nomod_minus_one);
1153	NO_UNLOAD_STUB(kcf, crypto_sign_final, nomod_minus_one);
1154	NO_UNLOAD_STUB(kcf, crypto_sign_recover, nomod_minus_one);
1155	NO_UNLOAD_STUB(kcf, crypto_sign_recover_prov, nomod_minus_one);
1156	NO_UNLOAD_STUB(kcf, crypto_sign_recover_init_prov, nomod_minus_one);
1157	NO_UNLOAD_STUB(kcf, crypto_verify, nomod_minus_one);
1158	NO_UNLOAD_STUB(kcf, crypto_verify_prov, nomod_minus_one);
1159	NO_UNLOAD_STUB(kcf, crypto_verify_init, nomod_minus_one);
1160	NO_UNLOAD_STUB(kcf, crypto_verify_init_prov, nomod_minus_one);
1161	NO_UNLOAD_STUB(kcf, crypto_verify_update, nomod_minus_one);
1162	NO_UNLOAD_STUB(kcf, crypto_verify_final, nomod_minus_one);
1163	NO_UNLOAD_STUB(kcf, crypto_verify_recover, nomod_minus_one);
1164	NO_UNLOAD_STUB(kcf, crypto_verify_recover_prov, nomod_minus_one);
1165	NO_UNLOAD_STUB(kcf, crypto_verify_recover_init_prov, nomod_minus_one);
1166	NO_UNLOAD_STUB(kcf, random_add_entropy, nomod_minus_one);
1167	NO_UNLOAD_STUB(kcf, random_get_bytes, nomod_minus_one);
1168	NO_UNLOAD_STUB(kcf, random_get_pseudo_bytes, nomod_minus_one);
1169	END_MODULE(kcf);
1170#endif
1171
1172/*
1173 * Stubs for sha1. A non-unloadable module.
1174 */
1175#ifndef SHA1_MODULE
1176	MODULE(sha1,crypto);
1177	NO_UNLOAD_STUB(sha1, SHA1Init, nomod_void);
1178	NO_UNLOAD_STUB(sha1, SHA1Update, nomod_void);
1179	NO_UNLOAD_STUB(sha1, SHA1Final, nomod_void);
1180	END_MODULE(sha1);
1181#endif
1182
1183/*
1184 * The following stubs are used by the mac module.
1185 * Since dls and dld already depend on mac, these
1186 * stubs are needed to avoid circular dependencies.
1187 */
1188#ifndef DLS_MODULE
1189	MODULE(dls,misc);
1190	STUB(dls, dls_create, nomod_einval);
1191	STUB(dls, dls_destroy, nomod_einval);
1192	END_MODULE(dls);
1193#endif
1194
1195#ifndef	DLD_MODULE
1196	MODULE(dld,drv);
1197	STUB(dld, dld_init_ops, nomod_void);
1198	STUB(dld, dld_fini_ops, nomod_void);
1199	END_MODULE(dld);
1200#endif
1201
1202/*
1203 * Stubs for kssl, the kernel SSL proxy
1204 */
1205#ifndef KSSL_MODULE
1206	MODULE(kssl,drv);
1207	NO_UNLOAD_STUB(kssl, kssl_check_proxy, nomod_zero);
1208	NO_UNLOAD_STUB(kssl, kssl_handle_record, nomod_zero);
1209	NO_UNLOAD_STUB(kssl, kssl_input, nomod_zero);
1210	NO_UNLOAD_STUB(kssl, kssl_build_record, nomod_zero);
1211	NO_UNLOAD_STUB(kssl, kssl_hold_ent, nomod_void);
1212	NO_UNLOAD_STUB(kssl, kssl_release_ent, nomod_void);
1213	NO_UNLOAD_STUB(kssl, kssl_find_fallback, nomod_zero);
1214	NO_UNLOAD_STUB(kssl, kssl_init_context, nomod_zero);
1215	NO_UNLOAD_STUB(kssl, kssl_hold_ctx, nomod_void);
1216	NO_UNLOAD_STUB(kssl, kssl_release_ctx, nomod_void);
1217	END_MODULE(kssl);
1218#endif
1219
1220/ this is just a marker for the area of text that contains stubs
1221
1222	ENTRY_NP(stubs_end)
1223	nop
1224
1225#endif	/* lint */
1226