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