TianoCore EDK2 master
Loading...
Searching...
No Matches
AmlLib.h File Reference
#include <AcpiObjects.h>
#include <IndustryStandard/Acpi.h>

Go to the source code of this file.

Data Structures

union  AML_METHOD_PARAM_DATA
 
struct  AML_METHOD_PARAM
 

Typedefs

typedef void * AML_NODE_HANDLE
 
typedef void * AML_ROOT_NODE_HANDLE
 
typedef void * AML_OBJECT_NODE_HANDLE
 
typedef void * AML_DATA_NODE_HANDLE
 

Enumerations

enum  AML_MEMORY_ATTRIBUTES_MEM {
  AmlMemoryNonCacheable = 0 , AmlMemoryCacheable = 1 , AmlMemoryCacheableWriteCombine = 2 , AmlMemoryCacheablePrefetch = 3 ,
  AmlMemoryCacheablityMax = 4
}
 
enum  AML_MEMORY_ATTRIBUTES_MTP {
  AmlAddressRangeMemory = 0 , AmlAddressRangeReserved = 1 , AmlAddressRangeACPI = 2 , AmlAddressRangeNVS = 3 ,
  AmlAddressRangeMax = 4
}
 
enum  AML_METHOD_PARAM_TYPE { AmlMethodParamTypeInteger = 0 , AmlMethodParamTypeString = 1 , AmlMethodParamTypeArg = 2 , AmlMethodParamTypeLocal = 3 }
 

Functions

EFI_STATUS EFIAPI AmlParseDefinitionBlock (IN CONST EFI_ACPI_DESCRIPTION_HEADER *DefinitionBlock, OUT AML_ROOT_NODE_HANDLE *RootPtr)
 
EFI_STATUS EFIAPI AmlSerializeDefinitionBlock (IN AML_ROOT_NODE_HANDLE RootNode, OUT EFI_ACPI_DESCRIPTION_HEADER **Table)
 
EFI_STATUS EFIAPI AmlCloneTree (IN AML_NODE_HANDLE Node, OUT AML_NODE_HANDLE *ClonedNode)
 
EFI_STATUS EFIAPI AmlDeleteTree (IN AML_NODE_HANDLE Node)
 
EFI_STATUS EFIAPI AmlDetachNode (IN AML_NODE_HANDLE Node)
 
EFI_STATUS EFIAPI AmlAttachNode (IN AML_NODE_HANDLE ParentNode, IN AML_NODE_HANDLE NewNode)
 
EFI_STATUS EFIAPI AmlFindNode (IN AML_NODE_HANDLE ReferenceNode, IN CONST CHAR8 *AslPath, OUT AML_NODE_HANDLE *OutNode)
 
EFI_STATUS EFIAPI AmlDeviceOpUpdateName (IN AML_OBJECT_NODE_HANDLE DeviceOpNode, IN CONST CHAR8 *NewNameString)
 
EFI_STATUS EFIAPI AmlNameOpUpdateInteger (IN AML_OBJECT_NODE_HANDLE NameOpNode, IN UINT64 NewInt)
 
EFI_STATUS EFIAPI AmlNameOpUpdateString (IN AML_OBJECT_NODE_HANDLE NameOpNode, IN CONST CHAR8 *NewName)
 
EFI_STATUS EFIAPI AmlNameOpGetFirstRdNode (IN AML_OBJECT_NODE_HANDLE NameOpNode, OUT AML_DATA_NODE_HANDLE *OutRdNode)
 
EFI_STATUS EFIAPI AmlNameOpGetNextRdNode (IN AML_DATA_NODE_HANDLE CurrRdNode, OUT AML_DATA_NODE_HANDLE *OutRdNode)
 
EFI_STATUS EFIAPI AmlUpdateRdInterrupt (IN AML_DATA_NODE_HANDLE InterruptRdNode, IN UINT32 Irq)
 
EFI_STATUS EFIAPI AmlUpdateRdQWord (IN AML_DATA_NODE_HANDLE QWordRdNode, IN UINT64 BaseAddress, IN UINT64 BaseAddressLength)
 
