1a9f12690SJung-uk Kim 
2a9f12690SJung-uk Kim /******************************************************************************
3a9f12690SJung-uk Kim  *
4a9f12690SJung-uk Kim  * Name: acpiosxf.h - All interfaces to the OS Services Layer (OSL).  These
5a9f12690SJung-uk Kim  *                    interfaces must be implemented by OSL to interface the
6a9f12690SJung-uk Kim  *                    ACPI components to the host operating system.
7a9f12690SJung-uk Kim  *
8a9f12690SJung-uk Kim  *****************************************************************************/
9a9f12690SJung-uk Kim 
10a9f12690SJung-uk Kim 
11a9f12690SJung-uk Kim /******************************************************************************
12a9f12690SJung-uk Kim  *
13a9f12690SJung-uk Kim  * 1. Copyright Notice
14a9f12690SJung-uk Kim  *
15a9f12690SJung-uk Kim  * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
16a9f12690SJung-uk Kim  * All rights reserved.
17a9f12690SJung-uk Kim  *
18a9f12690SJung-uk Kim  * 2. License
19a9f12690SJung-uk Kim  *
20a9f12690SJung-uk Kim  * 2.1. This is your license from Intel Corp. under its intellectual property
21a9f12690SJung-uk Kim  * rights.  You may have additional license terms from the party that provided
22a9f12690SJung-uk Kim  * you this software, covering your right to use that party's intellectual
23a9f12690SJung-uk Kim  * property rights.
24a9f12690SJung-uk Kim  *
25a9f12690SJung-uk Kim  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
26a9f12690SJung-uk Kim  * copy of the source code appearing in this file ("Covered Code") an
27a9f12690SJung-uk Kim  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
28a9f12690SJung-uk Kim  * base code distributed originally by Intel ("Original Intel Code") to copy,
29a9f12690SJung-uk Kim  * make derivatives, distribute, use and display any portion of the Covered
30a9f12690SJung-uk Kim  * Code in any form, with the right to sublicense such rights; and
31a9f12690SJung-uk Kim  *
32a9f12690SJung-uk Kim  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
33a9f12690SJung-uk Kim  * license (with the right to sublicense), under only those claims of Intel
34a9f12690SJung-uk Kim  * patents that are infringed by the Original Intel Code, to make, use, sell,
35a9f12690SJung-uk Kim  * offer to sell, and import the Covered Code and derivative works thereof
36a9f12690SJung-uk Kim  * solely to the minimum extent necessary to exer
37a9f12690SJung-uk Kim  se the above copyright
38a9f12690SJung-uk Kim  * license, and in no event shall the patent license extend to any additions
39a9f12690SJung-uk Kim  * to or modifications of the Original Intel Code.  No other license or right
40a9f12690SJung-uk Kim  * is granted directly or by implication, estoppel or otherwise;
41a9f12690SJung-uk Kim  *
42a9f12690SJung-uk Kim  * The above copyright and patent license is granted only if the following
43a9f12690SJung-uk Kim  * conditions are met:
44a9f12690SJung-uk Kim  *
45a9f12690SJung-uk Kim  * 3. Conditions
46a9f12690SJung-uk Kim  *
47a9f12690SJung-uk Kim  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
48a9f12690SJung-uk Kim  * Redistribution of source code of any substantial portion of the Covered
49a9f12690SJung-uk Kim  * Code or modification with rights to further distribute source must include
50a9f12690SJung-uk Kim  * the above Copyright Notice, the above License, this list of Conditions,
51a9f12690SJung-uk Kim  * and the following Disclaimer and Export Compliance provision.  In addition,
52a9f12690SJung-uk Kim  * Licensee must cause all Covered Code to which Licensee contributes to
53a9f12690SJung-uk Kim  * contain a file documenting the changes Licensee made to create that Covered
54a9f12690SJung-uk Kim  * Code and the date of any change.  Licensee must include in that file the
55a9f12690SJung-uk Kim  * documentation of any changes made by any predecessor Licensee.  Licensee
56a9f12690SJung-uk Kim  * must include a prominent statement that the modification is derived,
57a9f12690SJung-uk Kim  * directly or indirectly, from Original Intel Code.
58a9f12690SJung-uk Kim  *
59a9f12690SJung-uk Kim  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
60a9f12690SJung-uk Kim  * Redistribution of source code of any substantial portion of the Covered
61a9f12690SJung-uk Kim  * Code or modification without rights to further distribute source must
62a9f12690SJung-uk Kim  * include the following Disclaimer and Export Compliance provision in the
63a9f12690SJung-uk Kim  * documentation and/or other materials provided with distribution.  In
64a9f12690SJung-uk Kim  * addition, Licensee may not authorize further sublicense of source of any
65a9f12690SJung-uk Kim  * portion of the Covered Code, and must include terms to the effect that the
66a9f12690SJung-uk Kim  * license from Licensee to its licensee is limited to the intellectual
67a9f12690SJung-uk Kim  * property embodied in the software Licensee provides to its licensee, and
68a9f12690SJung-uk Kim  * not to intellectual property embodied in modifications its licensee may
69a9f12690SJung-uk Kim  * make.
70a9f12690SJung-uk Kim  *
71a9f12690SJung-uk Kim  * 3.3. Redistribution of Executable. Redistribution in executable form of any
72a9f12690SJung-uk Kim  * substantial portion of the Covered Code or modification must reproduce the
73a9f12690SJung-uk Kim  * above Copyright Notice, and the following Disclaimer and Export Compliance
74a9f12690SJung-uk Kim  * provision in the documentation and/or other materials provided with the
75a9f12690SJung-uk Kim  * distribution.
76a9f12690SJung-uk Kim  *
77a9f12690SJung-uk Kim  * 3.4. Intel retains all right, title, and interest in and to the Original
78a9f12690SJung-uk Kim  * Intel Code.
79a9f12690SJung-uk Kim  *
80a9f12690SJung-uk Kim  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
81a9f12690SJung-uk Kim  * Intel shall be used in advertising or otherwise to promote the sale, use or
82a9f12690SJung-uk Kim  * other dealings in products derived from or relating to the Covered Code
83a9f12690SJung-uk Kim  * without prior written authorization from Intel.
84a9f12690SJung-uk Kim  *
85a9f12690SJung-uk Kim  * 4. Disclaimer and Export Compliance
86a9f12690SJung-uk Kim  *
87a9f12690SJung-uk Kim  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
88a9f12690SJung-uk Kim  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
89a9f12690SJung-uk Kim  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
90a9f12690SJung-uk Kim  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
91a9f12690SJung-uk Kim  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
92a9f12690SJung-uk Kim  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
93a9f12690SJung-uk Kim  * PARTICULAR PURPOSE.
94a9f12690SJung-uk Kim  *
95a9f12690SJung-uk Kim  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
96a9f12690SJung-uk Kim  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
97a9f12690SJung-uk Kim  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
98a9f12690SJung-uk Kim  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
99a9f12690SJung-uk Kim  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
100a9f12690SJung-uk Kim  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
101a9f12690SJung-uk Kim  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
102a9f12690SJung-uk Kim  * LIMITED REMEDY.
103a9f12690SJung-uk Kim  *
104a9f12690SJung-uk Kim  * 4.3. Licensee shall not export, either directly or indirectly, any of this
105a9f12690SJung-uk Kim  * software or system incorporating such software without first obtaining any
106a9f12690SJung-uk Kim  * required license or other approval from the U. S. Department of Commerce or
107a9f12690SJung-uk Kim  * any other agency or department of the United States Government.  In the
108a9f12690SJung-uk Kim  * event Licensee exports any such software from the United States or
109a9f12690SJung-uk Kim  * re-exports any such software from a foreign destination, Licensee shall
110a9f12690SJung-uk Kim  * ensure that the distribution and export/re-export of the software is in
111a9f12690SJung-uk Kim  * compliance with all laws, regulations, orders, or other restrictions of the
112a9f12690SJung-uk Kim  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
113a9f12690SJung-uk Kim  * any of its subsidiaries will export/re-export any technical data, process,
114a9f12690SJung-uk Kim  * software, or service, directly or indirectly, to any country for which the
115a9f12690SJung-uk Kim  * United States government or any agency thereof requires an export license,
116a9f12690SJung-uk Kim  * other governmental approval, or letter of assurance, without first obtaining
117a9f12690SJung-uk Kim  * such license, approval or letter.
118a9f12690SJung-uk Kim  *
119a9f12690SJung-uk Kim  *****************************************************************************/
120a9f12690SJung-uk Kim 
121a9f12690SJung-uk Kim #ifndef __ACPIOSXF_H__
122a9f12690SJung-uk Kim #define __ACPIOSXF_H__
123a9f12690SJung-uk Kim 
124ab6f3bf9SJung-uk Kim #include <contrib/dev/acpica/include/platform/acenv.h>
125ab6f3bf9SJung-uk Kim #include <contrib/dev/acpica/include/actypes.h>
126a9f12690SJung-uk Kim 
127a9f12690SJung-uk Kim 
128a9f12690SJung-uk Kim /* Types for AcpiOsExecute */
129a9f12690SJung-uk Kim 
130a9f12690SJung-uk Kim typedef enum
131a9f12690SJung-uk Kim {
132a9f12690SJung-uk Kim     OSL_GLOBAL_LOCK_HANDLER,
133a9f12690SJung-uk Kim     OSL_NOTIFY_HANDLER,
134a9f12690SJung-uk Kim     OSL_GPE_HANDLER,
135a9f12690SJung-uk Kim     OSL_DEBUGGER_THREAD,
136a9f12690SJung-uk Kim     OSL_EC_POLL_HANDLER,
137a9f12690SJung-uk Kim     OSL_EC_BURST_HANDLER
138a9f12690SJung-uk Kim 
139a9f12690SJung-uk Kim } ACPI_EXECUTE_TYPE;
140a9f12690SJung-uk Kim 
141a9f12690SJung-uk Kim #define ACPI_NO_UNIT_LIMIT          ((UINT32) -1)
142a9f12690SJung-uk Kim #define ACPI_MUTEX_SEM              1
143a9f12690SJung-uk Kim 
144a9f12690SJung-uk Kim 
145a9f12690SJung-uk Kim /* Functions for AcpiOsSignal */
146a9f12690SJung-uk Kim 
147a9f12690SJung-uk Kim #define ACPI_SIGNAL_FATAL           0
148a9f12690SJung-uk Kim #define ACPI_SIGNAL_BREAKPOINT      1
149a9f12690SJung-uk Kim 
150a9f12690SJung-uk Kim typedef struct acpi_signal_fatal_info
151a9f12690SJung-uk Kim {
152a9f12690SJung-uk Kim     UINT32                  Type;
153a9f12690SJung-uk Kim     UINT32                  Code;
154a9f12690SJung-uk Kim     UINT32                  Argument;
155a9f12690SJung-uk Kim 
156a9f12690SJung-uk Kim } ACPI_SIGNAL_FATAL_INFO;
157a9f12690SJung-uk Kim 
158a9f12690SJung-uk Kim 
159a9f12690SJung-uk Kim /*
160a9f12690SJung-uk Kim  * OSL Initialization and shutdown primitives
161a9f12690SJung-uk Kim  */
162a9f12690SJung-uk Kim ACPI_STATUS
163a9f12690SJung-uk Kim AcpiOsInitialize (
164a9f12690SJung-uk Kim     void);
165a9f12690SJung-uk Kim 
166a9f12690SJung-uk Kim ACPI_STATUS
167a9f12690SJung-uk Kim AcpiOsTerminate (
168a9f12690SJung-uk Kim     void);
169a9f12690SJung-uk Kim 
170a9f12690SJung-uk Kim 
171a9f12690SJung-uk Kim /*
172a9f12690SJung-uk Kim  * ACPI Table interfaces
173a9f12690SJung-uk Kim  */
174a9f12690SJung-uk Kim ACPI_PHYSICAL_ADDRESS
175a9f12690SJung-uk Kim AcpiOsGetRootPointer (
176a9f12690SJung-uk Kim     void);
177a9f12690SJung-uk Kim 
178a9f12690SJung-uk Kim ACPI_STATUS
179a9f12690SJung-uk Kim AcpiOsPredefinedOverride (
180a9f12690SJung-uk Kim     const ACPI_PREDEFINED_NAMES *InitVal,
181a9f12690SJung-uk Kim     ACPI_STRING                 *NewVal);
182a9f12690SJung-uk Kim 
183a9f12690SJung-uk Kim ACPI_STATUS
184a9f12690SJung-uk Kim AcpiOsTableOverride (
185a9f12690SJung-uk Kim     ACPI_TABLE_HEADER       *ExistingTable,
186a9f12690SJung-uk Kim     ACPI_TABLE_HEADER       **NewTable);
187a9f12690SJung-uk Kim 
188a9f12690SJung-uk Kim 
189a9f12690SJung-uk Kim /*
190a9f12690SJung-uk Kim  * Spinlock primitives
191a9f12690SJung-uk Kim  */
192a9f12690SJung-uk Kim ACPI_STATUS
193a9f12690SJung-uk Kim AcpiOsCreateLock (
194a9f12690SJung-uk Kim     ACPI_SPINLOCK           *OutHandle);
195a9f12690SJung-uk Kim 
196a9f12690SJung-uk Kim void
197a9f12690SJung-uk Kim AcpiOsDeleteLock (
198a9f12690SJung-uk Kim     ACPI_SPINLOCK           Handle);
199a9f12690SJung-uk Kim 
200a9f12690SJung-uk Kim ACPI_CPU_FLAGS
201a9f12690SJung-uk Kim AcpiOsAcquireLock (
202a9f12690SJung-uk Kim     ACPI_SPINLOCK           Handle);
203a9f12690SJung-uk Kim 
204a9f12690SJung-uk Kim void
205a9f12690SJung-uk Kim AcpiOsReleaseLock (
206a9f12690SJung-uk Kim     ACPI_SPINLOCK           Handle,
207a9f12690SJung-uk Kim     ACPI_CPU_FLAGS          Flags);
208a9f12690SJung-uk Kim 
209a9f12690SJung-uk Kim 
210a9f12690SJung-uk Kim /*
211a9f12690SJung-uk Kim  * Semaphore primitives
212a9f12690SJung-uk Kim  */
213a9f12690SJung-uk Kim ACPI_STATUS
214a9f12690SJung-uk Kim AcpiOsCreateSemaphore (
215a9f12690SJung-uk Kim     UINT32                  MaxUnits,
216a9f12690SJung-uk Kim     UINT32                  InitialUnits,
217a9f12690SJung-uk Kim     ACPI_SEMAPHORE          *OutHandle);
218a9f12690SJung-uk Kim 
219a9f12690SJung-uk Kim ACPI_STATUS
220a9f12690SJung-uk Kim AcpiOsDeleteSemaphore (
221a9f12690SJung-uk Kim     ACPI_SEMAPHORE          Handle);
222a9f12690SJung-uk Kim 
223a9f12690SJung-uk Kim ACPI_STATUS
224a9f12690SJung-uk Kim AcpiOsWaitSemaphore (
225a9f12690SJung-uk Kim     ACPI_SEMAPHORE          Handle,
226a9f12690SJung-uk Kim     UINT32                  Units,
227a9f12690SJung-uk Kim     UINT16                  Timeout);
228a9f12690SJung-uk Kim 
229a9f12690SJung-uk Kim ACPI_STATUS
230a9f12690SJung-uk Kim AcpiOsSignalSemaphore (
231a9f12690SJung-uk Kim     ACPI_SEMAPHORE          Handle,
232a9f12690SJung-uk Kim     UINT32                  Units);
233a9f12690SJung-uk Kim 
234a9f12690SJung-uk Kim 
235a9f12690SJung-uk Kim /*
236a9f12690SJung-uk Kim  * Mutex primitives. May be configured to use semaphores instead via
237a9f12690SJung-uk Kim  * ACPI_MUTEX_TYPE (see platform/acenv.h)
238a9f12690SJung-uk Kim  */
239a9f12690SJung-uk Kim #if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE)
240a9f12690SJung-uk Kim 
241a9f12690SJung-uk Kim ACPI_STATUS
242a9f12690SJung-uk Kim AcpiOsCreateMutex (
243a9f12690SJung-uk Kim     ACPI_MUTEX              *OutHandle);
244a9f12690SJung-uk Kim 
245a9f12690SJung-uk Kim void
246a9f12690SJung-uk Kim AcpiOsDeleteMutex (
247a9f12690SJung-uk Kim     ACPI_MUTEX              Handle);
248a9f12690SJung-uk Kim 
249a9f12690SJung-uk Kim ACPI_STATUS
250a9f12690SJung-uk Kim AcpiOsAcquireMutex (
251a9f12690SJung-uk Kim     ACPI_MUTEX              Handle,
252a9f12690SJung-uk Kim     UINT16                  Timeout);
253a9f12690SJung-uk Kim 
254a9f12690SJung-uk Kim void
255a9f12690SJung-uk Kim AcpiOsReleaseMutex (
256a9f12690SJung-uk Kim     ACPI_MUTEX              Handle);
257a9f12690SJung-uk Kim #endif
258a9f12690SJung-uk Kim 
259a9f12690SJung-uk Kim 
260a9f12690SJung-uk Kim /*
261a9f12690SJung-uk Kim  * Memory allocation and mapping
262a9f12690SJung-uk Kim  */
263a9f12690SJung-uk Kim void *
264a9f12690SJung-uk Kim AcpiOsAllocate (
265a9f12690SJung-uk Kim     ACPI_SIZE               Size);
266a9f12690SJung-uk Kim 
267a9f12690SJung-uk Kim void
268a9f12690SJung-uk Kim AcpiOsFree (
269a9f12690SJung-uk Kim     void *                  Memory);
270a9f12690SJung-uk Kim 
271a9f12690SJung-uk Kim void *
272a9f12690SJung-uk Kim AcpiOsMapMemory (
273a9f12690SJung-uk Kim     ACPI_PHYSICAL_ADDRESS   Where,
274a9f12690SJung-uk Kim     ACPI_SIZE               Length);
275a9f12690SJung-uk Kim 
276a9f12690SJung-uk Kim void
277a9f12690SJung-uk Kim AcpiOsUnmapMemory (
278a9f12690SJung-uk Kim     void                    *LogicalAddress,
279a9f12690SJung-uk Kim     ACPI_SIZE               Size);
280a9f12690SJung-uk Kim 
281a9f12690SJung-uk Kim ACPI_STATUS
282a9f12690SJung-uk Kim AcpiOsGetPhysicalAddress (
283a9f12690SJung-uk Kim     void                    *LogicalAddress,
284a9f12690SJung-uk Kim     ACPI_PHYSICAL_ADDRESS   *PhysicalAddress);
285a9f12690SJung-uk Kim 
286a9f12690SJung-uk Kim 
287a9f12690SJung-uk Kim /*
288a9f12690SJung-uk Kim  * Memory/Object Cache
289a9f12690SJung-uk Kim  */
290a9f12690SJung-uk Kim ACPI_STATUS
291a9f12690SJung-uk Kim AcpiOsCreateCache (
292a9f12690SJung-uk Kim     char                    *CacheName,
293a9f12690SJung-uk Kim     UINT16                  ObjectSize,
294a9f12690SJung-uk Kim     UINT16                  MaxDepth,
295a9f12690SJung-uk Kim     ACPI_CACHE_T            **ReturnCache);
296a9f12690SJung-uk Kim 
297a9f12690SJung-uk Kim ACPI_STATUS
298a9f12690SJung-uk Kim AcpiOsDeleteCache (
299a9f12690SJung-uk Kim     ACPI_CACHE_T            *Cache);
300a9f12690SJung-uk Kim 
301a9f12690SJung-uk Kim ACPI_STATUS
302a9f12690SJung-uk Kim AcpiOsPurgeCache (
303a9f12690SJung-uk Kim     ACPI_CACHE_T            *Cache);
304a9f12690SJung-uk Kim 
305a9f12690SJung-uk Kim void *
306a9f12690SJung-uk Kim AcpiOsAcquireObject (
307a9f12690SJung-uk Kim     ACPI_CACHE_T            *Cache);
308a9f12690SJung-uk Kim 
309a9f12690SJung-uk Kim ACPI_STATUS
310a9f12690SJung-uk Kim AcpiOsReleaseObject (
311a9f12690SJung-uk Kim     ACPI_CACHE_T            *Cache,
312a9f12690SJung-uk Kim     void                    *Object);
313a9f12690SJung-uk Kim 
314a9f12690SJung-uk Kim 
315a9f12690SJung-uk Kim /*
316a9f12690SJung-uk Kim  * Interrupt handlers
317a9f12690SJung-uk Kim  */
318a9f12690SJung-uk Kim ACPI_STATUS
319a9f12690SJung-uk Kim AcpiOsInstallInterruptHandler (
320a9f12690SJung-uk Kim     UINT32                  InterruptNumber,
321a9f12690SJung-uk Kim     ACPI_OSD_HANDLER        ServiceRoutine,
322a9f12690SJung-uk Kim     void                    *Context);
323a9f12690SJung-uk Kim 
324a9f12690SJung-uk Kim ACPI_STATUS
325a9f12690SJung-uk Kim AcpiOsRemoveInterruptHandler (
326a9f12690SJung-uk Kim     UINT32                  InterruptNumber,
327a9f12690SJung-uk Kim     ACPI_OSD_HANDLER        ServiceRoutine);
328a9f12690SJung-uk Kim 
329a9f12690SJung-uk Kim 
330a9f12690SJung-uk Kim /*
331a9f12690SJung-uk Kim  * Threads and Scheduling
332a9f12690SJung-uk Kim  */
333a9f12690SJung-uk Kim ACPI_THREAD_ID
334a9f12690SJung-uk Kim AcpiOsGetThreadId (
335a9f12690SJung-uk Kim     void);
336a9f12690SJung-uk Kim 
337a9f12690SJung-uk Kim ACPI_STATUS
338a9f12690SJung-uk Kim AcpiOsExecute (
339a9f12690SJung-uk Kim     ACPI_EXECUTE_TYPE       Type,
340a9f12690SJung-uk Kim     ACPI_OSD_EXEC_CALLBACK  Function,
341a9f12690SJung-uk Kim     void                    *Context);
342a9f12690SJung-uk Kim 
343a9f12690SJung-uk Kim void
344a9f12690SJung-uk Kim AcpiOsWaitEventsComplete (
345a9f12690SJung-uk Kim     void                    *Context);
346a9f12690SJung-uk Kim 
347a9f12690SJung-uk Kim void
348a9f12690SJung-uk Kim AcpiOsSleep (
349a9f12690SJung-uk Kim     ACPI_INTEGER            Milliseconds);
350a9f12690SJung-uk Kim 
351a9f12690SJung-uk Kim void
352a9f12690SJung-uk Kim AcpiOsStall (
353a9f12690SJung-uk Kim     UINT32                  Microseconds);
354a9f12690SJung-uk Kim 
355a9f12690SJung-uk Kim 
356a9f12690SJung-uk Kim /*
357a9f12690SJung-uk Kim  * Platform and hardware-independent I/O interfaces
358a9f12690SJung-uk Kim  */
359a9f12690SJung-uk Kim ACPI_STATUS
360a9f12690SJung-uk Kim AcpiOsReadPort (
361a9f12690SJung-uk Kim     ACPI_IO_ADDRESS         Address,
362a9f12690SJung-uk Kim     UINT32                  *Value,
363a9f12690SJung-uk Kim     UINT32                  Width);
364a9f12690SJung-uk Kim 
365a9f12690SJung-uk Kim ACPI_STATUS
366a9f12690SJung-uk Kim AcpiOsWritePort (
367a9f12690SJung-uk Kim     ACPI_IO_ADDRESS         Address,
368a9f12690SJung-uk Kim     UINT32                  Value,
369a9f12690SJung-uk Kim     UINT32                  Width);
370a9f12690SJung-uk Kim 
371a9f12690SJung-uk Kim 
372a9f12690SJung-uk Kim /*
373a9f12690SJung-uk Kim  * Platform and hardware-independent physical memory interfaces
374a9f12690SJung-uk Kim  */
375a9f12690SJung-uk Kim ACPI_STATUS
376a9f12690SJung-uk Kim AcpiOsReadMemory (
377a9f12690SJung-uk Kim     ACPI_PHYSICAL_ADDRESS   Address,
378a9f12690SJung-uk Kim     UINT32                  *Value,
379a9f12690SJung-uk Kim     UINT32                  Width);
380a9f12690SJung-uk Kim 
381a9f12690SJung-uk Kim ACPI_STATUS
382a9f12690SJung-uk Kim AcpiOsWriteMemory (
383a9f12690SJung-uk Kim     ACPI_PHYSICAL_ADDRESS   Address,
384a9f12690SJung-uk Kim     UINT32                  Value,
385a9f12690SJung-uk Kim     UINT32                  Width);
386a9f12690SJung-uk Kim 
387a9f12690SJung-uk Kim 
388a9f12690SJung-uk Kim /*
389a9f12690SJung-uk Kim  * Platform and hardware-independent PCI configuration space access
390a9f12690SJung-uk Kim  * Note: Can't use "Register" as a parameter, changed to "Reg" --
391a9f12690SJung-uk Kim  * certain compilers complain.
392a9f12690SJung-uk Kim  */
393a9f12690SJung-uk Kim ACPI_STATUS
394a9f12690SJung-uk Kim AcpiOsReadPciConfiguration (
395a9f12690SJung-uk Kim     ACPI_PCI_ID             *PciId,
396a9f12690SJung-uk Kim     UINT32                  Reg,
397a9f12690SJung-uk Kim     void                    *Value,
398a9f12690SJung-uk Kim     UINT32                  Width);
399a9f12690SJung-uk Kim 
400a9f12690SJung-uk Kim ACPI_STATUS
401a9f12690SJung-uk Kim AcpiOsWritePciConfiguration (
402a9f12690SJung-uk Kim     ACPI_PCI_ID             *PciId,
403a9f12690SJung-uk Kim     UINT32                  Reg,
404a9f12690SJung-uk Kim     ACPI_INTEGER            Value,
405a9f12690SJung-uk Kim     UINT32                  Width);
406a9f12690SJung-uk Kim 
407a9f12690SJung-uk Kim 
408a9f12690SJung-uk Kim /*
409a9f12690SJung-uk Kim  * Interim function needed for PCI IRQ routing
410a9f12690SJung-uk Kim  */
411a9f12690SJung-uk Kim void
412a9f12690SJung-uk Kim AcpiOsDerivePciId(
413a9f12690SJung-uk Kim     ACPI_HANDLE             Rhandle,
414a9f12690SJung-uk Kim     ACPI_HANDLE             Chandle,
415a9f12690SJung-uk Kim     ACPI_PCI_ID             **PciId);
416a9f12690SJung-uk Kim 
417a9f12690SJung-uk Kim 
418a9f12690SJung-uk Kim /*
419a9f12690SJung-uk Kim  * Miscellaneous
420a9f12690SJung-uk Kim  */
421a9f12690SJung-uk Kim ACPI_STATUS
422a9f12690SJung-uk Kim AcpiOsValidateInterface (
423a9f12690SJung-uk Kim     char                    *Interface);
424a9f12690SJung-uk Kim 
425a9f12690SJung-uk Kim BOOLEAN
426a9f12690SJung-uk Kim AcpiOsReadable (
427a9f12690SJung-uk Kim     void                    *Pointer,
428a9f12690SJung-uk Kim     ACPI_SIZE               Length);
429a9f12690SJung-uk Kim 
430a9f12690SJung-uk Kim BOOLEAN
431a9f12690SJung-uk Kim AcpiOsWritable (
432a9f12690SJung-uk Kim     void                    *Pointer,
433a9f12690SJung-uk Kim     ACPI_SIZE               Length);
434a9f12690SJung-uk Kim 
435a9f12690SJung-uk Kim UINT64
436a9f12690SJung-uk Kim AcpiOsGetTimer (
437a9f12690SJung-uk Kim     void);
438a9f12690SJung-uk Kim 
439a9f12690SJung-uk Kim ACPI_STATUS
440a9f12690SJung-uk Kim AcpiOsSignal (
441a9f12690SJung-uk Kim     UINT32                  Function,
442a9f12690SJung-uk Kim     void                    *Info);
443a9f12690SJung-uk Kim 
444a9f12690SJung-uk Kim 
445a9f12690SJung-uk Kim /*
446a9f12690SJung-uk Kim  * Debug print routines
447a9f12690SJung-uk Kim  */
448a9f12690SJung-uk Kim void ACPI_INTERNAL_VAR_XFACE
449a9f12690SJung-uk Kim AcpiOsPrintf (
450a9f12690SJung-uk Kim     const char              *Format,
451a9f12690SJung-uk Kim     ...);
452a9f12690SJung-uk Kim 
453a9f12690SJung-uk Kim void
454a9f12690SJung-uk Kim AcpiOsVprintf (
455a9f12690SJung-uk Kim     const char              *Format,
456a9f12690SJung-uk Kim     va_list                 Args);
457a9f12690SJung-uk Kim 
458a9f12690SJung-uk Kim void
459a9f12690SJung-uk Kim AcpiOsRedirectOutput (
460a9f12690SJung-uk Kim     void                    *Destination);
461a9f12690SJung-uk Kim 
462a9f12690SJung-uk Kim 
463a9f12690SJung-uk Kim /*
464a9f12690SJung-uk Kim  * Debug input
465a9f12690SJung-uk Kim  */
466a9f12690SJung-uk Kim UINT32
467a9f12690SJung-uk Kim AcpiOsGetLine (
468a9f12690SJung-uk Kim     char                    *Buffer);
469a9f12690SJung-uk Kim 
470a9f12690SJung-uk Kim 
471a9f12690SJung-uk Kim /*
472a9f12690SJung-uk Kim  * Directory manipulation
473a9f12690SJung-uk Kim  */
474a9f12690SJung-uk Kim void *
475a9f12690SJung-uk Kim AcpiOsOpenDirectory (
476a9f12690SJung-uk Kim     char                    *Pathname,
477a9f12690SJung-uk Kim     char                    *WildcardSpec,
478a9f12690SJung-uk Kim     char                    RequestedFileType);
479a9f12690SJung-uk Kim 
480a9f12690SJung-uk Kim /* RequesteFileType values */
481a9f12690SJung-uk Kim 
482a9f12690SJung-uk Kim #define REQUEST_FILE_ONLY                   0
483a9f12690SJung-uk Kim #define REQUEST_DIR_ONLY                    1
484a9f12690SJung-uk Kim 
485a9f12690SJung-uk Kim 
486a9f12690SJung-uk Kim char *
487a9f12690SJung-uk Kim AcpiOsGetNextFilename (
488a9f12690SJung-uk Kim     void                    *DirHandle);
489a9f12690SJung-uk Kim 
490a9f12690SJung-uk Kim void
491a9f12690SJung-uk Kim AcpiOsCloseDirectory (
492a9f12690SJung-uk Kim     void                    *DirHandle);
493a9f12690SJung-uk Kim 
494a9f12690SJung-uk Kim 
495a9f12690SJung-uk Kim #endif /* __ACPIOSXF_H__ */
496