1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48#ifndef __ACPIOSXF_H__
49#define __ACPIOSXF_H__
50
51#include "platform/acenv.h"
52#include "actypes.h"
53
54
55
56
57#define OSD_PRIORITY_GPE 1
58#define OSD_PRIORITY_HIGH 2
59#define OSD_PRIORITY_MED 3
60#define OSD_PRIORITY_LO 4
61
62#define ACPI_NO_UNIT_LIMIT ((u32) -1)
63#define ACPI_MUTEX_SEM 1
64
65
66
67
68#define ACPI_SIGNAL_FATAL 0
69#define ACPI_SIGNAL_BREAKPOINT 1
70
71struct acpi_signal_fatal_info
72{
73 u32 type;
74 u32 code;
75 u32 argument;
76};
77
78
79
80
81
82
83acpi_status
84acpi_os_initialize (
85 void);
86
87acpi_status
88acpi_os_terminate (
89 void);
90
91
92
93
94
95
96acpi_status
97acpi_os_get_root_pointer (
98 u32 flags,
99 struct acpi_pointer *address);
100
101acpi_status
102acpi_os_predefined_override (
103 const struct acpi_predefined_names *init_val,
104 acpi_string *new_val);
105
106acpi_status
107acpi_os_table_override (
108 struct acpi_table_header *existing_table,
109 struct acpi_table_header **new_table);
110
111
112
113
114
115
116acpi_status
117acpi_os_create_semaphore (
118 u32 max_units,
119 u32 initial_units,
120 acpi_handle *out_handle);
121
122acpi_status
123acpi_os_delete_semaphore (
124 acpi_handle handle);
125
126acpi_status
127acpi_os_wait_semaphore (
128 acpi_handle handle,
129 u32 units,
130 u16 timeout);
131
132acpi_status
133acpi_os_signal_semaphore (
134 acpi_handle handle,
135 u32 units);
136
137acpi_status
138acpi_os_create_lock (
139 acpi_handle *out_handle);
140
141void
142acpi_os_delete_lock (
143 acpi_handle handle);
144
145void
146acpi_os_acquire_lock (
147 acpi_handle handle,
148 u32 flags);
149
150void
151acpi_os_release_lock (
152 acpi_handle handle,
153 u32 flags);
154
155
156
157
158
159
160void *
161acpi_os_allocate (
162 acpi_size size);
163
164void
165acpi_os_free (
166 void * memory);
167
168acpi_status
169acpi_os_map_memory (
170 acpi_physical_address physical_address,
171 acpi_size size,
172 void __iomem **logical_address);
173
174void
175acpi_os_unmap_memory (
176 void __iomem *logical_address,
177 acpi_size size);
178
179#ifdef ACPI_FUTURE_USAGE
180acpi_status
181acpi_os_get_physical_address (
182 void *logical_address,
183 acpi_physical_address *physical_address);
184#endif
185
186
187
188
189
190
191acpi_status
192acpi_os_install_interrupt_handler (
193 u32 gsi,
194 acpi_osd_handler service_routine,
195 void *context);
196
197acpi_status
198acpi_os_remove_interrupt_handler (
199 u32 gsi,
200 acpi_osd_handler service_routine);
201
202
203
204
205
206
207u32
208acpi_os_get_thread_id (
209 void);
210
211acpi_status
212acpi_os_queue_for_execution (
213 u32 priority,
214 acpi_osd_exec_callback function,
215 void *context);
216
217void
218acpi_os_wait_events_complete(
219 void * context);
220
221void
222acpi_os_wait_events_complete (
223 void *context);
224
225void
226acpi_os_sleep (
227 acpi_integer milliseconds);
228
229void
230acpi_os_stall (
231 u32 microseconds);
232
233
234
235
236
237
238acpi_status
239acpi_os_read_port (
240 acpi_io_address address,
241 u32 *value,
242 u32 width);
243
244acpi_status
245acpi_os_write_port (
246 acpi_io_address address,
247 u32 value,
248 u32 width);
249
250
251
252
253
254
255acpi_status
256acpi_os_read_memory (
257 acpi_physical_address address,
258 u32 *value,
259 u32 width);
260
261acpi_status
262acpi_os_write_memory (
263 acpi_physical_address address,
264 u32 value,
265 u32 width);
266
267
268
269
270
271
272
273
274acpi_status
275acpi_os_read_pci_configuration (
276 struct acpi_pci_id *pci_id,
277 u32 reg,
278 void *value,
279 u32 width);
280
281acpi_status
282acpi_os_write_pci_configuration (
283 struct acpi_pci_id *pci_id,
284 u32 reg,
285 acpi_integer value,
286 u32 width);
287
288
289
290
291
292void
293acpi_os_derive_pci_id(
294 acpi_handle rhandle,
295 acpi_handle chandle,
296 struct acpi_pci_id **pci_id);
297
298
299
300
301
302u8
303acpi_os_readable (
304 void *pointer,
305 acpi_size length);
306
307#ifdef ACPI_FUTURE_USAGE
308u8
309acpi_os_writable (
310 void *pointer,
311 acpi_size length);
312#endif
313
314u64
315acpi_os_get_timer (
316 void);
317
318acpi_status
319acpi_os_signal (
320 u32 function,
321 void *info);
322
323
324
325
326
327void ACPI_INTERNAL_VAR_XFACE
328acpi_os_printf (
329 const char *format,
330 ...);
331
332void
333acpi_os_vprintf (
334 const char *format,
335 va_list args);
336
337void
338acpi_os_redirect_output (
339 void *destination);
340
341
342
343
344
345
346#ifdef ACPI_FUTURE_USAGE
347u32
348acpi_os_get_line (
349 char *buffer);
350#endif
351
352
353
354
355
356
357void *
358acpi_os_open_directory (
359 char *pathname,
360 char *wildcard_spec,
361 char requested_file_type);
362
363
364
365#define REQUEST_FILE_ONLY 0
366#define REQUEST_DIR_ONLY 1
367
368
369char *
370acpi_os_get_next_filename (
371 void *dir_handle);
372
373void
374acpi_os_close_directory (
375 void *dir_handle);
376
377
378
379
380
381void
382acpi_os_dbg_assert(
383 void *failed_assertion,
384 void *file_name,
385 u32 line_number,
386 char *message);
387
388
389#endif
390