EFI_STATUS EFIAPI AmlCodeGenRdDWordIo (IN BOOLEAN IsResourceConsumer, IN BOOLEAN IsMinFixed, IN BOOLEAN IsMaxFixed, IN BOOLEAN IsPosDecode, IN UINT8 IsaRanges, IN UINT32 AddressGranularity, IN UINT32 AddressMinimum, IN UINT32 AddressMaximum, IN UINT32 AddressTranslation, IN UINT32 RangeLength, IN UINT8 ResourceSourceIndex, IN CONST CHAR8 *ResourceSource, IN BOOLEAN IsDenseTranslation, IN BOOLEAN IsTypeStatic, IN AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL OUT AML_DATA_NODE_HANDLE *NewRdNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlCodeGenRdDWordMemory (IN BOOLEAN IsResourceConsumer, IN BOOLEAN IsPosDecode, IN BOOLEAN IsMinFixed, IN BOOLEAN IsMaxFixed, IN AML_MEMORY_ATTRIBUTES_MEM Cacheable, IN BOOLEAN IsReadWrite, IN UINT32 AddressGranularity, IN UINT32 AddressMinimum, IN UINT32 AddressMaximum, IN UINT32 AddressTranslation, IN UINT32 RangeLength, IN UINT8 ResourceSourceIndex, IN CONST CHAR8 *ResourceSource, IN AML_MEMORY_ATTRIBUTES_MTP MemoryRangeType, IN BOOLEAN IsTypeStatic, IN AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL OUT AML_DATA_NODE_HANDLE *NewRdNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlCodeGenRdMemory32Fixed (BOOLEAN IsReadWrite, UINT32 Address, UINT32 RangeLength, AML_OBJECT_NODE_HANDLE NameOpNode, AML_DATA_NODE_HANDLE *NewMemNode)
 
EFI_STATUS EFIAPI AmlCodeGenRdWordBusNumber (IN BOOLEAN IsResourceConsumer, IN BOOLEAN IsMinFixed, IN BOOLEAN IsMaxFixed, IN BOOLEAN IsPosDecode, IN UINT16 AddressGranularity, IN UINT16 AddressMinimum, IN UINT16 AddressMaximum, IN UINT16 AddressTranslation, IN UINT16 RangeLength, IN UINT8 ResourceSourceIndex, IN CONST CHAR8 *ResourceSource, IN AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL OUT AML_DATA_NODE_HANDLE *NewRdNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlCodeGenRdWordIo (IN BOOLEAN IsResourceConsumer, IN BOOLEAN IsMinFixed, IN BOOLEAN IsMaxFixed, IN BOOLEAN IsPosDecode, IN UINT8 IsaRanges, IN UINT16 AddressGranularity, IN UINT16 AddressMinimum, IN UINT16 AddressMaximum, IN UINT16 AddressTranslation, IN UINT16 RangeLength, IN UINT8 ResourceSourceIndex, IN CONST CHAR8 *ResourceSource, IN BOOLEAN IsDenseTranslation, IN BOOLEAN IsTypeStatic, IN AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL OUT AML_DATA_NODE_HANDLE *NewRdNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlCodeGenRdQWordIo (IN BOOLEAN IsResourceConsumer, IN BOOLEAN IsMinFixed, IN BOOLEAN IsMaxFixed, IN BOOLEAN IsPosDecode, IN UINT8 IsaRanges, IN UINT64 AddressGranularity, IN UINT64 AddressMinimum, IN UINT64 AddressMaximum, IN UINT64 AddressTranslation, IN UINT64 RangeLength, IN UINT8 ResourceSourceIndex, IN CONST CHAR8 *ResourceSource, IN BOOLEAN IsDenseTranslation, IN BOOLEAN IsTypeStatic, IN AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL OUT AML_DATA_NODE_HANDLE *NewRdNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlCodeGenRdQWordMemory (IN BOOLEAN IsResourceConsumer, IN BOOLEAN IsPosDecode, IN BOOLEAN IsMinFixed, IN BOOLEAN IsMaxFixed, IN AML_MEMORY_ATTRIBUTES_MEM Cacheable, IN BOOLEAN IsReadWrite, IN UINT64 AddressGranularity, IN UINT64 AddressMinimum, IN UINT64 AddressMaximum, IN UINT64 AddressTranslation, IN UINT64 RangeLength, IN UINT8 ResourceSourceIndex, IN CONST CHAR8 *ResourceSource, IN AML_MEMORY_ATTRIBUTES_MTP MemoryRangeType, IN BOOLEAN IsTypeStatic, IN AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL OUT AML_DATA_NODE_HANDLE *NewRdNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlCodeGenRdInterrupt (IN BOOLEAN ResourceConsumer, IN BOOLEAN EdgeTriggered, IN BOOLEAN ActiveLow, IN BOOLEAN Shared, IN UINT32 *IrqList, IN UINT8 IrqCount, IN AML_OBJECT_NODE_HANDLE NameOpNode OPTIONAL, OUT AML_DATA_NODE_HANDLE *NewRdNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlCodeGenRdIo (IN BOOLEAN IsDecoder16, IN UINT16 AddressMinimum, IN UINT16 AddressMaximum, IN UINT8 Alignment, IN UINT8 RangeLength, IN AML_OBJECT_NODE_HANDLE NameOpNode, OPTIONAL OUT AML_DATA_NODE_HANDLE *NewRdNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlCodeGenDefinitionBlock (IN CONST CHAR8 *TableSignature, IN CONST CHAR8 *OemId, IN CONST CHAR8 *OemTableId, IN UINT32 OemRevision, OUT AML_ROOT_NODE_HANDLE *NewRootNode)
 
EFI_STATUS EFIAPI AmlCodeGenNameString (IN CONST CHAR8 *NameString, IN CONST CHAR8 *String, IN AML_NODE_HANDLE ParentNode OPTIONAL, OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlCodeGenNameInteger (IN CONST CHAR8 *NameString, IN UINT64 Integer, IN AML_NODE_HANDLE ParentNode OPTIONAL, OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlCodeGenNamePackage (IN CONST CHAR8 *NameString, IN AML_NODE_HANDLE ParentNode, OPTIONAL OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlCodeGenNameResourceTemplate (IN CONST CHAR8 *NameString, IN AML_NODE_HANDLE ParentNode, OPTIONAL OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlCodeGenNameUnicodeString (IN CONST CHAR8 *NameString, IN CHAR16 *String, IN AML_NODE_HANDLE ParentNode OPTIONAL, OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlAddPrtEntry (IN UINT32 Address, IN UINT8 Pin, IN CONST CHAR8 *LinkName, IN UINT32 SourceIndex, IN AML_OBJECT_NODE_HANDLE PrtNameNode)
 
EFI_STATUS EFIAPI AmlCodeGenDevice (IN CONST CHAR8 *NameString, IN AML_NODE_HANDLE ParentNode OPTIONAL, OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlCodeGenThermalZone (IN CONST CHAR8 *NameString, IN AML_NODE_HANDLE ParentNode OPTIONAL, OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlCodeGenScope (IN CONST CHAR8 *NameString, IN AML_NODE_HANDLE ParentNode OPTIONAL, OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlCodeGenMethodRetNameString (IN CONST CHAR8 *MethodNameString, IN CONST CHAR8 *ReturnedNameString OPTIONAL, IN UINT8 NumArgs, IN BOOLEAN IsSerialized, IN UINT8 SyncLevel, IN AML_NODE_HANDLE ParentNode OPTIONAL, OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlCodeGenMethodRetInteger (IN CONST CHAR8 *MethodNameString, IN UINT64 ReturnedInteger, IN UINT8 NumArgs, IN BOOLEAN IsSerialized, IN UINT8 SyncLevel, IN AML_NODE_HANDLE ParentNode OPTIONAL, OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlCodeGenMethodRetNameStringIntegerArgument (IN CONST CHAR8 *MethodNameString, IN CONST CHAR8 *ReturnedNameString OPTIONAL, IN UINT8 NumArgs, IN BOOLEAN IsSerialized, IN UINT8 SyncLevel, IN UINT64 IntegerArgument, IN AML_NODE_HANDLE ParentNode OPTIONAL, OUT AML_OBJECT_NODE_HANDLE *NewObjectNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlCreateLpiNode (IN CONST CHAR8 *LpiNameString, IN UINT16 Revision, IN UINT64 LevelId, IN AML_NODE_HANDLE ParentNode OPTIONAL, OUT AML_OBJECT_NODE_HANDLE *NewLpiNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlAddLpiState (IN UINT32 MinResidency, IN UINT32 WorstCaseWakeLatency, IN UINT32 Flags, IN UINT32 ArchFlags, IN UINT32 ResCntFreq, IN UINT32 EnableParentState, IN EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE *GenericRegisterDescriptor OPTIONAL, IN UINT64 Integer OPTIONAL, IN EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE *ResidencyCounterRegister OPTIONAL, IN EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE *UsageCounterRegister OPTIONAL, IN CONST CHAR8 *StateName OPTIONAL, IN AML_OBJECT_NODE_HANDLE LpiNode)
 
EFI_STATUS EFIAPI AmlAddDeviceDataDescriptorPackage (IN CONST EFI_GUID *Uuid, IN AML_OBJECT_NODE_HANDLE DsdNode, OUT AML_OBJECT_NODE_HANDLE *PackageNode)
 
EFI_STATUS EFIAPI AmlAddNameIntegerPackage (IN CONST CHAR8 *Name, IN UINT64 Value, IN AML_OBJECT_NODE_HANDLE PackageNode)
 
EFI_STATUS EFIAPI AmlCreateCpcNode (IN AML_CPC_INFO *CpcInfo, IN AML_NODE_HANDLE ParentNode OPTIONAL, OUT AML_OBJECT_NODE_HANDLE *NewCpcNode OPTIONAL)
 
EFI_STATUS EFIAPI AmlAddNameStringToNamedPackage (IN CONST CHAR8 *NameString, IN AML_OBJECT_NODE_HANDLE NamedNode)
 
EFI_STATUS EFIAPI AmlAddIntegerToNamedPackage (IN UINT32 Integer, IN OUT AML_OBJECT_NODE_HANDLE NameNode)
 
EFI_STATUS EFIAPI AmlCodeGenInvokeMethod (IN CONST CHAR8 *MethodNameString, IN UINT8 NumArgs, IN AML_METHOD_PARAM *Parameters OPTIONAL, IN AML_NODE_HANDLE ParentNode)
 
EFI_STATUS EFIAPI AmlCreatePsdNode (IN AML_PSD_INFO *PsdInfo, IN AML_NODE_HANDLE ParentNode OPTIONAL, OUT AML_OBJECT_NODE_HANDLE *NewPsdNode OPTIONAL)
 

Detailed Description

AML Lib.

Copyright (c) 2019 - 2023, Arm Limited. All rights reserved.
Copyright (C) 2023 - 2024, Advanced Micro Devices, Inc. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file AmlLib.h.

Typedef Documentation

◆ AML_DATA_NODE_HANDLE

typedef void* AML_DATA_NODE_HANDLE

Data Node handle.

Definition at line 59 of file AmlLib.h.

◆ AML_NODE_HANDLE

typedef void* AML_NODE_HANDLE

Node handle.

Definition at line 47 of file AmlLib.h.

◆ AML_OBJECT_NODE_HANDLE

typedef void* AML_OBJECT_NODE_HANDLE

Object Node handle.

Definition at line 55 of file AmlLib.h.

◆ AML_ROOT_NODE_HANDLE

typedef void* AML_ROOT_NODE_HANDLE

Root Node handle.

Definition at line 51 of file AmlLib.h.

Enumeration Type Documentation

◆ AML_MEMORY_ATTRIBUTES_MEM

Memory attributes, _MEM (2 bits)

Possible values are: 0-The memory is non-cacheable 1-The memory is cacheable (DEPRECATED) 2-The memory is cacheable and supports write combining (DEPRECATED) 3-The memory is cacheable and prefetchable

Reference(s):
  • ACPI 6.5, s6.4.3.5.5 "Resource Type Specific Flags"

Definition at line 76 of file AmlLib.h.

◆ AML_MEMORY_ATTRIBUTES_MTP

Memory attributes, _MTP (2 bits)

Possible values are: 0-AddressRangeMemory 1-AddressRangeReserved 2-AddressRangeACPI 3-AddressRangeNVS

Reference(s):
  • ACPI 6.5, s6.4.3.5.5 "Resource Type Specific Flags"

Definition at line 96 of file AmlLib.h.

◆ AML_METHOD_PARAM_TYPE

Method parameter types

Possible values are: 0 - AmlMethodParamTypeInteger 1 - AmlMethodParamTypeString 2 - AmlMethodParamTypeArg 3 - AmlMethodParamTypeLocal

Reference(s)
  • ACPI 6.5, s20.2.5 "Term Objects Encoding"

Definition at line 116 of file AmlLib.h.

Function Documentation

◆ AmlAddDeviceDataDescriptorPackage()

EFI_STATUS EFIAPI AmlAddDeviceDataDescriptorPackage ( IN CONST EFI_GUID Uuid,
IN AML_OBJECT_NODE_HANDLE  DsdNode,
OUT AML_OBJECT_NODE_HANDLE PackageNode 
)

AML code generation for a _DSD device data object.

AmlAddDeviceDataDescriptorPackage (Uuid, DsdNode, PackageNode) is equivalent of the following ASL code: ToUUID(Uuid), Package () {}

Cf ACPI 6.4 specification, s6.2.5 "_DSD (Device Specific Data)".

_DSD (Device Specific Data) Implementation Guide https://github.com/UEFI/DSD-Guide Per s3. "'Well-Known _DSD UUIDs and Data Structure Formats'" If creating a Device Properties data then UUID daffd814-6eba-4d8c-8a91-bc9bbf4aa301 should be used.

Parameters
[in]UuidThe Uuid of the descriptor to be created
[in]DsdNodeNode of the DSD Package.
[out]PackageNodeIf success, contains the created package node.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 3070 of file AmlCodeGen.c.

◆ AmlAddIntegerToNamedPackage()

EFI_STATUS EFIAPI AmlAddIntegerToNamedPackage ( IN UINT32  Integer,
IN OUT AML_OBJECT_NODE_HANDLE  NameNode 
)

Add an integer value to the named package node.

AmlCodeGenNamePackage ("_CID", NULL, &PackageNode); AmlGetEisaIdFromString ("PNP0A03", &EisaId); AmlAddIntegerToNamedPackage (EisaId, NameNode); AmlGetEisaIdFromString ("PNP0A08", &EisaId); AmlAddIntegerToNamedPackage (EisaId, NameNode);

equivalent of the following ASL code: Name (_CID, Package (0x02) // _CID: Compatible ID { EisaId ("PNP0A03"), EisaId ("PNP0A08") })

The package is added at the tail of the list of the input package node name: Name ("NamePackageNode", Package () { [Pre-existing package entries], [Newly created integer entry] })

Parameters
[in]IntegerInteger value that need to be added to package node.
[in,out]NameNodePackage named node to add the object to.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
OthersError occurred during the operation.

Definition at line 3908 of file AmlCodeGen.c.

◆ AmlAddLpiState()

EFI_STATUS EFIAPI AmlAddLpiState ( IN UINT32  MinResidency,
IN UINT32  WorstCaseWakeLatency,
IN UINT32  Flags,
IN UINT32  ArchFlags,
IN UINT32  ResCntFreq,
IN UINT32  EnableParentState,
IN EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE *GenericRegisterDescriptor  OPTIONAL,
IN UINT64 Integer  OPTIONAL,
IN EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE *ResidencyCounterRegister  OPTIONAL,
IN EFI_ACPI_6_3_GENERIC_ADDRESS_STRUCTURE *UsageCounterRegister  OPTIONAL,
IN CONST CHAR8 *StateName  OPTIONAL,
IN AML_OBJECT_NODE_HANDLE  LpiNode 
)

Add an _LPI state to a LPI node created using AmlCreateLpiNode ().

AmlAddLpiState () increments the Count of LPI states in the LPI node by one, and adds the following package: Package() { MinResidency, WorstCaseWakeLatency, Flags, ArchFlags, ResCntFreq, EnableParentState, (GenericRegisterDescriptor != NULL) ? // Entry method. If a ResourceTemplate(GenericRegisterDescriptor) : // Register is given, Integer, // use it. Use the Integer otherwise. ResourceTemplate() { // NULL Residency Counter Register (SystemMemory, 0, 0, 0, 0) }, ResourceTemplate() { // NULL Usage Counter Register (SystemMemory, 0, 0, 0, 0) }, "" // NULL State Name },

Cf ACPI 6.3 specification, s8.4.4 "Lower Power Idle States".

Parameters
[in]MinResidencyMinimum Residency.
[in]WorstCaseWakeLatencyWorst case wake-up latency.
[in]FlagsFlags.
[in]ArchFlagsArchitectural flags.
[in]ResCntFreqResidency Counter Frequency.
[in]EnableParentStateEnabled Parent State.
[in]GenericRegisterDescriptorEntry Method. If not NULL, use this Register to describe the entry method address.
[in]IntegerEntry Method. If GenericRegisterDescriptor is NULL, take this value.
[in]ResidencyCounterRegisterIf not NULL, use it to populate the residency counter register.
[in]UsageCounterRegisterIf not NULL, use it to populate the usage counter register.
[in]StateNameIf not NULL, use it to populate the state name.
[in]LpiNodeLpi node created with the function AmlCreateLpiNode to which the new LPI state is appended.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Add an _LPI state to a LPI node created using AmlCreateLpiNode.

AmlAddLpiState increments the Count of LPI states in the LPI node by one, and adds the following package: Package() { MinResidency, WorstCaseWakeLatency, Flags, ArchFlags, ResCntFreq, EnableParentState, (GenericRegisterDescriptor != NULL) ? // Entry method. If a ResourceTemplate(GenericRegisterDescriptor) : // Register is given, Integer, // use it. Use the Integer otherwise. ResourceTemplate() { // NULL Residency Counter Register (SystemMemory, 0, 0, 0, 0) }, ResourceTemplate() { // NULL Usage Counter Register (SystemMemory, 0, 0, 0, 0) }, "" // NULL State Name },

Cf ACPI 6.3 specification, s8.4.4 "Lower Power Idle States".

Parameters
[in]MinResidencyMinimum Residency.
[in]WorstCaseWakeLatencyWorst case wake-up latency.
[in]FlagsFlags.
[in]ArchFlagsArchitectural flags.
[in]ResCntFreqResidency Counter Frequency.
[in]EnableParentStateEnabled Parent State.
[in]GenericRegisterDescriptorEntry Method. If not NULL, use this Register to describe the entry method address.
[in]IntegerEntry Method. If GenericRegisterDescriptor is NULL, take this value.
[in]ResidencyCounterRegisterIf not NULL, use it to populate the residency counter register.
[in]UsageCounterRegisterIf not NULL, use it to populate the usage counter register.
[in]StateNameIf not NULL, use it to populate the state name.
[in]LpiNodeLpi node created with the function AmlCreateLpiNode to which the new LPI state is appended.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 2607 of file AmlCodeGen.c.

◆ AmlAddNameIntegerPackage()

EFI_STATUS EFIAPI AmlAddNameIntegerPackage ( IN CONST CHAR8 *  Name,
IN UINT64  Value,
IN AML_OBJECT_NODE_HANDLE  PackageNode 
)

AML code generation to add a package with a name and value, to a parent package. This is useful to build the _DSD package but can be used in other cases.

AmlAddNameIntegerPackage ("Name", Value, PackageNode) is equivalent of the following ASL code: Package (2) {"Name", Value}

Cf ACPI 6.4 specification, s6.2.5 "_DSD (Device Specific Data)".

Parameters
[in]NameString to place in first entry of package
[in]ValueInteger to place in second entry of package
[in]PackageNodePackage to add new sub package to.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 3206 of file AmlCodeGen.c.

◆ AmlAddNameStringToNamedPackage()

EFI_STATUS EFIAPI AmlAddNameStringToNamedPackage ( IN CONST CHAR8 *  NameString,
IN AML_OBJECT_NODE_HANDLE  NamedNode 
)

AML code generation to add a NameString to the package in a named node.

Parameters
[in]NameStringNameString to add
[in]NamedNodeNode to add the string to the included package.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 3802 of file AmlCodeGen.c.

◆ AmlAddPrtEntry()

EFI_STATUS EFIAPI AmlAddPrtEntry ( IN UINT32  Address,
IN UINT8  Pin,
IN CONST CHAR8 *  LinkName,
IN UINT32  SourceIndex,
IN AML_OBJECT_NODE_HANDLE  PrtNameNode 
)

Add a _PRT entry.

AmlCodeGenPrtEntry (0x0FFFF, 0, "LNKA", 0, PrtNameNode) is equivalent of the following ASL code: Package (4) { 0x0FFFF, // Address: Device address (([Device Id] << 16) | 0xFFFF). 0, // Pin: PCI pin number of the device (0-INTA, ...). LNKA // Source: Name of the device that allocates the interrupt to which the above pin is connected. 0 // Source Index: Source is assumed to only describe one interrupt, so let it to index 0. }

The package is added at the tail of the list of the input _PRT node name: Name (_PRT, Package () { [Pre-existing _PRT entries], [Newly created _PRT entry] })

Cf. ACPI 6.4, s6.2.13 "_PRT (PCI Routing Table)"

Parameters
[in]AddressAddress. Cf ACPI 6.4 specification, Table 6.2: "ADR Object Address Encodings": High word-Device #, Low word-Function #. (for example, device 3, function 2 is 0x00030002). To refer to all the functions on a device #, use a function number of FFFF).
[in]PinPCI pin number of the device (0-INTA ... 3-INTD). Must be between 0-3.
[in]LinkNameLink Name, i.e. device in the AML NameSpace describing the interrupt used. The input string is copied.
[in]SourceIndexSource index or GSIV.
[in]PrtNameNodePrt Named node to add the object to ....
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Add a _PRT entry.

AmlCodeGenPrtEntry (0x0FFFF, 0, "LNKA", 0, PrtNameNode) is equivalent of the following ASL code: Package (4) { 0x0FFFF, // Address: Device address (([Device Id] << 16) | 0xFFFF). 0, // Pin: PCI pin number of the device (0-INTA, ...). LNKA // Source: Name of the device that allocates the interrupt to which the above pin is connected. 0 // Source Index: Source is assumed to only describe one interrupt, so let it to index 0. }

The 2 models described in ACPI 6.4, s6.2.13 "_PRT (PCI Routing Table)" can be generated by this function. The example above matches the first model.

The package is added at the tail of the list of the input _PRT node name: Name (_PRT, Package () { [Pre-existing _PRT entries], [Newly created _PRT entry] })

Cf. ACPI 6.4 specification:

  • s6.2.13 "_PRT (PCI Routing Table)"
  • s6.1.1 "_ADR (Address)"
Parameters
[in]AddressAddress. Cf ACPI 6.4 specification, Table 6.2: "ADR Object Address Encodings": High word-Device #, Low word-Function #. (for example, device 3, function 2 is 0x00030002). To refer to all the functions on a device #, use a function number of FFFF).
[in]PinPCI pin number of the device (0-INTA ... 3-INTD). Must be between 0-3.
[in]LinkNameLink Name, i.e. device in the AML NameSpace describing the interrupt used. The input string is copied. If NULL, generate 0 in the 'Source' field (cf. second model, using GSIV).
[in]SourceIndexSource index or GSIV.
[in]PrtNameNodePrt Named node to add the object to ....
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 1008 of file AmlCodeGen.c.

◆ AmlAttachNode()

EFI_STATUS EFIAPI AmlAttachNode ( IN AML_NODE_HANDLE  ParentNode,
IN AML_NODE_HANDLE  NewNode 
)

Attach a node in an AML tree.

The node will be added as the last statement of the ParentNode. E.g.: ASL code corresponding to NewNode: Name (_UID, 0)

ASL code corresponding to ParentNode: Device (PCI0) { Name(_HID, EISAID("PNP0A08")) }

"AmlAttachNode (ParentNode, NewNode)" will result in: ASL code: Device (PCI0) { Name(_HID, EISAID("PNP0A08")) Name (_UID, 0) }

Parameters
[in]ParentNodePointer to the parent node. Must be a root or an object node.
[in]NewNodePointer to the node to add.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 425 of file AmlApi.c.

◆ AmlCodeGenDefinitionBlock()

EFI_STATUS EFIAPI AmlCodeGenDefinitionBlock ( IN CONST CHAR8 *  TableSignature,
IN CONST CHAR8 *  OemId,
IN CONST CHAR8 *  OemTableId,
IN UINT32  OemRevision,
OUT AML_ROOT_NODE_HANDLE NewRootNode 
)

AML code generation for DefinitionBlock.

Create a Root Node handle. It is the caller's responsibility to free the allocated memory with the AmlDeleteTree function.

AmlCodeGenDefinitionBlock (TableSignature, OemId, TableID, OEMRevision) is equivalent to the following ASL code: DefinitionBlock (AMLFileName, TableSignature, ComplianceRevision, OemId, TableID, OEMRevision) {} with the ComplianceRevision set to 2 and the AMLFileName is ignored.

Parameters
[in]TableSignature4-character ACPI signature. Must be 'DSDT' or 'SSDT'.
[in]OemId6-character string OEM identifier.
[in]OemTableId8-character string OEM table identifier.
[in]OemRevisionOEM revision number.
[out]DefinitionBlockTermThe ASL Term handle representing a Definition Block.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

◆ AmlCodeGenDevice()

EFI_STATUS EFIAPI AmlCodeGenDevice ( IN CONST CHAR8 *  NameString,
IN AML_NODE_HANDLE ParentNode  OPTIONAL,
OUT AML_OBJECT_NODE_HANDLE *NewObjectNode  OPTIONAL 
)

AML code generation for a Device object node.

AmlCodeGenDevice ("COM0", ParentNode, NewObjectNode) is equivalent of the following ASL code: Device(COM0) {}

Parameters
[in]NameStringThe new Device's name. Must be a NULL-terminated ASL NameString e.g.: "DEV0", "DV15.DEV0", etc. The input string is copied.
[in]ParentNodeIf provided, set ParentNode as the parent of the node created.
[out]NewObjectNodeIf success, contains the created node.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

◆ AmlCodeGenInvokeMethod()

EFI_STATUS EFIAPI AmlCodeGenInvokeMethod ( IN CONST CHAR8 *  MethodNameString,
IN UINT8  NumArgs,
IN AML_METHOD_PARAM *Parameters  OPTIONAL,
IN AML_NODE_HANDLE  ParentNode 
)

AML code generation to invoke/call another method.

This method is a subset implementation of MethodInvocation defined in the ACPI specification 6.5, section 20.2.5 "Term Objects Encoding". Added integer, string, ArgObj and LocalObj support.

Example 1: AmlCodeGenInvokeMethod ("MET0", 0, NULL, ParentNode); is equivalent to the following ASL code: MET0 ();

Example 2: AML_METHOD_PARAM Param[4]; Param[0].Data.Integer = 0x100; Param[0].Type = AmlMethodParamTypeInteger; Param[1].Data.Buffer = "TEST"; Param[1].Type = AmlMethodParamTypeString; Param[2].Data.Arg = 0; Param[2].Type = AmlMethodParamTypeArg; Param[3].Data.Local = 2; Param[3].Type = AmlMethodParamTypeLocal; AmlCodeGenInvokeMethod ("MET0", 4, Param, ParentNode);

is equivalent to the following ASL code: MET0 (0x100, "TEST", Arg0, Local2);

Example 3: AML_METHOD_PARAM Param[2]; Param[0].Data.Arg = 0; Param[0].Type = AmlMethodParamTypeArg; Param[1].Data.Integer = 0x100; Param[1].Type = AmlMethodParamTypeInteger; AmlCodeGenMethodRetNameString ("MET2", NULL, 2, TRUE, 0, ParentNode, &MethodNode); AmlCodeGenInvokeMethod ("MET3", 2, Param, MethodNode);

is equivalent to the following ASL code: Method (MET2, 2, Serialized) { MET3 (Arg0, 0x0100) }

Parameters
[in]MethodNameStringThe method name to be called or invoked.
[in]NumArgsNumber of arguments to be passed, 0 to 7 are permissible values.
[in]ParametersContains the parameter data.
[in]ParentNodeThe parent node to which the method invocation nodes are attached.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Allocate space to store methodname, object, data node pointers

Create a called or invoked method name string.

Validate and convert the Parameters to the stream of nodes.

Index <= NumArgs, because an additional method name was added.

The index contains the last successful node attached.

Index contains the node number that is failed for AmlVarListAddTail(). Hence, start detaching from the last successful

Index <= NumArgs, because an additional method name was added.

Definition at line 3997 of file AmlCodeGen.c.

◆ AmlCodeGenMethodRetInteger()

EFI_STATUS EFIAPI AmlCodeGenMethodRetInteger ( IN CONST CHAR8 *  MethodNameString,
IN UINT64  ReturnedInteger,
IN UINT8  NumArgs,
IN BOOLEAN  IsSerialized,
IN UINT8  SyncLevel,
IN AML_NODE_HANDLE ParentNode  OPTIONAL,
OUT AML_OBJECT_NODE_HANDLE *NewObjectNode  OPTIONAL 
)

AML code generation for a method returning an Integer.

AmlCodeGenMethodRetInteger ( "_CBA", 0, 1, TRUE, 3, ParentNode, NewObjectNode ); is equivalent of the following ASL code: Method(_CBA, 1, Serialized, 3) { Return (0) }

The ASL parameters "ReturnType" and "ParameterTypes" are not asked in this function. They are optional parameters in ASL.

Parameters
[in]MethodNameStringThe new Method's name. Must be a NULL-terminated ASL NameString e.g.: "MET0", "_SB.MET0", etc. The input string is copied.
[in]ReturnedIntegerThe value of the integer returned by the method.
[in]NumArgsNumber of arguments. Must be 0 <= NumArgs <= 6.
[in]IsSerializedTRUE is equivalent to Serialized. FALSE is equivalent to NotSerialized. Default is NotSerialized in ASL spec.
[in]SyncLevelSynchronization level for the method. Must be 0 <= SyncLevel <= 15. Default is 0 in ASL.
[in]ParentNodeIf provided, set ParentNode as the parent of the node created.
[out]NewObjectNodeIf success, contains the created node.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 2354 of file AmlCodeGen.c.

◆ AmlCodeGenMethodRetNameString()

EFI_STATUS EFIAPI AmlCodeGenMethodRetNameString ( IN CONST CHAR8 *  MethodNameString,
IN CONST CHAR8 *ReturnedNameString  OPTIONAL,
IN UINT8  NumArgs,
IN BOOLEAN  IsSerialized,
IN UINT8  SyncLevel,
IN AML_NODE_HANDLE ParentNode  OPTIONAL,
OUT AML_OBJECT_NODE_HANDLE *NewObjectNode  OPTIONAL 
)

AML code generation for a method returning a NameString.

AmlCodeGenMethodRetNameString ( "MET0", "_CRS", 1, TRUE, 3, ParentNode, NewObjectNode ); is equivalent of the following ASL code: Method(MET0, 1, Serialized, 3) { Return (_CRS) }

The ASL parameters "ReturnType" and "ParameterTypes" are not asked in this function. They are optional parameters in ASL.

Parameters
[in]MethodNameStringThe new Method's name. Must be a NULL-terminated ASL NameString e.g.: "MET0", "_SB.MET0", etc. The input string is copied.
[in]ReturnedNameStringThe name of the object returned by the method. Optional parameter, can be:
  • NULL (ignored).
  • A NULL-terminated ASL NameString. e.g.: "MET0", "_SB.MET0", etc. The input string is copied.
[in]NumArgsNumber of arguments. Must be 0 <= NumArgs <= 6.
[in]IsSerializedTRUE is equivalent to Serialized. FALSE is equivalent to NotSerialized. Default is NotSerialized in ASL spec.
[in]SyncLevelSynchronization level for the method. Must be 0 <= SyncLevel <= 15. Default is 0 in ASL.
[in]ParentNodeIf provided, set ParentNode as the parent of the node created.
[out]NewObjectNodeIf success, contains the created node.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 2138 of file AmlCodeGen.c.

◆ AmlCodeGenMethodRetNameStringIntegerArgument()

EFI_STATUS EFIAPI AmlCodeGenMethodRetNameStringIntegerArgument ( IN CONST CHAR8 *  MethodNameString,
IN CONST CHAR8 *ReturnedNameString  OPTIONAL,
IN UINT8  NumArgs,
IN BOOLEAN  IsSerialized,
IN UINT8  SyncLevel,
IN UINT64  IntegerArgument,
IN AML_NODE_HANDLE ParentNode  OPTIONAL,
OUT AML_OBJECT_NODE_HANDLE *NewObjectNode  OPTIONAL 
)

AML code generation for a method returning a NameString that takes an integer argument.

AmlCodeGenMethodRetNameStringIntegerArgument ( "MET0", "MET1", 1, TRUE, 3, 5, ParentNode, NewObjectNode ); is equivalent of the following ASL code: Method(MET0, 1, Serialized, 3) { Return (MET1 (5)) }

The ASL parameters "ReturnType" and "ParameterTypes" are not asked in this function. They are optional parameters in ASL.

Parameters
[in]MethodNameStringThe new Method's name. Must be a NULL-terminated ASL NameString e.g.: "MET0", "_SB.MET0", etc. The input string is copied.
[in]ReturnedNameStringThe name of the object returned by the method. Optional parameter, can be:
  • NULL (ignored).
  • A NULL-terminated ASL NameString. e.g.: "MET0", "_SB.MET0", etc. The input string is copied.
[in]NumArgsNumber of arguments. Must be 0 <= NumArgs <= 6.
[in]IsSerializedTRUE is equivalent to Serialized. FALSE is equivalent to NotSerialized. Default is NotSerialized in ASL spec.
[in]SyncLevelSynchronization level for the method. Must be 0 <= SyncLevel <= 15. Default is 0 in ASL.
[in]IntegerArgumentArgument to pass to the NameString.
[in]ParentNodeIf provided, set ParentNode as the parent of the node created.
[out]NewObjectNodeIf success, contains the created node.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 2248 of file AmlCodeGen.c.

◆ AmlCodeGenNameInteger()

EFI_STATUS EFIAPI AmlCodeGenNameInteger ( IN CONST CHAR8 *  NameString,
IN UINT64  Integer,
IN AML_NODE_HANDLE ParentNode  OPTIONAL,
OUT AML_OBJECT_NODE_HANDLE *NewObjectNode  OPTIONAL 
)

AML code generation for a Name object node, containing an Integer.

AmlCodeGenNameInteger ("_UID", 1, ParentNode, NewObjectNode) is equivalent of the following ASL code: Name(_UID, One)

Parameters
[in]NameStringThe new variable name. Must be a NULL-terminated ASL NameString e.g.: "DEV0", "DV15.DEV0", etc. The input string is copied.
[in]IntegerInteger to associate to the NameString.
[in]ParentNodeIf provided, set ParentNode as the parent of the node created.
[out]NewObjectNodeIf success, contains the created node.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

◆ AmlCodeGenNamePackage()

EFI_STATUS EFIAPI AmlCodeGenNamePackage ( IN CONST CHAR8 *  NameString,
IN AML_NODE_HANDLE  ParentNode,
OPTIONAL OUT AML_OBJECT_NODE_HANDLE *NewObjectNode  OPTIONAL 
)

AML code generation for a Name object node, containing a Package.

AmlCodeGenNamePackage ("PKG0", ParentNode, NewObjectNode) is equivalent of the following ASL code: Name(PKG0, Package () {})

Parameters
[in]NameStringThe new variable name. Must be a NULL-terminated ASL NameString e.g.: "DEV0", "DV15.DEV0", etc. The input string is copied.
[in]ParentNodeIf provided, set ParentNode as the parent of the node created.
[out]NewObjectNodeIf success, contains the created node.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

◆ AmlCodeGenNameResourceTemplate()

EFI_STATUS EFIAPI AmlCodeGenNameResourceTemplate ( IN CONST CHAR8 *  NameString,
IN AML_NODE_HANDLE  ParentNode,
OPTIONAL OUT AML_OBJECT_NODE_HANDLE *NewObjectNode  OPTIONAL 
)

AML code generation for a Name object node, containing a ResourceTemplate.

AmlCodeGenNameResourceTemplate ("PRS0", ParentNode, NewObjectNode) is equivalent of the following ASL code: Name(PRS0, ResourceTemplate () {})

Parameters
[in]NameStringThe new variable name. Must be a NULL-terminated ASL NameString e.g.: "DEV0", "DV15.DEV0", etc. The input string is copied.
[in]ParentNodeIf provided, set ParentNode as the parent of the node created.
[out]NewObjectNodeIf success, contains the created node.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

◆ AmlCodeGenNameString()

EFI_STATUS EFIAPI AmlCodeGenNameString ( IN CONST CHAR8 *  NameString,
IN CONST CHAR8 *  String,
IN AML_NODE_HANDLE ParentNode  OPTIONAL,
OUT AML_OBJECT_NODE_HANDLE *NewObjectNode  OPTIONAL 
)

AML code generation for a Name object node, containing a String.

AmlCodeGenNameString ("_HID", "HID0000", ParentNode, NewObjectNode) is equivalent of the following ASL code: Name(_HID, "HID0000")

Parameters
[in]NameStringThe new variable name. Must be a NULL-terminated ASL NameString e.g.: "DEV0", "DV15.DEV0", etc. The input string is copied.
[in]StringNULL terminated String to associate to the NameString.
[in]ParentNodeIf provided, set ParentNode as the parent of the node created.
[out]NewObjectNodeIf success, contains the created node.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

◆ AmlCodeGenNameUnicodeString()

EFI_STATUS EFIAPI AmlCodeGenNameUnicodeString ( IN CONST CHAR8 *  NameString,
IN CHAR16 *  String,
IN AML_NODE_HANDLE ParentNode  OPTIONAL,
OUT AML_OBJECT_NODE_HANDLE *NewObjectNode  OPTIONAL 
)

AML code generation for a Name object node, containing a String.

AmlCodeGenNameUnicodeString ("_STR", L"String", ParentNode, NewObjectNode) is equivalent of the following ASL code: Name(_STR, Unicode ("String"))

Parameters
[in]NameStringThe new variable name. Must be a NULL-terminated ASL NameString e.g.: "DEV0", "DV15.DEV0", etc. The input string is copied.
[in]StringNULL terminated Unicode String to associate to the NameString.
[in]ParentNodeIf provided, set ParentNode as the parent of the node created.
[out]NewObjectNodeIf success, contains the created node.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 897 of file AmlCodeGen.c.

◆ AmlCodeGenRdDWordIo()

EFI_STATUS EFIAPI AmlCodeGenRdDWordIo ( IN BOOLEAN  IsResourceConsumer,
IN BOOLEAN  IsMinFixed,
IN BOOLEAN  IsMaxFixed,
IN BOOLEAN  IsPosDecode,
IN UINT8  IsaRanges,
IN UINT32  AddressGranularity,
IN UINT32  AddressMinimum,
IN UINT32  AddressMaximum,
IN UINT32  AddressTranslation,
IN UINT32  RangeLength,
IN UINT8  ResourceSourceIndex,
IN CONST CHAR8 *  ResourceSource,
IN BOOLEAN  IsDenseTranslation,
IN BOOLEAN  IsTypeStatic,
IN AML_OBJECT_NODE_HANDLE  NameOpNode,
OPTIONAL OUT AML_DATA_NODE_HANDLE *NewRdNode  OPTIONAL 
)

Code generation for the "DWordIO ()" ASL function.

The Resource Data effectively created is a DWord Address Space Resource Data. Cf ACPI 6.4:

  • s6.4.3.5.2 "DWord Address Space Descriptor".
  • s19.6.34 "DWordIO".

The created resource data node can be:

  • appended to the list of resource data elements of the NameOpNode. In such case NameOpNode must be defined by a the "Name ()" ASL statement and initially contain a "ResourceTemplate ()".
  • returned through the NewRdNode parameter.

See ACPI 6.4 spec, s19.6.34 for more.

Parameters
[in]IsResourceConsumerResourceUsage parameter.
[in]IsMinFixedMinimum address is fixed.
[in]IsMaxFixedMaximum address is fixed.
[in]IsPosDecodeDecode parameter
[in]IsaRangesPossible values are: 0-Reserved 1-NonISAOnly 2-ISAOnly 3-EntireRange
[in]AddressGranularityAddress granularity.
[in]AddressMinimumMinimum address.
[in]AddressMaximumMaximum address.
[in]AddressTranslationAddress translation.
[in]RangeLengthRange length.
[in]ResourceSourceIndexResource Source index. Not supported. Must be 0.
[in]ResourceSourceResource Source. Not supported. Must be NULL.
[in]IsDenseTranslationTranslationDensity parameter.
[in]IsTypeStaticTranslationType parameter.
[in]NameOpNodeNameOp object node defining a named object. If provided, append the new resource data node to the list of resource data elements of this node.
[out]NewRdNodeIf provided and success, contain the created node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESCould not allocate memory.

Code generation for the "DWordIO ()" ASL function.

The Resource Data effectively created is a DWord Address Space Resource Data. Cf ACPI 6.4:

  • s6.4.3.5.2 "DWord Address Space Descriptor".
  • s19.6.34 "DWordIO".

The created resource data node can be:

  • appended to the list of resource data elements of the NameOpNode. In such case NameOpNode must be defined by a the "Name ()" ASL statement and initially contain a "ResourceTemplate ()".
  • returned through the NewRdNode parameter.

See ACPI 6.4 spec, s19.6.34 for more.

Parameters
[in]IsResourceConsumerResourceUsage parameter.
[in]IsMinFixedMinimum address is fixed.
[in]IsMaxFixedMaximum address is fixed.
[in]IsPosDecodeDecode parameter
[in]IsaRangesPossible values are: 0-Reserved 1-NonISAOnly 2-ISAOnly 3-EntireRange
[in]AddressGranularityAddress granularity.
[in]AddressMinimumMinimum address.
[in]AddressMaximumMaximum address.
[in]AddressTranslationAddress translation.
[in]RangeLengthRange length.
[in]ResourceSourceIndexResource Source index. Unused. Must be 0.
[in]ResourceSourceResource Source. Unused. Must be NULL.
[in]IsDenseTranslationTranslationDensity parameter.
[in]IsTypeStaticTranslationType parameter.
[in]NameOpNodeNameOp object node defining a named object. If provided, append the new resource data node to the list of resource data elements of this node.
[out]NewRdNodeIf provided and success, contain the created node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESCould not allocate memory.

Definition at line 473 of file AmlResourceDataCodeGen.c.

◆ AmlCodeGenRdDWordMemory()

EFI_STATUS EFIAPI AmlCodeGenRdDWordMemory ( IN BOOLEAN  IsResourceConsumer,
IN BOOLEAN  IsPosDecode,
IN BOOLEAN  IsMinFixed,
IN BOOLEAN  IsMaxFixed,
IN AML_MEMORY_ATTRIBUTES_MEM  Cacheable,
IN BOOLEAN  IsReadWrite,
IN UINT32  AddressGranularity,
IN UINT32  AddressMinimum,
IN UINT32  AddressMaximum,
IN UINT32  AddressTranslation,
IN UINT32  RangeLength,
IN UINT8  ResourceSourceIndex,
IN CONST CHAR8 *  ResourceSource,
IN AML_MEMORY_ATTRIBUTES_MTP  MemoryRangeType,
IN BOOLEAN  IsTypeStatic,
IN AML_OBJECT_NODE_HANDLE  NameOpNode,
OPTIONAL OUT AML_DATA_NODE_HANDLE *NewRdNode  OPTIONAL 
)

Code generation for the "DWordMemory ()" ASL function.

The Resource Data effectively created is a DWord Address Space Resource Data. Cf ACPI 6.4:

  • s6.4.3.5.2 "DWord Address Space Descriptor".
  • s19.6.35 "DWordMemory".

The created resource data node can be:

  • appended to the list of resource data elements of the NameOpNode. In such case NameOpNode must be defined by a the "Name ()" ASL statement and initially contain a "ResourceTemplate ()".
  • returned through the NewRdNode parameter.

See ACPI 6.4 spec, s19.6.35 for more.

Parameters
[in]IsResourceConsumerResourceUsage parameter.
[in]IsPosDecodeDecode parameter
[in]IsMinFixedMinimum address is fixed.
[in]IsMaxFixedMaximum address is fixed.
[in]CacheablePossible values are: 0-The memory is non-cacheable 1-The memory is cacheable 2-The memory is cacheable and supports write combining 3-The memory is cacheable and prefetchable
[in]IsReadWriteReadAndWrite parameter.
[in]AddressGranularityAddress granularity.
[in]AddressMinimumMinimum address.
[in]AddressMaximumMaximum address.
[in]AddressTranslationAddress translation.
[in]RangeLengthRange length.
[in]ResourceSourceIndexResource Source index. Not supported. Must be 0.
[in]ResourceSourceResource Source. Not supported. Must be NULL.
[in]MemoryRangeTypePossible values are: 0-AddressRangeMemory 1-AddressRangeReserved 2-AddressRangeACPI 3-AddressRangeNVS
[in]IsTypeStaticTranslationType parameter.
[in]NameOpNodeNameOp object node defining a named object. If provided, append the new resource data node to the list of resource data elements of this node.
[out]NewRdNodeIf provided and success, contain the created node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESCould not allocate memory.

Code generation for the "DWordMemory ()" ASL function.

The Resource Data effectively created is a DWord Address Space Resource Data. Cf ACPI 6.4:

  • s6.4.3.5.2 "DWord Address Space Descriptor".
  • s19.6.35 "DWordMemory".

The created resource data node can be:

  • appended to the list of resource data elements of the NameOpNode. In such case NameOpNode must be defined by a the "Name ()" ASL statement and initially contain a "ResourceTemplate ()".
  • returned through the NewRdNode parameter.

See ACPI 6.4 spec, s19.6.35 for more.

Parameters
[in]IsResourceConsumerResourceUsage parameter.
[in]IsPosDecodeDecode parameter
[in]IsMinFixedMinimum address is fixed.
[in]IsMaxFixedMaximum address is fixed.
[in]CacheablePossible values are: 0-The memory is non-cacheable 1-The memory is cacheable 2-The memory is cacheable and supports write combining 3-The memory is cacheable and prefetchable
[in]IsReadWriteReadAndWrite parameter.
[in]AddressGranularityAddress granularity.
[in]AddressMinimumMinimum address.
[in]AddressMaximumMaximum address.
[in]AddressTranslationAddress translation.
[in]RangeLengthRange length.
[in]ResourceSourceIndexResource Source index. Unused. Must be 0.
[in]ResourceSourceResource Source. Unused. Must be NULL.
[in]MemoryRangeTypePossible values are: 0-AddressRangeMemory 1-AddressRangeReserved 2-AddressRangeACPI 3-AddressRangeNVS
[in]IsTypeStaticTranslationType parameter.
[in]NameOpNodeNameOp object node defining a named object. If provided, append the new resource data node to the list of resource data elements of this node.
[out]NewRdNodeIf provided and success, contain the created node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESCould not allocate memory.

Definition at line 569 of file AmlResourceDataCodeGen.c.

◆ AmlCodeGenRdInterrupt()

EFI_STATUS EFIAPI AmlCodeGenRdInterrupt ( IN BOOLEAN  ResourceConsumer,
IN BOOLEAN  EdgeTriggered,
IN BOOLEAN  ActiveLow,
IN BOOLEAN  Shared,
IN UINT32 *  IrqList,
IN UINT8  IrqCount,
IN AML_OBJECT_NODE_HANDLE NameOpNode  OPTIONAL,
OUT AML_DATA_NODE_HANDLE *NewRdNode  OPTIONAL 
)

Code generation for the "Interrupt ()" ASL function.

The Resource Data effectively created is an Extended Interrupt Resource Data. Cf ACPI 6.4:

  • s6.4.3.6 "Extended Interrupt Descriptor"
  • s19.6.64 "Interrupt (Interrupt Resource Descriptor Macro)"

The created resource data node can be:

  • appended to the list of resource data elements of the NameOpNode. In such case NameOpNode must be defined by a the "Name ()" ASL statement and initially contain a "ResourceTemplate ()".
  • returned through the NewRdNode parameter.
Parameters
[in]ResourceConsumerThe device consumes the specified interrupt or produces it for use by a child device.
[in]EdgeTriggeredThe interrupt is edge triggered or level triggered.
[in]ActiveLowThe interrupt is active-high or active-low.
[in]SharedThe interrupt can be shared with other devices or not (Exclusive).
[in]IrqListInterrupt list. Must be non-NULL.
[in]IrqCountInterrupt count. Must be non-zero.
[in]NameOpNodeNameOp object node defining a named object. If provided, append the new resource data node to the list of resource data elements of this node.
[out]NewRdNodeIf provided and success, contain the created node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESCould not allocate memory.

Definition at line 1326 of file AmlResourceDataCodeGen.c.

◆ AmlCodeGenRdIo()

EFI_STATUS EFIAPI AmlCodeGenRdIo ( IN BOOLEAN  IsDecoder16,
IN UINT16  AddressMinimum,
IN UINT16  AddressMaximum,
IN UINT8  Alignment,
IN UINT8  RangeLength,
IN AML_OBJECT_NODE_HANDLE  NameOpNode,
OPTIONAL OUT AML_DATA_NODE_HANDLE *NewRdNode  OPTIONAL 
)

Code generation for the "IO ()" ASL function.

The Resource Data effectively created is a IO Resource Data. Cf ACPI 6.5:

  • s19.6.65 IO (IO Resource Descriptor Macro)
  • s6.4.2.5 I/O Port Descriptor

The created resource data node can be:

  • appended to the list of resource data elements of the NameOpNode. In such case NameOpNode must be defined by a the "Name ()" ASL statement and initially contain a "ResourceTemplate ()".
  • returned through the NewRdNode parameter.
Parameters
[in]IsDecoder16Decoder parameter. TRUE if 16-bit decoder. FALSE if 10-bit decoder.
[in]AddressMinimumMinimum address.
[in]AddressMaximumMaximum address.
[in]AlignmentAlignment.
[in]RangeLengthRange length.
[in]NameOpNodeNameOp object node defining a named object. If provided, append the new resource data node to the list of resource data elements of this node.
[out]NewRdNodeIf provided and success, contain the created node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.

check the alignment

Definition at line 1508 of file AmlResourceDataCodeGen.c.

◆ AmlCodeGenRdMemory32Fixed()

EFI_STATUS EFIAPI AmlCodeGenRdMemory32Fixed ( BOOLEAN  IsReadWrite,
UINT32  Address,
UINT32  RangeLength,
AML_OBJECT_NODE_HANDLE  NameOpNode,
AML_DATA_NODE_HANDLE NewMemNode 
)

Code generation for the "Memory32Fixed ()" ASL macro.

The Resource Data effectively created is a 32-bit Memory Resource Data. Cf ACPI 6.4:

  • s19.6.83 "Memory Resource Descriptor Macro".
  • s19.2.8 "Memory32FixedTerm".

See ACPI 6.4 spec, s19.2.8 for more.

Parameters
[in]IsReadWriteReadAndWrite parameter.
[in]AddressAddressBase parameter.
[in]RangeLengthRange length.
[in]NameOpNodeNameOp object node defining a named object. If provided, append the new resource data node to the list of resource data elements of this node.
[out]NewMemNodeIf provided and success, contain the created node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESCould not allocate memory.

Definition at line 638 of file AmlResourceDataCodeGen.c.

◆ AmlCodeGenRdQWordIo()

EFI_STATUS EFIAPI AmlCodeGenRdQWordIo ( IN BOOLEAN  IsResourceConsumer,
IN BOOLEAN  IsMinFixed,
IN BOOLEAN  IsMaxFixed,
IN BOOLEAN  IsPosDecode,
IN UINT8  IsaRanges,
IN UINT64  AddressGranularity,
IN UINT64  AddressMinimum,
IN UINT64  AddressMaximum,
IN UINT64  AddressTranslation,
IN UINT64  RangeLength,
IN UINT8  ResourceSourceIndex,
IN CONST CHAR8 *  ResourceSource,
IN BOOLEAN  IsDenseTranslation,
IN BOOLEAN  IsTypeStatic,
IN AML_OBJECT_NODE_HANDLE  NameOpNode,
OPTIONAL OUT AML_DATA_NODE_HANDLE *NewRdNode  OPTIONAL 
)

Code generation for the "QWordIO ()" ASL function.

The Resource Data effectively created is a QWord Address Space Resource Data. Cf ACPI 6.4:

  • s6.4.3.5.1 "QWord Address Space Descriptor".
  • s19.6.109 "QWordIO".

The created resource data node can be:

  • appended to the list of resource data elements of the NameOpNode. In such case NameOpNode must be defined by a the "Name ()" ASL statement and initially contain a "ResourceTemplate ()".
  • returned through the NewRdNode parameter.

See ACPI 6.4 spec, s19.6.109 for more.

Parameters
[in]IsResourceConsumerResourceUsage parameter.
[in]IsMinFixedMinimum address is fixed.
[in]IsMaxFixedMaximum address is fixed.
[in]IsPosDecodeDecode parameter
[in]IsaRangesPossible values are: 0-Reserved 1-NonISAOnly 2-ISAOnly 3-EntireRange
[in]AddressGranularityAddress granularity.
[in]AddressMinimumMinimum address.
[in]AddressMaximumMaximum address.
[in]AddressTranslationAddress translation.
[in]RangeLengthRange length.
[in]ResourceSourceIndexResource Source index. Unused. Must be 0.
[in]ResourceSourceResource Source. Unused. Must be NULL.
[in]IsDenseTranslationTranslationDensity parameter.
[in]IsTypeStaticTranslationType parameter.
[in]NameOpNodeNameOp object node defining a named object. If provided, append the new resource data node to the list of resource data elements of this node.
[out]NewRdNodeIf provided and success, contain the created node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESCould not allocate memory.

Definition at line 1151 of file AmlResourceDataCodeGen.c.

◆ AmlCodeGenRdQWordMemory()

EFI_STATUS EFIAPI AmlCodeGenRdQWordMemory ( IN BOOLEAN  IsResourceConsumer,
IN BOOLEAN  IsPosDecode,
IN BOOLEAN  IsMinFixed,
IN BOOLEAN  IsMaxFixed,
IN AML_MEMORY_ATTRIBUTES_MEM  Cacheable,
IN BOOLEAN  IsReadWrite,
IN UINT64  AddressGranularity,
IN UINT64  AddressMinimum,
IN UINT64  AddressMaximum,
IN UINT64  AddressTranslation,
IN UINT64  RangeLength,
IN UINT8  ResourceSourceIndex,
IN CONST CHAR8 *  ResourceSource,
IN AML_MEMORY_ATTRIBUTES_MTP  MemoryRangeType,
IN BOOLEAN  IsTypeStatic,
IN AML_OBJECT_NODE_HANDLE  NameOpNode,
OPTIONAL OUT AML_DATA_NODE_HANDLE *NewRdNode  OPTIONAL 
)

Code generation for the "QWordMemory ()" ASL function.

The Resource Data effectively created is a QWord Address Space Resource Data. Cf ACPI 6.4:

  • s6.4.3.5.1 "QWord Address Space Descriptor".
  • s19.6.110 "QWordMemory".

The created resource data node can be:

  • appended to the list of resource data elements of the NameOpNode. In such case NameOpNode must be defined by a the "Name ()" ASL statement and initially contain a "ResourceTemplate ()".
  • returned through the NewRdNode parameter.

See ACPI 6.4 spec, s19.6.110 for more.

Parameters
[in]IsResourceConsumerResourceUsage parameter.
[in]IsPosDecodeDecode parameter.
[in]IsMinFixedMinimum address is fixed.
[in]IsMaxFixedMaximum address is fixed.
[in]CacheablePossible values are: 0-The memory is non-cacheable 1-The memory is cacheable 2-The memory is cacheable and supports write combining 3-The memory is cacheable and prefetchable
[in]IsReadWriteReadAndWrite parameter.
[in]AddressGranularityAddress granularity.
[in]AddressMinimumMinimum address.
[in]AddressMaximumMaximum address.
[in]AddressTranslationAddress translation.
[in]RangeLengthRange length.
[in]ResourceSourceIndexResource Source index. Not supported. Must be 0.
[in]ResourceSourceResource Source. Not supported. Must be NULL.
[in]MemoryRangeTypePossible values are: 0-AddressRangeMemory 1-AddressRangeReserved 2-AddressRangeACPI 3-AddressRangeNVS
[in]IsTypeStaticTranslationType parameter.
[in]NameOpNodeNameOp object node defining a named object. If provided, append the new resource data node to the list of resource data elements of this node.
[out]NewRdNodeIf provided and success, contain the created node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESCould not allocate memory.

Code generation for the "QWordMemory ()" ASL function.

The Resource Data effectively created is a QWord Address Space Resource Data. Cf ACPI 6.4:

  • s6.4.3.5.1 "QWord Address Space Descriptor".
  • s19.6.110 "QWordMemory".

The created resource data node can be:

  • appended to the list of resource data elements of the NameOpNode. In such case NameOpNode must be defined by a the "Name ()" ASL statement and initially contain a "ResourceTemplate ()".
  • returned through the NewRdNode parameter.

See ACPI 6.4 spec, s19.6.110 for more.

Parameters
[in]IsResourceConsumerResourceUsage parameter.
[in]IsPosDecodeDecode parameter.
[in]IsMinFixedMinimum address is fixed.
[in]IsMaxFixedMaximum address is fixed.
[in]CacheablePossible values are: 0-The memory is non-cacheable 1-The memory is cacheable 2-The memory is cacheable and supports write combining 3-The memory is cacheable and prefetchable
[in]IsReadWriteReadAndWrite parameter.
[in]AddressGranularityAddress granularity.
[in]AddressMinimumMinimum address.
[in]AddressMaximumMaximum address.
[in]AddressTranslationAddress translation.
[in]RangeLengthRange length.
[in]ResourceSourceIndexResource Source index. Unused. Must be 0.
[in]ResourceSourceResource Source. Unused. Must be NULL.
[in]MemoryRangeTypePossible values are: 0-AddressRangeMemory 1-AddressRangeReserved 2-AddressRangeACPI 3-AddressRangeNVS
[in]IsTypeStaticTranslationType parameter.
[in]NameOpNodeNameOp object node defining a named object. If provided, append the new resource data node to the list of resource data elements of this node.
[out]NewRdNodeIf provided and success, contain the created node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESCould not allocate memory.

Definition at line 1247 of file AmlResourceDataCodeGen.c.

◆ AmlCodeGenRdWordBusNumber()

EFI_STATUS EFIAPI AmlCodeGenRdWordBusNumber ( IN BOOLEAN  IsResourceConsumer,
IN BOOLEAN  IsMinFixed,
IN BOOLEAN  IsMaxFixed,
IN BOOLEAN  IsPosDecode,
IN UINT16  AddressGranularity,
IN UINT16  AddressMinimum,
IN UINT16  AddressMaximum,
IN UINT16  AddressTranslation,
IN UINT16  RangeLength,
IN UINT8  ResourceSourceIndex,
IN CONST CHAR8 *  ResourceSource,
IN AML_OBJECT_NODE_HANDLE  NameOpNode,
OPTIONAL OUT AML_DATA_NODE_HANDLE *NewRdNode  OPTIONAL 
)

Code generation for the "WordBusNumber ()" ASL function.

The Resource Data effectively created is a Word Address Space Resource Data. Cf ACPI 6.4:

  • s6.4.3.5.3 "Word Address Space Descriptor".
  • s19.6.149 "WordBusNumber".

The created resource data node can be:

  • appended to the list of resource data elements of the NameOpNode. In such case NameOpNode must be defined by a the "Name ()" ASL statement and initially contain a "ResourceTemplate ()".
  • returned through the NewRdNode parameter.

See ACPI 6.4 spec, s19.6.149 for more.

Parameters
[in]IsResourceConsumerResourceUsage parameter.
[in]IsMinFixedMinimum address is fixed.
[in]IsMaxFixedMaximum address is fixed.
[in]IsPosDecodeDecode parameter
[in]AddressGranularityAddress granularity.
[in]AddressMinimumMinimum address.
[in]AddressMaximumMaximum address.
[in]AddressTranslationAddress translation.
[in]RangeLengthRange length.
[in]ResourceSourceIndexResource Source index. Not supported. Must be 0.
[in]ResourceSourceResource Source. Not supported. Must be NULL.
[in]NameOpNodeNameOp object node defining a named object. If provided, append the new resource data node to the list of resource data elements of this node.
[out]NewRdNodeIf provided and success, contain the created node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESCould not allocate memory.

Code generation for the "WordBusNumber ()" ASL function.

The Resource Data effectively created is a Word Address Space Resource Data. Cf ACPI 6.4:

  • s6.4.3.5.3 "Word Address Space Descriptor".
  • s19.6.149 "WordBusNumber".

The created resource data node can be:

  • appended to the list of resource data elements of the NameOpNode. In such case NameOpNode must be defined by a the "Name ()" ASL statement and initially contain a "ResourceTemplate ()".
  • returned through the NewRdNode parameter.

See ACPI 6.4 spec, s19.6.149 for more.

Parameters
[in]IsResourceConsumerResourceUsage parameter.
[in]IsMinFixedMinimum address is fixed.
[in]IsMaxFixedMaximum address is fixed.
[in]IsPosDecodeDecode parameter
[in]AddressGranularityAddress granularity.
[in]AddressMinimumMinimum address.
[in]AddressMaximumMaximum address.
[in]AddressTranslationAddress translation.
[in]RangeLengthRange length.
[in]ResourceSourceIndexResource Source index. Unused. Must be 0.
[in]ResourceSourceResource Source. Unused. Must be NULL.
[in]NameOpNodeNameOp object node defining a named object. If provided, append the new resource data node to the list of resource data elements of this node.
[out]NewRdNodeIf provided and success, contain the created node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESCould not allocate memory.

Definition at line 846 of file AmlResourceDataCodeGen.c.

◆ AmlCodeGenRdWordIo()

EFI_STATUS EFIAPI AmlCodeGenRdWordIo ( IN BOOLEAN  IsResourceConsumer,
IN BOOLEAN  IsMinFixed,
IN BOOLEAN  IsMaxFixed,
IN BOOLEAN  IsPosDecode,
IN UINT8  IsaRanges,
IN UINT16  AddressGranularity,
IN UINT16  AddressMinimum,
IN UINT16  AddressMaximum,
IN UINT16  AddressTranslation,
IN UINT16  RangeLength,
IN UINT8  ResourceSourceIndex,
IN CONST CHAR8 *  ResourceSource,
IN BOOLEAN  IsDenseTranslation,
IN BOOLEAN  IsTypeStatic,
IN AML_OBJECT_NODE_HANDLE  NameOpNode,
OPTIONAL OUT AML_DATA_NODE_HANDLE *NewRdNode  OPTIONAL 
)

Code generation for the "WordIO ()" ASL function.

The Resource Data effectively created is a Word Address Space Resource Data. Cf ACPI 6.5:

  • s6.4.3.5.3 "Word Address Space Descriptor".

The created resource data node can be:

  • appended to the list of resource data elements of the NameOpNode. In such case NameOpNode must be defined by a the "Name ()" ASL statement and initially contain a "ResourceTemplate ()".
  • returned through the NewRdNode parameter.
Parameters
[in]IsResourceConsumerResourceUsage parameter.
[in]IsMinFixedMinimum address is fixed.
[in]IsMaxFixedMaximum address is fixed.
[in]IsPosDecodeDecode parameter
[in]IsaRangesPossible values are: 0-Reserved 1-NonISAOnly 2-ISAOnly 3-EntireRange
[in]AddressGranularityAddress granularity.
[in]AddressMinimumMinimum address.
[in]AddressMaximumMaximum address.
[in]AddressTranslationAddress translation.
[in]RangeLengthRange length.
[in]ResourceSourceIndexResource Source index. Not supported. Must be 0.
[in]ResourceSourceResource Source. Not supported. Must be NULL.
[in]IsDenseTranslationTranslationDensity parameter.
[in]IsTypeStaticTranslationType parameter.
[in]NameOpNodeNameOp object node defining a named object. If provided, append the new resource data node to the list of resource data elements of this node.
[out]NewRdNodeIf provided and success, contain the created node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESCould not allocate memory.

Definition at line 927 of file AmlResourceDataCodeGen.c.

◆ AmlCodeGenScope()

EFI_STATUS EFIAPI AmlCodeGenScope ( IN CONST CHAR8 *  NameString,
IN AML_NODE_HANDLE ParentNode  OPTIONAL,
OUT AML_OBJECT_NODE_HANDLE *NewObjectNode  OPTIONAL 
)

AML code generation for a Scope object node.

AmlCodeGenScope ("_SB", ParentNode, NewObjectNode) is equivalent of the following ASL code: Scope(_SB) {}

Parameters
[in]NameStringThe new Scope's name. Must be a NULL-terminated ASL NameString e.g.: "DEV0", "DV15.DEV0", etc. The input string is copied.
[in]ParentNodeIf provided, set ParentNode as the parent of the node created.
[out]NewObjectNodeIf success, contains the created node.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

◆ AmlCodeGenThermalZone()

EFI_STATUS EFIAPI AmlCodeGenThermalZone ( IN CONST CHAR8 *  NameString,
IN AML_NODE_HANDLE ParentNode  OPTIONAL,
OUT AML_OBJECT_NODE_HANDLE *NewObjectNode  OPTIONAL 
)

AML code generation for a ThermalZone object node.

AmlCodeGenThermalZone ("TZ00", ParentNode, NewObjectNode) is equivalent of the following ASL code: ThermalZone(TZ00) {}

Parameters
[in]NameStringThe new ThermalZone's name. Must be a NULL-terminated ASL NameString e.g.: "DEV0", "DV15.DEV0", etc. The input string is copied.
[in]ParentNodeIf provided, set ParentNode as the parent of the node created.
[out]NewObjectNodeIf success, contains the created node.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 1330 of file AmlCodeGen.c.

◆ AmlCreateCpcNode()

EFI_STATUS EFIAPI AmlCreateCpcNode ( IN AML_CPC_INFO CpcInfo,
IN AML_NODE_HANDLE ParentNode  OPTIONAL,
OUT AML_OBJECT_NODE_HANDLE *NewCpcNode  OPTIONAL 
)

Create a _CPC node.

Creates and optionally adds the following node Name(_CPC, Package() { NumEntries, // Integer Revision, // Integer HighestPerformance, // Integer or Buffer (Resource Descriptor) NominalPerformance, // Integer or Buffer (Resource Descriptor) LowestNonlinearPerformance, // Integer or Buffer (Resource Descriptor) LowestPerformance, // Integer or Buffer (Resource Descriptor) GuaranteedPerformanceRegister, // Buffer (Resource Descriptor) DesiredPerformanceRegister , // Buffer (Resource Descriptor) MinimumPerformanceRegister , // Buffer (Resource Descriptor) MaximumPerformanceRegister , // Buffer (Resource Descriptor) PerformanceReductionToleranceRegister, // Buffer (Resource Descriptor) TimeWindowRegister, // Buffer (Resource Descriptor) CounterWraparoundTime, // Integer or Buffer (Resource Descriptor) ReferencePerformanceCounterRegister, // Buffer (Resource Descriptor) DeliveredPerformanceCounterRegister, // Buffer (Resource Descriptor) PerformanceLimitedRegister, // Buffer (Resource Descriptor) CPPCEnableRegister // Buffer (Resource Descriptor) AutonomousSelectionEnable, // Integer or Buffer (Resource Descriptor) AutonomousActivityWindowRegister, // Buffer (Resource Descriptor) EnergyPerformancePreferenceRegister, // Buffer (Resource Descriptor) ReferencePerformance // Integer or Buffer (Resource Descriptor) LowestFrequency, // Integer or Buffer (Resource Descriptor) NominalFrequency // Integer or Buffer (Resource Descriptor) })

If resource buffer is NULL then integer will be used.

Cf. ACPI 6.4, s8.4.7.1 _CPC (Continuous Performance Control)

Parameters
[in]CpcInfoCpcInfo object
[in]ParentNodeIf provided, set ParentNode as the parent of the node created.
[out]NewCpcNodeIf success and provided, contains the created node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

The following fields are theoretically mandatory, but not supported by some platforms.

  • PerformanceLimitedRegister
  • ReferencePerformanceCounterRegister
  • DeliveredPerformanceCounterRegister Warn if BIT0 in PcdDevelopmentPlatformRelaxations is set, otherwise return an error.

Definition at line 3508 of file AmlCodeGen.c.

◆ AmlCreateLpiNode()

EFI_STATUS EFIAPI AmlCreateLpiNode ( IN CONST CHAR8 *  LpiNameString,
IN UINT16  Revision,
IN UINT64  LevelId,
IN AML_NODE_HANDLE ParentNode  OPTIONAL,
OUT AML_OBJECT_NODE_HANDLE *NewLpiNode  OPTIONAL 
)

Create a _LPI name.

AmlCreateLpiNode ("_LPI", 0, 1, ParentNode, &LpiNode) is equivalent of the following ASL code: Name (_LPI, Package ( 0, // Revision 1, // LevelId 0 // Count ))

This function doesn't define any LPI state. As shown above, the count of _LPI state is set to 0. The AmlAddLpiState () function must be used to add LPI states.

Cf ACPI 6.3 specification, s8.4.4 "Lower Power Idle States".

Parameters
[in]LpiNameStringThe new LPI 's object name. Must be a NULL-terminated ASL NameString e.g.: "_LPI", "DEV0.PLPI", etc. The input string is copied.
[in]RevisionRevision number of the _LPI states.
[in]LevelIdA platform defined number that identifies the level of hierarchy of the processor node to which the LPI states apply.
[in]ParentNodeIf provided, set ParentNode as the parent of the node created.
[out]NewLpiNodeIf success, contains the created node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Create a _LPI name.

AmlCreateLpiNode ("_LPI", 0, 1, ParentNode, &LpiNode) is equivalent of the following ASL code: Name (_LPI, Package ( 0, // Revision 1, // LevelId 0 // Count ))

This function doesn't define any LPI state. As shown above, the count of _LPI state is set to 0. The AmlAddLpiState () function allows to add LPI states.

Cf ACPI 6.3 specification, s8.4.4 "Lower Power Idle States".

Parameters
[in]LpiNameStringThe new LPI 's object name. Must be a NULL-terminated ASL NameString e.g.: "_LPI", "DEV0.PLPI", etc. The input string is copied.
[in]RevisionRevision number of the _LPI states.
[in]LevelIdA platform defined number that identifies the level of hierarchy of the processor node to which the LPI states apply.
[in]ParentNodeIf provided, set ParentNode as the parent of the node created.
[out]NewLpiNodeIf success, contains the created node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 2452 of file AmlCodeGen.c.

◆ AmlCreatePsdNode()

EFI_STATUS EFIAPI AmlCreatePsdNode ( IN AML_PSD_INFO PsdInfo,
IN AML_NODE_HANDLE ParentNode  OPTIONAL,
OUT AML_OBJECT_NODE_HANDLE *NewPsdNode  OPTIONAL 
)

Create a _PSD node.

Creates and optionally adds the following node Name(_PSD, Package() { NumEntries, // Integer Revision, // Integer Domain, // Integer CoordType, // Integer NumProc, // Integer })

Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency)

Parameters
[in]PsdInfoPsdInfo object
[in]ParentNodeIf provided, set ParentNode as the parent of the node created.
[out]NewPsdNodeIf success and provided, contains the created node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Create a _PSD node.

Creates and optionally adds the following node Name(_PSD, Package() { Package () { NumEntries, // Integer Revision, // Integer Domain, // Integer CoordType, // Integer NumProc, // Integer } })

Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency)

Parameters
[in]PsdInfoPsdInfo object
[in]ParentNodeIf provided, set ParentNode as the parent of the node created.
[out]NewPsdNodeIf success and provided, contains the created node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 4210 of file AmlCodeGen.c.