checkdirs() was being passed the wrong mount point, resulting in a panic
[dragonfly.git] / sys / contrib / dev / acpica-unix-20050309 / 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 - 2005, 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_EVENT_HANDLER      Address,
372     void                    *Context);
373
374 ACPI_STATUS
375 AcpiInstallExceptionHandler (
376     ACPI_EXCEPTION_HANDLER  Handler);
377
378
379 /*
380  * Event interfaces
381  */
382
383 ACPI_STATUS
384 AcpiAcquireGlobalLock (
385     UINT16                  Timeout,
386     UINT32                  *Handle);
387
388 ACPI_STATUS
389 AcpiReleaseGlobalLock (
390     UINT32                  Handle);
391
392 ACPI_STATUS
393 AcpiRemoveGpeHandler (
394     ACPI_HANDLE             GpeDevice,
395     UINT32                  GpeNumber,
396     ACPI_EVENT_HANDLER      Address);
397
398 ACPI_STATUS
399 AcpiEnableEvent (
400     UINT32                  Event,
401     UINT32                  Flags);
402
403 ACPI_STATUS
404 AcpiDisableEvent (
405     UINT32                  Event,
406     UINT32                  Flags);
407
408 ACPI_STATUS
409 AcpiClearEvent (
410     UINT32                  Event);
411
412 ACPI_STATUS
413 AcpiGetEventStatus (
414     UINT32                  Event,
415     ACPI_EVENT_STATUS       *EventStatus);
416
417 ACPI_STATUS
418 AcpiSetGpeType (
419     ACPI_HANDLE             GpeDevice,
420     UINT32                  GpeNumber,
421     UINT8                   Type);
422
423 ACPI_STATUS
424 AcpiEnableGpe (
425     ACPI_HANDLE             GpeDevice,
426     UINT32                  GpeNumber,
427     UINT32                  Flags);
428
429 ACPI_STATUS
430 AcpiDisableGpe (
431     ACPI_HANDLE             GpeDevice,
432     UINT32                  GpeNumber,
433     UINT32                  Flags);
434
435 ACPI_STATUS
436 AcpiClearGpe (
437     ACPI_HANDLE             GpeDevice,
438     UINT32                  GpeNumber,
439     UINT32                  Flags);
440
441 ACPI_STATUS
442 AcpiGetGpeStatus (
443     ACPI_HANDLE             GpeDevice,
444     UINT32                  GpeNumber,
445     UINT32                  Flags,
446     ACPI_EVENT_STATUS       *EventStatus);
447
448 ACPI_STATUS
449 AcpiInstallGpeBlock (
450     ACPI_HANDLE             GpeDevice,
451     ACPI_GENERIC_ADDRESS    *GpeBlockAddress,
452     UINT32                  RegisterCount,
453     UINT32                  InterruptLevel);
454
455 ACPI_STATUS
456 AcpiRemoveGpeBlock (
457     ACPI_HANDLE             GpeDevice);
458
459
460 /*
461  * Resource interfaces
462  */
463
464 typedef
465 ACPI_STATUS (*ACPI_WALK_RESOURCE_CALLBACK) (
466     ACPI_RESOURCE           *Resource,
467     void                    *Context);
468
469
470 ACPI_STATUS
471 AcpiGetCurrentResources(
472     ACPI_HANDLE             DeviceHandle,
473     ACPI_BUFFER             *RetBuffer);
474
475 ACPI_STATUS
476 AcpiGetPossibleResources(
477     ACPI_HANDLE             DeviceHandle,
478     ACPI_BUFFER             *RetBuffer);
479
480 ACPI_STATUS
481 AcpiWalkResources (
482     ACPI_HANDLE                     DeviceHandle,
483     char                            *Path,
484     ACPI_WALK_RESOURCE_CALLBACK     UserFunction,
485     void                            *Context);
486
487 ACPI_STATUS
488 AcpiSetCurrentResources (
489     ACPI_HANDLE             DeviceHandle,
490     ACPI_BUFFER             *InBuffer);
491
492 ACPI_STATUS
493 AcpiGetIrqRoutingTable  (
494     ACPI_HANDLE             BusDeviceHandle,
495     ACPI_BUFFER             *RetBuffer);
496
497 ACPI_STATUS
498 AcpiResourceToAddress64 (
499     ACPI_RESOURCE           *Resource,
500     ACPI_RESOURCE_ADDRESS64 *Out);
501
502 /*
503  * Hardware (ACPI device) interfaces
504  */
505
506 ACPI_STATUS
507 AcpiGetRegister (
508     UINT32                  RegisterId,
509     UINT32                  *ReturnValue,
510     UINT32                  Flags);
511
512 ACPI_STATUS
513 AcpiSetRegister (
514     UINT32                  RegisterId,
515     UINT32                  Value,
516     UINT32                  Flags);
517
518 ACPI_STATUS
519 AcpiSetFirmwareWakingVector (
520     ACPI_PHYSICAL_ADDRESS   PhysicalAddress);
521
522 ACPI_STATUS
523 AcpiGetFirmwareWakingVector (
524     ACPI_PHYSICAL_ADDRESS   *PhysicalAddress);
525
526 ACPI_STATUS
527 AcpiGetSleepTypeData (
528     UINT8                   SleepState,
529     UINT8                   *Slp_TypA,
530     UINT8                   *Slp_TypB);
531
532 ACPI_STATUS
533 AcpiEnterSleepStatePrep (
534     UINT8                   SleepState);
535
536 ACPI_STATUS
537 AcpiEnterSleepState (
538     UINT8                   SleepState);
539
540 ACPI_STATUS
541 AcpiEnterSleepStateS4bios (
542     void);
543
544 ACPI_STATUS
545 AcpiLeaveSleepState (
546     UINT8                   SleepState);
547
548
549 #endif /* __ACXFACE_H__ */