TianoCore EDK2 master
Loading...
Searching...
No Matches
AmlNodeInterface.c File Reference

Go to the source code of this file.

Functions

EAML_NODE_TYPE EFIAPI AmlGetNodeType (IN AML_NODE_HEADER *Node)
 
EFI_STATUS EFIAPI AmlGetRootNodeInfo (IN AML_ROOT_NODE *RootNode, OUT EFI_ACPI_DESCRIPTION_HEADER *SdtHeaderBuffer)
 
EFI_STATUS EFIAPI AmlGetObjectNodeInfo (IN AML_OBJECT_NODE *ObjectNode, OUT UINT8 *OpCode OPTIONAL, OUT UINT8 *SubOpCode OPTIONAL, OUT UINT32 *PkgLen OPTIONAL, OUT BOOLEAN *IsNameSpaceNode OPTIONAL)
 
UINT8 AmlGetFixedArgumentCount (IN AML_OBJECT_NODE *Node)
 
EFI_STATUS EFIAPI AmlGetNodeDataType (IN AML_DATA_NODE *DataNode, OUT EAML_NODE_DATA_TYPE *DataType)
 
EFI_STATUS EFIAPI AmlGetResourceDataType (IN AML_DATA_NODE *DataNode, OUT AML_RD_HEADER *ResourceDataType)
 
EFI_STATUS EFIAPI AmlGetDataNodeBuffer (IN AML_DATA_NODE *DataNode, OUT UINT8 *Buffer OPTIONAL, IN OUT UINT32 *BufferSize)
 
EFI_STATUS EFIAPI AmlUpdateRootNode (IN AML_ROOT_NODE *RootNode, IN CONST EFI_ACPI_DESCRIPTION_HEADER *SdtHeader)
 
EFI_STATUS EFIAPI AmlUpdateInteger (IN AML_OBJECT_NODE *IntegerOpNode, IN UINT64 NewInteger)
 
EFI_STATUS EFIAPI AmlUpdateDataNode (IN AML_DATA_NODE *DataNode, IN EAML_NODE_DATA_TYPE DataType, IN UINT8 *Buffer, IN UINT32 Size)
 

Detailed Description

AML Node Interface.

Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.

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

Definition in file AmlNodeInterface.c.

Function Documentation

◆ AmlGetDataNodeBuffer()

EFI_STATUS EFIAPI AmlGetDataNodeBuffer ( IN AML_DATA_NODE 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.

Definition at line 236 of file AmlNodeInterface.c.

◆ AmlGetFixedArgumentCount()

UINT8 AmlGetFixedArgumentCount ( IN AML_OBJECT_NODE 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.

Definition at line 137 of file AmlNodeInterface.c.

◆ AmlGetNodeDataType()

EFI_STATUS EFIAPI AmlGetNodeDataType ( IN AML_DATA_NODE 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.

Definition at line 161 of file AmlNodeInterface.c.

◆ AmlGetNodeType()

EAML_NODE_TYPE EFIAPI AmlGetNodeType ( IN AML_NODE_HEADER Node)

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

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

Definition at line 27 of file AmlNodeInterface.c.

◆ AmlGetObjectNodeInfo()

EFI_STATUS EFIAPI AmlGetObjectNodeInfo ( IN AML_OBJECT_NODE 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.

Definition at line 97 of file AmlNodeInterface.c.

◆ AmlGetResourceDataType()

EFI_STATUS EFIAPI AmlGetResourceDataType ( IN AML_DATA_NODE 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.

Definition at line 195 of file AmlNodeInterface.c.

◆ AmlGetRootNodeInfo()

EFI_STATUS EFIAPI AmlGetRootNodeInfo ( IN AML_ROOT_NODE 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.

Definition at line 50 of file AmlNodeInterface.c.

◆ AmlUpdateDataNode()

EFI_STATUS EFIAPI AmlUpdateDataNode ( IN AML_DATA_NODE 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.

Definition at line 393 of file AmlNodeInterface.c.

◆ AmlUpdateInteger()

EFI_STATUS EFIAPI AmlUpdateInteger ( IN AML_OBJECT_NODE IntegerOpNode,
IN UINT64  NewInteger 
)

Update an object node representing an integer with a new value.

The object node must have one of the following OpCodes:

  • AML_BYTE_PREFIX
  • AML_WORD_PREFIX
  • AML_DWORD_PREFIX
  • AML_QWORD_PREFIX
  • AML_ZERO_OP
  • AML_ONE_OP

The following OpCode is not supported:

  • AML_ONES_OP
Parameters
[in]IntegerOpNodePointer an object node containing an integer. Must not be an object node with an AML_ONES_OP OpCode.
[in]NewIntegerNew integer value to set.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 335 of file AmlNodeInterface.c.

◆ AmlUpdateRootNode()

EFI_STATUS EFIAPI AmlUpdateRootNode ( IN AML_ROOT_NODE 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.

Definition at line 274 of file AmlNodeInterface.c.