16 typedef KXKextManagerError kload_error
;
18 kload_error_none
= kKXKextManagerErrorNone
,
19 kload_error_unspecified
= kKXKextManagerErrorUnspecified
,
20 kload_error_invalid_argument
= kKXKextManagerErrorInvalidArgument
,
21 kload_error_no_memory
= kKXKextManagerErrorNoMemory
,
23 kload_error_user_abort
= kKXKextManagerErrorUserAbort
,
24 kload_error_kernel_error
= kKXKextManagerErrorKernelError
,
25 kload_error_kernel_permission
= kKXKextManagerErrorKernelPermission
,
27 kload_error_executable_bad
= kKXKextManagerErrorLoadExecutableBad
,
28 kload_error_already_loaded
= kKXKextManagerErrorAlreadyLoaded
,
29 kload_error_loaded_version_differs
= kKXKextManagerErrorLoadedVersionDiffers
,
30 kload_error_dependency_loaded_version_differs
= kKXKextManagerErrorDependencyLoadedVersionDiffers
,
31 kload_error_link_load
= kKXKextManagerErrorLinkLoad
34 typedef KXKextManagerLogLevel kload_log_level
;
36 kload_log_level_silent
= kKXKextManagerLogLevelSilent
,
37 kload_log_level_errors_only
= kKXKextManagerLogLevelErrorsOnly
,
38 kload_log_level_default
= kKXKextManagerLogLevelDefault
,
39 kload_log_level_basic
= kKXKextManagerLogLevelBasic
,
40 kload_log_level_load_basic
= kKXKextManagerLogLevelLoadBasic
,
41 kload_log_level_details
= kKXKextManagerLogLevelDetails
,
42 kload_log_level_kexts
= kKXKextManagerLogLevelKexts
,
43 kload_log_level_kext_details
= kKXKextManagerLogLevelKextDetails
,
44 kload_log_level_load_details
= kKXKextManagerLogLevelLoadDetails
50 kload_error_unspecified
,
51 kload_error_invalid_argument
,
52 kload_error_no_memory
,
54 kload_error_user_abort
,
55 kload_error_kernel_error
,
56 kload_error_kernel_permission
,
58 kload_error_executable_bad
,
59 kload_error_already_loaded
,
60 kload_error_loaded_version_differs
,
61 kload_error_dependency_loaded_version_differs
,
66 kload_log_level_silent
= -2, // no notices, no errors
67 kload_log_level_errors_only
= -1,
68 kload_log_level_default
= 0,
69 kload_log_level_basic
= 1,
70 kload_log_level_load_basic
= 2,
71 kload_log_level_details
= 3,
72 kload_log_level_kexts
= 4,
73 kload_log_level_kext_details
= 5,
74 kload_log_level_load_details
= 6
80 kload_error
kload_load_dgraph(dgraph_t
* dgraph
83 const char * kernel_file
,
84 const char * patch_file
, const char * patch_dir
,
85 const char * symbol_file
, const char * symbol_dir
,
86 int do_load
, int do_start_kmod
, int do_prelink
,
87 int interactive_level
,
88 int ask_overwrite_symbols
, int overwrite_symbols
89 #endif /* not KERNEL */
93 kload_error
kload_load_with_arglist(
94 int argc
, char **argv
,
95 const char * kernel_file
,
96 const char * patch_file
, const char * patch_dir
,
97 const char * symbol_file
, const char * symbol_dir
,
98 int do_load
, int do_start_kmod
,
99 int interactive_level
,
100 int ask_overwrite_symbols
, int overwrite_symbols
);
101 #endif /* not KERNEL */
103 kload_error
kload_map_dgraph(dgraph_t
* dgraph
106 const char * kernel_file
107 #endif /* not KERNEL */
109 kload_error
kload_map_entry(dgraph_entry_t
* entry
);
112 int kload_file_exists(const char * path
);
113 kload_error
kload_request_load_addresses(
115 const char * kernel_file
);
116 kload_error
kload_set_load_addresses_from_args(
118 const char * kernel_file
,
120 #endif /* not KERNEL */
122 kload_error
kload_set_load_addresses_from_kernel(
126 const char * kernel_file
,
128 #endif /* not KERNEL */
131 void kload_set_log_level(kload_log_level level
);
133 void kload_set_log_function(
134 void (*)(const char * format
, ...));
135 void kload_set_error_log_function(
136 void (*)(const char * format
, ...));
137 void kload_set_user_approve_function(
138 int (*)(int default_answer
, const char * format
, ...));
139 void kload_set_user_veto_function(
140 int (*)(int default_answer
, const char * format
, ...));
141 void kload_set_user_input_function(
142 const char * (*)(const char * format
, ...));
144 void kload_log_message(const char * format
, ...);
145 void kload_log_error(const char * format
, ...);
149 #define kload_log_message IOLog
150 #define kload_log_error IOLog
153 #endif /* not KERNEL */
157 #endif /* __LOAD_H__ */