diff options
Diffstat (limited to 'include/acpi/acpiosxf.h')
-rw-r--r-- | include/acpi/acpiosxf.h | 155 |
1 files changed, 139 insertions, 16 deletions
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 64b8c7639520..01e6c6d8b7e1 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -77,54 +77,80 @@ struct acpi_signal_fatal_info { | |||
77 | /* | 77 | /* |
78 | * OSL Initialization and shutdown primitives | 78 | * OSL Initialization and shutdown primitives |
79 | */ | 79 | */ |
80 | acpi_status __init acpi_os_initialize(void); | 80 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_initialize |
81 | acpi_status acpi_os_initialize(void); | ||
82 | #endif | ||
81 | 83 | ||
84 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_terminate | ||
82 | acpi_status acpi_os_terminate(void); | 85 | acpi_status acpi_os_terminate(void); |
86 | #endif | ||
83 | 87 | ||
84 | /* | 88 | /* |
85 | * ACPI Table interfaces | 89 | * ACPI Table interfaces |
86 | */ | 90 | */ |
91 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_root_pointer | ||
87 | acpi_physical_address acpi_os_get_root_pointer(void); | 92 | acpi_physical_address acpi_os_get_root_pointer(void); |
93 | #endif | ||
88 | 94 | ||
95 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_predefined_override | ||
89 | acpi_status | 96 | acpi_status |
90 | acpi_os_predefined_override(const struct acpi_predefined_names *init_val, | 97 | acpi_os_predefined_override(const struct acpi_predefined_names *init_val, |
91 | acpi_string * new_val); | 98 | acpi_string * new_val); |
99 | #endif | ||
92 | 100 | ||
101 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_table_override | ||
93 | acpi_status | 102 | acpi_status |
94 | acpi_os_table_override(struct acpi_table_header *existing_table, | 103 | acpi_os_table_override(struct acpi_table_header *existing_table, |
95 | struct acpi_table_header **new_table); | 104 | struct acpi_table_header **new_table); |
105 | #endif | ||
96 | 106 | ||
107 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_physical_table_override | ||
97 | acpi_status | 108 | acpi_status |
98 | acpi_os_physical_table_override(struct acpi_table_header *existing_table, | 109 | acpi_os_physical_table_override(struct acpi_table_header *existing_table, |
99 | acpi_physical_address * new_address, | 110 | acpi_physical_address * new_address, |
100 | u32 *new_table_length); | 111 | u32 *new_table_length); |
112 | #endif | ||
101 | 113 | ||
102 | /* | 114 | /* |
103 | * Spinlock primitives | 115 | * Spinlock primitives |
104 | */ | 116 | */ |
105 | #ifndef acpi_os_create_lock | 117 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_lock |
106 | acpi_status acpi_os_create_lock(acpi_spinlock * out_handle); | 118 | acpi_status acpi_os_create_lock(acpi_spinlock * out_handle); |
107 | #endif | 119 | #endif |
108 | 120 | ||
121 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_lock | ||
109 | void acpi_os_delete_lock(acpi_spinlock handle); | 122 | void acpi_os_delete_lock(acpi_spinlock handle); |
123 | #endif | ||
110 | 124 | ||
125 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_lock | ||
111 | acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle); | 126 | acpi_cpu_flags acpi_os_acquire_lock(acpi_spinlock handle); |
127 | #endif | ||
112 | 128 | ||
129 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_lock | ||
113 | void acpi_os_release_lock(acpi_spinlock handle, acpi_cpu_flags flags); | 130 | void acpi_os_release_lock(acpi_spinlock handle, acpi_cpu_flags flags); |
131 | #endif | ||
114 | 132 | ||
115 | /* | 133 | /* |
116 | * Semaphore primitives | 134 | * Semaphore primitives |
117 | */ | 135 | */ |
136 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_semaphore | ||
118 | acpi_status | 137 | acpi_status |
119 | acpi_os_create_semaphore(u32 max_units, | 138 | acpi_os_create_semaphore(u32 max_units, |
120 | u32 initial_units, acpi_semaphore * out_handle); | 139 | u32 initial_units, acpi_semaphore * out_handle); |
140 | #endif | ||
121 | 141 | ||
142 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_semaphore | ||
122 | acpi_status acpi_os_delete_semaphore(acpi_semaphore handle); | 143 | acpi_status acpi_os_delete_semaphore(acpi_semaphore handle); |
144 | #endif | ||
123 | 145 | ||
146 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_wait_semaphore | ||
124 | acpi_status | 147 | acpi_status |
125 | acpi_os_wait_semaphore(acpi_semaphore handle, u32 units, u16 timeout); | 148 | acpi_os_wait_semaphore(acpi_semaphore handle, u32 units, u16 timeout); |
149 | #endif | ||
126 | 150 | ||
151 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_signal_semaphore | ||
127 | acpi_status acpi_os_signal_semaphore(acpi_semaphore handle, u32 units); | 152 | acpi_status acpi_os_signal_semaphore(acpi_semaphore handle, u32 units); |
153 | #endif | ||
128 | 154 | ||
129 | /* | 155 | /* |
130 | * Mutex primitives. May be configured to use semaphores instead via | 156 | * Mutex primitives. May be configured to use semaphores instead via |
@@ -132,29 +158,48 @@ acpi_status acpi_os_signal_semaphore(acpi_semaphore handle, u32 units); | |||
132 | */ | 158 | */ |
133 | #if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE) | 159 | #if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE) |
134 | 160 | ||
161 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_mutex | ||
135 | acpi_status acpi_os_create_mutex(acpi_mutex * out_handle); | 162 | acpi_status acpi_os_create_mutex(acpi_mutex * out_handle); |
163 | #endif | ||
136 | 164 | ||
165 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_mutex | ||
137 | void acpi_os_delete_mutex(acpi_mutex handle); | 166 | void acpi_os_delete_mutex(acpi_mutex handle); |
167 | #endif | ||
138 | 168 | ||
169 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_mutex | ||
139 | acpi_status acpi_os_acquire_mutex(acpi_mutex handle, u16 timeout); | 170 | acpi_status acpi_os_acquire_mutex(acpi_mutex handle, u16 timeout); |
171 | #endif | ||
140 | 172 | ||
173 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_mutex | ||
141 | void acpi_os_release_mutex(acpi_mutex handle); | 174 | void acpi_os_release_mutex(acpi_mutex handle); |
142 | #endif | 175 | #endif |
143 | 176 | ||
177 | #endif | ||
178 | |||
144 | /* | 179 | /* |
145 | * Memory allocation and mapping | 180 | * Memory allocation and mapping |
146 | */ | 181 | */ |
182 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate | ||
147 | void *acpi_os_allocate(acpi_size size); | 183 | void *acpi_os_allocate(acpi_size size); |
184 | #endif | ||
148 | 185 | ||
186 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_allocate_zeroed | ||
187 | void *acpi_os_allocate_zeroed(acpi_size size); | ||
188 | #endif | ||
189 | |||
190 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_free | ||
149 | void acpi_os_free(void *memory); | 191 | void acpi_os_free(void *memory); |
192 | #endif | ||
150 | 193 | ||
151 | void __iomem *acpi_os_map_memory(acpi_physical_address where, | 194 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_map_memory |
152 | acpi_size length); | 195 | void *acpi_os_map_memory(acpi_physical_address where, acpi_size length); |
196 | #endif | ||
153 | 197 | ||
154 | void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size); | 198 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_unmap_memory |
155 | void early_acpi_os_unmap_memory(void __iomem * virt, acpi_size size); | 199 | void acpi_os_unmap_memory(void *logical_address, acpi_size size); |
200 | #endif | ||
156 | 201 | ||
157 | #ifdef ACPI_FUTURE_USAGE | 202 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_physical_address |
158 | acpi_status | 203 | acpi_status |
159 | acpi_os_get_physical_address(void *logical_address, | 204 | acpi_os_get_physical_address(void *logical_address, |
160 | acpi_physical_address * physical_address); | 205 | acpi_physical_address * physical_address); |
@@ -163,117 +208,195 @@ acpi_os_get_physical_address(void *logical_address, | |||
163 | /* | 208 | /* |
164 | * Memory/Object Cache | 209 | * Memory/Object Cache |
165 | */ | 210 | */ |
211 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_create_cache | ||
166 | acpi_status | 212 | acpi_status |
167 | acpi_os_create_cache(char *cache_name, | 213 | acpi_os_create_cache(char *cache_name, |
168 | u16 object_size, | 214 | u16 object_size, |
169 | u16 max_depth, acpi_cache_t ** return_cache); | 215 | u16 max_depth, acpi_cache_t ** return_cache); |
216 | #endif | ||
170 | 217 | ||
218 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_delete_cache | ||
171 | acpi_status acpi_os_delete_cache(acpi_cache_t * cache); | 219 | acpi_status acpi_os_delete_cache(acpi_cache_t * cache); |
220 | #endif | ||
172 | 221 | ||
222 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_purge_cache | ||
173 | acpi_status acpi_os_purge_cache(acpi_cache_t * cache); | 223 | acpi_status acpi_os_purge_cache(acpi_cache_t * cache); |
224 | #endif | ||
174 | 225 | ||
226 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_acquire_object | ||
175 | void *acpi_os_acquire_object(acpi_cache_t * cache); | 227 | void *acpi_os_acquire_object(acpi_cache_t * cache); |
228 | #endif | ||
176 | 229 | ||
230 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_release_object | ||
177 | acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object); | 231 | acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object); |
232 | #endif | ||
178 | 233 | ||
179 | /* | 234 | /* |
180 | * Interrupt handlers | 235 | * Interrupt handlers |
181 | */ | 236 | */ |
237 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_install_interrupt_handler | ||
182 | acpi_status | 238 | acpi_status |
183 | acpi_os_install_interrupt_handler(u32 interrupt_number, | 239 | acpi_os_install_interrupt_handler(u32 interrupt_number, |
184 | acpi_osd_handler service_routine, | 240 | acpi_osd_handler service_routine, |
185 | void *context); | 241 | void *context); |
242 | #endif | ||
186 | 243 | ||
244 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_remove_interrupt_handler | ||
187 | acpi_status | 245 | acpi_status |
188 | acpi_os_remove_interrupt_handler(u32 interrupt_number, | 246 | acpi_os_remove_interrupt_handler(u32 interrupt_number, |
189 | acpi_osd_handler service_routine); | 247 | acpi_osd_handler service_routine); |
190 | 248 | #endif | |
191 | void acpi_os_gpe_count(u32 gpe_number); | ||
192 | void acpi_os_fixed_event_count(u32 fixed_event_number); | ||
193 | 249 | ||
194 | /* | 250 | /* |
195 | * Threads and Scheduling | 251 | * Threads and Scheduling |
196 | */ | 252 | */ |
253 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_thread_id | ||
197 | acpi_thread_id acpi_os_get_thread_id(void); | 254 | acpi_thread_id acpi_os_get_thread_id(void); |
255 | #endif | ||
198 | 256 | ||
257 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_execute | ||
199 | acpi_status | 258 | acpi_status |
200 | acpi_os_execute(acpi_execute_type type, | 259 | acpi_os_execute(acpi_execute_type type, |
201 | acpi_osd_exec_callback function, void *context); | 260 | acpi_osd_exec_callback function, void *context); |
261 | #endif | ||
202 | 262 | ||
203 | acpi_status | 263 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_wait_events_complete |
204 | acpi_os_hotplug_execute(acpi_osd_exec_callback function, void *context); | ||
205 | |||
206 | void acpi_os_wait_events_complete(void); | 264 | void acpi_os_wait_events_complete(void); |
265 | #endif | ||
207 | 266 | ||
267 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_sleep | ||
208 | void acpi_os_sleep(u64 milliseconds); | 268 | void acpi_os_sleep(u64 milliseconds); |
269 | #endif | ||
209 | 270 | ||
271 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_stall | ||
210 | void acpi_os_stall(u32 microseconds); | 272 | void acpi_os_stall(u32 microseconds); |
273 | #endif | ||
211 | 274 | ||
212 | /* | 275 | /* |
213 | * Platform and hardware-independent I/O interfaces | 276 | * Platform and hardware-independent I/O interfaces |
214 | */ | 277 | */ |
215 | acpi_status acpi_os_read_port(acpi_io_address address, u32 * value, u32 width); | 278 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_read_port |
279 | acpi_status acpi_os_read_port(acpi_io_address address, u32 *value, u32 width); | ||
280 | #endif | ||
216 | 281 | ||
282 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_write_port | ||
217 | acpi_status acpi_os_write_port(acpi_io_address address, u32 value, u32 width); | 283 | acpi_status acpi_os_write_port(acpi_io_address address, u32 value, u32 width); |
284 | #endif | ||
218 | 285 | ||
219 | /* | 286 | /* |
220 | * Platform and hardware-independent physical memory interfaces | 287 | * Platform and hardware-independent physical memory interfaces |
221 | */ | 288 | */ |
289 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_read_memory | ||
222 | acpi_status | 290 | acpi_status |
223 | acpi_os_read_memory(acpi_physical_address address, u64 *value, u32 width); | 291 | acpi_os_read_memory(acpi_physical_address address, u64 *value, u32 width); |
292 | #endif | ||
224 | 293 | ||
294 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_write_memory | ||
225 | acpi_status | 295 | acpi_status |
226 | acpi_os_write_memory(acpi_physical_address address, u64 value, u32 width); | 296 | acpi_os_write_memory(acpi_physical_address address, u64 value, u32 width); |
297 | #endif | ||
227 | 298 | ||
228 | /* | 299 | /* |
229 | * Platform and hardware-independent PCI configuration space access | 300 | * Platform and hardware-independent PCI configuration space access |
230 | * Note: Can't use "Register" as a parameter, changed to "Reg" -- | 301 | * Note: Can't use "Register" as a parameter, changed to "Reg" -- |
231 | * certain compilers complain. | 302 | * certain compilers complain. |
232 | */ | 303 | */ |
304 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_read_pci_configuration | ||
233 | acpi_status | 305 | acpi_status |
234 | acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id, | 306 | acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id, |
235 | u32 reg, u64 *value, u32 width); | 307 | u32 reg, u64 *value, u32 width); |
308 | #endif | ||
236 | 309 | ||
310 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_write_pci_configuration | ||
237 | acpi_status | 311 | acpi_status |
238 | acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id, | 312 | acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id, |
239 | u32 reg, u64 value, u32 width); | 313 | u32 reg, u64 value, u32 width); |
314 | #endif | ||
240 | 315 | ||
241 | /* | 316 | /* |
242 | * Miscellaneous | 317 | * Miscellaneous |
243 | */ | 318 | */ |
319 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_readable | ||
320 | u8 acpi_os_readable(void *pointer, acpi_size length); | ||
321 | #endif | ||
322 | |||
323 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_writable | ||
324 | u8 acpi_os_writable(void *pointer, acpi_size length); | ||
325 | #endif | ||
326 | |||
327 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_timer | ||
244 | u64 acpi_os_get_timer(void); | 328 | u64 acpi_os_get_timer(void); |
329 | #endif | ||
245 | 330 | ||
331 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_signal | ||
246 | acpi_status acpi_os_signal(u32 function, void *info); | 332 | acpi_status acpi_os_signal(u32 function, void *info); |
333 | #endif | ||
247 | 334 | ||
248 | /* | 335 | /* |
249 | * Debug print routines | 336 | * Debug print routines |
250 | */ | 337 | */ |
338 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_printf | ||
251 | void ACPI_INTERNAL_VAR_XFACE acpi_os_printf(const char *format, ...); | 339 | void ACPI_INTERNAL_VAR_XFACE acpi_os_printf(const char *format, ...); |
340 | #endif | ||
252 | 341 | ||
342 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_vprintf | ||
253 | void acpi_os_vprintf(const char *format, va_list args); | 343 | void acpi_os_vprintf(const char *format, va_list args); |
344 | #endif | ||
254 | 345 | ||
346 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_redirect_output | ||
255 | void acpi_os_redirect_output(void *destination); | 347 | void acpi_os_redirect_output(void *destination); |
348 | #endif | ||
256 | 349 | ||
257 | #ifdef ACPI_FUTURE_USAGE | ||
258 | /* | 350 | /* |
259 | * Debug input | 351 | * Debug input |
260 | */ | 352 | */ |
261 | u32 acpi_os_get_line(char *buffer); | 353 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_line |
354 | acpi_status acpi_os_get_line(char *buffer, u32 buffer_length, u32 *bytes_read); | ||
355 | #endif | ||
356 | |||
357 | /* | ||
358 | * Obtain ACPI table(s) | ||
359 | */ | ||
360 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_name | ||
361 | acpi_status | ||
362 | acpi_os_get_table_by_name(char *signature, | ||
363 | u32 instance, | ||
364 | struct acpi_table_header **table, | ||
365 | acpi_physical_address * address); | ||
366 | #endif | ||
367 | |||
368 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_index | ||
369 | acpi_status | ||
370 | acpi_os_get_table_by_index(u32 index, | ||
371 | struct acpi_table_header **table, | ||
372 | u32 *instance, acpi_physical_address * address); | ||
373 | #endif | ||
374 | |||
375 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_table_by_address | ||
376 | acpi_status | ||
377 | acpi_os_get_table_by_address(acpi_physical_address address, | ||
378 | struct acpi_table_header **table); | ||
262 | #endif | 379 | #endif |
263 | 380 | ||
264 | /* | 381 | /* |
265 | * Directory manipulation | 382 | * Directory manipulation |
266 | */ | 383 | */ |
384 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_open_directory | ||
267 | void *acpi_os_open_directory(char *pathname, | 385 | void *acpi_os_open_directory(char *pathname, |
268 | char *wildcard_spec, char requested_file_type); | 386 | char *wildcard_spec, char requested_file_type); |
387 | #endif | ||
269 | 388 | ||
270 | /* requeste_file_type values */ | 389 | /* requeste_file_type values */ |
271 | 390 | ||
272 | #define REQUEST_FILE_ONLY 0 | 391 | #define REQUEST_FILE_ONLY 0 |
273 | #define REQUEST_DIR_ONLY 1 | 392 | #define REQUEST_DIR_ONLY 1 |
274 | 393 | ||
394 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_next_filename | ||
275 | char *acpi_os_get_next_filename(void *dir_handle); | 395 | char *acpi_os_get_next_filename(void *dir_handle); |
396 | #endif | ||
276 | 397 | ||
398 | #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_close_directory | ||
277 | void acpi_os_close_directory(void *dir_handle); | 399 | void acpi_os_close_directory(void *dir_handle); |
400 | #endif | ||
278 | 401 | ||
279 | #endif /* __ACPIOSXF_H__ */ | 402 | #endif /* __ACPIOSXF_H__ */ |