]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - include/acpi/acpiosxf.h
[ACPI] whitespace
[mirror_ubuntu-artful-kernel.git] / include / acpi / acpiosxf.h
CommitLineData
1da177e4
LT
1
2/******************************************************************************
3 *
4 * Name: acpiosxf.h - All interfaces to the OS Services Layer (OSL). These
5 * interfaces must be implemented by OSL to interface the
6 * ACPI components to the host operating system.
7 *
8 *****************************************************************************/
9
10
11/*
12 * Copyright (C) 2000 - 2005, R. Byron Moore
13 * All rights reserved.
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions, and the following disclaimer,
20 * without modification.
21 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
22 * substantially similar to the "NO WARRANTY" disclaimer below
23 * ("Disclaimer") and any redistribution must be conditioned upon
24 * including a substantially similar Disclaimer requirement for further
25 * binary redistribution.
26 * 3. Neither the names of the above-listed copyright holders nor the names
27 * of any contributors may be used to endorse or promote products derived
28 * from this software without specific prior written permission.
29 *
30 * Alternatively, this software may be distributed under the terms of the
31 * GNU General Public License ("GPL") version 2 as published by the Free
32 * Software Foundation.
33 *
34 * NO WARRANTY
35 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
36 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
37 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
38 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
39 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
40 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
41 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
42 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
43 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
44 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
45 * POSSIBILITY OF SUCH DAMAGES.
46 */
47
48#ifndef __ACPIOSXF_H__
49#define __ACPIOSXF_H__
50
51#include "platform/acenv.h"
52#include "actypes.h"
53
54
55/* Priorities for acpi_os_queue_for_execution */
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/* Functions for acpi_os_signal */
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 * OSL Initialization and shutdown primitives
81 */
1da177e4
LT
82acpi_status
83acpi_os_initialize (
84 void);
85
86acpi_status
87acpi_os_terminate (
88 void);
89
90
91/*
92 * ACPI Table interfaces
93 */
1da177e4
LT
94acpi_status
95acpi_os_get_root_pointer (
96 u32 flags,
97 struct acpi_pointer *address);
98
99acpi_status
100acpi_os_predefined_override (
101 const struct acpi_predefined_names *init_val,
102 acpi_string *new_val);
103
104acpi_status
105acpi_os_table_override (
106 struct acpi_table_header *existing_table,
107 struct acpi_table_header **new_table);
108
109
110/*
111 * Synchronization primitives
112 */
1da177e4
LT
113acpi_status
114acpi_os_create_semaphore (
115 u32 max_units,
116 u32 initial_units,
117 acpi_handle *out_handle);
118
119acpi_status
120acpi_os_delete_semaphore (
121 acpi_handle handle);
122
123acpi_status
124acpi_os_wait_semaphore (
125 acpi_handle handle,
126 u32 units,
127 u16 timeout);
128
129acpi_status
130acpi_os_signal_semaphore (
131 acpi_handle handle,
132 u32 units);
133
134acpi_status
135acpi_os_create_lock (
136 acpi_handle *out_handle);
137
138void
139acpi_os_delete_lock (
140 acpi_handle handle);
141
73459f73 142unsigned long
1da177e4 143acpi_os_acquire_lock (
73459f73 144 acpi_handle handle);
1da177e4
LT
145
146void
147acpi_os_release_lock (
148 acpi_handle handle,
73459f73 149 unsigned long flags);
1da177e4
LT
150
151
152/*
153 * Memory allocation and mapping
154 */
1da177e4
LT
155void *
156acpi_os_allocate (
157 acpi_size size);
158
159void
160acpi_os_free (
161 void * memory);
162
163acpi_status
164acpi_os_map_memory (
165 acpi_physical_address physical_address,
166 acpi_size size,
167 void __iomem **logical_address);
168
169void
170acpi_os_unmap_memory (
171 void __iomem *logical_address,
172 acpi_size size);
173
174#ifdef ACPI_FUTURE_USAGE
175acpi_status
176acpi_os_get_physical_address (
177 void *logical_address,
178 acpi_physical_address *physical_address);
179#endif
180
181
73459f73
RM
182
183/*
184 * Memory/Object Cache
185 */
186acpi_status
187acpi_os_create_cache (
188 char *cache_name,
189 u16 object_size,
190 u16 max_depth,
191 acpi_cache_t **return_cache);
192
193acpi_status
194acpi_os_delete_cache (
195 acpi_cache_t *cache);
196
197acpi_status
198acpi_os_purge_cache (
199 acpi_cache_t *cache);
200
201void *
202acpi_os_acquire_object (
203 acpi_cache_t *cache);
204
205acpi_status
206acpi_os_release_object (
207 acpi_cache_t *cache,
208 void *object);
209
1da177e4
LT
210/*
211 * Interrupt handlers
212 */
1da177e4
LT
213acpi_status
214acpi_os_install_interrupt_handler (
215 u32 gsi,
216 acpi_osd_handler service_routine,
217 void *context);
218
219acpi_status
220acpi_os_remove_interrupt_handler (
221 u32 gsi,
222 acpi_osd_handler service_routine);
223
224
225/*
226 * Threads and Scheduling
227 */
1da177e4
LT
228u32
229acpi_os_get_thread_id (
230 void);
231
232acpi_status
233acpi_os_queue_for_execution (
234 u32 priority,
235 acpi_osd_exec_callback function,
236 void *context);
237
238void
239acpi_os_wait_events_complete(
240 void * context);
241
242void
243acpi_os_wait_events_complete (
244 void *context);
245
246void
247acpi_os_sleep (
248 acpi_integer milliseconds);
249
250void
251acpi_os_stall (
252 u32 microseconds);
253
254
255/*
256 * Platform and hardware-independent I/O interfaces
257 */
1da177e4
LT
258acpi_status
259acpi_os_read_port (
260 acpi_io_address address,
261 u32 *value,
262 u32 width);
263
264acpi_status
265acpi_os_write_port (
266 acpi_io_address address,
267 u32 value,
268 u32 width);
269
270
271/*
272 * Platform and hardware-independent physical memory interfaces
273 */
1da177e4
LT
274acpi_status
275acpi_os_read_memory (
276 acpi_physical_address address,
277 u32 *value,
278 u32 width);
279
280acpi_status
281acpi_os_write_memory (
282 acpi_physical_address address,
283 u32 value,
284 u32 width);
285
286
287/*
288 * Platform and hardware-independent PCI configuration space access
289 * Note: Can't use "Register" as a parameter, changed to "Reg" --
290 * certain compilers complain.
291 */
1da177e4
LT
292acpi_status
293acpi_os_read_pci_configuration (
294 struct acpi_pci_id *pci_id,
295 u32 reg,
296 void *value,
297 u32 width);
298
299acpi_status
300acpi_os_write_pci_configuration (
301 struct acpi_pci_id *pci_id,
302 u32 reg,
303 acpi_integer value,
304 u32 width);
305
306/*
307 * Interim function needed for PCI IRQ routing
308 */
1da177e4
LT
309void
310acpi_os_derive_pci_id(
311 acpi_handle rhandle,
312 acpi_handle chandle,
313 struct acpi_pci_id **pci_id);
314
315/*
316 * Miscellaneous
317 */
1da177e4
LT
318u8
319acpi_os_readable (
320 void *pointer,
321 acpi_size length);
322
323#ifdef ACPI_FUTURE_USAGE
324u8
325acpi_os_writable (
326 void *pointer,
327 acpi_size length);
328#endif
329
330u64
331acpi_os_get_timer (
332 void);
333
334acpi_status
335acpi_os_signal (
336 u32 function,
337 void *info);
338
339/*
340 * Debug print routines
341 */
1da177e4
LT
342void ACPI_INTERNAL_VAR_XFACE
343acpi_os_printf (
344 const char *format,
345 ...);
346
347void
348acpi_os_vprintf (
349 const char *format,
350 va_list args);
351
352void
353acpi_os_redirect_output (
354 void *destination);
355
356
44f6c012 357#ifdef ACPI_FUTURE_USAGE
1da177e4
LT
358/*
359 * Debug input
360 */
1da177e4
LT
361u32
362acpi_os_get_line (
363 char *buffer);
364#endif
365
366
367/*
368 * Directory manipulation
369 */
1da177e4
LT
370void *
371acpi_os_open_directory (
372 char *pathname,
373 char *wildcard_spec,
374 char requested_file_type);
375
376/* requeste_file_type values */
377
378#define REQUEST_FILE_ONLY 0
379#define REQUEST_DIR_ONLY 1
380
381
382char *
383acpi_os_get_next_filename (
384 void *dir_handle);
385
386void
387acpi_os_close_directory (
388 void *dir_handle);
389
390/*
391 * Debug
392 */
1da177e4
LT
393void
394acpi_os_dbg_assert(
395 void *failed_assertion,
396 void *file_name,
397 u32 line_number,
398 char *message);
399
1da177e4 400#endif /* __ACPIOSXF_H__ */