xref: /titanic_44/usr/src/uts/sparc/ml/modstubs.s (revision c28749e97052f09388969427adf7df641cdcdc22)
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#if !defined(lint)
30#include "assym.h"
31#endif /* !lint */
32
33#include <sys/asm_linkage.h>
34
35#if defined(lint)
36
37char stubs_base[1], stubs_end[1];
38
39#else	/* lint */
40
41/*
42 * WARNING: there is no check for forgetting to write END_MODULE,
43 * and if you do, the kernel will most likely crash.  Be careful
44 *
45 * This file assumes that all of the contributions to the data segment
46 * will be contiguous in the output file, even though they are separated
47 * by pieces of text.  This is safe for all assemblers I know of now...
48 */
49
50/*
51 * This file uses ansi preprocessor features:
52 *
53 * 1. 	#define mac(a) extra_ ## a     -->   mac(x) expands to extra_a
54 * The old version of this is
55 *      #define mac(a) extra_/.*.*./a
56 * but this fails if the argument has spaces "mac ( x )"
57 * (Ignore the dots above, I had to put them in to keep this a comment.)
58 *
59 * 2.   #define mac(a) #a             -->    mac(x) expands to "x"
60 * The old version is
61 *      #define mac(a) "a"
62 *
63 * For some reason, the 5.0 preprocessor isn't happy with the above usage.
64 * For now, we're not using these ansi features.
65 *
66 * The reason is that "the 5.0 ANSI preprocessor" is built into the compiler
67 * and is a tokenizing preprocessor. This means, when confronted by something
68 * other than C token generation rules, strange things occur. In this case,
69 * when confronted by an assembly file, it would turn the token ".globl" into
70 * two tokens "." and "globl". For this reason, the traditional, non-ANSI
71 * preprocessor is used on assembly files.
72 *
73 * It would be desirable to have a non-tokenizing cpp (accp?) to use for this.
74 */
75
76/*
77 * This file contains the stubs routines for modules which can be autoloaded.
78 */
79
80
81/*
82 * See the 'struct mod_modinfo' definition to see what this structure
83 * is trying to achieve here.
84 */
85/*
86 * XX64 - This still needs some repair.
87 * (a) define 'pointer alignment' and use it
88 * (b) define '.pword' or equivalent, and use it (to mean .word or .xword).
89 */
90#define	MODULE(module,namespace)	\
91	.seg	".data";		\
92module/**/_modname:			\
93	.ascii	"namespace/module";	\
94	.byte	0;			\
95	.align	CPTRSIZE;		\
96	.global	module/**/_modinfo;	\
97	.type	module/**/_modinfo, #object;	\
98	.size	module/**/_modinfo, 16;	\
99module/**/_modinfo:			\
100	.word 0;			\
101	.word module/**/_modname;	\
102	.word 0;			\
103	.word 0;
104
105#define	END_MODULE(module)		\
106	.align 8; .word 0; .word 0	/* FIXME: .xword 0 */
107
108
109#define STUB(module, fcnname, retfcn)	\
110    STUB_COMMON(module, fcnname, mod_hold_stub, retfcn, 0)
111
112/*
113 * "weak stub", don't load on account of this call
114 */
115#define WSTUB(module, fcnname, retfcn)	\
116    STUB_COMMON(module, fcnname, retfcn, retfcn, MODS_WEAK)
117
118/*
119 * "non-unloadable stub", don't bother 'holding' module if it's already loaded
120 * since the module cannot be unloaded.
121 *
122 * User *MUST* guarantee the module is not unloadable (no _fini routine).
123 */
124#define NO_UNLOAD_STUB(module, fcnname, retfcn)	\
125    STUB_UNLOADABLE(module, fcnname, retfcn, retfcn, MODS_NOUNLOAD)
126
127/*
128 * Macro for modstubbed system calls whose modules are not unloadable.
129 *
130 * System call modstubs needs special handling for the case where
131 * the modstub is a system call, because %fp comes from user frame.
132 */
133#define	SCALL_NU_STUB(module, fcnname, retfcn)	\
134    SCALL_UNLOADABLE(module, fcnname, retfcn, retfcn, MODS_NOUNLOAD)
135/* "weak stub" for non-unloadable module, don't load on account of this call */
136#define NO_UNLOAD_WSTUB(module, fcnname, retfcn) \
137    STUB_UNLOADABLE(module, fcnname, retfcn, retfcn, MODS_NOUNLOAD|MODS_WEAK)
138
139#define	STUB_DATA(module, fcnname, install_fcn, retfcn, weak)		\
140	.seg	".data";						\
141	.align	8;							\
142fcnname/**/_info:							\
143	.word	0;			/* 0 */				\
144	.word	install_fcn;		/* 4 */				\
145	.word	0;			/* 8 */				\
146	.word	module/**/_modinfo;	/* c */				\
147	.word	0;			/* 10 */			\
148	.word	fcnname;		/* 14 */			\
149	.word	0;			/* 18 */			\
150	.word	retfcn;			/* 1c */			\
151	.word   weak			/* 20 */
152
153/*
154 * The flag MODS_INSTALLED is stored in the stub data and is used to
155 * indicate if a module is installed and initialized.  This flag is used
156 * instead of the mod_stub_info->mods_modinfo->mod_installed flag
157 * to minimize the number of pointer de-references for each function
158 * call (and also to avoid possible TLB misses which could be induced
159 * by dereferencing these pointers.)
160 */
161
162#define STUB_COMMON(module, fcnname, install_fcn, retfcn, weak)		\
163	ENTRY_NP(fcnname);						\
164	save	%sp, -SA(MINFRAME), %sp;/* new window */		\
165	set	fcnname/**/_info, %l5;					\
166	ld	[%l5 + MODS_FLAG], %l1;	/* weak?? */			\
167	cmp	%l1, 0;							\
168	be,a	1f;			/* not weak */			\
169	restore;							\
170	btst	MODS_INSTALLED, %l1;	/* installed?? */		\
171 	bne,a,pt %xcc, 1f;		/* yes, do mod_hold thing */	\
172 	restore;							\
173 	ldn	[%l5 + MODS_RETFCN], %g1;				\
174	jmp	%g1;			/* no, just jump to retfcn */	\
175	restore;							\
1761:	sub	%sp, %fp, %g1;	/* get (-)size of callers stack */	\
177	save	%sp, %g1, %sp;	/* create new frame same size */	\
178	sub	%g0, %g1, %l4;  /* size of stack frame */		\
179	sethi	%hi(fcnname/**/_info), %l5;				\
180	b	stubs_common_code;					\
181	or	%l5, %lo(fcnname/**/_info), %l5;			\
182	SET_SIZE(fcnname);						\
183	STUB_DATA(module, fcnname, install_fcn, retfcn, weak)
184
185#define STUB_UNLOADABLE(module, fcnname, install_fcn, retfcn, weak)	\
186	ENTRY_NP(fcnname);						\
187	save	%sp, -SA(MINFRAME), %sp;	/* new window */	\
188	set	fcnname/**/_info, %l5;					\
189	ld	[%l5 + MODS_FLAG], %l1;					\
190	btst	MODS_INSTALLED, %l1;		/* installed?? */	\
191	bne,a	%xcc, 1f;			/* yes */		\
192	ldn	[%l5], %g1;						\
193	btst	MODS_WEAK, %l1;			/* weak?? */		\
194	be,a	2f;				/* no, load module */	\
195	restore;							\
196	ldn	[%l5 + MODS_RETFCN], %g1;				\
1971:	jmp	%g1;				/* off we go */		\
198	restore;							\
1992:	sub	%sp, %fp, %g1;	/* get (-)size of callers frame */	\
200	save	%sp, %g1, %sp;	/* create new frame same size */	\
201	sub	%g0, %g1, %l4;  /* size of stack frame */		\
202	sethi	%hi(fcnname/**/_info), %l5;				\
203	b	stubs_common_code;					\
204	or	%l5, %lo(fcnname/**/_info), %l5;			\
205	SET_SIZE(fcnname);						\
206	STUB_DATA(module, fcnname, install_fcn, retfcn, weak)
207
208#define SCALL_UNLOADABLE(module, fcnname, install_fcn, retfcn, weak)	\
209	ENTRY_NP(fcnname);						\
210	save	%sp, -SA(MINFRAME), %sp;	/* new window */	\
211	set	fcnname/**/_info, %l5;					\
212	ld	[%l5 + MODS_FLAG], %l1;		/* installed?? */	\
213	btst	MODS_INSTALLED, %l1;					\
214	be,a	%xcc, 1f;			/* no, load module */	\
215	restore;							\
216 	ldn	[%l5], %g1;						\
217	jmp	%g1;				/* yes, off we go */	\
218	restore;							\
2191:	save	%sp, -SA(MINFRAME), %sp;/* new frame */			\
220	sub	%g0, -SA(MINFRAME), %l4;/* size of stack frame */	\
221	sethi	%hi(fcnname/**/_info), %l5;				\
222	b	stubs_common_code;					\
223	or	%l5, %lo(fcnname/**/_info), %l5;			\
224	SET_SIZE(fcnname);						\
225	STUB_DATA(module, fcnname, install_fcn, retfcn, weak)
226
227	.section	".text"
228
229	/*
230	 * We branch here with the fcnname_info pointer in l5
231	 * and the frame size in %l4.
232	 */
233	ENTRY_NP(stubs_common_code)
234	cmp	%l4, SA(MINFRAME)
235	ble,a,pn %xcc, 2f
236	nop
237
238	sub	%l4, 0x80, %l4		/* skip locals and outs */
239	add	%sp, 0x80, %l0
240	add	%fp, 0x80, %l1		/* get original sp before save */
2411:
242	/* Copy stack frame */
243	ldn	[%l1 + STACK_BIAS], %l2
244	inc	8, %l1
245	stn	%l2, [%l0 + STACK_BIAS]
246	deccc	8, %l4
247	bg,a	1b
248	inc	8, %l0
2492:
250	call	mod_hold_stub		/* Hold the module */
251	mov	%l5, %o0
252	cmp	%o0, -1			/* if error then return error */
253	bne,a	1f
254	nop
255	ldn	[%l5 + MODS_RETFCN], %i0
256	call	%i0
257	nop
258	ret
259	restore	%o0, 0, %o0
2601:
261	ldn	[%l5], %g1
262	mov	%i0, %o0	/* copy over incoming args, if number of */
263	mov	%i1, %o1	/* args is > 6 then we copied them above */
264	mov	%i2, %o2
265	mov	%i3, %o3
266	mov	%i4, %o4
267	call	%g1		/* jump to the stub function */
268	mov	%i5, %o5
269	mov	%o0, %i0	/* copy any return values */
270	mov	%o1, %i1
271	call	mod_release_stub	/* release hold on module */
272	mov	%l5, %o0
273	ret			/* return to caller */
274	restore
275	SET_SIZE(stubs_common_code)
276
277! this is just a marker for the area of text that contains stubs
278	.seg ".text"
279	.global stubs_base
280stubs_base:
281	nop
282
283/*
284 * WARNING WARNING WARNING!!!!!!
285 *
286 * On the MODULE macro you MUST NOT use any spaces!!! They are
287 * significant to the preprocessor.  With ansi c there is a way around this
288 * but for some reason (yet to be investigated) ansi didn't work for other
289 * reasons!
290 *
291 * When zero is used as the return function, the system will call
292 * panic if the stub can't be resolved.
293 */
294
295/*
296 * Stubs for devfs. A non-unloadable module.
297 */
298#ifndef DEVFS_MODULE
299	MODULE(devfs,fs);
300	NO_UNLOAD_STUB(devfs, devfs_clean,		nomod_minus_one);
301	NO_UNLOAD_STUB(devfs, devfs_lookupname,		nomod_minus_one);
302	NO_UNLOAD_STUB(devfs, devfs_walk,		nomod_minus_one);
303	NO_UNLOAD_STUB(devfs, devfs_devpolicy,		nomod_minus_one);
304	NO_UNLOAD_STUB(devfs, devfs_reset_perm,		nomod_minus_one);
305	NO_UNLOAD_STUB(devfs, devfs_remdrv_cleanup,	nomod_minus_one);
306	END_MODULE(devfs);
307#endif
308
309/*
310 * Stubs for specfs. A non-unloadable module.
311 */
312
313#ifndef SPEC_MODULE
314	MODULE(specfs,fs);
315	NO_UNLOAD_STUB(specfs, common_specvp,  	nomod_zero);
316	NO_UNLOAD_STUB(specfs, makectty,		nomod_zero);
317	NO_UNLOAD_STUB(specfs, makespecvp,      	nomod_zero);
318	NO_UNLOAD_STUB(specfs, smark,           	nomod_zero);
319	NO_UNLOAD_STUB(specfs, spec_segmap,     	nomod_einval);
320	NO_UNLOAD_STUB(specfs, specfind,        	nomod_zero);
321	NO_UNLOAD_STUB(specfs, specvp,          	nomod_zero);
322	NO_UNLOAD_STUB(specfs, devi_stillreferenced,	nomod_zero);
323	NO_UNLOAD_STUB(specfs, spec_getvnodeops,	nomod_zero);
324	NO_UNLOAD_STUB(specfs, spec_char_map,		nomod_zero);
325	NO_UNLOAD_STUB(specfs, specvp_devfs,  		nomod_zero);
326	NO_UNLOAD_STUB(specfs, spec_assoc_vp_with_devi,	nomod_void);
327	NO_UNLOAD_STUB(specfs, spec_hold_devi_by_vp,	nomod_zero);
328	NO_UNLOAD_STUB(specfs, spec_snode_walk,		nomod_void);
329	NO_UNLOAD_STUB(specfs, spec_devi_open_count,	nomod_minus_one);
330	NO_UNLOAD_STUB(specfs, spec_is_clone,		nomod_zero);
331	NO_UNLOAD_STUB(specfs, spec_is_selfclone,	nomod_zero);
332	END_MODULE(specfs);
333#endif
334
335
336/*
337 * Stubs for sockfs. A non-unloadable module.
338 */
339#ifndef SOCK_MODULE
340	MODULE(sockfs, fs);
341	SCALL_NU_STUB(sockfs, so_socket,  	nomod_zero);
342	SCALL_NU_STUB(sockfs, so_socketpair,	nomod_zero);
343	SCALL_NU_STUB(sockfs, bind,  		nomod_zero);
344	SCALL_NU_STUB(sockfs, listen,  		nomod_zero);
345	SCALL_NU_STUB(sockfs, accept,  		nomod_zero);
346	SCALL_NU_STUB(sockfs, connect,  	nomod_zero);
347	SCALL_NU_STUB(sockfs, shutdown,  	nomod_zero);
348	SCALL_NU_STUB(sockfs, recv,  		nomod_zero);
349	SCALL_NU_STUB(sockfs, recvfrom,  	nomod_zero);
350	SCALL_NU_STUB(sockfs, recvmsg,  	nomod_zero);
351	SCALL_NU_STUB(sockfs, send,  		nomod_zero);
352	SCALL_NU_STUB(sockfs, sendmsg,  	nomod_zero);
353	SCALL_NU_STUB(sockfs, sendto, 		nomod_zero);
354#ifdef _SYSCALL32_IMPL
355	SCALL_NU_STUB(sockfs, recv32,  		nomod_zero);
356	SCALL_NU_STUB(sockfs, recvfrom32,  	nomod_zero);
357	SCALL_NU_STUB(sockfs, send32,  		nomod_zero);
358	SCALL_NU_STUB(sockfs, sendto32, 	nomod_zero);
359#endif /* _SYSCALL32_IMPL */
360	SCALL_NU_STUB(sockfs, getpeername,  	nomod_zero);
361	SCALL_NU_STUB(sockfs, getsockname,  	nomod_zero);
362	SCALL_NU_STUB(sockfs, getsockopt,  	nomod_zero);
363	SCALL_NU_STUB(sockfs, setsockopt,  	nomod_zero);
364	SCALL_NU_STUB(sockfs, sockconfig,  	nomod_zero);
365	SCALL_NU_STUB(sockfs, nca_sendfilev,  	nomod_zero);
366	NO_UNLOAD_STUB(sockfs, sock_getmsg,  	nomod_zero);
367	NO_UNLOAD_STUB(sockfs, sock_putmsg,  	nomod_zero);
368	NO_UNLOAD_STUB(sockfs, sosendfile64,  	nomod_zero);
369	NO_UNLOAD_STUB(sockfs, sock_getfasync,  nomod_zero);
370	NO_UNLOAD_STUB(sockfs, nl7c_sendfilev,  nomod_zero);
371	NO_UNLOAD_STUB(sockfs, sostream_direct,	nomod_zero);
372	END_MODULE(sockfs);
373#endif
374
375/*
376 * IPsec stubs.
377 */
378
379#ifndef	IPSECAH_MODULE
380	MODULE(ipsecah,drv);
381	WSTUB(ipsecah,	ipsec_construct_inverse_acquire,	nomod_zero);
382	WSTUB(ipsecah,	sadb_acquire,		nomod_zero);
383	WSTUB(ipsecah,	sadb_ill_download,	nomod_zero);
384	WSTUB(ipsecah,	ipsecah_algs_changed,	nomod_zero);
385	WSTUB(ipsecah,	sadb_alg_update,	nomod_zero);
386	WSTUB(ipsecah,	sadb_unlinkassoc,	nomod_zero);
387	WSTUB(ipsecah,	sadb_insertassoc,	nomod_zero);
388	WSTUB(ipsecah,	ipsecah_rl_strlog,	nomod_zero);
389	WSTUB(ipsecah,	ipsecah_in_assocfailure,	nomod_zero);
390	WSTUB(ipsecah,	sadb_set_lpkt,		nomod_zero);
391	WSTUB(ipsecah,	ipsecah_icmp_error,	nomod_zero);
392	END_MODULE(ipsecah);
393#endif
394
395#ifndef	IPSECESP_MODULE
396	MODULE(ipsecesp,drv);
397	WSTUB(ipsecesp,	ipsecesp_fill_defs,	nomod_zero);
398	WSTUB(ipsecesp,	ipsecesp_algs_changed,	nomod_zero);
399	WSTUB(ipsecesp, ipsecesp_in_assocfailure,	nomod_zero);
400	WSTUB(ipsecesp, ipsecesp_init_funcs,	nomod_zero);
401	WSTUB(ipsecesp,	ipsecesp_icmp_error,	nomod_zero);
402	END_MODULE(ipsecesp);
403#endif
404
405#ifndef KEYSOCK_MODULE
406	MODULE(keysock,drv);
407	WSTUB(keysock,	keysock_plumb_ipsec,	nomod_zero);
408	WSTUB(keysock,	keysock_extended_reg,	nomod_zero);
409	WSTUB(keysock,	keysock_next_seq,	nomod_zero);
410	END_MODULE(keysock);
411#endif
412
413#ifndef SPDSOCK_MODULE
414	MODULE(spdsock,drv);
415	WSTUB(spdsock,	spdsock_update_pending_algs,	nomod_zero);
416	END_MODULE(spdsock);
417#endif
418
419#ifndef NATTYMOD_MODULE
420	MODULE(nattymod, strmod);
421	WSTUB(nattymod, nattymod_clean_ipif, nomod_zero);
422	END_MODULE(nattymod);
423#endif
424
425/*
426 * Stubs for nfs common code.
427 * XXX nfs_getvnodeops should go away with removal of kludge in vnode.c
428 */
429#ifndef NFS_MODULE
430	MODULE(nfs,fs);
431	WSTUB(nfs,	nfs_getvnodeops,	nomod_zero);
432	WSTUB(nfs,	nfs_perror,		nomod_zero);
433	WSTUB(nfs,	nfs_cmn_err,		nomod_zero);
434	WSTUB(nfs,	clcleanup_zone,		nomod_zero);
435	WSTUB(nfs,	clcleanup4_zone,	nomod_zero);
436	END_MODULE(nfs);
437#endif
438
439/*
440 * Stubs for nfs_dlboot (diskless booting).
441 */
442#ifndef NFS_DLBOOT_MODULE
443	MODULE(nfs_dlboot,misc);
444	STUB(nfs_dlboot,	mount_root,	nomod_minus_one);
445	STUB(nfs_dlboot,        dhcpinit,       nomod_minus_one);
446	END_MODULE(nfs_dlboot);
447#endif
448
449/*
450 * Stubs for nfs server-only code.
451 */
452#ifndef NFSSRV_MODULE
453	MODULE(nfssrv,misc);
454	STUB(nfssrv,		lm_nfs3_fhtovp,	nomod_minus_one);
455	STUB(nfssrv,		lm_fhtovp,	nomod_minus_one);
456	STUB(nfssrv,		exportfs,	nomod_minus_one);
457	STUB(nfssrv,		nfs_getfh,	nomod_minus_one);
458	STUB(nfssrv,		nfsl_flush,	nomod_minus_one);
459	STUB(nfssrv,		rfs4_check_delegated, nomod_zero) ;
460	NO_UNLOAD_STUB(nfssrv,	rdma_start,	nomod_zero);
461	NO_UNLOAD_STUB(nfssrv,	nfs_svc,	nomod_zero);
462	END_MODULE(nfssrv);
463#endif
464
465/*
466 * Stubs for kernel lock manager.
467 */
468#ifndef KLM_MODULE
469	MODULE(klmmod,misc);
470	NO_UNLOAD_STUB(klmmod, lm_svc,		nomod_zero);
471	NO_UNLOAD_STUB(klmmod, lm_shutdown,	nomod_zero);
472	NO_UNLOAD_STUB(klmmod, lm_unexport,	nomod_zero);
473	NO_UNLOAD_STUB(klmmod, lm_cprresume,	nomod_zero);
474	NO_UNLOAD_STUB(klmmod, lm_cprsuspend,	nomod_zero);
475	NO_UNLOAD_STUB(klmmod, lm_safelock, nomod_zero);
476	NO_UNLOAD_STUB(klmmod, lm_safemap, nomod_zero);
477	NO_UNLOAD_STUB(klmmod, lm_has_sleep, nomod_zero);
478	NO_UNLOAD_STUB(klmmod, lm_free_config, nomod_zero);
479	NO_UNLOAD_STUB(klmmod, lm_vp_active, nomod_zero);
480	NO_UNLOAD_STUB(klmmod, lm_get_sysid, nomod_zero);
481	NO_UNLOAD_STUB(klmmod, lm_rel_sysid, nomod_zero);
482	NO_UNLOAD_STUB(klmmod, lm_alloc_sysidt, nomod_minus_one);
483	NO_UNLOAD_STUB(klmmod, lm_free_sysidt, nomod_zero);
484	NO_UNLOAD_STUB(klmmod, lm_sysidt, nomod_minus_one);
485	END_MODULE(klmmod);
486#endif
487
488#ifndef KLMOPS_MODULE
489	MODULE(klmops,misc);
490	NO_UNLOAD_STUB(klmops, lm_frlock,	nomod_zero);
491	NO_UNLOAD_STUB(klmops, lm4_frlock,	nomod_zero);
492	NO_UNLOAD_STUB(klmops, lm_shrlock,	nomod_zero);
493	NO_UNLOAD_STUB(klmops, lm4_shrlock,	nomod_zero);
494	NO_UNLOAD_STUB(klmops, lm_nlm_dispatch,	nomod_zero);
495	NO_UNLOAD_STUB(klmops, lm_nlm4_dispatch,	nomod_zero);
496	NO_UNLOAD_STUB(klmops, lm_nlm_reclaim,	nomod_zero);
497	NO_UNLOAD_STUB(klmops, lm_nlm4_reclaim,	nomod_zero);
498	NO_UNLOAD_STUB(klmops, lm_register_lock_locally, nomod_zero);
499	END_MODULE(klmops);
500#endif
501
502/*
503 * Stubs for kernel TLI module
504 *   XXX currently we never allow this to unload
505 */
506#ifndef TLI_MODULE
507	MODULE(tlimod,misc);
508	NO_UNLOAD_STUB(tlimod, t_kopen,		nomod_minus_one);
509	NO_UNLOAD_STUB(tlimod, t_kunbind,  	nomod_zero);
510	NO_UNLOAD_STUB(tlimod, t_kadvise,  	nomod_zero);
511	NO_UNLOAD_STUB(tlimod, t_krcvudata,  	nomod_zero);
512	NO_UNLOAD_STUB(tlimod, t_ksndudata,  	nomod_zero);
513	NO_UNLOAD_STUB(tlimod, t_kalloc,  	nomod_zero);
514	NO_UNLOAD_STUB(tlimod, t_kbind,  	nomod_zero);
515	NO_UNLOAD_STUB(tlimod, t_kclose,  	nomod_zero);
516	NO_UNLOAD_STUB(tlimod, t_kspoll,  	nomod_zero);
517	NO_UNLOAD_STUB(tlimod, t_kfree,  	nomod_zero);
518	END_MODULE(tlimod);
519#endif
520
521/*
522 * Stubs for kernel RPC module
523 *   XXX currently we never allow this to unload
524 */
525#ifndef RPC_MODULE
526	MODULE(rpcmod,strmod);
527	NO_UNLOAD_STUB(rpcmod, clnt_tli_kcreate,	nomod_minus_one);
528	NO_UNLOAD_STUB(rpcmod, svc_tli_kcreate,		nomod_minus_one);
529	NO_UNLOAD_STUB(rpcmod, bindresvport,		nomod_minus_one);
530	NO_UNLOAD_STUB(rpcmod, rdma_register_mod,	nomod_minus_one);
531	NO_UNLOAD_STUB(rpcmod, rdma_unregister_mod,	nomod_minus_one);
532	NO_UNLOAD_STUB(rpcmod, svc_queuereq,		nomod_minus_one);
533	NO_UNLOAD_STUB(rpcmod, clist_add,		nomod_minus_one);
534	END_MODULE(rpcmod);
535#endif
536
537/*
538 * Stubs for des
539 */
540#ifndef DES_MODULE
541	MODULE(des,misc);
542	STUB(des, cbc_crypt, 	 	nomod_zero);
543	STUB(des, ecb_crypt, 		nomod_zero);
544	STUB(des, _des_crypt,		nomod_zero);
545	END_MODULE(des);
546#endif
547
548/*
549 * Stubs for procfs. A non-unloadable module.
550 */
551#ifndef PROC_MODULE
552	MODULE(procfs,fs);
553	NO_UNLOAD_STUB(procfs, prfree,		nomod_zero);
554	NO_UNLOAD_STUB(procfs, prexit,		nomod_zero);
555	NO_UNLOAD_STUB(procfs, prlwpfree,	nomod_zero);
556	NO_UNLOAD_STUB(procfs, prlwpexit,	nomod_zero);
557	NO_UNLOAD_STUB(procfs, prinvalidate,	nomod_zero);
558	NO_UNLOAD_STUB(procfs, prnsegs,		nomod_zero);
559	NO_UNLOAD_STUB(procfs, prgetcred,	nomod_zero);
560	NO_UNLOAD_STUB(procfs, prgetpriv,	nomod_zero);
561	NO_UNLOAD_STUB(procfs, prgetprivsize,	nomod_zero);
562	NO_UNLOAD_STUB(procfs, prgetstatus,	nomod_zero);
563	NO_UNLOAD_STUB(procfs, prgetlwpstatus,	nomod_zero);
564	NO_UNLOAD_STUB(procfs, prgetpsinfo,	nomod_zero);
565	NO_UNLOAD_STUB(procfs, prgetlwpsinfo,	nomod_zero);
566	NO_UNLOAD_STUB(procfs, oprgetstatus,	nomod_zero);
567	NO_UNLOAD_STUB(procfs, oprgetpsinfo,	nomod_zero);
568#ifdef _SYSCALL32_IMPL
569	NO_UNLOAD_STUB(procfs, prgetstatus32,	nomod_zero);
570	NO_UNLOAD_STUB(procfs, prgetlwpstatus32, nomod_zero);
571	NO_UNLOAD_STUB(procfs, prgetpsinfo32,	nomod_zero);
572	NO_UNLOAD_STUB(procfs, prgetlwpsinfo32,	nomod_zero);
573	NO_UNLOAD_STUB(procfs, oprgetstatus32,	nomod_zero);
574	NO_UNLOAD_STUB(procfs, oprgetpsinfo32,	nomod_zero);
575#endif	/* _SYSCALL32_IMPL */
576	NO_UNLOAD_STUB(procfs, prnotify,	nomod_zero);
577	NO_UNLOAD_STUB(procfs, prexecstart,	nomod_zero);
578	NO_UNLOAD_STUB(procfs, prexecend,	nomod_zero);
579	NO_UNLOAD_STUB(procfs, prrelvm,		nomod_zero);
580	NO_UNLOAD_STUB(procfs, prbarrier,	nomod_zero);
581	NO_UNLOAD_STUB(procfs, estimate_msacct,	nomod_zero);
582	NO_UNLOAD_STUB(procfs, pr_getprot,	nomod_zero);
583	NO_UNLOAD_STUB(procfs, pr_getprot_done,	nomod_zero);
584	NO_UNLOAD_STUB(procfs, pr_getsegsize,	nomod_zero);
585	NO_UNLOAD_STUB(procfs, pr_isobject,	nomod_zero);
586	NO_UNLOAD_STUB(procfs, pr_isself,	nomod_zero);
587	NO_UNLOAD_STUB(procfs, pr_allstopped,	nomod_zero);
588	NO_UNLOAD_STUB(procfs, pr_free_watched_pages, nomod_zero);
589	END_MODULE(procfs);
590#endif
591
592/*
593 * Stubs for fifofs
594 */
595#ifndef FIFO_MODULE
596	MODULE(fifofs,fs);
597	STUB(fifofs, fifovp,      	0);
598	STUB(fifofs, fifo_getinfo,	0);
599	STUB(fifofs, fifo_vfastoff,	0);
600	END_MODULE(fifofs);
601#endif
602
603/*
604 * Stubs for ufs
605 *
606 * This is needed to support the old quotactl system call.
607 * When the old sysent stuff goes away, this will need to be revisited.
608 */
609#ifndef UFS_MODULE
610	MODULE(ufs,fs);
611	STUB(ufs, quotactl, nomod_minus_one);
612	STUB(ufs, ufs_remountroot, 0);
613	END_MODULE(ufs);
614#endif
615
616/*
617 * Stubs for namefs
618 */
619#ifndef NAMEFS_MODULE
620	MODULE(namefs,fs);
621	STUB(namefs, nm_unmountall, 	0);
622	END_MODULE(namefs);
623#endif
624
625/*
626 * Stubs for ts_dptbl
627 */
628#ifndef TS_DPTBL_MODULE
629	MODULE(TS_DPTBL,sched);
630	STUB(TS_DPTBL, ts_getdptbl,		0);
631	STUB(TS_DPTBL, ts_getkmdpris,		0);
632	STUB(TS_DPTBL, ts_getmaxumdpri,	0);
633	END_MODULE(TS_DPTBL);
634#endif
635
636/*
637 * Stubs for rt_dptbl
638 */
639#ifndef RT_DPTBL_MODULE
640	MODULE(RT_DPTBL,sched);
641	STUB(RT_DPTBL, rt_getdptbl,		0);
642	END_MODULE(RT_DPTBL);
643#endif
644
645/*
646 * Stubs for ia_dptbl
647 */
648#ifndef IA_DPTBL_MODULE
649	MODULE(IA_DPTBL,sched);
650	STUB(IA_DPTBL, ia_getdptbl,		0);
651	STUB(IA_DPTBL, ia_getkmdpris,		0);
652	STUB(IA_DPTBL, ia_getmaxumdpri,	0);
653	END_MODULE(IA_DPTBL);
654#endif
655
656/*
657 * Stubs for FSS scheduler
658 */
659#ifndef	FSS_MODULE
660	MODULE(FSS,sched);
661	WSTUB(FSS, fss_allocbuf,		nomod_zero);
662	WSTUB(FSS, fss_freebuf,			nomod_zero);
663	WSTUB(FSS, fss_changeproj,		nomod_zero);
664	WSTUB(FSS, fss_changepset,		nomod_zero);
665	END_MODULE(FSS);
666#endif
667
668/*
669 * Stubs for fx_dptbl
670 */
671#ifndef FX_DPTBL_MODULE
672	MODULE(FX_DPTBL,sched);
673	STUB(FX_DPTBL, fx_getdptbl,		0);
674	STUB(FX_DPTBL, fx_getmaxumdpri,		0);
675	END_MODULE(FX_DPTBL);
676#endif
677
678/*
679 * Stubs for kb (only needed for 'win')
680 */
681#ifndef KB_MODULE
682	MODULE(kb,strmod);
683	STUB(kb, strsetwithdecimal,	0);
684	END_MODULE(kb);
685#endif
686
687/*
688 * Stubs for swapgeneric
689 */
690#ifndef SWAPGENERIC_MODULE
691	MODULE(swapgeneric,misc);
692	STUB(swapgeneric, rootconf,     0);
693	STUB(swapgeneric, svm_rootconf, 0);
694	STUB(swapgeneric, getfstype,    0);
695	STUB(swapgeneric, getrootdev,   0);
696	STUB(swapgeneric, getfsname,    0);
697	STUB(swapgeneric, loadrootmodules, 0);
698	END_MODULE(swapgeneric);
699#endif
700
701/*
702 * Stubs for bootdev
703 */
704#ifndef BOOTDEV_MODULE
705	MODULE(bootdev,misc);
706	STUB(bootdev, i_devname_to_promname, 0);
707	STUB(bootdev, i_promname_to_devname, 0);
708	STUB(bootdev, i_convert_boot_device_name, 0);
709	END_MODULE(bootdev);
710#endif
711
712/*
713 * stubs for strplumb...
714 */
715#ifndef STRPLUMB_MODULE
716	MODULE(strplumb,misc);
717	STUB(strplumb, strplumb,     0);
718	STUB(strplumb, strplumb_load, 0);
719	END_MODULE(strplumb);
720#endif
721
722/*
723 * Stubs for console configuration module
724 */
725#ifndef CONSCONFIG_MODULE
726	MODULE(consconfig,misc);
727	STUB(consconfig, consconfig,	0);
728	STUB(consconfig, consconfig_get_usb_kb_path,	0);
729	STUB(consconfig, consconfig_get_usb_ms_path,	0);
730	END_MODULE(consconfig);
731#endif
732
733/*
734 * Stubs for zs (uart) module
735 */
736#ifndef ZS_MODULE
737	MODULE(zs,drv);
738	STUB(zs, zsgetspeed,		0);
739	END_MODULE(zs);
740#endif
741
742/*
743 * Stubs for accounting.
744 */
745#ifndef SYSACCT_MODULE
746	MODULE(sysacct,sys);
747	WSTUB(sysacct, acct,  		nomod_zero);
748	WSTUB(sysacct, acct_fs_in_use,	nomod_zero);
749	END_MODULE(sysacct);
750#endif
751
752/*
753 * Stubs for semaphore routines. sem.c
754 */
755#ifndef SEMSYS_MODULE
756	MODULE(semsys,sys);
757	WSTUB(semsys, semexit,		nomod_zero);
758	END_MODULE(semsys);
759#endif
760
761/*
762 * Stubs for shmem routines. shm.c
763 */
764#ifndef SHMSYS_MODULE
765	MODULE(shmsys,sys);
766	WSTUB(shmsys, shmexit,		nomod_zero);
767	WSTUB(shmsys, shmfork,		nomod_zero);
768	WSTUB(shmsys, shmgetid,		nomod_zero);
769	END_MODULE(shmsys);
770#endif
771
772/*
773 * Stubs for doors
774 */
775#ifndef DOORFS_MODULE
776	MODULE(doorfs,sys);
777	WSTUB(doorfs, door_slam,			nomod_zero);
778	WSTUB(doorfs, door_exit,			nomod_zero);
779	WSTUB(doorfs, door_revoke_all,			nomod_zero);
780	WSTUB(doorfs, door_fork,			nomod_zero);
781	NO_UNLOAD_STUB(doorfs, door_upcall,		nomod_einval);
782	NO_UNLOAD_STUB(doorfs, door_ki_create,		nomod_einval);
783	NO_UNLOAD_STUB(doorfs, door_ki_open,		nomod_einval);
784	NO_UNLOAD_STUB(doorfs, door_ki_lookup,		nomod_zero);
785	WSTUB(doorfs, door_ki_upcall,			nomod_einval);
786	WSTUB(doorfs, door_ki_hold,			nomod_zero);
787	WSTUB(doorfs, door_ki_rele,			nomod_zero);
788	WSTUB(doorfs, door_ki_info,			nomod_einval);
789	END_MODULE(doorfs);
790#endif
791
792/*
793 * Stubs for dma routines. dmaga.c
794 * (These are only needed for cross-checks, not autoloading)
795 */
796#ifndef DMA_MODULE
797	MODULE(dma,drv);
798	WSTUB(dma, dma_alloc,		nomod_zero); /* (DMAGA *)0 */
799	WSTUB(dma, dma_free,		nomod_zero); /* (DMAGA *)0 */
800	END_MODULE(dma);
801#endif
802
803/*
804 * Stubs for auditing.
805 */
806#ifndef C2AUDIT_MODULE
807	MODULE(c2audit,sys);
808	STUB(c2audit,  audit_init,			nomod_zero);
809	STUB(c2audit,  _auditsys,			nomod_zero);
810	NO_UNLOAD_STUB(c2audit, audit_free,		nomod_zero);
811	NO_UNLOAD_STUB(c2audit, audit_start, 		nomod_zero);
812	NO_UNLOAD_STUB(c2audit, audit_finish,		nomod_zero);
813	NO_UNLOAD_STUB(c2audit, audit_newproc,		nomod_zero);
814	NO_UNLOAD_STUB(c2audit, audit_pfree,		nomod_zero);
815	NO_UNLOAD_STUB(c2audit, audit_thread_free,	nomod_zero);
816	NO_UNLOAD_STUB(c2audit, audit_thread_create,	nomod_zero);
817	NO_UNLOAD_STUB(c2audit, audit_falloc,		nomod_zero);
818	NO_UNLOAD_STUB(c2audit, audit_unfalloc,		nomod_zero);
819	NO_UNLOAD_STUB(c2audit, audit_closef,		nomod_zero);
820	NO_UNLOAD_STUB(c2audit, audit_copen,		nomod_zero);
821	NO_UNLOAD_STUB(c2audit, audit_core_start,	nomod_zero);
822	NO_UNLOAD_STUB(c2audit, audit_core_finish,	nomod_zero);
823	NO_UNLOAD_STUB(c2audit, audit_stropen,		nomod_zero);
824	NO_UNLOAD_STUB(c2audit, audit_strclose,		nomod_zero);
825	NO_UNLOAD_STUB(c2audit, audit_strioctl,		nomod_zero);
826	NO_UNLOAD_STUB(c2audit, audit_strputmsg,	nomod_zero);
827	NO_UNLOAD_STUB(c2audit, audit_c2_revoke,	nomod_zero);
828	NO_UNLOAD_STUB(c2audit, audit_savepath,		nomod_zero);
829	NO_UNLOAD_STUB(c2audit, audit_anchorpath,	nomod_zero);
830	NO_UNLOAD_STUB(c2audit, audit_addcomponent,	nomod_zero);
831	NO_UNLOAD_STUB(c2audit, audit_exit,		nomod_zero);
832	NO_UNLOAD_STUB(c2audit, audit_exec,		nomod_zero);
833	NO_UNLOAD_STUB(c2audit, audit_symlink,		nomod_zero);
834	NO_UNLOAD_STUB(c2audit, audit_symlink_create,	nomod_zero);
835	NO_UNLOAD_STUB(c2audit, audit_vncreate_start,	nomod_zero);
836	NO_UNLOAD_STUB(c2audit, audit_vncreate_finish,	nomod_zero);
837	NO_UNLOAD_STUB(c2audit, audit_enterprom,	nomod_zero);
838	NO_UNLOAD_STUB(c2audit, audit_exitprom,		nomod_zero);
839	NO_UNLOAD_STUB(c2audit, audit_chdirec,		nomod_zero);
840	NO_UNLOAD_STUB(c2audit, audit_getf,		nomod_zero);
841	NO_UNLOAD_STUB(c2audit, audit_setf,		nomod_zero);
842	NO_UNLOAD_STUB(c2audit, audit_sock,		nomod_zero);
843	NO_UNLOAD_STUB(c2audit, audit_strgetmsg,	nomod_zero);
844	NO_UNLOAD_STUB(c2audit, audit_ipc,		nomod_zero);
845	NO_UNLOAD_STUB(c2audit, audit_ipcget,		nomod_zero);
846	NO_UNLOAD_STUB(c2audit, audit_lookupname,	nomod_zero);
847	NO_UNLOAD_STUB(c2audit, audit_pathcomp,		nomod_zero);
848	NO_UNLOAD_STUB(c2audit, audit_fdsend,		nomod_zero);
849	NO_UNLOAD_STUB(c2audit, audit_fdrecv,		nomod_zero);
850	NO_UNLOAD_STUB(c2audit, audit_priv,		nomod_zero);
851	NO_UNLOAD_STUB(c2audit, audit_setppriv,		nomod_zero);
852	NO_UNLOAD_STUB(c2audit, audit_devpolicy,	nomod_zero);
853	NO_UNLOAD_STUB(c2audit, audit_setfsat_path,	nomod_zero);
854	NO_UNLOAD_STUB(c2audit, audit_cryptoadm,	nomod_zero);
855	NO_UNLOAD_STUB(c2audit, audit_update_context,	nomod_zero);
856	NO_UNLOAD_STUB(c2audit, audit_kssl,		nomod_zero);
857	END_MODULE(c2audit);
858#endif
859
860/*
861 * Stubs for kernel rpc security service module
862 */
863#ifndef RPCSEC_MODULE
864	MODULE(rpcsec,misc);
865	NO_UNLOAD_STUB(rpcsec, sec_clnt_revoke,		nomod_zero);
866	NO_UNLOAD_STUB(rpcsec, authkern_create,		nomod_zero);
867	NO_UNLOAD_STUB(rpcsec, sec_svc_msg,		nomod_zero);
868	NO_UNLOAD_STUB(rpcsec, sec_svc_control,		nomod_zero);
869	END_MODULE(rpcsec);
870#endif
871
872/*
873 * Stubs for rpc RPCSEC_GSS security service module
874 */
875#ifndef RPCSEC_GSS_MODULE
876	MODULE(rpcsec_gss,misc);
877	NO_UNLOAD_STUB(rpcsec_gss, __svcrpcsec_gss,		nomod_zero);
878	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_getcred,		nomod_zero);
879	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_set_callback,	nomod_zero);
880	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_secget,		nomod_zero);
881	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_secfree,		nomod_zero);
882	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_seccreate,		nomod_zero);
883	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_set_defaults,	nomod_zero);
884	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_revauth,		nomod_zero);
885	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_secpurge,		nomod_zero);
886	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_cleanup,		nomod_zero);
887	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_get_versions,	nomod_zero);
888	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_max_data_length,	nomod_zero);
889	NO_UNLOAD_STUB(rpcsec_gss, rpc_gss_svc_max_data_length,	nomod_zero);
890	END_MODULE(rpcsec_gss);
891#endif
892
893#ifndef SAD_MODULE
894	MODULE(sad,drv);
895	STUB(sad, sadinit, 0);
896	STUB(sad, ap_free, 0);
897	END_MODULE(sad);
898#endif
899
900#ifndef WC_MODULE
901	MODULE(wc,drv);
902	STUB(wc, wcvnget, 0);
903	STUB(wc, wcvnrele, 0);
904	END_MODULE(wc);
905#endif
906
907#ifndef IWSCN_MODULE
908	MODULE(iwscn,drv);
909	STUB(iwscn, srpop, 0);
910	END_MODULE(iwscn);
911#endif
912
913/*
914 * Stubs for checkpoint-resume module
915 */
916#ifndef CPR_MODULE
917        MODULE(cpr,misc);
918        STUB(cpr, cpr, 0);
919        END_MODULE(cpr);
920#endif
921
922/*
923 * Stubs for VIS module
924 */
925#ifndef VIS_MODULE
926        MODULE(vis,misc);
927        STUB(vis, vis_fpu_simulator, 0);
928        STUB(vis, vis_fldst, 0);
929        STUB(vis, vis_rdgsr, 0);
930        STUB(vis, vis_wrgsr, 0);
931        END_MODULE(vis);
932#endif
933
934/*
935 * Stubs for kernel probes (tnf module).  Not unloadable.
936 */
937#ifndef TNF_MODULE
938	MODULE(tnf,drv);
939	NO_UNLOAD_STUB(tnf, tnf_ref32_1,	nomod_zero);
940	NO_UNLOAD_STUB(tnf, tnf_string_1,	nomod_zero);
941	NO_UNLOAD_STUB(tnf, tnf_opaque_array_1,	nomod_zero);
942	NO_UNLOAD_STUB(tnf, tnf_opaque32_array_1, nomod_zero);
943	NO_UNLOAD_STUB(tnf, tnf_struct_tag_1,	nomod_zero);
944	NO_UNLOAD_STUB(tnf, tnf_allocate,	nomod_zero);
945	END_MODULE(tnf);
946#endif
947
948/*
949 * Clustering: stubs for bootstrapping.
950 */
951#ifndef CL_BOOTSTRAP
952	MODULE(cl_bootstrap,misc);
953	NO_UNLOAD_WSTUB(cl_bootstrap, clboot_modload, nomod_minus_one);
954	NO_UNLOAD_WSTUB(cl_bootstrap, clboot_loadrootmodules, nomod_zero);
955	NO_UNLOAD_WSTUB(cl_bootstrap, clboot_rootconf, nomod_zero);
956	NO_UNLOAD_WSTUB(cl_bootstrap, clboot_mountroot, nomod_zero);
957	NO_UNLOAD_WSTUB(cl_bootstrap, clconf_init, nomod_zero);
958	NO_UNLOAD_WSTUB(cl_bootstrap, clconf_get_nodeid, nomod_zero);
959	NO_UNLOAD_WSTUB(cl_bootstrap, clconf_maximum_nodeid, nomod_zero);
960	NO_UNLOAD_WSTUB(cl_bootstrap, cluster, nomod_zero);
961	END_MODULE(cl_bootstrap);
962#endif
963
964/*
965 * Clustering: stubs for cluster infrastructure.
966 */
967#ifndef CL_COMM_MODULE
968	MODULE(cl_comm,misc);
969	NO_UNLOAD_STUB(cl_comm, cladmin, nomod_minus_one);
970	END_MODULE(cl_comm);
971#endif
972
973/*
974 * Clustering: stubs for global file system operations.
975 */
976#ifndef PXFS_MODULE
977	MODULE(pxfs,fs);
978	NO_UNLOAD_WSTUB(pxfs, clpxfs_aio_read, nomod_zero);
979	NO_UNLOAD_WSTUB(pxfs, clpxfs_aio_write, nomod_zero);
980	NO_UNLOAD_WSTUB(pxfs, cl_flk_state_transition_notify, nomod_zero);
981	END_MODULE(pxfs);
982#endif
983
984/*
985 * Stubs for PCI configurator module (misc/pcicfg).
986 */
987#ifndef	PCICFG_MODULE
988	MODULE(pcicfg,misc);
989	STUB(pcicfg, pcicfg_configure, 0);
990	STUB(pcicfg, pcicfg_unconfigure, 0);
991	END_MODULE(pcicfg);
992#endif
993
994#ifndef PCIHP_MODULE
995	MODULE(pcihp,misc);
996	WSTUB(pcihp, pcihp_init, nomod_minus_one);
997	WSTUB(pcihp, pcihp_uninit, nomod_minus_one);
998	WSTUB(pcihp, pcihp_info, nomod_minus_one);
999	WSTUB(pcihp, pcihp_get_cb_ops, nomod_zero);
1000	END_MODULE(pcihp);
1001#endif
1002
1003/*
1004 * Stubs for kernel cryptographic framework module (misc/kcf).
1005 */
1006#ifndef KCF_MODULE
1007	MODULE(kcf,misc);
1008	NO_UNLOAD_STUB(kcf, crypto_mech2id, nomod_minus_one);
1009	NO_UNLOAD_STUB(kcf, crypto_register_provider, nomod_minus_one);
1010	NO_UNLOAD_STUB(kcf, crypto_unregister_provider, nomod_minus_one);
1011	NO_UNLOAD_STUB(kcf, crypto_provider_notification, nomod_minus_one);
1012	NO_UNLOAD_STUB(kcf, crypto_op_notification, nomod_minus_one);
1013	NO_UNLOAD_STUB(kcf, crypto_kmflag, nomod_minus_one);
1014	NO_UNLOAD_STUB(kcf, crypto_digest, nomod_minus_one);
1015	NO_UNLOAD_STUB(kcf, crypto_digest_init, nomod_minus_one);
1016	NO_UNLOAD_STUB(kcf, crypto_digest_update, nomod_minus_one);
1017	NO_UNLOAD_STUB(kcf, crypto_digest_final, nomod_minus_one);
1018	NO_UNLOAD_STUB(kcf, crypto_encrypt, nomod_minus_one);
1019	NO_UNLOAD_STUB(kcf, crypto_encrypt_init, nomod_minus_one);
1020	NO_UNLOAD_STUB(kcf, crypto_encrypt_update, nomod_minus_one);
1021	NO_UNLOAD_STUB(kcf, crypto_encrypt_final, nomod_minus_one);
1022	NO_UNLOAD_STUB(kcf, crypto_decrypt, nomod_minus_one);
1023	NO_UNLOAD_STUB(kcf, crypto_decrypt_init, nomod_minus_one);
1024	NO_UNLOAD_STUB(kcf, crypto_decrypt_update, nomod_minus_one);
1025	NO_UNLOAD_STUB(kcf, crypto_decrypt_final, nomod_minus_one);
1026	NO_UNLOAD_STUB(kcf, crypto_get_all_mech_info, nomod_minus_one);
1027	NO_UNLOAD_STUB(kcf, crypto_mac, nomod_minus_one);
1028	NO_UNLOAD_STUB(kcf, crypto_mac_verify, nomod_minus_one);
1029	NO_UNLOAD_STUB(kcf, crypto_mac_init, nomod_minus_one);
1030	NO_UNLOAD_STUB(kcf, crypto_mac_update, nomod_minus_one);
1031	NO_UNLOAD_STUB(kcf, crypto_mac_final, nomod_minus_one);
1032	NO_UNLOAD_STUB(kcf, crypto_mac_decrypt, nomod_minus_one);
1033	NO_UNLOAD_STUB(kcf, crypto_mac_verify_decrypt, nomod_minus_one);
1034	NO_UNLOAD_STUB(kcf, crypto_mac_decrypt_init, nomod_minus_one);
1035	NO_UNLOAD_STUB(kcf, crypto_mac_decrypt_update, nomod_minus_one);
1036	NO_UNLOAD_STUB(kcf, crypto_mac_decrypt_final, nomod_minus_one);
1037	NO_UNLOAD_STUB(kcf, crypto_encrypt_mac, nomod_minus_one);
1038	NO_UNLOAD_STUB(kcf, crypto_encrypt_mac_init, nomod_minus_one);
1039	NO_UNLOAD_STUB(kcf, crypto_encrypt_mac_update, nomod_minus_one);
1040	NO_UNLOAD_STUB(kcf, crypto_encrypt_mac_final, nomod_minus_one);
1041	NO_UNLOAD_STUB(kcf, crypto_create_ctx_template, nomod_minus_one);
1042	NO_UNLOAD_STUB(kcf, crypto_destroy_ctx_template, nomod_minus_one);
1043	NO_UNLOAD_STUB(kcf, crypto_get_mech_list, nomod_minus_one);
1044	NO_UNLOAD_STUB(kcf, crypto_free_mech_list, nomod_minus_one);
1045	NO_UNLOAD_STUB(kcf, crypto_cancel_req, nomod_minus_one);
1046	NO_UNLOAD_STUB(kcf, crypto_cancel_ctx, nomod_minus_one);
1047	NO_UNLOAD_STUB(kcf, crypto_bufcall_alloc, nomod_minus_one);
1048	NO_UNLOAD_STUB(kcf, crypto_bufcall_free, nomod_minus_one);
1049	NO_UNLOAD_STUB(kcf, crypto_bufcall, nomod_minus_one);
1050	NO_UNLOAD_STUB(kcf, crypto_unbufcall, nomod_minus_one);
1051	NO_UNLOAD_STUB(kcf, crypto_notify_events, nomod_minus_one);
1052	NO_UNLOAD_STUB(kcf, crypto_unnotify_events, nomod_minus_one);
1053	NO_UNLOAD_STUB(kcf, crypto_key_check, nomod_minus_one);
1054	NO_UNLOAD_STUB(kcf, crypto_sign, nomod_minus_one);
1055	NO_UNLOAD_STUB(kcf, crypto_sign_init, nomod_minus_one);
1056	NO_UNLOAD_STUB(kcf, crypto_sign_update, nomod_minus_one);
1057	NO_UNLOAD_STUB(kcf, crypto_sign_final, nomod_minus_one);
1058	NO_UNLOAD_STUB(kcf, crypto_sign_recover, nomod_minus_one);
1059	NO_UNLOAD_STUB(kcf, crypto_verify, nomod_minus_one);
1060	NO_UNLOAD_STUB(kcf, crypto_verify_init, nomod_minus_one);
1061	NO_UNLOAD_STUB(kcf, crypto_verify_update, nomod_minus_one);
1062	NO_UNLOAD_STUB(kcf, crypto_verify_final, nomod_minus_one);
1063	NO_UNLOAD_STUB(kcf, crypto_verify_recover, nomod_minus_one);
1064	NO_UNLOAD_STUB(kcf, random_add_entropy, nomod_minus_one);
1065	NO_UNLOAD_STUB(kcf, random_get_bytes, nomod_minus_one);
1066	NO_UNLOAD_STUB(kcf, random_get_pseudo_bytes, nomod_minus_one);
1067	END_MODULE(kcf);
1068#endif
1069
1070/*
1071 * Stubs for sha1. A non-unloadable module.
1072 */
1073#ifndef SHA1_MODULE
1074	MODULE(sha1,crypto);
1075	NO_UNLOAD_STUB(sha1, SHA1Init, nomod_void);
1076	NO_UNLOAD_STUB(sha1, SHA1Update, nomod_void);
1077	NO_UNLOAD_STUB(sha1, SHA1Final,	nomod_void);
1078	END_MODULE(sha1);
1079#endif
1080
1081/*
1082 * The following stubs are used by the mac module.
1083 * Since dls and dld already depend on mac, these
1084 * stubs are needed to avoid circular dependencies.
1085 */
1086#ifndef DLS_MODULE
1087	MODULE(dls,misc);
1088	STUB(dls, dls_create, nomod_einval);
1089	STUB(dls, dls_destroy, nomod_einval);
1090	END_MODULE(dls);
1091#endif
1092
1093#ifndef	DLD_MODULE
1094	MODULE(dld,drv);
1095	STUB(dld, dld_init_ops, nomod_void);
1096	STUB(dld, dld_fini_ops, nomod_void);
1097	END_MODULE(dld);
1098#endif
1099
1100/*
1101 * Stubs for kssl, the kernel SSL proxy
1102 */
1103#ifndef KSSL_MODULE
1104	MODULE(kssl,drv);
1105	NO_UNLOAD_STUB(kssl, kssl_check_proxy, nomod_zero);
1106	NO_UNLOAD_STUB(kssl, kssl_handle_record, nomod_zero);
1107	NO_UNLOAD_STUB(kssl, kssl_input, nomod_zero);
1108	NO_UNLOAD_STUB(kssl, kssl_build_record, nomod_zero);
1109	NO_UNLOAD_STUB(kssl, kssl_hold_ent, nomod_void);
1110	NO_UNLOAD_STUB(kssl, kssl_release_ent, nomod_void);
1111	NO_UNLOAD_STUB(kssl, kssl_find_fallback, nomod_zero);
1112	NO_UNLOAD_STUB(kssl, kssl_init_context, nomod_zero);
1113	NO_UNLOAD_STUB(kssl, kssl_hold_ctx, nomod_void);
1114	NO_UNLOAD_STUB(kssl, kssl_release_ctx, nomod_void);
1115	END_MODULE(kssl);
1116#endif
1117
1118! this is just a marker for the area of text that contains stubs
1119	.seg ".text"
1120	.global stubs_end
1121stubs_end:
1122	nop
1123
1124#endif	/* lint */
1125