diff options
Diffstat (limited to 'include/acpi/acpiosxf.h')
-rw-r--r-- | include/acpi/acpiosxf.h | 264 |
1 files changed, 78 insertions, 186 deletions
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index ea489f235216..98e0b8cd14ed 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -7,7 +7,6 @@ | |||
7 | * | 7 | * |
8 | *****************************************************************************/ | 8 | *****************************************************************************/ |
9 | 9 | ||
10 | |||
11 | /* | 10 | /* |
12 | * Copyright (C) 2000 - 2005, R. Byron Moore | 11 | * Copyright (C) 2000 - 2005, R. Byron Moore |
13 | * All rights reserved. | 12 | * All rights reserved. |
@@ -51,7 +50,6 @@ | |||
51 | #include "platform/acenv.h" | 50 | #include "platform/acenv.h" |
52 | #include "actypes.h" | 51 | #include "actypes.h" |
53 | 52 | ||
54 | |||
55 | /* Priorities for acpi_os_queue_for_execution */ | 53 | /* Priorities for acpi_os_queue_for_execution */ |
56 | 54 | ||
57 | #define OSD_PRIORITY_GPE 1 | 55 | #define OSD_PRIORITY_GPE 1 |
@@ -62,200 +60,136 @@ | |||
62 | #define ACPI_NO_UNIT_LIMIT ((u32) -1) | 60 | #define ACPI_NO_UNIT_LIMIT ((u32) -1) |
63 | #define ACPI_MUTEX_SEM 1 | 61 | #define ACPI_MUTEX_SEM 1 |
64 | 62 | ||
65 | |||
66 | /* Functions for acpi_os_signal */ | 63 | /* Functions for acpi_os_signal */ |
67 | 64 | ||
68 | #define ACPI_SIGNAL_FATAL 0 | 65 | #define ACPI_SIGNAL_FATAL 0 |
69 | #define ACPI_SIGNAL_BREAKPOINT 1 | 66 | #define ACPI_SIGNAL_BREAKPOINT 1 |
70 | 67 | ||
71 | struct acpi_signal_fatal_info | 68 | struct acpi_signal_fatal_info { |
72 | { | 69 | u32 type; |
73 | u32 type; | 70 | u32 code; |
74 | u32 code; | 71 | u32 argument; |
75 | u32 argument; | ||
76 | }; | 72 | }; |
77 | 73 | ||
78 | |||
79 | /* | 74 | /* |
80 | * OSL Initialization and shutdown primitives | 75 | * OSL Initialization and shutdown primitives |
81 | */ | 76 | */ |
82 | acpi_status | 77 | acpi_status acpi_os_initialize(void); |
83 | acpi_os_initialize ( | ||
84 | void); | ||
85 | |||
86 | acpi_status | ||
87 | acpi_os_terminate ( | ||
88 | void); | ||
89 | 78 | ||
79 | acpi_status acpi_os_terminate(void); | ||
90 | 80 | ||
91 | /* | 81 | /* |
92 | * ACPI Table interfaces | 82 | * ACPI Table interfaces |
93 | */ | 83 | */ |
94 | acpi_status | 84 | acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *address); |
95 | acpi_os_get_root_pointer ( | ||
96 | u32 flags, | ||
97 | struct acpi_pointer *address); | ||
98 | 85 | ||
99 | acpi_status | 86 | acpi_status |
100 | acpi_os_predefined_override ( | 87 | acpi_os_predefined_override(const struct acpi_predefined_names *init_val, |
101 | const struct acpi_predefined_names *init_val, | 88 | acpi_string * new_val); |
102 | acpi_string *new_val); | ||
103 | 89 | ||
104 | acpi_status | 90 | acpi_status |
105 | acpi_os_table_override ( | 91 | acpi_os_table_override(struct acpi_table_header *existing_table, |
106 | struct acpi_table_header *existing_table, | 92 | struct acpi_table_header **new_table); |
107 | struct acpi_table_header **new_table); | ||
108 | |||
109 | 93 | ||
110 | /* | 94 | /* |
111 | * Synchronization primitives | 95 | * Synchronization primitives |
112 | */ | 96 | */ |
113 | acpi_status | 97 | acpi_status |
114 | acpi_os_create_semaphore ( | 98 | acpi_os_create_semaphore(u32 max_units, |
115 | u32 max_units, | 99 | u32 initial_units, acpi_handle * out_handle); |
116 | u32 initial_units, | ||
117 | acpi_handle *out_handle); | ||
118 | |||
119 | acpi_status | ||
120 | acpi_os_delete_semaphore ( | ||
121 | acpi_handle handle); | ||
122 | 100 | ||
123 | acpi_status | 101 | acpi_status acpi_os_delete_semaphore(acpi_handle handle); |
124 | acpi_os_wait_semaphore ( | ||
125 | acpi_handle handle, | ||
126 | u32 units, | ||
127 | u16 timeout); | ||
128 | 102 | ||
129 | acpi_status | 103 | acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout); |
130 | acpi_os_signal_semaphore ( | ||
131 | acpi_handle handle, | ||
132 | u32 units); | ||
133 | 104 | ||
134 | acpi_status | 105 | acpi_status acpi_os_signal_semaphore(acpi_handle handle, u32 units); |
135 | acpi_os_create_lock ( | ||
136 | acpi_handle *out_handle); | ||
137 | 106 | ||
138 | void | 107 | acpi_status acpi_os_create_lock(acpi_handle * out_handle); |
139 | acpi_os_delete_lock ( | ||
140 | acpi_handle handle); | ||
141 | 108 | ||
142 | void | 109 | void acpi_os_delete_lock(acpi_handle handle); |
143 | acpi_os_acquire_lock ( | ||
144 | acpi_handle handle, | ||
145 | u32 flags); | ||
146 | 110 | ||
147 | void | 111 | unsigned long acpi_os_acquire_lock(acpi_handle handle); |
148 | acpi_os_release_lock ( | ||
149 | acpi_handle handle, | ||
150 | u32 flags); | ||
151 | 112 | ||
113 | void acpi_os_release_lock(acpi_handle handle, unsigned long flags); | ||
152 | 114 | ||
153 | /* | 115 | /* |
154 | * Memory allocation and mapping | 116 | * Memory allocation and mapping |
155 | */ | 117 | */ |
156 | void * | 118 | void *acpi_os_allocate(acpi_size size); |
157 | acpi_os_allocate ( | ||
158 | acpi_size size); | ||
159 | 119 | ||
160 | void | 120 | void acpi_os_free(void *memory); |
161 | acpi_os_free ( | ||
162 | void * memory); | ||
163 | 121 | ||
164 | acpi_status | 122 | acpi_status |
165 | acpi_os_map_memory ( | 123 | acpi_os_map_memory(acpi_physical_address physical_address, |
166 | acpi_physical_address physical_address, | 124 | acpi_size size, void __iomem ** logical_address); |
167 | acpi_size size, | ||
168 | void __iomem **logical_address); | ||
169 | 125 | ||
170 | void | 126 | void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size); |
171 | acpi_os_unmap_memory ( | ||
172 | void __iomem *logical_address, | ||
173 | acpi_size size); | ||
174 | 127 | ||
175 | #ifdef ACPI_FUTURE_USAGE | 128 | #ifdef ACPI_FUTURE_USAGE |
176 | acpi_status | 129 | acpi_status |
177 | acpi_os_get_physical_address ( | 130 | acpi_os_get_physical_address(void *logical_address, |
178 | void *logical_address, | 131 | acpi_physical_address * physical_address); |
179 | acpi_physical_address *physical_address); | ||
180 | #endif | 132 | #endif |
181 | 133 | ||
134 | /* | ||
135 | * Memory/Object Cache | ||
136 | */ | ||
137 | acpi_status | ||
138 | acpi_os_create_cache(char *cache_name, | ||
139 | u16 object_size, | ||
140 | u16 max_depth, acpi_cache_t ** return_cache); | ||
141 | |||
142 | acpi_status acpi_os_delete_cache(acpi_cache_t * cache); | ||
143 | |||
144 | acpi_status acpi_os_purge_cache(acpi_cache_t * cache); | ||
145 | |||
146 | void *acpi_os_acquire_object(acpi_cache_t * cache); | ||
147 | |||
148 | acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object); | ||
182 | 149 | ||
183 | /* | 150 | /* |
184 | * Interrupt handlers | 151 | * Interrupt handlers |
185 | */ | 152 | */ |
186 | acpi_status | 153 | acpi_status |
187 | acpi_os_install_interrupt_handler ( | 154 | acpi_os_install_interrupt_handler(u32 gsi, |
188 | u32 gsi, | 155 | acpi_osd_handler service_routine, |
189 | acpi_osd_handler service_routine, | 156 | void *context); |
190 | void *context); | ||
191 | 157 | ||
192 | acpi_status | 158 | acpi_status |
193 | acpi_os_remove_interrupt_handler ( | 159 | acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler service_routine); |
194 | u32 gsi, | ||
195 | acpi_osd_handler service_routine); | ||
196 | |||
197 | 160 | ||
198 | /* | 161 | /* |
199 | * Threads and Scheduling | 162 | * Threads and Scheduling |
200 | */ | 163 | */ |
201 | u32 | 164 | u32 acpi_os_get_thread_id(void); |
202 | acpi_os_get_thread_id ( | ||
203 | void); | ||
204 | 165 | ||
205 | acpi_status | 166 | acpi_status |
206 | acpi_os_queue_for_execution ( | 167 | acpi_os_queue_for_execution(u32 priority, |
207 | u32 priority, | 168 | acpi_osd_exec_callback function, void *context); |
208 | acpi_osd_exec_callback function, | ||
209 | void *context); | ||
210 | 169 | ||
211 | void | 170 | void acpi_os_wait_events_complete(void *context); |
212 | acpi_os_wait_events_complete( | ||
213 | void * context); | ||
214 | 171 | ||
215 | void | 172 | void acpi_os_wait_events_complete(void *context); |
216 | acpi_os_wait_events_complete ( | ||
217 | void *context); | ||
218 | 173 | ||
219 | void | 174 | void acpi_os_sleep(acpi_integer milliseconds); |
220 | acpi_os_sleep ( | ||
221 | acpi_integer milliseconds); | ||
222 | |||
223 | void | ||
224 | acpi_os_stall ( | ||
225 | u32 microseconds); | ||
226 | 175 | ||
176 | void acpi_os_stall(u32 microseconds); | ||
227 | 177 | ||
228 | /* | 178 | /* |
229 | * Platform and hardware-independent I/O interfaces | 179 | * Platform and hardware-independent I/O interfaces |
230 | */ | 180 | */ |
231 | acpi_status | 181 | acpi_status acpi_os_read_port(acpi_io_address address, u32 * value, u32 width); |
232 | acpi_os_read_port ( | ||
233 | acpi_io_address address, | ||
234 | u32 *value, | ||
235 | u32 width); | ||
236 | |||
237 | acpi_status | ||
238 | acpi_os_write_port ( | ||
239 | acpi_io_address address, | ||
240 | u32 value, | ||
241 | u32 width); | ||
242 | 182 | ||
183 | acpi_status acpi_os_write_port(acpi_io_address address, u32 value, u32 width); | ||
243 | 184 | ||
244 | /* | 185 | /* |
245 | * Platform and hardware-independent physical memory interfaces | 186 | * Platform and hardware-independent physical memory interfaces |
246 | */ | 187 | */ |
247 | acpi_status | 188 | acpi_status |
248 | acpi_os_read_memory ( | 189 | acpi_os_read_memory(acpi_physical_address address, u32 * value, u32 width); |
249 | acpi_physical_address address, | ||
250 | u32 *value, | ||
251 | u32 width); | ||
252 | 190 | ||
253 | acpi_status | 191 | acpi_status |
254 | acpi_os_write_memory ( | 192 | acpi_os_write_memory(acpi_physical_address address, u32 value, u32 width); |
255 | acpi_physical_address address, | ||
256 | u32 value, | ||
257 | u32 width); | ||
258 | |||
259 | 193 | ||
260 | /* | 194 | /* |
261 | * Platform and hardware-independent PCI configuration space access | 195 | * Platform and hardware-independent PCI configuration space access |
@@ -263,111 +197,69 @@ acpi_os_write_memory ( | |||
263 | * certain compilers complain. | 197 | * certain compilers complain. |
264 | */ | 198 | */ |
265 | acpi_status | 199 | acpi_status |
266 | acpi_os_read_pci_configuration ( | 200 | acpi_os_read_pci_configuration(struct acpi_pci_id *pci_id, |
267 | struct acpi_pci_id *pci_id, | 201 | u32 reg, void *value, u32 width); |
268 | u32 reg, | ||
269 | void *value, | ||
270 | u32 width); | ||
271 | 202 | ||
272 | acpi_status | 203 | acpi_status |
273 | acpi_os_write_pci_configuration ( | 204 | acpi_os_write_pci_configuration(struct acpi_pci_id *pci_id, |
274 | struct acpi_pci_id *pci_id, | 205 | u32 reg, acpi_integer value, u32 width); |
275 | u32 reg, | ||
276 | acpi_integer value, | ||
277 | u32 width); | ||
278 | 206 | ||
279 | /* | 207 | /* |
280 | * Interim function needed for PCI IRQ routing | 208 | * Interim function needed for PCI IRQ routing |
281 | */ | 209 | */ |
282 | void | 210 | void |
283 | acpi_os_derive_pci_id( | 211 | acpi_os_derive_pci_id(acpi_handle rhandle, |
284 | acpi_handle rhandle, | 212 | acpi_handle chandle, struct acpi_pci_id **pci_id); |
285 | acpi_handle chandle, | ||
286 | struct acpi_pci_id **pci_id); | ||
287 | 213 | ||
288 | /* | 214 | /* |
289 | * Miscellaneous | 215 | * Miscellaneous |
290 | */ | 216 | */ |
291 | u8 | 217 | u8 acpi_os_readable(void *pointer, acpi_size length); |
292 | acpi_os_readable ( | ||
293 | void *pointer, | ||
294 | acpi_size length); | ||
295 | 218 | ||
296 | #ifdef ACPI_FUTURE_USAGE | 219 | #ifdef ACPI_FUTURE_USAGE |
297 | u8 | 220 | u8 acpi_os_writable(void *pointer, acpi_size length); |
298 | acpi_os_writable ( | ||
299 | void *pointer, | ||
300 | acpi_size length); | ||
301 | #endif | 221 | #endif |
302 | 222 | ||
303 | u64 | 223 | u64 acpi_os_get_timer(void); |
304 | acpi_os_get_timer ( | ||
305 | void); | ||
306 | 224 | ||
307 | acpi_status | 225 | acpi_status acpi_os_signal(u32 function, void *info); |
308 | acpi_os_signal ( | ||
309 | u32 function, | ||
310 | void *info); | ||
311 | 226 | ||
312 | /* | 227 | /* |
313 | * Debug print routines | 228 | * Debug print routines |
314 | */ | 229 | */ |
315 | void ACPI_INTERNAL_VAR_XFACE | 230 | void ACPI_INTERNAL_VAR_XFACE acpi_os_printf(const char *format, ...); |
316 | acpi_os_printf ( | ||
317 | const char *format, | ||
318 | ...); | ||
319 | |||
320 | void | ||
321 | acpi_os_vprintf ( | ||
322 | const char *format, | ||
323 | va_list args); | ||
324 | 231 | ||
325 | void | 232 | void acpi_os_vprintf(const char *format, va_list args); |
326 | acpi_os_redirect_output ( | ||
327 | void *destination); | ||
328 | 233 | ||
234 | void acpi_os_redirect_output(void *destination); | ||
329 | 235 | ||
330 | #ifdef ACPI_FUTURE_USAGE | 236 | #ifdef ACPI_FUTURE_USAGE |
331 | /* | 237 | /* |
332 | * Debug input | 238 | * Debug input |
333 | */ | 239 | */ |
334 | u32 | 240 | u32 acpi_os_get_line(char *buffer); |
335 | acpi_os_get_line ( | ||
336 | char *buffer); | ||
337 | #endif | 241 | #endif |
338 | 242 | ||
339 | |||
340 | /* | 243 | /* |
341 | * Directory manipulation | 244 | * Directory manipulation |
342 | */ | 245 | */ |
343 | void * | 246 | void *acpi_os_open_directory(char *pathname, |
344 | acpi_os_open_directory ( | 247 | char *wildcard_spec, char requested_file_type); |
345 | char *pathname, | ||
346 | char *wildcard_spec, | ||
347 | char requested_file_type); | ||
348 | 248 | ||
349 | /* requeste_file_type values */ | 249 | /* requeste_file_type values */ |
350 | 250 | ||
351 | #define REQUEST_FILE_ONLY 0 | 251 | #define REQUEST_FILE_ONLY 0 |
352 | #define REQUEST_DIR_ONLY 1 | 252 | #define REQUEST_DIR_ONLY 1 |
353 | 253 | ||
254 | char *acpi_os_get_next_filename(void *dir_handle); | ||
354 | 255 | ||
355 | char * | 256 | void acpi_os_close_directory(void *dir_handle); |
356 | acpi_os_get_next_filename ( | ||
357 | void *dir_handle); | ||
358 | |||
359 | void | ||
360 | acpi_os_close_directory ( | ||
361 | void *dir_handle); | ||
362 | 257 | ||
363 | /* | 258 | /* |
364 | * Debug | 259 | * Debug |
365 | */ | 260 | */ |
366 | void | 261 | void |
367 | acpi_os_dbg_assert( | 262 | acpi_os_dbg_assert(void *failed_assertion, |
368 | void *failed_assertion, | 263 | void *file_name, u32 line_number, char *message); |
369 | void *file_name, | ||
370 | u32 line_number, | ||
371 | char *message); | ||
372 | 264 | ||
373 | #endif /* __ACPIOSXF_H__ */ | 265 | #endif /* __ACPIOSXF_H__ */ |