xref: /titanic_53/usr/src/uts/common/sys/modctl.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate #ifndef	_SYS_MODCTL_H
28*7c478bd9Sstevel@tonic-gate #define	_SYS_MODCTL_H
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*7c478bd9Sstevel@tonic-gate 
32*7c478bd9Sstevel@tonic-gate /*
33*7c478bd9Sstevel@tonic-gate  * loadable module support.
34*7c478bd9Sstevel@tonic-gate  */
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate #include <sys/types.h>
37*7c478bd9Sstevel@tonic-gate #include <sys/ioccom.h>
38*7c478bd9Sstevel@tonic-gate #include <sys/nexusdefs.h>
39*7c478bd9Sstevel@tonic-gate #include <sys/thread.h>
40*7c478bd9Sstevel@tonic-gate #include <sys/t_lock.h>
41*7c478bd9Sstevel@tonic-gate #include <sys/dditypes.h>
42*7c478bd9Sstevel@tonic-gate #include <sys/hwconf.h>
43*7c478bd9Sstevel@tonic-gate 
44*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
45*7c478bd9Sstevel@tonic-gate extern "C" {
46*7c478bd9Sstevel@tonic-gate #endif
47*7c478bd9Sstevel@tonic-gate 
48*7c478bd9Sstevel@tonic-gate /*
49*7c478bd9Sstevel@tonic-gate  * The following structure defines the operations used by modctl
50*7c478bd9Sstevel@tonic-gate  * to load and unload modules.  Each supported loadable module type
51*7c478bd9Sstevel@tonic-gate  * requires a set of mod_ops.
52*7c478bd9Sstevel@tonic-gate  */
53*7c478bd9Sstevel@tonic-gate struct mod_ops {
54*7c478bd9Sstevel@tonic-gate 	int		(*modm_install)();	/* install module in kernel */
55*7c478bd9Sstevel@tonic-gate 	int		(*modm_remove)();	/* remove from kernel */
56*7c478bd9Sstevel@tonic-gate 	int		(*modm_info)();		/* module info */
57*7c478bd9Sstevel@tonic-gate };
58*7c478bd9Sstevel@tonic-gate 
59*7c478bd9Sstevel@tonic-gate #ifdef _KERNEL
60*7c478bd9Sstevel@tonic-gate 
61*7c478bd9Sstevel@tonic-gate /*
62*7c478bd9Sstevel@tonic-gate  * The defined set of mod_ops structures for each loadable module type
63*7c478bd9Sstevel@tonic-gate  * Defined in modctl.c
64*7c478bd9Sstevel@tonic-gate  */
65*7c478bd9Sstevel@tonic-gate extern struct mod_ops mod_cryptoops;
66*7c478bd9Sstevel@tonic-gate extern struct mod_ops mod_driverops;
67*7c478bd9Sstevel@tonic-gate extern struct mod_ops mod_execops;
68*7c478bd9Sstevel@tonic-gate extern struct mod_ops mod_fsops;
69*7c478bd9Sstevel@tonic-gate extern struct mod_ops mod_miscops;
70*7c478bd9Sstevel@tonic-gate extern struct mod_ops mod_schedops;
71*7c478bd9Sstevel@tonic-gate extern struct mod_ops mod_strmodops;
72*7c478bd9Sstevel@tonic-gate extern struct mod_ops mod_syscallops;
73*7c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32_IMPL
74*7c478bd9Sstevel@tonic-gate extern struct mod_ops mod_syscallops32;
75*7c478bd9Sstevel@tonic-gate #endif
76*7c478bd9Sstevel@tonic-gate extern struct mod_ops mod_dacfops;
77*7c478bd9Sstevel@tonic-gate extern struct mod_ops mod_ippops;
78*7c478bd9Sstevel@tonic-gate extern struct mod_ops mod_pcbeops;
79*7c478bd9Sstevel@tonic-gate 
80*7c478bd9Sstevel@tonic-gate #endif /* _KERNEL */
81*7c478bd9Sstevel@tonic-gate 
82*7c478bd9Sstevel@tonic-gate /*
83*7c478bd9Sstevel@tonic-gate  * Definitions for the module specific linkage structures.
84*7c478bd9Sstevel@tonic-gate  * The first two fields are the same in all of the structures.
85*7c478bd9Sstevel@tonic-gate  * The linkinfo is for informational purposes only and is returned by
86*7c478bd9Sstevel@tonic-gate  * modctl with the MODINFO cmd.
87*7c478bd9Sstevel@tonic-gate  */
88*7c478bd9Sstevel@tonic-gate 
89*7c478bd9Sstevel@tonic-gate /* For drivers */
90*7c478bd9Sstevel@tonic-gate struct modldrv {
91*7c478bd9Sstevel@tonic-gate 	struct mod_ops		*drv_modops;
92*7c478bd9Sstevel@tonic-gate 	char			*drv_linkinfo;
93*7c478bd9Sstevel@tonic-gate 	struct dev_ops		*drv_dev_ops;
94*7c478bd9Sstevel@tonic-gate };
95*7c478bd9Sstevel@tonic-gate 
96*7c478bd9Sstevel@tonic-gate /* For system calls */
97*7c478bd9Sstevel@tonic-gate struct modlsys {
98*7c478bd9Sstevel@tonic-gate 	struct mod_ops		*sys_modops;
99*7c478bd9Sstevel@tonic-gate 	char			*sys_linkinfo;
100*7c478bd9Sstevel@tonic-gate 	struct sysent		*sys_sysent;
101*7c478bd9Sstevel@tonic-gate };
102*7c478bd9Sstevel@tonic-gate 
103*7c478bd9Sstevel@tonic-gate /* For filesystems */
104*7c478bd9Sstevel@tonic-gate struct modlfs {
105*7c478bd9Sstevel@tonic-gate 	struct mod_ops		*fs_modops;
106*7c478bd9Sstevel@tonic-gate 	char			*fs_linkinfo;
107*7c478bd9Sstevel@tonic-gate 	struct vfsdef_v3	*fs_vfsdef;	/* version may actually vary */
108*7c478bd9Sstevel@tonic-gate };
109*7c478bd9Sstevel@tonic-gate 
110*7c478bd9Sstevel@tonic-gate /* For cryptographic providers */
111*7c478bd9Sstevel@tonic-gate struct modlcrypto {
112*7c478bd9Sstevel@tonic-gate 	struct mod_ops		*crypto_modops;
113*7c478bd9Sstevel@tonic-gate 	char			*crypto_linkinfo;
114*7c478bd9Sstevel@tonic-gate };
115*7c478bd9Sstevel@tonic-gate 
116*7c478bd9Sstevel@tonic-gate /* For misc */
117*7c478bd9Sstevel@tonic-gate struct modlmisc {
118*7c478bd9Sstevel@tonic-gate 	struct mod_ops		*misc_modops;
119*7c478bd9Sstevel@tonic-gate 	char			*misc_linkinfo;
120*7c478bd9Sstevel@tonic-gate };
121*7c478bd9Sstevel@tonic-gate 
122*7c478bd9Sstevel@tonic-gate /* For IP Modules */
123*7c478bd9Sstevel@tonic-gate struct modlipp {
124*7c478bd9Sstevel@tonic-gate 	struct mod_ops		*ipp_modops;
125*7c478bd9Sstevel@tonic-gate 	char			*ipp_linkinfo;
126*7c478bd9Sstevel@tonic-gate 	struct ipp_ops		*ipp_ops;
127*7c478bd9Sstevel@tonic-gate };
128*7c478bd9Sstevel@tonic-gate 
129*7c478bd9Sstevel@tonic-gate /* For Streams Modules. */
130*7c478bd9Sstevel@tonic-gate struct modlstrmod {
131*7c478bd9Sstevel@tonic-gate 	struct mod_ops		*strmod_modops;
132*7c478bd9Sstevel@tonic-gate 	char			*strmod_linkinfo;
133*7c478bd9Sstevel@tonic-gate 	struct fmodsw		*strmod_fmodsw;
134*7c478bd9Sstevel@tonic-gate };
135*7c478bd9Sstevel@tonic-gate 
136*7c478bd9Sstevel@tonic-gate /* For Scheduling classes */
137*7c478bd9Sstevel@tonic-gate struct modlsched {
138*7c478bd9Sstevel@tonic-gate 	struct mod_ops		*sched_modops;
139*7c478bd9Sstevel@tonic-gate 	char			*sched_linkinfo;
140*7c478bd9Sstevel@tonic-gate 	struct sclass		*sched_class;
141*7c478bd9Sstevel@tonic-gate };
142*7c478bd9Sstevel@tonic-gate 
143*7c478bd9Sstevel@tonic-gate /* For Exec file type (like ELF, ...) */
144*7c478bd9Sstevel@tonic-gate struct modlexec {
145*7c478bd9Sstevel@tonic-gate 	struct mod_ops		*exec_modops;
146*7c478bd9Sstevel@tonic-gate 	char			*exec_linkinfo;
147*7c478bd9Sstevel@tonic-gate 	struct execsw		*exec_execsw;
148*7c478bd9Sstevel@tonic-gate };
149*7c478bd9Sstevel@tonic-gate 
150*7c478bd9Sstevel@tonic-gate /* For dacf modules */
151*7c478bd9Sstevel@tonic-gate struct modldacf {
152*7c478bd9Sstevel@tonic-gate 	struct mod_ops		*dacf_modops;
153*7c478bd9Sstevel@tonic-gate 	char			*dacf_linkinfo;
154*7c478bd9Sstevel@tonic-gate 	struct dacfsw		*dacf_dacfsw;
155*7c478bd9Sstevel@tonic-gate };
156*7c478bd9Sstevel@tonic-gate 
157*7c478bd9Sstevel@tonic-gate /* For PCBE modules */
158*7c478bd9Sstevel@tonic-gate struct modlpcbe {
159*7c478bd9Sstevel@tonic-gate 	struct mod_ops		*pcbe_modops;
160*7c478bd9Sstevel@tonic-gate 	char			*pcbe_linkinfo;
161*7c478bd9Sstevel@tonic-gate 	struct __pcbe_ops	*pcbe_ops;
162*7c478bd9Sstevel@tonic-gate };
163*7c478bd9Sstevel@tonic-gate 
164*7c478bd9Sstevel@tonic-gate /*
165*7c478bd9Sstevel@tonic-gate  * Revision number of loadable modules support.  This is the value
166*7c478bd9Sstevel@tonic-gate  * that must be used in the modlinkage structure.
167*7c478bd9Sstevel@tonic-gate  */
168*7c478bd9Sstevel@tonic-gate #define	MODREV_1		1
169*7c478bd9Sstevel@tonic-gate 
170*7c478bd9Sstevel@tonic-gate /*
171*7c478bd9Sstevel@tonic-gate  * The modlinkage structure is the structure that the module writer
172*7c478bd9Sstevel@tonic-gate  * provides to the routines to install, remove, and stat a module.
173*7c478bd9Sstevel@tonic-gate  * The ml_linkage element is an array of pointers to linkage structures.
174*7c478bd9Sstevel@tonic-gate  * For most modules there is only one linkage structure.  We allocate
175*7c478bd9Sstevel@tonic-gate  * enough space for 3 linkage structures which happens to be the most
176*7c478bd9Sstevel@tonic-gate  * we have in any sun supplied module.  For those modules with more
177*7c478bd9Sstevel@tonic-gate  * than 3 linkage structures (which is very unlikely), a modlinkage
178*7c478bd9Sstevel@tonic-gate  * structure must be kmem_alloc'd in the module wrapper to be big enough
179*7c478bd9Sstevel@tonic-gate  * for all of the linkage structures.
180*7c478bd9Sstevel@tonic-gate  */
181*7c478bd9Sstevel@tonic-gate struct modlinkage {
182*7c478bd9Sstevel@tonic-gate 	int		ml_rev;		/* rev of loadable modules system */
183*7c478bd9Sstevel@tonic-gate #ifdef _LP64
184*7c478bd9Sstevel@tonic-gate 	void		*ml_linkage[7];	/* more space in 64-bit OS */
185*7c478bd9Sstevel@tonic-gate #else
186*7c478bd9Sstevel@tonic-gate 	void		*ml_linkage[4];	/* NULL terminated list of */
187*7c478bd9Sstevel@tonic-gate 					/* linkage structures */
188*7c478bd9Sstevel@tonic-gate #endif
189*7c478bd9Sstevel@tonic-gate };
190*7c478bd9Sstevel@tonic-gate 
191*7c478bd9Sstevel@tonic-gate /*
192*7c478bd9Sstevel@tonic-gate  * commands.  These are the commands supported by the modctl system call.
193*7c478bd9Sstevel@tonic-gate  */
194*7c478bd9Sstevel@tonic-gate #define	MODLOAD			0
195*7c478bd9Sstevel@tonic-gate #define	MODUNLOAD		1
196*7c478bd9Sstevel@tonic-gate #define	MODINFO			2
197*7c478bd9Sstevel@tonic-gate #define	MODRESERVED		3
198*7c478bd9Sstevel@tonic-gate #define	MODSETMINIROOT		4
199*7c478bd9Sstevel@tonic-gate #define	MODADDMAJBIND		5
200*7c478bd9Sstevel@tonic-gate #define	MODGETPATH		6
201*7c478bd9Sstevel@tonic-gate #define	MODREADSYSBIND		7
202*7c478bd9Sstevel@tonic-gate #define	MODGETMAJBIND		8
203*7c478bd9Sstevel@tonic-gate #define	MODGETNAME		9
204*7c478bd9Sstevel@tonic-gate #define	MODSIZEOF_DEVID		10
205*7c478bd9Sstevel@tonic-gate #define	MODGETDEVID		11
206*7c478bd9Sstevel@tonic-gate #define	MODSIZEOF_MINORNAME	12
207*7c478bd9Sstevel@tonic-gate #define	MODGETMINORNAME		13
208*7c478bd9Sstevel@tonic-gate #define	MODGETPATHLEN		14
209*7c478bd9Sstevel@tonic-gate #define	MODEVENTS		15
210*7c478bd9Sstevel@tonic-gate #define	MODGETFBNAME		16
211*7c478bd9Sstevel@tonic-gate #define	MODREREADDACF		17
212*7c478bd9Sstevel@tonic-gate #define	MODLOADDRVCONF		18
213*7c478bd9Sstevel@tonic-gate #define	MODUNLOADDRVCONF	19
214*7c478bd9Sstevel@tonic-gate #define	MODREMMAJBIND		20
215*7c478bd9Sstevel@tonic-gate #define	MODDEVT2INSTANCE	21
216*7c478bd9Sstevel@tonic-gate #define	MODGETDEVFSPATH_LEN	22
217*7c478bd9Sstevel@tonic-gate #define	MODGETDEVFSPATH		23
218*7c478bd9Sstevel@tonic-gate #define	MODDEVID2PATHS		24
219*7c478bd9Sstevel@tonic-gate #define	MODSETDEVPOLICY		26
220*7c478bd9Sstevel@tonic-gate #define	MODGETDEVPOLICY		27
221*7c478bd9Sstevel@tonic-gate #define	MODALLOCPRIV		28
222*7c478bd9Sstevel@tonic-gate #define	MODGETDEVPOLICYBYNAME	29
223*7c478bd9Sstevel@tonic-gate #define	MODCLEANUP		30
224*7c478bd9Sstevel@tonic-gate #define	MODLOADMINORPERM	31
225*7c478bd9Sstevel@tonic-gate #define	MODADDMINORPERM		32
226*7c478bd9Sstevel@tonic-gate #define	MODREMMINORPERM		33
227*7c478bd9Sstevel@tonic-gate #define	MODREMDRVCLEANUP	34
228*7c478bd9Sstevel@tonic-gate 
229*7c478bd9Sstevel@tonic-gate /*
230*7c478bd9Sstevel@tonic-gate  * sub cmds for MODEVENTS
231*7c478bd9Sstevel@tonic-gate  */
232*7c478bd9Sstevel@tonic-gate #define	MODEVENTS_FLUSH				0
233*7c478bd9Sstevel@tonic-gate #define	MODEVENTS_FLUSH_DUMP			1
234*7c478bd9Sstevel@tonic-gate #define	MODEVENTS_SET_DOOR_UPCALL_FILENAME	2
235*7c478bd9Sstevel@tonic-gate #define	MODEVENTS_GETDATA			3
236*7c478bd9Sstevel@tonic-gate #define	MODEVENTS_FREEDATA			4
237*7c478bd9Sstevel@tonic-gate #define	MODEVENTS_POST_EVENT			5
238*7c478bd9Sstevel@tonic-gate #define	MODEVENTS_REGISTER_EVENT		6
239*7c478bd9Sstevel@tonic-gate 
240*7c478bd9Sstevel@tonic-gate /*
241*7c478bd9Sstevel@tonic-gate  * Data structure passed to modconfig command in kernel to build devfs tree
242*7c478bd9Sstevel@tonic-gate  */
243*7c478bd9Sstevel@tonic-gate 
244*7c478bd9Sstevel@tonic-gate struct aliases {
245*7c478bd9Sstevel@tonic-gate 	struct aliases *a_next;
246*7c478bd9Sstevel@tonic-gate 	char *a_name;
247*7c478bd9Sstevel@tonic-gate 	int a_len;
248*7c478bd9Sstevel@tonic-gate };
249*7c478bd9Sstevel@tonic-gate 
250*7c478bd9Sstevel@tonic-gate #define	MAXMODCONFNAME	256
251*7c478bd9Sstevel@tonic-gate 
252*7c478bd9Sstevel@tonic-gate struct modconfig {
253*7c478bd9Sstevel@tonic-gate 	char drvname[MAXMODCONFNAME];
254*7c478bd9Sstevel@tonic-gate 	char drvclass[MAXMODCONFNAME];
255*7c478bd9Sstevel@tonic-gate 	int major;
256*7c478bd9Sstevel@tonic-gate 	int num_aliases;
257*7c478bd9Sstevel@tonic-gate 	struct aliases *ap;
258*7c478bd9Sstevel@tonic-gate };
259*7c478bd9Sstevel@tonic-gate 
260*7c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
261*7c478bd9Sstevel@tonic-gate 
262*7c478bd9Sstevel@tonic-gate struct aliases32 {
263*7c478bd9Sstevel@tonic-gate 	caddr32_t a_next;
264*7c478bd9Sstevel@tonic-gate 	caddr32_t a_name;
265*7c478bd9Sstevel@tonic-gate 	int32_t a_len;
266*7c478bd9Sstevel@tonic-gate };
267*7c478bd9Sstevel@tonic-gate 
268*7c478bd9Sstevel@tonic-gate struct modconfig32 {
269*7c478bd9Sstevel@tonic-gate 	char drvname[MAXMODCONFNAME];
270*7c478bd9Sstevel@tonic-gate 	char drvclass[MAXMODCONFNAME];
271*7c478bd9Sstevel@tonic-gate 	int32_t major;
272*7c478bd9Sstevel@tonic-gate 	int32_t num_aliases;
273*7c478bd9Sstevel@tonic-gate 	caddr32_t ap;
274*7c478bd9Sstevel@tonic-gate };
275*7c478bd9Sstevel@tonic-gate 
276*7c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */
277*7c478bd9Sstevel@tonic-gate 
278*7c478bd9Sstevel@tonic-gate /*
279*7c478bd9Sstevel@tonic-gate  * Max module path length
280*7c478bd9Sstevel@tonic-gate  */
281*7c478bd9Sstevel@tonic-gate #define	MOD_MAXPATH	256
282*7c478bd9Sstevel@tonic-gate 
283*7c478bd9Sstevel@tonic-gate /*
284*7c478bd9Sstevel@tonic-gate  * Default search path for modules ADDITIONAL to the directory
285*7c478bd9Sstevel@tonic-gate  * where the kernel components we booted from are.
286*7c478bd9Sstevel@tonic-gate  *
287*7c478bd9Sstevel@tonic-gate  * Most often, this will be "/platform/{platform}/kernel /kernel /usr/kernel",
288*7c478bd9Sstevel@tonic-gate  * but we don't wire it down here.
289*7c478bd9Sstevel@tonic-gate  */
290*7c478bd9Sstevel@tonic-gate #define	MOD_DEFPATH	"/kernel /usr/kernel"
291*7c478bd9Sstevel@tonic-gate 
292*7c478bd9Sstevel@tonic-gate /*
293*7c478bd9Sstevel@tonic-gate  * Default file name extension for autoloading modules.
294*7c478bd9Sstevel@tonic-gate  */
295*7c478bd9Sstevel@tonic-gate #define	MOD_DEFEXT	""
296*7c478bd9Sstevel@tonic-gate 
297*7c478bd9Sstevel@tonic-gate /*
298*7c478bd9Sstevel@tonic-gate  * Parameters for modinfo
299*7c478bd9Sstevel@tonic-gate  */
300*7c478bd9Sstevel@tonic-gate #define	MODMAXNAMELEN 32		/* max module name length */
301*7c478bd9Sstevel@tonic-gate #define	MODMAXLINKINFOLEN 32		/* max link info length */
302*7c478bd9Sstevel@tonic-gate 
303*7c478bd9Sstevel@tonic-gate /*
304*7c478bd9Sstevel@tonic-gate  * Module specific information.
305*7c478bd9Sstevel@tonic-gate  */
306*7c478bd9Sstevel@tonic-gate struct modspecific_info {
307*7c478bd9Sstevel@tonic-gate 	char	msi_linkinfo[MODMAXLINKINFOLEN]; /* name in linkage struct */
308*7c478bd9Sstevel@tonic-gate 	int	msi_p0;			/* module specific information */
309*7c478bd9Sstevel@tonic-gate };
310*7c478bd9Sstevel@tonic-gate 
311*7c478bd9Sstevel@tonic-gate /*
312*7c478bd9Sstevel@tonic-gate  * Structure returned by modctl with MODINFO command.
313*7c478bd9Sstevel@tonic-gate  */
314*7c478bd9Sstevel@tonic-gate #define	MODMAXLINK 10			/* max linkages modinfo can handle */
315*7c478bd9Sstevel@tonic-gate 
316*7c478bd9Sstevel@tonic-gate struct modinfo {
317*7c478bd9Sstevel@tonic-gate 	int		   mi_info;		/* Flags for info wanted */
318*7c478bd9Sstevel@tonic-gate 	int		   mi_state;		/* Flags for module state */
319*7c478bd9Sstevel@tonic-gate 	int		   mi_id;		/* id of this loaded module */
320*7c478bd9Sstevel@tonic-gate 	int		   mi_nextid;		/* id of next module or -1 */
321*7c478bd9Sstevel@tonic-gate 	caddr_t		   mi_base;		/* virtual addr of text */
322*7c478bd9Sstevel@tonic-gate 	size_t		   mi_size;		/* size of module in bytes */
323*7c478bd9Sstevel@tonic-gate 	int		   mi_rev;		/* loadable modules rev */
324*7c478bd9Sstevel@tonic-gate 	int		   mi_loadcnt;		/* # of times loaded */
325*7c478bd9Sstevel@tonic-gate 	char		   mi_name[MODMAXNAMELEN]; /* name of module */
326*7c478bd9Sstevel@tonic-gate 	struct modspecific_info mi_msinfo[MODMAXLINK];
327*7c478bd9Sstevel@tonic-gate 						/* mod specific info */
328*7c478bd9Sstevel@tonic-gate };
329*7c478bd9Sstevel@tonic-gate 
330*7c478bd9Sstevel@tonic-gate 
331*7c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
332*7c478bd9Sstevel@tonic-gate 
333*7c478bd9Sstevel@tonic-gate #define	MODMAXNAMELEN32 32		/* max module name length */
334*7c478bd9Sstevel@tonic-gate #define	MODMAXLINKINFOLEN32 32		/* max link info length */
335*7c478bd9Sstevel@tonic-gate #define	MODMAXLINK32 10			/* max linkages modinfo can handle */
336*7c478bd9Sstevel@tonic-gate 
337*7c478bd9Sstevel@tonic-gate struct modspecific_info32 {
338*7c478bd9Sstevel@tonic-gate 	char	msi_linkinfo[MODMAXLINKINFOLEN32]; /* name in linkage struct */
339*7c478bd9Sstevel@tonic-gate 	int32_t	msi_p0;			/* module specific information */
340*7c478bd9Sstevel@tonic-gate };
341*7c478bd9Sstevel@tonic-gate 
342*7c478bd9Sstevel@tonic-gate struct modinfo32 {
343*7c478bd9Sstevel@tonic-gate 	int32_t		   mi_info;		/* Flags for info wanted */
344*7c478bd9Sstevel@tonic-gate 	int32_t		   mi_state;		/* Flags for module state */
345*7c478bd9Sstevel@tonic-gate 	int32_t		   mi_id;		/* id of this loaded module */
346*7c478bd9Sstevel@tonic-gate 	int32_t		   mi_nextid;		/* id of next module or -1 */
347*7c478bd9Sstevel@tonic-gate 	caddr32_t	   mi_base;		/* virtual addr of text */
348*7c478bd9Sstevel@tonic-gate 	uint32_t	   mi_size;		/* size of module in bytes */
349*7c478bd9Sstevel@tonic-gate 	int32_t		   mi_rev;		/* loadable modules rev */
350*7c478bd9Sstevel@tonic-gate 	int32_t		   mi_loadcnt;		/* # of times loaded */
351*7c478bd9Sstevel@tonic-gate 	char		   mi_name[MODMAXNAMELEN32]; /* name of module */
352*7c478bd9Sstevel@tonic-gate 	struct modspecific_info32 mi_msinfo[MODMAXLINK32];
353*7c478bd9Sstevel@tonic-gate 						/* mod specific info */
354*7c478bd9Sstevel@tonic-gate };
355*7c478bd9Sstevel@tonic-gate 
356*7c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */
357*7c478bd9Sstevel@tonic-gate 
358*7c478bd9Sstevel@tonic-gate /* Values for mi_info flags */
359*7c478bd9Sstevel@tonic-gate #define	MI_INFO_ONE	1
360*7c478bd9Sstevel@tonic-gate #define	MI_INFO_ALL	2
361*7c478bd9Sstevel@tonic-gate #define	MI_INFO_CNT	4
362*7c478bd9Sstevel@tonic-gate #ifdef _KERNEL
363*7c478bd9Sstevel@tonic-gate #define	MI_INFO_LINKAGE	8	/* used internally to extract modlinkage */
364*7c478bd9Sstevel@tonic-gate #endif
365*7c478bd9Sstevel@tonic-gate /*
366*7c478bd9Sstevel@tonic-gate  * MI_INFO_NOBASE indicates caller does not need mi_base. Failure to use this
367*7c478bd9Sstevel@tonic-gate  * flag may lead 32-bit apps to receive an EOVERFLOW error from modctl(MODINFO)
368*7c478bd9Sstevel@tonic-gate  * when used with a 64-bit kernel.
369*7c478bd9Sstevel@tonic-gate  */
370*7c478bd9Sstevel@tonic-gate #define	MI_INFO_NOBASE	16
371*7c478bd9Sstevel@tonic-gate 
372*7c478bd9Sstevel@tonic-gate /* Values for mi_state */
373*7c478bd9Sstevel@tonic-gate #define	MI_LOADED	1
374*7c478bd9Sstevel@tonic-gate #define	MI_INSTALLED	2
375*7c478bd9Sstevel@tonic-gate 
376*7c478bd9Sstevel@tonic-gate /*
377*7c478bd9Sstevel@tonic-gate  * Macros to vector to the appropriate module specific routine.
378*7c478bd9Sstevel@tonic-gate  */
379*7c478bd9Sstevel@tonic-gate #define	MODL_INSTALL(MODL, MODLP) \
380*7c478bd9Sstevel@tonic-gate 	(*(MODL)->misc_modops->modm_install)(MODL, MODLP)
381*7c478bd9Sstevel@tonic-gate #define	MODL_REMOVE(MODL, MODLP) \
382*7c478bd9Sstevel@tonic-gate 	(*(MODL)->misc_modops->modm_remove)(MODL, MODLP)
383*7c478bd9Sstevel@tonic-gate #define	MODL_INFO(MODL, MODLP, P0) \
384*7c478bd9Sstevel@tonic-gate 	(*(MODL)->misc_modops->modm_info)(MODL, MODLP, P0)
385*7c478bd9Sstevel@tonic-gate 
386*7c478bd9Sstevel@tonic-gate /*
387*7c478bd9Sstevel@tonic-gate  * Definitions for stubs
388*7c478bd9Sstevel@tonic-gate  */
389*7c478bd9Sstevel@tonic-gate struct mod_stub_info {
390*7c478bd9Sstevel@tonic-gate 	uintptr_t mods_func_adr;
391*7c478bd9Sstevel@tonic-gate 	struct mod_modinfo *mods_modinfo;
392*7c478bd9Sstevel@tonic-gate 	uintptr_t mods_stub_adr;
393*7c478bd9Sstevel@tonic-gate 	int (*mods_errfcn)();
394*7c478bd9Sstevel@tonic-gate 	int mods_flag;			/* flags defined below */
395*7c478bd9Sstevel@tonic-gate };
396*7c478bd9Sstevel@tonic-gate 
397*7c478bd9Sstevel@tonic-gate /*
398*7c478bd9Sstevel@tonic-gate  * Definitions for mods_flag.
399*7c478bd9Sstevel@tonic-gate  */
400*7c478bd9Sstevel@tonic-gate #define	MODS_WEAK	0x01		/* weak stub (not loaded if called) */
401*7c478bd9Sstevel@tonic-gate #define	MODS_NOUNLOAD	0x02		/* module not unloadable (no _fini()) */
402*7c478bd9Sstevel@tonic-gate #define	MODS_INSTALLED	0x10		/* module installed */
403*7c478bd9Sstevel@tonic-gate 
404*7c478bd9Sstevel@tonic-gate struct mod_modinfo {
405*7c478bd9Sstevel@tonic-gate 	char *modm_module_name;
406*7c478bd9Sstevel@tonic-gate 	struct modctl *mp;
407*7c478bd9Sstevel@tonic-gate 	struct mod_stub_info modm_stubs[1];
408*7c478bd9Sstevel@tonic-gate };
409*7c478bd9Sstevel@tonic-gate 
410*7c478bd9Sstevel@tonic-gate struct modctl_list {
411*7c478bd9Sstevel@tonic-gate 	struct modctl_list *modl_next;
412*7c478bd9Sstevel@tonic-gate 	struct modctl *modl_modp;
413*7c478bd9Sstevel@tonic-gate };
414*7c478bd9Sstevel@tonic-gate 
415*7c478bd9Sstevel@tonic-gate /*
416*7c478bd9Sstevel@tonic-gate  * Structure to manage a loadable module.
417*7c478bd9Sstevel@tonic-gate  * Note: the module (mod_mp) structure's "text" and "text_size" information
418*7c478bd9Sstevel@tonic-gate  * are replicated in the modctl structure so that mod_containing_pc()
419*7c478bd9Sstevel@tonic-gate  * doesn't have to grab any locks (modctls are persistent; modules are not.)
420*7c478bd9Sstevel@tonic-gate  */
421*7c478bd9Sstevel@tonic-gate struct modctl {
422*7c478bd9Sstevel@tonic-gate 	struct modctl	*mod_next;	/* &modules based list */
423*7c478bd9Sstevel@tonic-gate 	struct modctl	*mod_prev;
424*7c478bd9Sstevel@tonic-gate 	int		mod_id;
425*7c478bd9Sstevel@tonic-gate 	void		*mod_mp;
426*7c478bd9Sstevel@tonic-gate 	kthread_t	*mod_inprogress_thread;
427*7c478bd9Sstevel@tonic-gate 	struct mod_modinfo *mod_modinfo;
428*7c478bd9Sstevel@tonic-gate 	struct modlinkage *mod_linkage;
429*7c478bd9Sstevel@tonic-gate 	char		*mod_filename;
430*7c478bd9Sstevel@tonic-gate 	char		*mod_modname;
431*7c478bd9Sstevel@tonic-gate 
432*7c478bd9Sstevel@tonic-gate 	char		mod_busy;	/* inprogress_thread has locked */
433*7c478bd9Sstevel@tonic-gate 	char		mod_want;	/* someone waiting for unlock */
434*7c478bd9Sstevel@tonic-gate 	char		mod_prim;	/* primary module */
435*7c478bd9Sstevel@tonic-gate 
436*7c478bd9Sstevel@tonic-gate 	int		mod_ref;	/* ref count - from dependent or stub */
437*7c478bd9Sstevel@tonic-gate 
438*7c478bd9Sstevel@tonic-gate 	char		mod_loaded;	/* module in memory */
439*7c478bd9Sstevel@tonic-gate 	char		mod_installed;	/* post _init pre _fini */
440*7c478bd9Sstevel@tonic-gate 	char		mod_loadflags;
441*7c478bd9Sstevel@tonic-gate 	char		mod_delay_unload;	/* deferred unload */
442*7c478bd9Sstevel@tonic-gate 
443*7c478bd9Sstevel@tonic-gate 	struct modctl_list *mod_requisites;	/* mods this one depends on. */
444*7c478bd9Sstevel@tonic-gate 	void		*__unused;	/* NOTE: reuse (same size) is OK, */
445*7c478bd9Sstevel@tonic-gate 					/* deletion causes mdb.vs.core issues */
446*7c478bd9Sstevel@tonic-gate 	int		mod_loadcnt;	/* number of times mod was loaded */
447*7c478bd9Sstevel@tonic-gate 	int		mod_nenabled;	/* # of enabled DTrace probes in mod */
448*7c478bd9Sstevel@tonic-gate 	char		*mod_text;
449*7c478bd9Sstevel@tonic-gate 	size_t		mod_text_size;
450*7c478bd9Sstevel@tonic-gate 
451*7c478bd9Sstevel@tonic-gate 	int		mod_gencount;	/* # times loaded/unloaded */
452*7c478bd9Sstevel@tonic-gate 	struct modctl	*mod_requisite_loading;	/* mod circular dependency */
453*7c478bd9Sstevel@tonic-gate };
454*7c478bd9Sstevel@tonic-gate 
455*7c478bd9Sstevel@tonic-gate /*
456*7c478bd9Sstevel@tonic-gate  * mod_loadflags
457*7c478bd9Sstevel@tonic-gate  */
458*7c478bd9Sstevel@tonic-gate 
459*7c478bd9Sstevel@tonic-gate #define	MOD_NOAUTOUNLOAD	0x1	/* Auto mod-unloader skips this mod */
460*7c478bd9Sstevel@tonic-gate #define	MOD_NONOTIFY		0x2	/* No krtld notifications on (un)load */
461*7c478bd9Sstevel@tonic-gate #define	MOD_NOUNLOAD		0x4	/* Assume EBUSY for all _fini's */
462*7c478bd9Sstevel@tonic-gate 
463*7c478bd9Sstevel@tonic-gate #ifdef _KERNEL
464*7c478bd9Sstevel@tonic-gate 
465*7c478bd9Sstevel@tonic-gate #define	MOD_BIND_HASHSIZE	64
466*7c478bd9Sstevel@tonic-gate #define	MOD_BIND_HASHMASK	(MOD_BIND_HASHSIZE-1)
467*7c478bd9Sstevel@tonic-gate 
468*7c478bd9Sstevel@tonic-gate typedef int modid_t;
469*7c478bd9Sstevel@tonic-gate 
470*7c478bd9Sstevel@tonic-gate /*
471*7c478bd9Sstevel@tonic-gate  * global function and data declarations
472*7c478bd9Sstevel@tonic-gate  */
473*7c478bd9Sstevel@tonic-gate extern kmutex_t mod_lock;
474*7c478bd9Sstevel@tonic-gate 
475*7c478bd9Sstevel@tonic-gate extern char *systemfile;
476*7c478bd9Sstevel@tonic-gate extern char **syscallnames;
477*7c478bd9Sstevel@tonic-gate extern int moddebug;
478*7c478bd9Sstevel@tonic-gate 
479*7c478bd9Sstevel@tonic-gate /*
480*7c478bd9Sstevel@tonic-gate  * this is the head of a doubly linked list.  Only the next and prev
481*7c478bd9Sstevel@tonic-gate  * pointers are used
482*7c478bd9Sstevel@tonic-gate  */
483*7c478bd9Sstevel@tonic-gate extern struct modctl modules;
484*7c478bd9Sstevel@tonic-gate 
485*7c478bd9Sstevel@tonic-gate extern void	mod_setup(void);
486*7c478bd9Sstevel@tonic-gate extern int	modload(char *, char *);
487*7c478bd9Sstevel@tonic-gate extern int	modloadonly(char *, char *);
488*7c478bd9Sstevel@tonic-gate extern int	modunload(int);
489*7c478bd9Sstevel@tonic-gate extern int	mod_hold_stub(struct mod_stub_info *);
490*7c478bd9Sstevel@tonic-gate extern void	modunload_disable(void);
491*7c478bd9Sstevel@tonic-gate extern void	modunload_enable(void);
492*7c478bd9Sstevel@tonic-gate extern int	mod_remove_by_name(char *);
493*7c478bd9Sstevel@tonic-gate extern int	mod_sysvar(const char *, const char *, u_longlong_t *);
494*7c478bd9Sstevel@tonic-gate extern int	mod_sysctl(int, void *);
495*7c478bd9Sstevel@tonic-gate struct sysparam;
496*7c478bd9Sstevel@tonic-gate extern int	mod_hold_by_modctl(struct modctl *, int);
497*7c478bd9Sstevel@tonic-gate #define		MOD_WAIT_ONCE		0x01
498*7c478bd9Sstevel@tonic-gate #define		MOD_WAIT_FOREVER	0x02
499*7c478bd9Sstevel@tonic-gate #define		MOD_LOCK_HELD		0x04
500*7c478bd9Sstevel@tonic-gate #define		MOD_LOCK_NOT_HELD	0x08
501*7c478bd9Sstevel@tonic-gate extern int	mod_sysctl_type(int, int (*)(struct sysparam *, void *),
502*7c478bd9Sstevel@tonic-gate     void *);
503*7c478bd9Sstevel@tonic-gate extern void	mod_read_system_file(int);
504*7c478bd9Sstevel@tonic-gate extern void	mod_release_stub(struct mod_stub_info *);
505*7c478bd9Sstevel@tonic-gate extern void	mod_askparams(void);
506*7c478bd9Sstevel@tonic-gate extern void	mod_uninstall_daemon(void);
507*7c478bd9Sstevel@tonic-gate extern void	modreap(void);
508*7c478bd9Sstevel@tonic-gate extern struct modctl *mod_hold_by_name(char *);
509*7c478bd9Sstevel@tonic-gate extern void	mod_release_mod(struct modctl *);
510*7c478bd9Sstevel@tonic-gate extern uintptr_t	modlookup(char *, char *);
511*7c478bd9Sstevel@tonic-gate extern char	*modgetsymname(uintptr_t, unsigned long *);
512*7c478bd9Sstevel@tonic-gate extern void	mod_release_requisites(struct modctl *);
513*7c478bd9Sstevel@tonic-gate extern struct modctl *mod_load_requisite(struct modctl *, char *);
514*7c478bd9Sstevel@tonic-gate extern struct modctl *mod_find_by_filename(char *, char *);
515*7c478bd9Sstevel@tonic-gate extern uintptr_t	modgetsymvalue(char *, int);
516*7c478bd9Sstevel@tonic-gate 
517*7c478bd9Sstevel@tonic-gate extern void	mod_rele_dev_by_major(major_t);
518*7c478bd9Sstevel@tonic-gate extern struct dev_ops *mod_hold_dev_by_major(major_t);
519*7c478bd9Sstevel@tonic-gate extern struct dev_ops *mod_hold_dev_by_devi(dev_info_t *);
520*7c478bd9Sstevel@tonic-gate extern void	mod_rele_dev_by_devi(dev_info_t *);
521*7c478bd9Sstevel@tonic-gate 
522*7c478bd9Sstevel@tonic-gate extern int make_devname(char *, major_t);
523*7c478bd9Sstevel@tonic-gate 
524*7c478bd9Sstevel@tonic-gate struct bind;
525*7c478bd9Sstevel@tonic-gate extern void make_aliases(struct bind **);
526*7c478bd9Sstevel@tonic-gate extern int read_binding_file(char *, struct bind **,
527*7c478bd9Sstevel@tonic-gate     int (*line_parser)(char *, int, char *, struct bind **));
528*7c478bd9Sstevel@tonic-gate extern void clear_binding_hash(struct bind **);
529*7c478bd9Sstevel@tonic-gate 
530*7c478bd9Sstevel@tonic-gate extern void read_class_file(void);
531*7c478bd9Sstevel@tonic-gate extern void setbootpath(char *);
532*7c478bd9Sstevel@tonic-gate extern void setbootfstype(char *);
533*7c478bd9Sstevel@tonic-gate 
534*7c478bd9Sstevel@tonic-gate extern int install_stubs_by_name(struct modctl *, char *);
535*7c478bd9Sstevel@tonic-gate extern void install_stubs(struct modctl *);
536*7c478bd9Sstevel@tonic-gate extern void uninstall_stubs(struct modctl *);
537*7c478bd9Sstevel@tonic-gate extern void reset_stubs(struct modctl *);
538*7c478bd9Sstevel@tonic-gate extern struct modctl *mod_getctl(struct modlinkage *);
539*7c478bd9Sstevel@tonic-gate extern major_t mod_name_to_major(char *);
540*7c478bd9Sstevel@tonic-gate extern modid_t mod_name_to_modid(char *);
541*7c478bd9Sstevel@tonic-gate extern char *mod_major_to_name(major_t);
542*7c478bd9Sstevel@tonic-gate extern void init_devnamesp(int);
543*7c478bd9Sstevel@tonic-gate extern void init_syscallnames(int);
544*7c478bd9Sstevel@tonic-gate 
545*7c478bd9Sstevel@tonic-gate extern char *mod_getsysname(int);
546*7c478bd9Sstevel@tonic-gate extern int mod_getsysnum(char *);
547*7c478bd9Sstevel@tonic-gate 
548*7c478bd9Sstevel@tonic-gate extern char *mod_containing_pc(caddr_t);
549*7c478bd9Sstevel@tonic-gate extern int mod_in_autounload(void);
550*7c478bd9Sstevel@tonic-gate extern char	*mod_modname(struct modlinkage *);
551*7c478bd9Sstevel@tonic-gate 
552*7c478bd9Sstevel@tonic-gate extern int dev_minorperm(dev_info_t *dip, char *name, mperm_t *rmp);
553*7c478bd9Sstevel@tonic-gate 
554*7c478bd9Sstevel@tonic-gate /*
555*7c478bd9Sstevel@tonic-gate  * Declarations used for dynamic linking support routines.  Interfaces
556*7c478bd9Sstevel@tonic-gate  * are marked with the pragma "unknown_control_flow" to prevent tail call
557*7c478bd9Sstevel@tonic-gate  * optimization, so that implementations can reliably use caller() to
558*7c478bd9Sstevel@tonic-gate  * determine initiating module.
559*7c478bd9Sstevel@tonic-gate  */
560*7c478bd9Sstevel@tonic-gate #define	KRTLD_MODE_FIRST	0x0001
561*7c478bd9Sstevel@tonic-gate typedef	struct __ddi_modhandle	*ddi_modhandle_t;
562*7c478bd9Sstevel@tonic-gate extern ddi_modhandle_t		ddi_modopen(const char *,
563*7c478bd9Sstevel@tonic-gate 				    int, int *);
564*7c478bd9Sstevel@tonic-gate extern void			*ddi_modsym(ddi_modhandle_t,
565*7c478bd9Sstevel@tonic-gate 				    const char *, int *);
566*7c478bd9Sstevel@tonic-gate extern int			ddi_modclose(ddi_modhandle_t);
567*7c478bd9Sstevel@tonic-gate #pragma	unknown_control_flow(ddi_modopen, ddi_modsym, ddi_modclose)
568*7c478bd9Sstevel@tonic-gate 
569*7c478bd9Sstevel@tonic-gate /*
570*7c478bd9Sstevel@tonic-gate  * Only the following are part of the DDI/DKI
571*7c478bd9Sstevel@tonic-gate  */
572*7c478bd9Sstevel@tonic-gate extern int	_init(void);
573*7c478bd9Sstevel@tonic-gate extern int	_fini(void);
574*7c478bd9Sstevel@tonic-gate extern int	_info(struct modinfo *);
575*7c478bd9Sstevel@tonic-gate extern int	mod_install(struct modlinkage *);
576*7c478bd9Sstevel@tonic-gate extern int	mod_remove(struct modlinkage *);
577*7c478bd9Sstevel@tonic-gate extern int	mod_info(struct modlinkage *, struct modinfo *);
578*7c478bd9Sstevel@tonic-gate 
579*7c478bd9Sstevel@tonic-gate #else	/* _KERNEL */
580*7c478bd9Sstevel@tonic-gate 
581*7c478bd9Sstevel@tonic-gate extern int modctl(int, ...);
582*7c478bd9Sstevel@tonic-gate 
583*7c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
584*7c478bd9Sstevel@tonic-gate 
585*7c478bd9Sstevel@tonic-gate /*
586*7c478bd9Sstevel@tonic-gate  * bit definitions for moddebug.
587*7c478bd9Sstevel@tonic-gate  */
588*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_LOADMSG	0x80000000	/* print "[un]loading..." msg */
589*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_ERRMSG		0x40000000	/* print detailed error msgs */
590*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_LOADMSG2	0x20000000	/* print 2nd level msgs */
591*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_FINI_EBUSY	0x00020000	/* pretend fini returns EBUSY */
592*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_NOAUL_IPP	0x00010000	/* no Autounloading ipp mods */
593*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_NOAUL_DACF	0x00008000	/* no Autounloading dacf mods */
594*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_KEEPTEXT	0x00004000	/* keep text after unloading */
595*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_NOAUL_DRV	0x00001000	/* no Autounloading Drivers */
596*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_NOAUL_EXEC	0x00000800	/* no Autounloading Execs */
597*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_NOAUL_FS	0x00000400	/* no Autounloading File sys */
598*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_NOAUL_MISC	0x00000200	/* no Autounloading misc */
599*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_NOAUL_SCHED	0x00000100	/* no Autounloading scheds */
600*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_NOAUL_STR	0x00000080	/* no Autounloading streams */
601*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_NOAUL_SYS	0x00000040	/* no Autounloading syscalls */
602*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_NOCTF		0x00000020	/* do not load CTF debug data */
603*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_NOAUTOUNLOAD	0x00000010	/* no autounloading at all */
604*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_DDI_MOD	0x00000008	/* ddi_mod{open,sym,close} */
605*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_MP_MATCH	0x00000004	/* dev_minorperm */
606*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_MINORPERM	0x00000002	/* minor perm modctls */
607*7c478bd9Sstevel@tonic-gate #define	MODDEBUG_USERDEBUG	0x00000001	/* bpt after init_module() */
608*7c478bd9Sstevel@tonic-gate 
609*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
610*7c478bd9Sstevel@tonic-gate }
611*7c478bd9Sstevel@tonic-gate #endif
612*7c478bd9Sstevel@tonic-gate 
613*7c478bd9Sstevel@tonic-gate #endif	/* _SYS_MODCTL_H */
614