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