TianoCore EDK2 master
Loading...
Searching...
No Matches
AmlNode.h File Reference

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI AmlCreateRootNode (IN CONST EFI_ACPI_DESCRIPTION_HEADER *SdtHeader, OUT AML_ROOT_NODE **NewRootNodePtr)
 
EFI_STATUS EFIAPI AmlCreateObjectNode (IN CONST AML_BYTE_ENCODING *AmlByteEncoding, IN UINT32 PkgLength, OUT AML_OBJECT_NODE **NewObjectNodePtr)
 
EFI_STATUS EFIAPI AmlCreateDataNode (IN EAML_NODE_DATA_TYPE DataType, IN CONST UINT8 *Data, IN UINT32 DataSize, OUT AML_DATA_NODE **NewDataNodePtr)
 
EFI_STATUS EFIAPI AmlDeleteNode (IN AML_NODE_HEADER *Node)
 
BOOLEAN EFIAPI AmlNodeHasAttribute (IN CONST AML_OBJECT_NODE *ObjectNode, IN AML_OP_ATTRIBUTE Attribute)
 
BOOLEAN EFIAPI AmlNodeCompareOpCode (IN CONST AML_OBJECT_NODE *ObjectNode, IN UINT8 OpCode, IN UINT8 SubOpCode)
 
BOOLEAN EFIAPI IsIntegerNode (IN AML_OBJECT_NODE *Node)
 
BOOLEAN EFIAPI IsSpecialIntegerNode (IN AML_OBJECT_NODE *Node)
 
BOOLEAN EFIAPI AmlIsMethodDefinitionNode (IN CONST AML_OBJECT_NODE *Node)
 
EFI_STATUS AmlNodeGetNameIndex (IN CONST AML_OBJECT_NODE *ObjectNode, OUT EAML_PARSE_INDEX *Index)
 
CHAR8 *EFIAPI AmlNodeGetName (IN CONST AML_OBJECT_NODE *ObjectNode)
 

Detailed Description

AML Node.

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

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

Definition in file AmlNode.h.

Function Documentation

◆ AmlCreateDataNode()

EFI_STATUS EFIAPI AmlCreateDataNode ( IN EAML_NODE_DATA_TYPE  DataType,
IN CONST UINT8 *  Data,
IN UINT32  DataSize,
OUT AML_DATA_NODE **  NewDataNodePtr 
)

Create an AML_DATA_NODE.

Parameters
[in]DataTypeDataType of the node.
[in]DataPointer to the AML bytecode corresponding to this node. Data is copied from there.
[in]DataSizeNumber of bytes to consider at the address pointed by Data.
[out]NewDataNodePtrIf success, contains the created AML_DATA_NODE. Otherwise reset to NULL.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESCould not allocate memory.

Definition at line 275 of file AmlNode.c.

◆ AmlCreateObjectNode()

EFI_STATUS EFIAPI AmlCreateObjectNode ( IN CONST AML_BYTE_ENCODING AmlByteEncoding,
IN UINT32  PkgLength,
OUT AML_OBJECT_NODE **  NewObjectNodePtr 
)

Create an AML_OBJECT_NODE.

Parameters
[in]AmlByteEncodingByte encoding entry.
[in]PkgLengthPkgLength of the node if the AmlByteEncoding has the PkgLen attribute. 0 otherwise.
[out]NewObjectNodePtrIf success, contains the created AML_OBJECT_NODE. Otherwise reset to NULL.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESCould not allocate memory.

Definition at line 181 of file AmlNode.c.

◆ AmlCreateRootNode()

EFI_STATUS EFIAPI AmlCreateRootNode ( IN CONST EFI_ACPI_DESCRIPTION_HEADER SdtHeader,
OUT AML_ROOT_NODE **  NewRootNodePtr 
)

Create an AML_ROOT_NODE. This node will be the root of the tree.

Parameters
[in]SdtHeaderPointer to an ACPI DSDT/SSDT header to copy the data from.
[out]NewRootNodePtrIf success, contains the created AML_ROOT_NODE. Otherwise reset to NULL.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESCould not allocate memory.

Definition at line 92 of file AmlNode.c.

