1 /******************************************************************************
3 * Name: acpixf.h - External interfaces to the ACPI subsystem
5 *****************************************************************************/
8 * Copyright (C) 2000 - 2013, Intel Corp.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
48 /* Current ACPICA subsystem version in YYYYMMDD format */
50 #define ACPI_CA_VERSION 0x20131115
58 * Globals that are publically available
60 extern UINT32 AcpiCurrentGpeCount
;
61 extern ACPI_TABLE_FADT AcpiGbl_FADT
;
62 extern BOOLEAN AcpiGbl_SystemAwakeAndRunning
;
63 extern BOOLEAN AcpiGbl_ReducedHardware
; /* ACPI 5.0 */
64 extern UINT8 AcpiGbl_OsiData
;
66 /* Runtime configuration of debug print levels */
68 extern UINT32 AcpiDbgLevel
;
69 extern UINT32 AcpiDbgLayer
;
71 /* ACPICA runtime options */
73 extern UINT8 AcpiGbl_EnableInterpreterSlack
;
74 extern UINT8 AcpiGbl_AllMethodsSerialized
;
75 extern UINT8 AcpiGbl_CreateOsiMethod
;
76 extern UINT8 AcpiGbl_UseDefaultRegisterWidths
;
77 extern ACPI_NAME AcpiGbl_TraceMethodName
;
78 extern UINT32 AcpiGbl_TraceFlags
;
79 extern UINT8 AcpiGbl_EnableAmlDebugObject
;
80 extern UINT8 AcpiGbl_CopyDsdtLocally
;
81 extern UINT8 AcpiGbl_TruncateIoAddresses
;
82 extern UINT8 AcpiGbl_DisableAutoRepair
;
83 extern UINT8 AcpiGbl_DisableSsdtTableLoad
;
87 * Hardware-reduced prototypes. All interfaces that use these macros will
88 * be configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
91 #if (!ACPI_REDUCED_HARDWARE)
92 #define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \
95 #define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \
98 #define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
102 #define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \
103 static ACPI_INLINE Prototype {return(AE_NOT_CONFIGURED);}
105 #define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \
106 static ACPI_INLINE Prototype {return(AE_OK);}
108 #define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \
109 static ACPI_INLINE Prototype {return;}
111 #endif /* !ACPI_REDUCED_HARDWARE */
118 AcpiInitializeTables (
119 ACPI_TABLE_DESC
*InitialStorage
,
120 UINT32 InitialTableCount
,
121 BOOLEAN AllowResize
);
124 AcpiInitializeSubsystem (
128 AcpiEnableSubsystem (
132 AcpiInitializeObjects (
141 * Miscellaneous global interfaces
143 ACPI_HW_DEPENDENT_RETURN_STATUS (
148 ACPI_HW_DEPENDENT_RETURN_STATUS (
154 AcpiSubsystemStatus (
159 ACPI_BUFFER
*RetBuffer
);
163 ACPI_STATISTICS
*Stats
);
166 AcpiFormatException (
167 ACPI_STATUS Exception
);
170 AcpiPurgeCachedObjects (
174 AcpiInstallInterface (
175 ACPI_STRING InterfaceName
);
178 AcpiRemoveInterface (
179 ACPI_STRING InterfaceName
);
182 AcpiUpdateInterfaces (
186 AcpiCheckAddressRange (
187 ACPI_ADR_SPACE_TYPE SpaceId
,
188 ACPI_PHYSICAL_ADDRESS Address
,
193 AcpiDecodePldBuffer (
196 ACPI_PLD_INFO
**ReturnBuffer
);
200 * ACPI table load/unload interfaces
204 ACPI_TABLE_HEADER
*Table
);
207 AcpiUnloadParentTable (
216 * ACPI table manipulation interfaces
219 AcpiReallocateRootTable (
223 AcpiFindRootPointer (
224 ACPI_SIZE
*RsdpAddress
);
228 ACPI_STRING Signature
,
230 ACPI_TABLE_HEADER
*OutTableHeader
);
234 ACPI_STRING Signature
,
236 ACPI_TABLE_HEADER
**OutTable
);
239 AcpiGetTableByIndex (
241 ACPI_TABLE_HEADER
**OutTable
);
244 AcpiInstallTableHandler (
245 ACPI_TABLE_HANDLER Handler
,
249 AcpiRemoveTableHandler (
250 ACPI_TABLE_HANDLER Handler
);
254 * Namespace and name interfaces
258 ACPI_OBJECT_TYPE Type
,
259 ACPI_HANDLE StartObject
,
261 ACPI_WALK_CALLBACK DescendingCallback
,
262 ACPI_WALK_CALLBACK AscendingCallback
,
269 ACPI_WALK_CALLBACK UserFunction
,
277 ACPI_BUFFER
*RetPathPtr
);
282 ACPI_STRING Pathname
,
283 ACPI_HANDLE
*RetHandle
);
288 ACPI_OBJECT_HANDLER Handler
,
294 ACPI_OBJECT_HANDLER Handler
);
299 ACPI_OBJECT_HANDLER Handler
,
311 * Object manipulation and enumeration
316 ACPI_STRING Pathname
,
317 ACPI_OBJECT_LIST
*ParameterObjects
,
318 ACPI_BUFFER
*ReturnObjectBuffer
);
321 AcpiEvaluateObjectTyped (
323 ACPI_STRING Pathname
,
324 ACPI_OBJECT_LIST
*ExternalParams
,
325 ACPI_BUFFER
*ReturnBuffer
,
326 ACPI_OBJECT_TYPE ReturnType
);
331 ACPI_DEVICE_INFO
**ReturnBuffer
);
339 ACPI_OBJECT_TYPE Type
,
342 ACPI_HANDLE
*OutHandle
);
347 ACPI_OBJECT_TYPE
*OutType
);
352 ACPI_HANDLE
*OutHandle
);
359 AcpiInstallInitializationHandler (
360 ACPI_INIT_HANDLER Handler
,
363 ACPI_HW_DEPENDENT_RETURN_STATUS (
365 AcpiInstallSciHandler (
366 ACPI_SCI_HANDLER Address
,
369 ACPI_HW_DEPENDENT_RETURN_STATUS (
371 AcpiRemoveSciHandler (
372 ACPI_SCI_HANDLER Address
))
374 ACPI_HW_DEPENDENT_RETURN_STATUS (
376 AcpiInstallGlobalEventHandler (
377 ACPI_GBL_EVENT_HANDLER Handler
,
380 ACPI_HW_DEPENDENT_RETURN_STATUS (
382 AcpiInstallFixedEventHandler (
384 ACPI_EVENT_HANDLER Handler
,
387 ACPI_HW_DEPENDENT_RETURN_STATUS (
389 AcpiRemoveFixedEventHandler (
391 ACPI_EVENT_HANDLER Handler
))
393 ACPI_HW_DEPENDENT_RETURN_STATUS (
395 AcpiInstallGpeHandler (
396 ACPI_HANDLE GpeDevice
,
399 ACPI_GPE_HANDLER Address
,
402 ACPI_HW_DEPENDENT_RETURN_STATUS (
404 AcpiRemoveGpeHandler (
405 ACPI_HANDLE GpeDevice
,
407 ACPI_GPE_HANDLER Address
))
410 AcpiInstallNotifyHandler (
413 ACPI_NOTIFY_HANDLER Handler
,
417 AcpiRemoveNotifyHandler (
420 ACPI_NOTIFY_HANDLER Handler
);
423 AcpiInstallAddressSpaceHandler (
425 ACPI_ADR_SPACE_TYPE SpaceId
,
426 ACPI_ADR_SPACE_HANDLER Handler
,
427 ACPI_ADR_SPACE_SETUP Setup
,
431 AcpiRemoveAddressSpaceHandler (
433 ACPI_ADR_SPACE_TYPE SpaceId
,
434 ACPI_ADR_SPACE_HANDLER Handler
);
437 AcpiInstallExceptionHandler (
438 ACPI_EXCEPTION_HANDLER Handler
);
441 AcpiInstallInterfaceHandler (
442 ACPI_INTERFACE_HANDLER Handler
);
446 * Global Lock interfaces
448 ACPI_HW_DEPENDENT_RETURN_STATUS (
450 AcpiAcquireGlobalLock (
454 ACPI_HW_DEPENDENT_RETURN_STATUS (
456 AcpiReleaseGlobalLock (
461 * Interfaces to AML mutex objects
466 ACPI_STRING Pathname
,
472 ACPI_STRING Pathname
);
476 * Fixed Event interfaces
478 ACPI_HW_DEPENDENT_RETURN_STATUS (
484 ACPI_HW_DEPENDENT_RETURN_STATUS (
490 ACPI_HW_DEPENDENT_RETURN_STATUS (
495 ACPI_HW_DEPENDENT_RETURN_STATUS (
499 ACPI_EVENT_STATUS
*EventStatus
))
503 * General Purpose Event (GPE) Interfaces
505 ACPI_HW_DEPENDENT_RETURN_STATUS (
510 ACPI_HW_DEPENDENT_RETURN_STATUS (
513 ACPI_HANDLE GpeDevice
,
516 ACPI_HW_DEPENDENT_RETURN_STATUS (
519 ACPI_HANDLE GpeDevice
,
522 ACPI_HW_DEPENDENT_RETURN_STATUS (
525 ACPI_HANDLE GpeDevice
,
528 ACPI_HW_DEPENDENT_RETURN_STATUS (
531 ACPI_HANDLE GpeDevice
,
535 ACPI_HW_DEPENDENT_RETURN_STATUS (
538 ACPI_HANDLE GpeDevice
,
541 ACPI_HW_DEPENDENT_RETURN_STATUS (
543 AcpiSetupGpeForWake (
544 ACPI_HANDLE ParentDevice
,
545 ACPI_HANDLE GpeDevice
,
548 ACPI_HW_DEPENDENT_RETURN_STATUS (
551 ACPI_HANDLE GpeDevice
,
555 ACPI_HW_DEPENDENT_RETURN_STATUS (
558 ACPI_HANDLE GpeDevice
,
560 ACPI_EVENT_STATUS
*EventStatus
))
562 ACPI_HW_DEPENDENT_RETURN_STATUS (
567 ACPI_HW_DEPENDENT_RETURN_STATUS (
569 AcpiEnableAllRuntimeGpes (
572 ACPI_HW_DEPENDENT_RETURN_STATUS (
576 ACPI_HANDLE
*GpeDevice
))
578 ACPI_HW_DEPENDENT_RETURN_STATUS (
580 AcpiInstallGpeBlock (
581 ACPI_HANDLE GpeDevice
,
582 ACPI_GENERIC_ADDRESS
*GpeBlockAddress
,
583 UINT32 RegisterCount
,
584 UINT32 InterruptNumber
))
586 ACPI_HW_DEPENDENT_RETURN_STATUS (
589 ACPI_HANDLE GpeDevice
))
593 * Resource interfaces
596 ACPI_STATUS (*ACPI_WALK_RESOURCE_CALLBACK
) (
597 ACPI_RESOURCE
*Resource
,
601 AcpiGetVendorResource (
604 ACPI_VENDOR_UUID
*Uuid
,
605 ACPI_BUFFER
*RetBuffer
);
608 AcpiGetCurrentResources (
610 ACPI_BUFFER
*RetBuffer
);
613 AcpiGetPossibleResources (
615 ACPI_BUFFER
*RetBuffer
);
618 AcpiGetEventResources (
619 ACPI_HANDLE DeviceHandle
,
620 ACPI_BUFFER
*RetBuffer
);
623 AcpiWalkResourceBuffer (
625 ACPI_WALK_RESOURCE_CALLBACK UserFunction
,
632 ACPI_WALK_RESOURCE_CALLBACK UserFunction
,
636 AcpiSetCurrentResources (
638 ACPI_BUFFER
*InBuffer
);
641 AcpiGetIrqRoutingTable (
643 ACPI_BUFFER
*RetBuffer
);
646 AcpiResourceToAddress64 (
647 ACPI_RESOURCE
*Resource
,
648 ACPI_RESOURCE_ADDRESS64
*Out
);
651 AcpiBufferToResource (
653 UINT16 AmlBufferLength
,
654 ACPI_RESOURCE
**ResourcePtr
);
658 * Hardware (ACPI device) interfaces
667 ACPI_GENERIC_ADDRESS
*Reg
);
672 ACPI_GENERIC_ADDRESS
*Reg
);
674 ACPI_HW_DEPENDENT_RETURN_STATUS (
676 AcpiReadBitRegister (
678 UINT32
*ReturnValue
))
680 ACPI_HW_DEPENDENT_RETURN_STATUS (
682 AcpiWriteBitRegister (
688 * Sleep/Wake interfaces
691 AcpiGetSleepTypeData (
697 AcpiEnterSleepStatePrep (
701 AcpiEnterSleepState (
704 ACPI_HW_DEPENDENT_RETURN_STATUS (
706 AcpiEnterSleepStateS4bios (
710 AcpiLeaveSleepStatePrep (
714 AcpiLeaveSleepState (
717 ACPI_HW_DEPENDENT_RETURN_STATUS (
719 AcpiSetFirmwareWakingVector (
720 UINT32 PhysicalAddress
))
722 #if ACPI_MACHINE_WIDTH == 64
723 ACPI_HW_DEPENDENT_RETURN_STATUS (
725 AcpiSetFirmwareWakingVector64 (
726 UINT64 PhysicalAddress
))
731 * ACPI Timer interfaces
733 ACPI_HW_DEPENDENT_RETURN_STATUS (
735 AcpiGetTimerResolution (
738 ACPI_HW_DEPENDENT_RETURN_STATUS (
743 ACPI_HW_DEPENDENT_RETURN_STATUS (
745 AcpiGetTimerDuration (
748 UINT32
*TimeElapsed
))
752 * Error/Warning output
755 void ACPI_INTERNAL_VAR_XFACE
757 const char *ModuleName
,
763 void ACPI_INTERNAL_VAR_XFACE
765 const char *ModuleName
,
772 void ACPI_INTERNAL_VAR_XFACE
774 const char *ModuleName
,
780 void ACPI_INTERNAL_VAR_XFACE
782 const char *ModuleName
,
788 void ACPI_INTERNAL_VAR_XFACE
790 const char *ModuleName
,
796 void ACPI_INTERNAL_VAR_XFACE
798 const char *ModuleName
,
807 #ifdef ACPI_DEBUG_OUTPUT
810 void ACPI_INTERNAL_VAR_XFACE
812 UINT32 RequestedDebugLevel
,
814 const char *FunctionName
,
815 const char *ModuleName
,
821 void ACPI_INTERNAL_VAR_XFACE
823 UINT32 RequestedDebugLevel
,
825 const char *FunctionName
,
826 const char *ModuleName
,
832 #endif /* __ACXFACE_H__ */