modctl.h revision facf4a8d7b59fde89a8662b4f4c73a758e6c402c
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * CDDL HEADER START
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * The contents of this file are subject to the terms of the
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * Common Development and Distribution License (the "License").
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * You may not use this file except in compliance with the License.
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * See the License for the specific language governing permissions
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * and limitations under the License.
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * When distributing Covered Code, include this CDDL HEADER in each
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * If applicable, add the following below this CDDL HEADER, with the
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * fields enclosed by brackets "[]" replaced with your own identifying
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * information: Portions Copyright [yyyy] [name of copyright owner]
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * CDDL HEADER END
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
02b4e56ca3a4e4a4fe9e52fca9c2972101f0e57fHaik Aftandilian * Use is subject to license terms.
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda#pragma ident "%Z%%M% %I% %E% SMI"
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * loadable module support.
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaedaextern "C" {
af4c679f647cf088543c762e33d41a3ac52cfa14Sean McEnroe * The following structure defines the operations used by modctl
af4c679f647cf088543c762e33d41a3ac52cfa14Sean McEnroe * to load and unload modules. Each supported loadable module type
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * requires a set of mod_ops.
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda int (*modm_install)(); /* install module in kernel */
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * The defined set of mod_ops structures for each loadable module type
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * Defined in modctl.c
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda#endif /* _KERNEL */
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * Definitions for the module specific linkage structures.
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * The first two fields are the same in all of the structures.
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * The linkinfo is for informational purposes only and is returned by
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda * modctl with the MODINFO cmd.
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda/* For drivers */
99c7e85592b5d673f1469b2767f876710004dc23James Marks - Sun Microsystems/* For system calls */
99c7e85592b5d673f1469b2767f876710004dc23James Marks - Sun Microsystems/* For filesystems */
99c7e85592b5d673f1469b2767f876710004dc23James Marks - Sun Microsystems struct vfsdef_v3 *fs_vfsdef; /* version may actually vary */
99c7e85592b5d673f1469b2767f876710004dc23James Marks - Sun Microsystems#if defined(__i386) || defined(__amd64)
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda/* For CPU modules */
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda/* For cryptographic providers */
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda/* For misc */
99c7e85592b5d673f1469b2767f876710004dc23James Marks - Sun Microsystems/* For IP Modules */
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda/* For Streams Modules. */
1d4b38e0077763e7c9b20768eacb841957e787bcrsmaeda/* For Scheduling classes */
char *sched_linkinfo;
struct modlexec {
char *exec_linkinfo;
struct modldacf {
char *dacf_linkinfo;
struct modlpcbe {
char *pcbe_linkinfo;
struct modldev {
char *dev_linkinfo;
struct modlinkage {
#ifdef _LP64
#define MODLOAD 0
#define MODEVENTS_FLUSH 0
#define MODDEVNAME_LOOKUPDOOR 0
struct aliases {
char *a_name;
int a_len;
struct modconfig {
int major;
int num_aliases;
#if defined(_SYSCALL32)
struct aliases32 {
struct modconfig32 {
struct modspecific_info {
struct modinfo {
#if defined(_SYSCALL32)
struct modspecific_info32 {
struct modinfo32 {
#ifdef _KERNEL
struct mod_stub_info {
int (*mods_errfcn)();
struct mod_modinfo {
char *modm_module_name;
struct modctl_list {
typedef struct modctl {
int mod_id;
void *mod_mp;
char *mod_filename;
char *mod_modname;
char mod_loadflags;
/* deletion causes mdb.vs.core issues */
char *mod_text;
} modctl_t;
#ifdef _KERNEL
typedef int modid_t;
extern char *systemfile;
extern char **syscallnames;
extern int moddebug;
extern int modload_qualified(const char *,
const char *, const char *, const char *, uint_t[], int);
extern void mod_setup(void);
extern int modload(char *, char *);
extern int modloadonly(char *, char *);
extern int modunload(int);
extern void modunload_disable(void);
extern void modunload_enable(void);
extern void modunload_begin(void);
extern void modunload_end(void);
extern int mod_remove_by_name(char *);
extern int mod_sysctl(int, void *);
struct sysparam;
extern void mod_read_system_file(int);
extern void mod_askparams(void);
extern void mod_uninstall_daemon(void);
extern void modreap(void);
extern int gmatch(const char *, const char *);
struct bind;
extern void read_class_file(void);
extern void setbootpath(char *);
extern void setbootfstype(char *);
extern void init_devnamesp(int);
extern void init_syscallnames(int);
extern char *mod_getsysname(int);
extern int mod_getsysnum(char *);
extern int mod_in_autounload(void);
extern int _init(void);
extern int _fini(void);
extern int modctl(int, ...);
#ifdef __cplusplus