xref: /titanic_52/usr/src/uts/intel/sys/acpi/acpixf.h (revision a1b5e537933659371285214eae1db2603e6364b4)
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 
278 /*
279  * Object manipulation and enumeration
280  */
281 ACPI_STATUS
282 AcpiEvaluateObject (
283     ACPI_HANDLE             Object,
284     ACPI_STRING             Pathname,
285     ACPI_OBJECT_LIST        *ParameterObjects,
286     ACPI_BUFFER             *ReturnObjectBuffer);
287 
288 ACPI_STATUS
289 AcpiEvaluateObjectTyped (
290     ACPI_HANDLE             Object,
291     ACPI_STRING             Pathname,
292     ACPI_OBJECT_LIST        *ExternalParams,
293     ACPI_BUFFER             *ReturnBuffer,
294     ACPI_OBJECT_TYPE        ReturnType);
295 
296 ACPI_STATUS
297 AcpiGetObjectInfo (
298     ACPI_HANDLE             Handle,
299     ACPI_BUFFER             *ReturnBuffer);
300 
301 ACPI_STATUS
302 AcpiGetNextObject (
303     ACPI_OBJECT_TYPE        Type,
304     ACPI_HANDLE             Parent,
305     ACPI_HANDLE             Child,
306     ACPI_HANDLE             *OutHandle);
307 
308 ACPI_STATUS
309 AcpiGetType (
310     ACPI_HANDLE             Object,
311     ACPI_OBJECT_TYPE        *OutType);
312 
313 ACPI_STATUS
314 AcpiGetParent (
315     ACPI_HANDLE             Object,
316     ACPI_HANDLE             *OutHandle);
317 
318 
319 /*
320  * Event handler interfaces
321  */
322 ACPI_STATUS
323 AcpiInstallFixedEventHandler (
324     UINT32                  AcpiEvent,
325     ACPI_EVENT_HANDLER      Handler,
326     void                    *Context);
327 
328 ACPI_STATUS
329 AcpiRemoveFixedEventHandler (
330     UINT32                  AcpiEvent,
331     ACPI_EVENT_HANDLER      Handler);
332 
333 ACPI_STATUS
334 AcpiInstallNotifyHandler (
335     ACPI_HANDLE             Device,
336     UINT32                  HandlerType,
337     ACPI_NOTIFY_HANDLER     Handler,
338     void                    *Context);
339 
340 ACPI_STATUS
341 AcpiRemoveNotifyHandler (
342     ACPI_HANDLE             Device,
343     UINT32                  HandlerType,
344     ACPI_NOTIFY_HANDLER     Handler);
345 
346 ACPI_STATUS
347 AcpiInstallAddressSpaceHandler (
348     ACPI_HANDLE             Device,
349     ACPI_ADR_SPACE_TYPE     SpaceId,
350     ACPI_ADR_SPACE_HANDLER  Handler,
351     ACPI_ADR_SPACE_SETUP    Setup,
352     void                    *Context);
353 
354 ACPI_STATUS
355 AcpiRemoveAddressSpaceHandler (
356     ACPI_HANDLE             Device,
357     ACPI_ADR_SPACE_TYPE     SpaceId,
358     ACPI_ADR_SPACE_HANDLER  Handler);
359 
360 ACPI_STATUS
361 AcpiInstallGpeHandler (
362     ACPI_HANDLE             GpeDevice,
363     UINT32                  GpeNumber,
364     UINT32                  Type,
365     ACPI_EVENT_HANDLER      Address,
366     void                    *Context);
367 
368 ACPI_STATUS
369 AcpiInstallExceptionHandler (
370     ACPI_EXCEPTION_HANDLER  Handler);
371 
372 
373 /*
374  * Event interfaces
375  */
376 ACPI_STATUS
377 AcpiAcquireGlobalLock (
378     UINT16                  Timeout,
379     UINT32                  *Handle);
380 
381 ACPI_STATUS
382 AcpiReleaseGlobalLock (
383     UINT32                  Handle);
384 
385 ACPI_STATUS
386 AcpiRemoveGpeHandler (
387     ACPI_HANDLE             GpeDevice,
388     UINT32                  GpeNumber,
389     ACPI_EVENT_HANDLER      Address);
390 
391 ACPI_STATUS
392 AcpiEnableEvent (
393     UINT32                  Event,
394     UINT32                  Flags);
395 
396 ACPI_STATUS
397 AcpiDisableEvent (
398     UINT32                  Event,
399     UINT32                  Flags);
400 
401 ACPI_STATUS
402 AcpiClearEvent (
403     UINT32                  Event);
404 
405 ACPI_STATUS
406 AcpiGetEventStatus (
407     UINT32                  Event,
408     ACPI_EVENT_STATUS       *EventStatus);
409 
410 ACPI_STATUS
411 AcpiSetGpeType (
412     ACPI_HANDLE             GpeDevice,
413     UINT32                  GpeNumber,
414     UINT8                   Type);
415 
416 ACPI_STATUS
417 AcpiEnableGpe (
418     ACPI_HANDLE             GpeDevice,
419     UINT32                  GpeNumber,
420     UINT32                  Flags);
421 
422 ACPI_STATUS
423 AcpiDisableGpe (
424     ACPI_HANDLE             GpeDevice,
425     UINT32                  GpeNumber,
426     UINT32                  Flags);
427 
428 ACPI_STATUS
429 AcpiClearGpe (
430     ACPI_HANDLE             GpeDevice,
431     UINT32                  GpeNumber,
432     UINT32                  Flags);
433 
434 ACPI_STATUS
435 AcpiGetGpeStatus (
436     ACPI_HANDLE             GpeDevice,
437     UINT32                  GpeNumber,
438     UINT32                  Flags,
439     ACPI_EVENT_STATUS       *EventStatus);
440 
441 ACPI_STATUS
442 AcpiInstallGpeBlock (
443     ACPI_HANDLE             GpeDevice,
444     ACPI_GENERIC_ADDRESS    *GpeBlockAddress,
445     UINT32                  RegisterCount,
446     UINT32                  InterruptNumber);
447 
448 ACPI_STATUS
449 AcpiRemoveGpeBlock (
450     ACPI_HANDLE             GpeDevice);
451 
452 
453 /*
454  * Resource interfaces
455  */
456 typedef
457 ACPI_STATUS (*ACPI_WALK_RESOURCE_CALLBACK) (
458     ACPI_RESOURCE           *Resource,
459     void                    *Context);
460 
461 
462 ACPI_STATUS
463 AcpiGetCurrentResources(
464     ACPI_HANDLE             DeviceHandle,
465     ACPI_BUFFER             *RetBuffer);
466 
467 ACPI_STATUS
468 AcpiGetPossibleResources(
469     ACPI_HANDLE             DeviceHandle,
470     ACPI_BUFFER             *RetBuffer);
471 
472 ACPI_STATUS
473 AcpiWalkResources (
474     ACPI_HANDLE                     DeviceHandle,
475     char                            *Path,
476     ACPI_WALK_RESOURCE_CALLBACK     UserFunction,
477     void                            *Context);
478 
479 ACPI_STATUS
480 AcpiSetCurrentResources (
481     ACPI_HANDLE             DeviceHandle,
482     ACPI_BUFFER             *InBuffer);
483 
484 ACPI_STATUS
485 AcpiGetIrqRoutingTable  (
486     ACPI_HANDLE             BusDeviceHandle,
487     ACPI_BUFFER             *RetBuffer);
488 
489 ACPI_STATUS
490 AcpiResourceToAddress64 (
491     ACPI_RESOURCE           *Resource,
492     ACPI_RESOURCE_ADDRESS64 *Out);
493 
494 /*
495  * Hardware (ACPI device) interfaces
496  */
497 ACPI_STATUS
498 AcpiGetRegister (
499     UINT32                  RegisterId,
500     UINT32                  *ReturnValue,
501     UINT32                  Flags);
502 
503 ACPI_STATUS
504 AcpiSetRegister (
505     UINT32                  RegisterId,
506     UINT32                  Value,
507     UINT32                  Flags);
508 
509 ACPI_STATUS
510 AcpiSetFirmwareWakingVector (
511     ACPI_PHYSICAL_ADDRESS   PhysicalAddress);
512 
513 ACPI_STATUS
514 AcpiGetFirmwareWakingVector (
515     ACPI_PHYSICAL_ADDRESS   *PhysicalAddress);
516 
517 ACPI_STATUS
518 AcpiGetSleepTypeData (
519     UINT8                   SleepState,
520     UINT8                   *Slp_TypA,
521     UINT8                   *Slp_TypB);
522 
523 ACPI_STATUS
524 AcpiEnterSleepStatePrep (
525     UINT8                   SleepState);
526 
527 ACPI_STATUS
528 AcpiEnterSleepState (
529     UINT8                   SleepState);
530 
531 ACPI_STATUS
532 AcpiEnterSleepStateS4bios (
533     void);
534 
535 ACPI_STATUS
536 AcpiLeaveSleepState (
537     UINT8                   SleepState);
538 
539 
540 #endif /* __ACXFACE_H__ */
541