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