2 /******************************************************************************
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.
8 *****************************************************************************/
12 * Copyright (C) 2000 - 2005, R. Byron Moore
13 * All rights reserved.
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
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.
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.
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.
48 #ifndef __ACPIOSXF_H__
49 #define __ACPIOSXF_H__
51 #include "platform/acenv.h"
55 /* Priorities for acpi_os_queue_for_execution */
57 #define OSD_PRIORITY_GPE 1
58 #define OSD_PRIORITY_HIGH 2
59 #define OSD_PRIORITY_MED 3
60 #define OSD_PRIORITY_LO 4
62 #define ACPI_NO_UNIT_LIMIT ((u32) -1)
63 #define ACPI_MUTEX_SEM 1
66 /* Functions for acpi_os_signal */
68 #define ACPI_SIGNAL_FATAL 0
69 #define ACPI_SIGNAL_BREAKPOINT 1
71 struct acpi_signal_fatal_info
80 * OSL Initialization and shutdown primitives
92 * ACPI Table interfaces
95 acpi_os_get_root_pointer (
97 struct acpi_pointer *address);
100 acpi_os_predefined_override (
101 const struct acpi_predefined_names *init_val,
102 acpi_string *new_val);
105 acpi_os_table_override (
106 struct acpi_table_header *existing_table,
107 struct acpi_table_header **new_table);
111 * Synchronization primitives
114 acpi_os_create_semaphore (
117 acpi_handle *out_handle);
120 acpi_os_delete_semaphore (
124 acpi_os_wait_semaphore (
130 acpi_os_signal_semaphore (
135 acpi_os_create_lock (
136 acpi_handle *out_handle);
139 acpi_os_delete_lock (
143 acpi_os_acquire_lock (
147 acpi_os_release_lock (
149 unsigned long flags);
153 * Memory allocation and mapping
165 acpi_physical_address physical_address,
167 void __iomem **logical_address);
170 acpi_os_unmap_memory (
171 void __iomem *logical_address,
174 #ifdef ACPI_FUTURE_USAGE
176 acpi_os_get_physical_address (
177 void *logical_address,
178 acpi_physical_address *physical_address);
184 * Memory/Object Cache
187 acpi_os_create_cache (
191 acpi_cache_t **return_cache);
194 acpi_os_delete_cache (
195 acpi_cache_t *cache);
198 acpi_os_purge_cache (
199 acpi_cache_t *cache);
202 acpi_os_acquire_object (
203 acpi_cache_t *cache);
206 acpi_os_release_object (
214 acpi_os_install_interrupt_handler (
216 acpi_osd_handler service_routine,
220 acpi_os_remove_interrupt_handler (
222 acpi_osd_handler service_routine);
226 * Threads and Scheduling
229 acpi_os_get_thread_id (
233 acpi_os_queue_for_execution (
235 acpi_osd_exec_callback function,
239 acpi_os_wait_events_complete(
243 acpi_os_wait_events_complete (
248 acpi_integer milliseconds);
256 * Platform and hardware-independent I/O interfaces
260 acpi_io_address address,
266 acpi_io_address address,
272 * Platform and hardware-independent physical memory interfaces
275 acpi_os_read_memory (
276 acpi_physical_address address,
281 acpi_os_write_memory (
282 acpi_physical_address address,
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.
293 acpi_os_read_pci_configuration (
294 struct acpi_pci_id *pci_id,
300 acpi_os_write_pci_configuration (
301 struct acpi_pci_id *pci_id,
307 * Interim function needed for PCI IRQ routing
310 acpi_os_derive_pci_id(
313 struct acpi_pci_id **pci_id);
323 #ifdef ACPI_FUTURE_USAGE
340 * Debug print routines
342 void ACPI_INTERNAL_VAR_XFACE
353 acpi_os_redirect_output (
357 #ifdef ACPI_FUTURE_USAGE
368 * Directory manipulation
371 acpi_os_open_directory (
374 char requested_file_type);
376 /* requeste_file_type values */
378 #define REQUEST_FILE_ONLY 0
379 #define REQUEST_DIR_ONLY 1
383 acpi_os_get_next_filename (
387 acpi_os_close_directory (
395 void *failed_assertion,
400 #endif /* __ACPIOSXF_H__ */