#include <mach/kmod.h> also included by <mach/mach.h>

mach/kmod.h

NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce support for mandatory and extensible security protections. This notice is included in support of clause 2.2 (b) of the Apple Public License, Version 2.0.
10 typedefs · 7 macros · 4 structs

macroKMOD_MAX_NAME

********************************************************************* Basic macros & typedefs *********************************************************************
#define KMOD_MAX_NAME 64

macroKMOD_RETURN_SUCCESS

#define KMOD_RETURN_SUCCESS KERN_SUCCESS

macroKMOD_RETURN_FAILURE

#define KMOD_RETURN_FAILURE KERN_FAILURE

typedefkmod_t

typedef int kmod_t

typedefkmod_start_func_t

typedef kern_return_t kmod_start_func_t(struct kmod_info * ki, void * data)

typedefkmod_stop_func_t

typedef kern_return_t kmod_stop_func_t(struct kmod_info * ki, void * data)

structkmod_reference

Run-time struct only; never saved to a file
size 16, align 4
struct kmod_reference *next
struct kmod_info *info

typedefkmod_reference_t

typedef struct kmod_reference kmod_reference_t;

structkmod_info

The kmod_info_t structure is only safe to use inside the running kernel. If you need to work with a kmod_info_t structure outside the kernel, please use the compatibility definitions below.
size 196, align 4
struct kmod_info *next
int32_tinfo_versionversion of this structure
uint32_tid
char[64]name
char[64]version
int32_treference_count# linkage refs to this
kmod_reference_t *reference_listwho this refs (links on)
vm_address_taddressstarting address
vm_size_tsizetotal size
vm_size_thdr_sizeunwired hdr size
kmod_start_func_t *start
kmod_stop_func_t *stop

typedefkmod_info_t

typedef struct kmod_info kmod_info_t;

structkmod_info_32_v1

A compatibility definition of kmod_info_t for 32-bit kexts.
size 168, align 4
uint32_tnext_addr
int32_tinfo_version
uint32_tid
uint8_t[64]name
uint8_t[64]version
int32_treference_count
uint32_treference_list_addr
uint32_taddress
uint32_tsize
uint32_thdr_size
uint32_tstart_addr
uint32_tstop_addr

typedefkmod_info_32_v1_t

typedef struct kmod_info_32_v1 kmod_info_32_v1_t;

structkmod_info_64_v1

A compatibility definition of kmod_info_t for 64-bit kexts.
size 196, align 4
uint64_tnext_addr
int32_tinfo_version
uint32_tid
uint8_t[64]name
uint8_t[64]version
int32_treference_count
uint64_treference_list_addr
uint64_taddress
uint64_tsize
uint64_thdr_size
uint64_tstart_addr
uint64_tstop_addr

typedefkmod_info_64_v1_t

typedef struct kmod_info_64_v1 kmod_info_64_v1_t;

macroKMOD_INFO_NAME

********************************************************************* Kmod structure declaration macros *********************************************************************
#define KMOD_INFO_NAME kmod_info

macroKMOD_INFO_VERSION

#define KMOD_INFO_VERSION 1

macroKMOD_DECL

#define KMOD_DECL(name, version) static kmod_start_func_t name ## _module_start;
    static kmod_stop_func_t  name ## _module_stop;
    kmod_info_t KMOD_INFO_NAME = { 0, KMOD_INFO_VERSION, -1U,
	               { #name }, { version }, -1, 0, 0, 0, 0,
	                   name ## _module_start,
	                   name ## _module_stop };

macroKMOD_EXPLICIT_DECL

#define KMOD_EXPLICIT_DECL(name, version, start, stop) kmod_info_t KMOD_INFO_NAME = { 0, KMOD_INFO_VERSION, -1U,
	               { #name }, { version }, -1, 0, 0, 0, 0,
	                   start, stop };

typedefkmod_args_t

********************************************************************* These 3 should be dropped but they're referenced by MIG declarations. *********************************************************************
typedef void * kmod_args_t

typedefkmod_control_flavor_t

typedef int kmod_control_flavor_t

typedefkmod_info_array_t

typedef kmod_info_t * kmod_info_array_t