-#pragma pack()
-
-typedef kmod_info_t *kmod_info_array_t;
-
-#define KMOD_INFO_NAME kmod_info
-#define KMOD_INFO_VERSION 1
-
-#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, -1, \
- { #name }, { version }, -1, 0, 0, 0, 0, \
- name ## _module_start, \
- name ## _module_stop };
-
-#define KMOD_EXPLICIT_DECL(name, version, start, stop) \
- kmod_info_t KMOD_INFO_NAME = { 0, KMOD_INFO_VERSION, -1, \
- { #name }, { version }, -1, 0, 0, 0, 0, \
- start, stop };
-
-// the following is useful for libaries that don't need their own start and stop functions
-#define KMOD_LIB_DECL(name, version) \
- kmod_info_t KMOD_INFO_NAME = { 0, KMOD_INFO_VERSION, -1, \
- { #name }, { version }, -1, 0, 0, 0, 0, \
- kmod_default_start, \
- kmod_default_stop };
-
-
-// *************************************************************************************
-// kmod kernel to user commands
-// *************************************************************************************
-
-#define KMOD_LOAD_EXTENSION_PACKET 1
-#define KMOD_LOAD_WITH_DEPENDENCIES_PACKET 2
-
-// for generic packets
-#define KMOD_IOKIT_START_RANGE_PACKET 0x1000
-#define KMOD_IOKIT_END_RANGE_PACKET 0x1fff
-
-typedef struct kmod_load_extension_cmd {
- int type;
- char name[KMOD_MAX_NAME];
-} kmod_load_extension_cmd_t;
-
-typedef struct kmod_load_with_dependencies_cmd {
- int type;
- char name[KMOD_MAX_NAME];
- char dependencies[1][KMOD_MAX_NAME];
-} kmod_load_with_dependencies_cmd_t;
-
-typedef struct kmod_generic_cmd {
- int type;
- char data[1];
-} kmod_generic_cmd_t;
-
-#ifdef KERNEL_PRIVATE
-
-extern kmod_info_t *kmod_lookupbyname(const char * name);
-extern kmod_info_t *kmod_lookupbyid(kmod_t id);
+/* A compatibility definition of kmod_info_t for 32-bit kexts.
+ */
+typedef struct kmod_info_32_v1 {
+ uint32_t next_addr;
+ int32_t info_version;
+ uint32_t id;
+ uint8_t name[KMOD_MAX_NAME];
+ uint8_t version[KMOD_MAX_NAME];
+ int32_t reference_count;
+ uint32_t reference_list_addr;
+ uint32_t address;
+ uint32_t size;
+ uint32_t hdr_size;
+ uint32_t start_addr;
+ uint32_t stop_addr;
+} kmod_info_32_v1_t;
+
+/* A compatibility definition of kmod_info_t for 64-bit kexts.
+ */
+typedef struct kmod_info_64_v1 {
+ uint64_t next_addr;
+ int32_t info_version;
+ uint32_t id;
+ uint8_t name[KMOD_MAX_NAME];
+ uint8_t version[KMOD_MAX_NAME];
+ int32_t reference_count;
+ uint64_t reference_list_addr;
+ uint64_t address;
+ uint64_t size;
+ uint64_t hdr_size;
+ uint64_t start_addr;
+ uint64_t stop_addr;
+} kmod_info_64_v1_t;