◆ AmlDeleteNode()

EFI_STATUS EFIAPI AmlDeleteNode ( IN AML_NODE_HEADER Node)

Delete a Node.

Parameters
[in]NodePointer to a Node.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 339 of file AmlNode.c.

◆ AmlIsMethodDefinitionNode()

BOOLEAN EFIAPI AmlIsMethodDefinitionNode ( IN CONST AML_OBJECT_NODE Node)

Check whether Node corresponds to a method definition.

A method definition can be introduced:

  • By a method object, having an AML_METHOD_OP OpCode;
  • By an external definition of a method, having an AML_EXTERNAL_OP OpCode and an ObjectType byte set to the MethodObj.

Note: An alias node, having an AML_ALIAS_OP, can be resolved to a method definition. This function doesn't handle this case.

Parameters
[in]NodeNode to check whether it is a method definition.
Return values
TRUEThe Node is a method definition.
FALSEOtherwise.

Definition at line 570 of file AmlNode.c.

◆ AmlNodeCompareOpCode()

BOOLEAN EFIAPI AmlNodeCompareOpCode ( IN CONST AML_OBJECT_NODE ObjectNode,
IN UINT8  OpCode,
IN UINT8  SubOpCode 
)

Check whether ObjectNode has the input OpCode/SubOpcode couple.

Parameters
[in]ObjectNodePointer to an object node.
[in]OpCodeOpCode to check
[in]SubOpCodeSubOpCode to check
Return values
TRUEThe node is an AML object and the Opcode and the SubOpCode match.
FALSEOtherwise.

Definition at line 457 of file AmlNode.c.

◆ AmlNodeGetName()

CHAR8 *EFIAPI AmlNodeGetName ( IN CONST AML_OBJECT_NODE ObjectNode)

Get the name of the Node.

Node must be part of the namespace.

Parameters
[in]ObjectNodePointer to an object node, which is part of the namespace.
Returns
A pointer to the name. NULL otherwise. Return NULL for the root node.

Definition at line 663 of file AmlNode.c.

◆ AmlNodeGetNameIndex()

EFI_STATUS AmlNodeGetNameIndex ( IN CONST AML_OBJECT_NODE ObjectNode,
OUT EAML_PARSE_INDEX Index 
)

Get the index at which the name of the node is stored.

Parameters
[in]ObjectNodePointer to an object node. Must have the AML_IN_NAMESPACE attribute.
[out]IndexIndex of the name in the fixed list of arguments.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 621 of file AmlNode.c.

◆ AmlNodeHasAttribute()

BOOLEAN EFIAPI AmlNodeHasAttribute ( IN CONST AML_OBJECT_NODE ObjectNode,
IN AML_OP_ATTRIBUTE  Attribute 
)

Check whether ObjectNode has the input attribute. This function can be used to check ObjectNode is an object node at the same time.

Parameters
[in]ObjectNodePointer to an object node.
[in]AttributeAttribute to check for.
Return values
TRUEThe node is an AML object and the attribute is present.
FALSEOtherwise.

Definition at line 430 of file AmlNode.c.

◆ IsIntegerNode()

BOOLEAN EFIAPI IsIntegerNode ( IN AML_OBJECT_NODE Node)

Check whether a Node is an integer node.

By integer node we mean an object node having one of the following opcode:

  • AML_BYTE_PREFIX;
  • AML_WORD_PREFIX;
  • AML_DWORD_PREFIX;
  • AML_QWORD_PREFIX.
Parameters
[in]NodeThe node to check.
Return values
TRUEThe Node is an integer node.
FALSEOtherwise.

Definition at line 491 of file AmlNode.c.

◆ IsSpecialIntegerNode()

BOOLEAN EFIAPI IsSpecialIntegerNode ( IN AML_OBJECT_NODE Node)

Check whether a Node is a ZeroOp, a OneOp or a OnesOp.

These two objects don't have a data node holding a value. This require special handling.

Parameters
[in]NodeThe node to check.
Return values
TRUEThe Node is a ZeroOp or OneOp.
FALSEOtherwise.

Definition at line 528 of file AmlNode.c.