TianoCore EDK2 master
Loading...
Searching...
No Matches
Node Interface APIs

Functions

EAML_NODE_TYPE EFIAPI AmlGetNodeType (IN AML_NODE_HANDLE Node)
 
EFI_STATUS EFIAPI AmlGetRootNodeInfo (IN AML_ROOT_NODE_HANDLE RootNode, OUT EFI_ACPI_DESCRIPTION_HEADER *SdtHeaderBuffer)
 
EFI_STATUS EFIAPI AmlGetObjectNodeInfo (IN AML_OBJECT_NODE_HANDLE ObjectNode, OUT UINT8 *OpCode OPTIONAL, OUT UINT8 *SubOpCode OPTIONAL, OUT UINT32 *PkgLen OPTIONAL, OUT BOOLEAN *IsNameSpaceNode OPTIONAL)
 
UINT8 AmlGetFixedArgumentCount (IN AML_OBJECT_NODE_HANDLE Node)
 
EFI_STATUS EFIAPI AmlGetNodeDataType (IN AML_DATA_NODE_HANDLE DataNode, OUT EAML_NODE_DATA_TYPE *DataType)
 
EFI_STATUS EFIAPI AmlGetResourceDataType (IN AML_DATA_NODE_HANDLE DataNode, OUT AML_RD_HEADER *ResourceDataType)
 
EFI_STATUS EFIAPI AmlGetDataNodeBuffer (IN AML_DATA_NODE_HANDLE DataNode, OUT UINT8 *Buffer OPTIONAL, IN OUT UINT32 *BufferSize)
 
EFI_STATUS EFIAPI AmlUpdateRootNode (IN AML_ROOT_NODE_HANDLE RootNode, IN CONST EFI_ACPI_DESCRIPTION_HEADER *SdtHeader)
 
EFI_STATUS EFIAPI AmlUpdateDataNode (IN AML_DATA_NODE_HANDLE DataNode, IN EAML_NODE_DATA_TYPE DataType, IN UINT8 *Buffer, IN UINT32 Size)
 

Detailed Description

Node Interface APIs allow to query information from a node. Some functions expect a specific node type among the root/object/data node types.

For instance, AmlGetRootNodeInfo expects to receive a root node.

E.g.: Query the node type, the ACPI header stored in the root node, the OpCode/SubOpCode/PkgLen of an object node, the type of data stored in a data node, etc.

These APIs also allow to update some information.

E.g.: The ACPI header stored in the root node, the buffer of a data node.

The information of object nodes and the data type of data nodes cannot be modified. This prevents the creation of an inconsistent tree.

It is however possible to remove a node from a variable list of arguments and replace it. Use the Tree modification APIs APIs for this.

Function Documentation

◆ AmlGetDataNodeBuffer()

EFI_STATUS EFIAPI AmlGetDataNodeBuffer ( IN AML_DATA_NODE_HANDLE  DataNode,
OUT UINT8 *Buffer  OPTIONAL,
IN OUT UINT32 *  BufferSize 
)

Get the data buffer and size of the DataNode. The Node must be a data node.

BufferSize is always updated to the size of buffer of the DataNode.

If:

  • the content of BufferSize is >= to the DataNode's buffer size;
  • Buffer is not NULL; then copy the content of the DataNode's buffer in Buffer.
Parameters
[in]DataNodePointer to a data node.
[out]BufferBuffer to write the data to. Optional, if NULL, only update BufferSize.
[in,out]BufferSizePointer holding:
  • At entry, the size of the Buffer;
  • At exit, the size of the DataNode's buffer size.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.

◆ AmlGetFixedArgumentCount()

UINT8 AmlGetFixedArgumentCount ( IN AML_OBJECT_NODE_HANDLE  Node)

Returns the count of the fixed arguments for the input Node.

Parameters
[in]NodePointer to an object node.
Returns
Number of fixed arguments of the object node. Return 0 if the node is not an object node.

◆ AmlGetNodeDataType()

EFI_STATUS EFIAPI AmlGetNodeDataType ( IN AML_DATA_NODE_HANDLE  DataNode,
OUT EAML_NODE_DATA_TYPE DataType 
)

