1 /******************************************************************************
3 * Name: acpiosxf.h - All interfaces to the OS Services Layer (OSL). These
4 * interfaces must be implemented by OSL to interface the
5 * ACPI components to the host operating system.
7 *****************************************************************************/
11 * Copyright (C) 2000 - 2013, Intel Corp.
12 * All rights reserved.
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions, and the following disclaimer,
19 * without modification.
20 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
21 * substantially similar to the "NO WARRANTY" disclaimer below
22 * ("Disclaimer") and any redistribution must be conditioned upon
23 * including a substantially similar Disclaimer requirement for further
24 * binary redistribution.
25 * 3. Neither the names of the above-listed copyright holders nor the names
26 * of any contributors may be used to endorse or promote products derived
27 * from this software without specific prior written permission.
29 * Alternatively, this software may be distributed under the terms of the
30 * GNU General Public License ("GPL") version 2 as published by the Free
31 * Software Foundation.
34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
35 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
36 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
37 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
38 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
39 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
40 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
41 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
42 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
43 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
44 * POSSIBILITY OF SUCH DAMAGES.
47 #ifndef __ACPIOSXF_H__
48 #define __ACPIOSXF_H__
50 #include <contrib/dev/acpica/include/platform/acenv.h>
51 #include <contrib/dev/acpica/include/actypes.h>
54 /* Types for AcpiOsExecute */
58 OSL_GLOBAL_LOCK_HANDLER,
67 #define ACPI_NO_UNIT_LIMIT ((UINT32) -1)
68 #define ACPI_MUTEX_SEM 1
71 /* Functions for AcpiOsSignal */
73 #define ACPI_SIGNAL_FATAL 0
74 #define ACPI_SIGNAL_BREAKPOINT 1
76 typedef struct acpi_signal_fatal_info
82 } ACPI_SIGNAL_FATAL_INFO;
86 * OSL Initialization and shutdown primitives
98 * ACPI Table interfaces
100 ACPI_PHYSICAL_ADDRESS
101 AcpiOsGetRootPointer (
105 AcpiOsPredefinedOverride (
106 const ACPI_PREDEFINED_NAMES *InitVal,
107 ACPI_STRING *NewVal);
110 AcpiOsTableOverride (
111 ACPI_TABLE_HEADER *ExistingTable,
112 ACPI_TABLE_HEADER **NewTable);
115 AcpiOsPhysicalTableOverride (
116 ACPI_TABLE_HEADER *ExistingTable,
117 ACPI_PHYSICAL_ADDRESS *NewAddress,
118 UINT32 *NewTableLength);
122 * Spinlock primitives
124 #ifndef AcpiOsCreateLock
127 ACPI_SPINLOCK *OutHandle);
132 ACPI_SPINLOCK Handle);
136 ACPI_SPINLOCK Handle);
140 ACPI_SPINLOCK Handle,
141 ACPI_CPU_FLAGS Flags);
145 * Semaphore primitives
148 AcpiOsCreateSemaphore (
151 ACPI_SEMAPHORE *OutHandle);
154 AcpiOsDeleteSemaphore (
155 ACPI_SEMAPHORE Handle);
158 AcpiOsWaitSemaphore (
159 ACPI_SEMAPHORE Handle,
164 AcpiOsSignalSemaphore (
165 ACPI_SEMAPHORE Handle,
170 * Mutex primitives. May be configured to use semaphores instead via
171 * ACPI_MUTEX_TYPE (see platform/acenv.h)
173 #if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE)
177 ACPI_MUTEX *OutHandle);
195 * Memory allocation and mapping
207 ACPI_PHYSICAL_ADDRESS Where,
212 void *LogicalAddress,
216 AcpiOsGetPhysicalAddress (
217 void *LogicalAddress,
218 ACPI_PHYSICAL_ADDRESS *PhysicalAddress);
222 * Memory/Object Cache
229 ACPI_CACHE_T **ReturnCache);
233 ACPI_CACHE_T *Cache);
237 ACPI_CACHE_T *Cache);
240 AcpiOsAcquireObject (
241 ACPI_CACHE_T *Cache);
244 AcpiOsReleaseObject (
253 AcpiOsInstallInterruptHandler (
254 UINT32 InterruptNumber,
255 ACPI_OSD_HANDLER ServiceRoutine,
259 AcpiOsRemoveInterruptHandler (
260 UINT32 InterruptNumber,
261 ACPI_OSD_HANDLER ServiceRoutine);
265 * Threads and Scheduling
273 ACPI_EXECUTE_TYPE Type,
274 ACPI_OSD_EXEC_CALLBACK Function,
278 AcpiOsWaitEventsComplete (
283 UINT64 Milliseconds);
287 UINT32 Microseconds);
291 * Platform and hardware-independent I/O interfaces
295 ACPI_IO_ADDRESS Address,
301 ACPI_IO_ADDRESS Address,
307 * Platform and hardware-independent physical memory interfaces
311 ACPI_PHYSICAL_ADDRESS Address,
317 ACPI_PHYSICAL_ADDRESS Address,
323 * Platform and hardware-independent PCI configuration space access
324 * Note: Can't use "Register" as a parameter, changed to "Reg" --
325 * certain compilers complain.
328 AcpiOsReadPciConfiguration (
335 AcpiOsWritePciConfiguration (
366 * Debug print routines
368 void ACPI_INTERNAL_VAR_XFACE
379 AcpiOsRedirectOutput (
394 * Obtain ACPI table(s)
397 AcpiOsGetTableByName (
400 ACPI_TABLE_HEADER **Table,
401 ACPI_PHYSICAL_ADDRESS *Address);
404 AcpiOsGetTableByIndex (
406 ACPI_TABLE_HEADER **Table,
408 ACPI_PHYSICAL_ADDRESS *Address);
411 AcpiOsGetTableByAddress (
412 ACPI_PHYSICAL_ADDRESS Address,
413 ACPI_TABLE_HEADER **Table);
417 * Directory manipulation
420 AcpiOsOpenDirectory (
423 char RequestedFileType);
425 /* RequesteFileType values */
427 #define REQUEST_FILE_ONLY 0
428 #define REQUEST_DIR_ONLY 1
432 AcpiOsGetNextFilename (
436 AcpiOsCloseDirectory (
440 #endif /* __ACPIOSXF_H__ */