Merge from vendor branch TCPDUMP:
[dragonfly.git] / sys / contrib / dev / acpica-unix-20031203 / include / acpixf.h
1
2 /******************************************************************************
3  *
4  * Name: acpixf.h - External interfaces to the ACPI subsystem
5  *
6  *****************************************************************************/
7
8 /******************************************************************************
9  *
10  * 1. Copyright Notice
11  *
12  * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.
13  * All rights reserved.
14  *
15  * 2. License
16  *
17  * 2.1. This is your license from Intel Corp. under its intellectual property
18  * rights.  You may have additional license terms from the party that provided
19  * you this software, covering your right to use that party's intellectual
20  * property rights.
21  *
22  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23  * copy of the source code appearing in this file ("Covered Code") an
24  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25  * base code distributed originally by Intel ("Original Intel Code") to copy,
26  * make derivatives, distribute, use and display any portion of the Covered
27  * Code in any form, with the right to sublicense such rights; and
28  *
29  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30  * license (with the right to sublicense), under only those claims of Intel
31  * patents that are infringed by the Original Intel Code, to make, use, sell,
32  * offer to sell, and import the Covered Code and derivative works thereof
33  * solely to the minimum extent necessary to exercise the above copyright
34  * license, and in no event shall the patent license extend to any additions
35  * to or modifications of the Original Intel Code.  No other license or right
36  * is granted directly or by implication, estoppel or otherwise;
37  *
38  * The above copyright and patent license is granted only if the following
39  * conditions are met:
40  *
41  * 3. Conditions
42  *
43  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44  * Redistribution of source code of any substantial portion of the Covered
45  * Code or modification with rights to further distribute source must include
46  * the above Copyright Notice, the above License, this list of Conditions,
47  * and the following Disclaimer and Export Compliance provision.  In addition,
48  * Licensee must cause all Covered Code to which Licensee contributes to
49  * contain a file documenting the changes Licensee made to create that Covered
50  * Code and the date of any change.  Licensee must include in that file the
51  * documentation of any changes made by any predecessor Licensee.  Licensee
52  * must include a prominent statement that the modification is derived,
53  * directly or indirectly, from Original Intel Code.
54  *
55  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56  * Redistribution of source code of any substantial portion of the Covered
57  * Code or modification without rights to further distribute source must
58  * include the following Disclaimer and Export Compliance provision in the
59  * documentation and/or other materials provided with distribution.  In
60  * addition, Licensee may not authorize further sublicense of source of any
61  * portion of the Covered Code, and must include terms to the effect that the
62  * license from Licensee to its licensee is limited to the intellectual
63  * property embodied in the software Licensee provides to its licensee, and
64  * not to intellectual property embodied in modifications its licensee may
65  * make.
66  *
67  * 3.3. Redistribution of Executable. Redistribution in executable form of any
68  * substantial portion of the Covered Code or modification must reproduce the
69  * above Copyright Notice, and the following Disclaimer and Export Compliance
70  * provision in the documentation and/or other materials provided with the
71  * distribution.
72  *
73  * 3.4. Intel retains all right, title, and interest in and to the Original
74  * Intel Code.
75  *
76  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77  * Intel shall be used in advertising or otherwise to promote the sale, use or
78  * other dealings in products derived from or relating to the Covered Code
79  * without prior written authorization from Intel.
80  *
81  * 4. Disclaimer and Export Compliance
82  *
83  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89  * PARTICULAR PURPOSE.
90  *
91  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98  * LIMITED REMEDY.
99  *
100  * 4.3. Licensee shall not export, either directly or indirectly, any of this
101  * software or system incorporating such software without first obtaining any
102  * required license or other approval from the U. S. Department of Commerce or
103  * any other agency or department of the United States Government.  In the
104  * event Licensee exports any such software from the United States or
105  * re-exports any such software from a foreign destination, Licensee shall
106  * ensure that the distribution and export/re-export of the software is in
107  * compliance with all laws, regulations, orders, or other restrictions of the
108  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109  * any of its subsidiaries will export/re-export any technical data, process,
110  * software, or service, directly or indirectly, to any country for which the
111  * United States government or any agency thereof requires an export license,
112  * other governmental approval, or letter of assurance, without first obtaining
113  * such license, approval or letter.
114  *
115  *****************************************************************************/
116
117
118 #ifndef __ACXFACE_H__
119 #define __ACXFACE_H__
120
121 #include "actypes.h"
122 #include "actbl.h"
123
124
125  /*
126  * Global interfaces
127  */
128
129 ACPI_STATUS
130 AcpiInitializeSubsystem (
131     void);
132
133 ACPI_STATUS
134 AcpiEnableSubsystem (
135     UINT32                  Flags);
136
137 ACPI_STATUS
138 AcpiInitializeObjects (
139     UINT32                  Flags);
140
141 ACPI_STATUS
142 AcpiTerminate (
143     void);
144
145 ACPI_STATUS
146 AcpiSubsystemStatus (
147     void);
148
149 ACPI_STATUS
150 AcpiEnable (
151     void);
152
153 ACPI_STATUS
154 AcpiDisable (
155     void);
156
157 ACPI_STATUS
158 AcpiGetSystemInfo (
159     ACPI_BUFFER             *RetBuffer);
160
161 const char *
162 AcpiFormatException (
163     ACPI_STATUS             Exception);
164
165 ACPI_STATUS
166 AcpiPurgeCachedObjects (
167     void);
168
169 ACPI_STATUS
170 AcpiInstallInitializationHandler (
171     ACPI_INIT_HANDLER       Handler,
172     UINT32                  Function);
173
174 /*
175  * ACPI Memory manager
176  */
177
178 void *
179 AcpiAllocate (
180     UINT32                  Size);
181
182 void *
183 AcpiCallocate (
184     UINT32                  Size);
185
186 void
187 AcpiFree (
188     void                    *Address);
189
190
191 /*
192  * ACPI table manipulation interfaces
193  */
194
195 ACPI_STATUS
196 AcpiFindRootPointer (
197     UINT32                  Flags,
198     ACPI_POINTER            *RsdpAddress);
199
200 ACPI_STATUS
201 AcpiLoadTables (
202     void);
203
204 ACPI_STATUS
205 AcpiLoadTable (
206     ACPI_TABLE_HEADER       *TablePtr);
207
208 ACPI_STATUS
209 AcpiUnloadTable (
210     ACPI_TABLE_TYPE         TableType);
211
212 ACPI_STATUS
213 AcpiGetTableHeader (
214     ACPI_TABLE_TYPE         TableType,
215     UINT32                  Instance,
216     ACPI_TABLE_HEADER       *OutTableHeader);
217
218 ACPI_STATUS
219 AcpiGetTable (
220     ACPI_TABLE_TYPE         TableType,
221     UINT32                  Instance,
222     ACPI_BUFFER             *RetBuffer);
223
224 ACPI_STATUS
225 AcpiGetFirmwareTable (
226     ACPI_STRING             Signature,
227     UINT32                  Instance,
228     UINT32                  Flags,
229     ACPI_TABLE_HEADER       **TablePointer);
230
231
232 /*
233  * Namespace and name interfaces
234  */
235
236 ACPI_STATUS
237 AcpiWalkNamespace (
238     ACPI_OBJECT_TYPE        Type,
239     ACPI_HANDLE             StartObject,
240     UINT32                  MaxDepth,
241     ACPI_WALK_CALLBACK      UserFunction,
242     void                    *Context,
243     void                    **ReturnValue);
244
245 ACPI_STATUS
246 AcpiGetDevices (
247     char                    *HID,
248     ACPI_WALK_CALLBACK      UserFunction,
249     void                    *Context,
250     void                    **ReturnValue);
251
252 ACPI_STATUS
253 AcpiGetName (
254     ACPI_HANDLE             Handle,
255     UINT32                  NameType,
256     ACPI_BUFFER             *RetPathPtr);
257
258 ACPI_STATUS
259 AcpiGetHandle (
260     ACPI_HANDLE             Parent,
261     ACPI_STRING             Pathname,
262     ACPI_HANDLE             *RetHandle);
263
264 ACPI_STATUS
265 AcpiAttachData (
266     ACPI_HANDLE             ObjHandle,
267     ACPI_OBJECT_HANDLER     Handler,
268     void                    *Data);
269
270 ACPI_STATUS
271 AcpiDetachData (
272     ACPI_HANDLE             ObjHandle,
273     ACPI_OBJECT_HANDLER     Handler);
274
275 ACPI_STATUS
276 AcpiGetData (
277     ACPI_HANDLE             ObjHandle,
278     ACPI_OBJECT_HANDLER     Handler,
279     void                    **Data);
280
281
282 /*
283  * Object manipulation and enumeration
284  */
285
286 ACPI_STATUS
287 AcpiEvaluateObject (
288     ACPI_HANDLE             Object,
289     ACPI_STRING             Pathname,
290     ACPI_OBJECT_LIST        *ParameterObjects,
291     ACPI_BUFFER             *ReturnObjectBuffer);
292
293 ACPI_STATUS
294 AcpiEvaluateObjectTyped (
295     ACPI_HANDLE             Object,
296     ACPI_STRING             Pathname,
297     ACPI_OBJECT_LIST        *ExternalParams,
298     ACPI_BUFFER             *ReturnBuffer,
299     ACPI_OBJECT_TYPE        ReturnType);
300
301 ACPI_STATUS
302 AcpiGetObjectInfo (
303     ACPI_HANDLE             Handle,
304     ACPI_BUFFER             *ReturnBuffer);
305
306 ACPI_STATUS
307 AcpiGetNextObject (
308     ACPI_OBJECT_TYPE        Type,
309     ACPI_HANDLE             Parent,
310     ACPI_HANDLE             Child,
311     ACPI_HANDLE             *OutHandle);
312
313 ACPI_STATUS
314 AcpiGetType (
315     ACPI_HANDLE             Object,
316     ACPI_OBJECT_TYPE        *OutType);
317
318 ACPI_STATUS
319 AcpiGetParent (
320     ACPI_HANDLE             Object,
321     ACPI_HANDLE             *OutHandle);
322
323
324 /*
325  * Event handler interfaces
326  */
327
328 ACPI_STATUS
329 AcpiInstallFixedEventHandler (
330     UINT32                  AcpiEvent,
331     ACPI_EVENT_HANDLER      Handler,
332     void                    *Context);
333
334 ACPI_STATUS
335 AcpiRemoveFixedEventHandler (
336     UINT32                  AcpiEvent,
337     ACPI_EVENT_HANDLER      Handler);
338
339 ACPI_STATUS
340 AcpiInstallNotifyHandler (
341     ACPI_HANDLE             Device,
342     UINT32                  HandlerType,
343     ACPI_NOTIFY_HANDLER     Handler,
344     void                    *Context);
345
346 ACPI_STATUS
347 AcpiRemoveNotifyHandler (
348     ACPI_HANDLE             Device,
349     UINT32                  HandlerType,
350     ACPI_NOTIFY_HANDLER     Handler);
351
352 ACPI_STATUS
353 AcpiInstallAddressSpaceHandler (
354     ACPI_HANDLE             Device,
355     ACPI_ADR_SPACE_TYPE     SpaceId,
356     ACPI_ADR_SPACE_HANDLER  Handler,
357     ACPI_ADR_SPACE_SETUP    Setup,
358     void                    *Context);
359
360 ACPI_STATUS
361 AcpiRemoveAddressSpaceHandler (
362     ACPI_HANDLE             Device,
363     ACPI_ADR_SPACE_TYPE     SpaceId,
364     ACPI_ADR_SPACE_HANDLER  Handler);
365
366 ACPI_STATUS
367 AcpiInstallGpeHandler (
368     ACPI_HANDLE             GpeDevice,
369     UINT32                  GpeNumber,
370     UINT32                  Type,
371     ACPI_GPE_HANDLER        Handler,
372     void                    *Context);
373
374 ACPI_STATUS
375 AcpiAcquireGlobalLock (
376     UINT16                  Timeout,
377     UINT32                  *Handle);
378
379 ACPI_STATUS
380 AcpiReleaseGlobalLock (
381     UINT32                  Handle);
382
383 ACPI_STATUS
384 AcpiRemoveGpeHandler (
385     ACPI_HANDLE             GpeDevice,
386     UINT32                  GpeNumber,
387     ACPI_GPE_HANDLER        Handler);
388
389 ACPI_STATUS
390 AcpiEnableEvent (
391     UINT32                  Event,
392     UINT32                  Flags);
393
394 ACPI_STATUS
395 AcpiDisableEvent (
396     UINT32                  Event,
397     UINT32                  Flags);
398
399 ACPI_STATUS
400 AcpiClearEvent (
401     UINT32                  Event);
402
403 ACPI_STATUS
404 AcpiGetEventStatus (
405     UINT32                  Event,
406     ACPI_EVENT_STATUS       *EventStatus);
407
408 ACPI_STATUS
409 AcpiEnableGpe (
410     ACPI_HANDLE             GpeDevice,
411     UINT32                  GpeNumber,
412     UINT32                  Flags);
413
414 ACPI_STATUS
415 AcpiDisableGpe (
416     ACPI_HANDLE             GpeDevice,
417     UINT32                  GpeNumber,
418     UINT32                  Flags);
419
420 ACPI_STATUS
421 AcpiClearGpe (
422     ACPI_HANDLE             GpeDevice,
423     UINT32                  GpeNumber,
424     UINT32                  Flags);
425
426 ACPI_STATUS
427 AcpiGetGpeStatus (
428     ACPI_HANDLE             GpeDevice,
429     UINT32                  GpeNumber,
430     UINT32                  Flags,
431     ACPI_EVENT_STATUS       *EventStatus);
432
433 ACPI_STATUS
434 AcpiInstallGpeBlock (
435     ACPI_HANDLE             GpeDevice,
436     ACPI_GENERIC_ADDRESS    *GpeBlockAddress,
437     UINT32                  RegisterCount,
438     UINT32                  InterruptLevel);
439
440 ACPI_STATUS
441 AcpiRemoveGpeBlock (
442     ACPI_HANDLE             GpeDevice);
443
444
445 /*
446  * Resource interfaces
447  */
448
449 typedef
450 ACPI_STATUS (*ACPI_WALK_RESOURCE_CALLBACK) (
451     ACPI_RESOURCE           *Resource,
452     void                    *Context);
453
454
455 ACPI_STATUS
456 AcpiGetCurrentResources(
457     ACPI_HANDLE             DeviceHandle,
458     ACPI_BUFFER             *RetBuffer);
459
460 ACPI_STATUS
461 AcpiGetPossibleResources(
462     ACPI_HANDLE             DeviceHandle,
463     ACPI_BUFFER             *RetBuffer);
464
465 ACPI_STATUS
466 AcpiWalkResources (
467     ACPI_HANDLE                     DeviceHandle,
468     char                            *Path,
469     ACPI_WALK_RESOURCE_CALLBACK     UserFunction,
470     void                            *Context);
471
472 ACPI_STATUS
473 AcpiSetCurrentResources (
474     ACPI_HANDLE             DeviceHandle,
475     ACPI_BUFFER             *InBuffer);
476
477 ACPI_STATUS
478 AcpiGetIrqRoutingTable  (
479     ACPI_HANDLE             BusDeviceHandle,
480     ACPI_BUFFER             *RetBuffer);
481
482 ACPI_STATUS
483 AcpiResourceToAddress64 (
484     ACPI_RESOURCE           *Resource,
485     ACPI_RESOURCE_ADDRESS64 *Out);
486
487 /*
488  * Hardware (ACPI device) interfaces
489  */
490
491 ACPI_STATUS
492 AcpiGetRegister (
493     UINT32                  RegisterId,
494     UINT32                  *ReturnValue,
495     UINT32                  Flags);
496
497 ACPI_STATUS
498 AcpiSetRegister (
499     UINT32                  RegisterId,
500     UINT32                  Value,
501     UINT32                  Flags);
502
503 ACPI_STATUS
504 AcpiSetFirmwareWakingVector (
505     ACPI_PHYSICAL_ADDRESS   PhysicalAddress);
506
507 ACPI_STATUS
508 AcpiGetFirmwareWakingVector (
509     ACPI_PHYSICAL_ADDRESS   *PhysicalAddress);
510
511 ACPI_STATUS
512 AcpiGetSleepTypeData (
513     UINT8                   SleepState,
514     UINT8                   *Slp_TypA,
515     UINT8                   *Slp_TypB);
516
517 ACPI_STATUS
518 AcpiEnterSleepStatePrep (
519     UINT8                   SleepState);
520
521 ACPI_STATUS
522 AcpiEnterSleepState (
523     UINT8                   SleepState);
524
525 ACPI_STATUS
526 AcpiEnterSleepStateS4bios (
527     void);
528
529 ACPI_STATUS
530 AcpiLeaveSleepState (
531     UINT8                   SleepState);
532
533
534 #endif /* __ACXFACE_H__ */