Get the data type of the DataNode. The Node must be a data node.

Parameters
[in]DataNodePointer to a data node.
[out]DataTypePointer holding the data type of the data buffer.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.

◆ AmlGetNodeType()

EAML_NODE_TYPE EFIAPI AmlGetNodeType ( IN AML_NODE_HANDLE  Node)

Returns the tree node type (Root/Object/Data).

Parameters
[in]NodePointer to a Node.
Returns
The node type. EAmlNodeUnknown if invalid parameter.

◆ AmlGetObjectNodeInfo()

EFI_STATUS EFIAPI AmlGetObjectNodeInfo ( IN AML_OBJECT_NODE_HANDLE  ObjectNode,
OUT UINT8 *OpCode  OPTIONAL,
OUT UINT8 *SubOpCode  OPTIONAL,
OUT UINT32 *PkgLen  OPTIONAL,
OUT BOOLEAN *IsNameSpaceNode  OPTIONAL 
)

Get the ObjectNode information. The Node must be an object node.

Parameters
[in]ObjectNodePointer to an object node.
[out]OpCodePointer holding the OpCode. Optional, can be NULL.
[out]SubOpCodePointer holding the SubOpCode. Optional, can be NULL.
[out]PkgLenPointer holding the PkgLen. The PkgLen is 0 for nodes not having the Pkglen attribute. Optional, can be NULL.
[out]IsNameSpaceNodePointer holding TRUE if the node is defining or changing the NameSpace scope. E.g.: The "Name ()" and "Scope ()" ASL statements add/modify the NameSpace scope. Their corresponding node are NameSpace nodes. Optional, can be NULL.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.

◆ AmlGetResourceDataType()

EFI_STATUS EFIAPI AmlGetResourceDataType ( IN AML_DATA_NODE_HANDLE  DataNode,
OUT AML_RD_HEADER ResourceDataType 
)

Get the descriptor Id of the resource data element contained in the DataNode.

The Node must be a data node. The Node must have the resource data type, i.e. have the EAmlNodeDataTypeResourceData data type.

Parameters
[in]DataNodePointer to a data node containing a resource data element.
[out]ResourceDataTypePointer holding the descriptor Id of the resource data.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.

◆ AmlGetRootNodeInfo()

EFI_STATUS EFIAPI AmlGetRootNodeInfo ( IN AML_ROOT_NODE_HANDLE  RootNode,
OUT EFI_ACPI_DESCRIPTION_HEADER SdtHeaderBuffer 
)

Get the RootNode information. The Node must be a root node.

Parameters
[in]RootNodePointer to a root node.
[out]SdtHeaderBufferBuffer to copy the ACPI DSDT/SSDT header to.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.

◆ AmlUpdateDataNode()

EFI_STATUS EFIAPI AmlUpdateDataNode ( IN AML_DATA_NODE_HANDLE  DataNode,
IN EAML_NODE_DATA_TYPE  DataType,
IN UINT8 *  Buffer,
IN UINT32  Size 
)

Update the buffer of a data node.

Note: The data type of the buffer's content must match the data type of the DataNode. This is a hard restriction to prevent undesired behaviour.

Parameters
[in]DataNodePointer to a data node.
[in]DataTypeData type of the Buffer's content.
[in]BufferBuffer containing the new data. The content of the Buffer is copied.
[in]SizeSize of the Buffer.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_UNSUPPORTEDOperation not supporter.

◆ AmlUpdateRootNode()

EFI_STATUS EFIAPI AmlUpdateRootNode ( IN AML_ROOT_NODE_HANDLE  RootNode,
IN CONST EFI_ACPI_DESCRIPTION_HEADER SdtHeader 
)

Update the ACPI DSDT/SSDT table header.

The input SdtHeader information is copied to the tree RootNode. The table Length field is automatically updated. The checksum field is only updated when serializing the tree.

Parameters
[in]RootNodePointer to a root node.
[in]SdtHeaderPointer to an ACPI DSDT/SSDT table header.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.