xref: /titanic_51/usr/src/uts/intel/sys/acpi/acpixf.h (revision dc0093f44ee4fac928e006850f8ed53f68277af5)
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 ACPI_STATUS
129 AcpiInitializeSubsystem (
130     void);
131 
132 ACPI_STATUS
133 AcpiEnableSubsystem (
134     UINT32                  Flags);
135 
136 ACPI_STATUS
137 AcpiInitializeObjects (
138     UINT32                  Flags);
139 
140 ACPI_STATUS
141 AcpiTerminate (
142     void);
143 
144 ACPI_STATUS
145 AcpiSubsystemStatus (
146     void);
147 
148 ACPI_STATUS
149 AcpiEnable (
150     void);
151 
152 ACPI_STATUS
153 AcpiDisable (
154     void);
155 
156 ACPI_STATUS
157 AcpiGetSystemInfo (
158     ACPI_BUFFER             *RetBuffer);
159 
160 const char *
161 AcpiFormatException (
162     ACPI_STATUS             Exception);
163 
164 ACPI_STATUS
165 AcpiPurgeCachedObjects (
166     void);
167 
168 ACPI_STATUS
169 AcpiInstallInitializationHandler (
170     ACPI_INIT_HANDLER       Handler,
171     UINT32                  Function);
172 
173 /*
174  * ACPI Memory managment
175  */
176 void *
177 AcpiAllocate (
178     UINT32                  Size);
179 
180 void *
181 AcpiCallocate (
182     UINT32                  Size);
183 
184 void
185 AcpiFree (
186     void                    *Address);
187 
188 
189 /*
190  * ACPI table manipulation interfaces
191  */
192 ACPI_STATUS
193 AcpiFindRootPointer (
194     UINT32                  Flags,
195     ACPI_POINTER            *RsdpAddress);
196 
197 ACPI_STATUS
198 AcpiLoadTables (
199     void);
200 
201 ACPI_STATUS
202 AcpiLoadTable (
203     ACPI_TABLE_HEADER       *TablePtr);
204 
205 ACPI_STATUS
206 AcpiUnloadTable (
207     ACPI_TABLE_TYPE         TableType);
208 
209 ACPI_STATUS
210 AcpiGetTableHeader (
211     ACPI_TABLE_TYPE         TableType,
212     UINT32                  Instance,
213     ACPI_TABLE_HEADER       *OutTableHeader);
214 
215 ACPI_STATUS
216 AcpiGetTable (
217     ACPI_TABLE_TYPE         TableType,
218     UINT32                  Instance,
219     ACPI_BUFFER             *RetBuffer);
220 
221 ACPI_STATUS
222 AcpiGetFirmwareTable (
223     ACPI_STRING             Signature,
224     UINT32                  Instance,
225     UINT32                  Flags,
226     ACPI_TABLE_HEADER       **TablePointer);
227 
228 
229 /*
230  * Namespace and name interfaces
231  */
232 ACPI_STATUS
233 AcpiWalkNamespace (
234     ACPI_OBJECT_TYPE        Type,
235     ACPI_HANDLE             StartObject,
236     UINT32                  MaxDepth,
237     ACPI_WALK_CALLBACK      UserFunction,
238     void                    *Context,
239     void                    **ReturnValue);
240 
241 ACPI_STATUS
242 AcpiGetDevices (
243     char                    *HID,
244     ACPI_WALK_CALLBACK      UserFunction,
245     void                    *Context,
246     void                    **ReturnValue);
247 
248 ACPI_STATUS
249 AcpiGetName (
250     ACPI_HANDLE             Handle,
251     UINT32                  NameType,
252     ACPI_BUFFER             *RetPathPtr);
253 
254 ACPI_STATUS
255 AcpiGetHandle (
256     ACPI_HANDLE             Parent,
257     ACPI_STRING             Pathname,
258     ACPI_HANDLE             *RetHandle);
259 
260 ACPI_STATUS
261 AcpiAttachData (
262     ACPI_HANDLE             ObjHandle,
263     ACPI_OBJECT_HANDLER     Handler,
264     void                    *Data);
265 
266 ACPI_STATUS
267 AcpiDetachData (
268     ACPI_HANDLE             ObjHandle,
269     ACPI_OBJECT_HANDLER     Handler);
270 
271 ACPI_STATUS
272 AcpiGetData (
273     ACPI_HANDLE             ObjHandle,
274     ACPI_OBJECT_HANDLER     Handler,
275     void                    **Data);
276 
277 ACPI_STATUS
278 AcpiDebugTrace (
279     char                    *Name,
280     UINT32                  DebugLevel,
281     UINT32                  DebugLayer,
282     UINT32                  Flags);
283 
284 
285 /*
286  * Object manipulation and enumeration
287  */
288 ACPI_STATUS
289 AcpiEvaluateObject (
290     ACPI_HANDLE             Object,
291     ACPI_STRING             Pathname,
292     ACPI_OBJECT_LIST        *ParameterObjects,
293     ACPI_BUFFER             *ReturnObjectBuffer);
294 
295 ACPI_STATUS
296 AcpiEvaluateObjectTyped (
297     ACPI_HANDLE             Object,
298     ACPI_STRING             Pathname,
299     ACPI_OBJECT_LIST        *ExternalParams,
300     ACPI_BUFFER             *ReturnBuffer,
301     ACPI_OBJECT_TYPE        ReturnType);
302 
303 ACPI_STATUS
304 AcpiGetObjectInfo (
305     ACPI_HANDLE             Handle,
306     ACPI_BUFFER             *ReturnBuffer);
307 
308 ACPI_STATUS
309 AcpiGetNextObject (
310     ACPI_OBJECT_TYPE        Type,
311     ACPI_HANDLE             Parent,
312     ACPI_HANDLE             Child,
313     ACPI_HANDLE             *OutHandle);
314 
315 ACPI_STATUS
316 AcpiGetType (
317     ACPI_HANDLE             Object,
318     ACPI_OBJECT_TYPE        *OutType);
319 
320 ACPI_STATUS
321 AcpiGetParent (
322     ACPI_HANDLE             Object,
323     ACPI_HANDLE             *OutHandle);
324 
325 
326 /*
327  * Event handler interfaces
328  */
329 ACPI_STATUS
330 AcpiInstallFixedEventHandler (
331     UINT32                  AcpiEvent,
332     ACPI_EVENT_HANDLER      Handler,
333     void                    *Context);
334 
335 ACPI_STATUS
336 AcpiRemoveFixedEventHandler (
337     UINT32                  AcpiEvent,
338     ACPI_EVENT_HANDLER      Handler);
339 
340 ACPI_STATUS
341 AcpiInstallNotifyHandler (
342     ACPI_HANDLE             Device,
343     UINT32                  HandlerType,
344     ACPI_NOTIFY_HANDLER     Handler,
345     void                    *Context);
346 
347 ACPI_STATUS
348 AcpiRemoveNotifyHandler (
349     ACPI_HANDLE             Device,
350     UINT32                  HandlerType,
351     ACPI_NOTIFY_HANDLER     Handler);
352 
353 ACPI_STATUS
354 AcpiInstallAddressSpaceHandler (
355     ACPI_HANDLE             Device,
356     ACPI_ADR_SPACE_TYPE     SpaceId,
357     ACPI_ADR_SPACE_HANDLER  Handler,
358     ACPI_ADR_SPACE_SETUP    Setup,
359     void                    *Context);
360 
361 ACPI_STATUS
362 AcpiRemoveAddressSpaceHandler (
363     ACPI_HANDLE             Device,
364     ACPI_ADR_SPACE_TYPE     SpaceId,
365     ACPI_ADR_SPACE_HANDLER  Handler);
366 
367 ACPI_STATUS
368 AcpiInstallGpeHandler (
369     ACPI_HANDLE             GpeDevice,
370     UINT32                  GpeNumber,
371     UINT32                  Type,
372     ACPI_EVENT_HANDLER      Address,
373     void                    *Context);
374 
375 ACPI_STATUS
376 AcpiInstallExceptionHandler (
377     ACPI_EXCEPTION_HANDLER  Handler);
378 
379 
380 /*
381  * Event interfaces
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                  InterruptNumber);
454 
455 ACPI_STATUS
456 AcpiRemoveGpeBlock (
457     ACPI_HANDLE             GpeDevice);
458 
459 
460 /*
461  * Resource interfaces
462  */
463 typedef
464 ACPI_STATUS (*ACPI_WALK_RESOURCE_CALLBACK) (
465     ACPI_RESOURCE           *Resource,
466     void                    *Context);
467 
468 
469 ACPI_STATUS
470 AcpiGetCurrentResources(
471     ACPI_HANDLE             DeviceHandle,
472     ACPI_BUFFER             *RetBuffer);
473 
474 ACPI_STATUS
475 AcpiGetPossibleResources(
476     ACPI_HANDLE             DeviceHandle,
477     ACPI_BUFFER             *RetBuffer);
478 
479 ACPI_STATUS
480 AcpiWalkResources (
481     ACPI_HANDLE                     DeviceHandle,
482     char                            *Path,
483     ACPI_WALK_RESOURCE_CALLBACK     UserFunction,
484     void                            *Context);
485 
486 ACPI_STATUS
487 AcpiSetCurrentResources (
488     ACPI_HANDLE             DeviceHandle,
489     ACPI_BUFFER             *InBuffer);
490 
491 ACPI_STATUS
492 AcpiGetIrqRoutingTable  (
493     ACPI_HANDLE             BusDeviceHandle,
494     ACPI_BUFFER             *RetBuffer);
495 
496 ACPI_STATUS
497 AcpiResourceToAddress64 (
498     ACPI_RESOURCE           *Resource,
499     ACPI_RESOURCE_ADDRESS64 *Out);
500 
501 /*
502  * Hardware (ACPI device) interfaces
503  */
504 ACPI_STATUS
505 AcpiGetRegister (
506     UINT32                  RegisterId,
507     UINT32                  *ReturnValue,
508     UINT32                  Flags);
509 
510 ACPI_STATUS
511 AcpiSetRegister (
512     UINT32                  RegisterId,
513     UINT32                  Value,
514     UINT32                  Flags);
515 
516 ACPI_STATUS
517 AcpiSetFirmwareWakingVector (
518     ACPI_PHYSICAL_ADDRESS   PhysicalAddress);
519 
520 ACPI_STATUS
521 AcpiGetFirmwareWakingVector (
522     ACPI_PHYSICAL_ADDRESS   *PhysicalAddress);
523 
524 ACPI_STATUS
525 AcpiGetSleepTypeData (
526     UINT8                   SleepState,
527     UINT8                   *Slp_TypA,
528     UINT8                   *Slp_TypB);
529 
530 ACPI_STATUS
531 AcpiEnterSleepStatePrep (
532     UINT8                   SleepState);
533 
534 ACPI_STATUS
535 AcpiEnterSleepState (
536     UINT8                   SleepState);
537 
538 ACPI_STATUS
539 AcpiEnterSleepStateS4bios (
540     void);
541 
542 ACPI_STATUS
543 AcpiLeaveSleepState (
544     UINT8                   SleepState);
545 
546 
547 #endif /* __ACXFACE_H__ */
548