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 - 2011, 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);
117 * Spinlock primitives
121 ACPI_SPINLOCK *OutHandle);
125 ACPI_SPINLOCK Handle);
129 ACPI_SPINLOCK Handle);
133 ACPI_SPINLOCK Handle,
134 ACPI_CPU_FLAGS Flags);
138 * Semaphore primitives
141 AcpiOsCreateSemaphore (
144 ACPI_SEMAPHORE *OutHandle);
147 AcpiOsDeleteSemaphore (
148 ACPI_SEMAPHORE Handle);
151 AcpiOsWaitSemaphore (
152 ACPI_SEMAPHORE Handle,
157 AcpiOsSignalSemaphore (
158 ACPI_SEMAPHORE Handle,
163 * Mutex primitives. May be configured to use semaphores instead via
164 * ACPI_MUTEX_TYPE (see platform/acenv.h)
166 #if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE)
170 ACPI_MUTEX *OutHandle);
188 * Memory allocation and mapping
200 ACPI_PHYSICAL_ADDRESS Where,
205 void *LogicalAddress,
209 AcpiOsGetPhysicalAddress (
210 void *LogicalAddress,
211 ACPI_PHYSICAL_ADDRESS *PhysicalAddress);
215 * Memory/Object Cache
222 ACPI_CACHE_T **ReturnCache);
226 ACPI_CACHE_T *Cache);
230 ACPI_CACHE_T *Cache);
233 AcpiOsAcquireObject (
234 ACPI_CACHE_T *Cache);
237 AcpiOsReleaseObject (
246 AcpiOsInstallInterruptHandler (
247 UINT32 InterruptNumber,
248 ACPI_OSD_HANDLER ServiceRoutine,
252 AcpiOsRemoveInterruptHandler (
253 UINT32 InterruptNumber,
254 ACPI_OSD_HANDLER ServiceRoutine);
258 * Threads and Scheduling
266 ACPI_EXECUTE_TYPE Type,
267 ACPI_OSD_EXEC_CALLBACK Function,
271 AcpiOsWaitEventsComplete (
276 UINT64 Milliseconds);
280 UINT32 Microseconds);
284 * Platform and hardware-independent I/O interfaces
288 ACPI_IO_ADDRESS Address,
294 ACPI_IO_ADDRESS Address,
300 * Platform and hardware-independent physical memory interfaces
304 ACPI_PHYSICAL_ADDRESS Address,
310 ACPI_PHYSICAL_ADDRESS Address,
316 * Platform and hardware-independent PCI configuration space access
317 * Note: Can't use "Register" as a parameter, changed to "Reg" --
318 * certain compilers complain.
321 AcpiOsReadPciConfiguration (
328 AcpiOsWritePciConfiguration (
359 * Debug print routines
361 void ACPI_INTERNAL_VAR_XFACE
372 AcpiOsRedirectOutput (
387 * Directory manipulation
390 AcpiOsOpenDirectory (
393 char RequestedFileType);
395 /* RequesteFileType values */
397 #define REQUEST_FILE_ONLY 0
398 #define REQUEST_DIR_ONLY 1
402 AcpiOsGetNextFilename (
406 AcpiOsCloseDirectory (
410 #endif /* __ACPIOSXF_H__ */