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 - 2012, Intel Corp.
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 <contrib/dev/acpica/include/platform/acenv.h>
52 #include <contrib/dev/acpica/include/actypes.h>
55 /* Types for AcpiOsExecute */
59 OSL_GLOBAL_LOCK_HANDLER,
68 #define ACPI_NO_UNIT_LIMIT ((UINT32) -1)
69 #define ACPI_MUTEX_SEM 1
72 /* Functions for AcpiOsSignal */
74 #define ACPI_SIGNAL_FATAL 0
75 #define ACPI_SIGNAL_BREAKPOINT 1
77 typedef struct acpi_signal_fatal_info
83 } ACPI_SIGNAL_FATAL_INFO;
87 * OSL Initialization and shutdown primitives
99 * ACPI Table interfaces
101 ACPI_PHYSICAL_ADDRESS
102 AcpiOsGetRootPointer (
106 AcpiOsPredefinedOverride (
107 const ACPI_PREDEFINED_NAMES *InitVal,
108 ACPI_STRING *NewVal);
111 AcpiOsTableOverride (
112 ACPI_TABLE_HEADER *ExistingTable,
113 ACPI_TABLE_HEADER **NewTable);
116 AcpiOsPhysicalTableOverride (
117 ACPI_TABLE_HEADER *ExistingTable,
118 ACPI_PHYSICAL_ADDRESS *NewAddress,
119 UINT32 *NewTableLength);
123 * Spinlock primitives
127 ACPI_SPINLOCK *OutHandle);
131 ACPI_SPINLOCK Handle);
135 ACPI_SPINLOCK Handle);
139 ACPI_SPINLOCK Handle,
140 ACPI_CPU_FLAGS Flags);
144 * Semaphore primitives
147 AcpiOsCreateSemaphore (
150 ACPI_SEMAPHORE *OutHandle);
153 AcpiOsDeleteSemaphore (
154 ACPI_SEMAPHORE Handle);
157 AcpiOsWaitSemaphore (
158 ACPI_SEMAPHORE Handle,
163 AcpiOsSignalSemaphore (
164 ACPI_SEMAPHORE Handle,
169 * Mutex primitives. May be configured to use semaphores instead via
170 * ACPI_MUTEX_TYPE (see platform/acenv.h)
172 #if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE)
176 ACPI_MUTEX *OutHandle);
194 * Memory allocation and mapping
206 ACPI_PHYSICAL_ADDRESS Where,
211 void *LogicalAddress,
215 AcpiOsGetPhysicalAddress (
216 void *LogicalAddress,
217 ACPI_PHYSICAL_ADDRESS *PhysicalAddress);
221 * Memory/Object Cache
228 ACPI_CACHE_T **ReturnCache);
232 ACPI_CACHE_T *Cache);
236 ACPI_CACHE_T *Cache);
239 AcpiOsAcquireObject (
240 ACPI_CACHE_T *Cache);
243 AcpiOsReleaseObject (
252 AcpiOsInstallInterruptHandler (
253 UINT32 InterruptNumber,
254 ACPI_OSD_HANDLER ServiceRoutine,
258 AcpiOsRemoveInterruptHandler (
259 UINT32 InterruptNumber,
260 ACPI_OSD_HANDLER ServiceRoutine);
264 * Threads and Scheduling
272 ACPI_EXECUTE_TYPE Type,
273 ACPI_OSD_EXEC_CALLBACK Function,
277 AcpiOsWaitEventsComplete (
282 UINT64 Milliseconds);
286 UINT32 Microseconds);
290 * Platform and hardware-independent I/O interfaces
294 ACPI_IO_ADDRESS Address,
300 ACPI_IO_ADDRESS Address,
306 * Platform and hardware-independent physical memory interfaces
310 ACPI_PHYSICAL_ADDRESS Address,
316 ACPI_PHYSICAL_ADDRESS Address,
322 * Platform and hardware-independent PCI configuration space access
323 * Note: Can't use "Register" as a parameter, changed to "Reg" --
324 * certain compilers complain.
327 AcpiOsReadPciConfiguration (
334 AcpiOsWritePciConfiguration (
365 * Debug print routines
367 void ACPI_INTERNAL_VAR_XFACE
378 AcpiOsRedirectOutput (
393 * Directory manipulation
396 AcpiOsOpenDirectory (
399 char RequestedFileType);
401 /* RequesteFileType values */
403 #define REQUEST_FILE_ONLY 0
404 #define REQUEST_DIR_ONLY 1
408 AcpiOsGetNextFilename (
412 AcpiOsCloseDirectory (
416 #endif /* __ACPIOSXF_H__ */