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