TianoCore EDK2 master
Loading...
Searching...
No Matches
NameSpace APIs

Functions

EFI_STATUS EFIAPI AmlFindNode (IN AML_NODE_HANDLE ReferenceNode, IN CONST CHAR8 *AslPath, OUT AML_NODE_HANDLE *OutNode)
 
EFI_STATUS EFIAPI AmlGetAslPathName (IN AML_NODE_HANDLE Node, OUT CHAR8 *Buffer, IN OUT UINT32 *BufferSize)
 

Detailed Description

NameSpace APIs allow to find a node from an AML path, and reciprocally get the AML path of a node.

These APIs only operate on "NameSpace nodes", i.e. nodes that are part of the AML namespace. These are the root node and object nodes acknowledged by AmlGetObjectNodeInfo in Node Interface APIs.

Function Documentation

◆ AmlFindNode()

EFI_STATUS EFIAPI AmlFindNode ( IN AML_NODE_HANDLE  ReferenceNode,
IN CONST CHAR8 *  AslPath,
OUT AML_NODE_HANDLE OutNode 
)

Find a node in the AML namespace, given an ASL path and a reference Node.

  • The AslPath can be an absolute path, or a relative path from the reference Node;
  • Node must be a root node or a namespace node;
  • A root node is expected to be at the top of the tree.

E.g.: For the following AML namespace, with the ReferenceNode being the node with the name "AAAA":

  • the node with the name "BBBB" can be found by looking for the ASL path "BBBB";
  • the root node can be found by looking for the ASL relative path "^", or the absolute path "\\". AML namespace: \ \-AAAA <- ReferenceNode \-BBBB @param [in] ReferenceNode Reference node. If a relative path is given, the search is done from this node. If an absolute path is given, the search is done from the root node. Must be a root node or an object node which is part of the namespace. @param [in] AslPath ASL path to the searched node in the namespace. An ASL path name is NULL terminated. Can be a relative or absolute path. E.g.: "\_SB.CLU0.CPU0" or "^CPU0"
    Parameters
    [out]OutNodePointer to the found node. Contains NULL if not found.
    Return values
    EFI_SUCCESSThe function completed successfully.
    EFI_BUFFER_TOO_SMALLNo space left in the buffer.
    EFI_INVALID_PARAMETERInvalid parameter.
    EFI_OUT_OF_RESOURCESOut of memory.

◆ AmlGetAslPathName()

EFI_STATUS EFIAPI AmlGetAslPathName ( IN AML_NODE_HANDLE  Node,
OUT CHAR8 *  Buffer,
IN OUT UINT32 *  BufferSize 
)

Build the absolute ASL pathname to Node.

BufferSize is always updated to the size of the pathname.

If:

  • the content of BufferSize is >= to the size of the pathname AND;
  • Buffer is not NULL; then copy the pathname in the Buffer. A buffer of the size MAX_ASL_NAMESTRING_SIZE is big enough to receive any ASL pathname.
Parameters
[in]NodeNode to build the absolute path to. Must be a root node, or a namespace node.
[out]BufferBuffer to write the path to. If NULL, only update *BufferSize.
[in,out]BufferSizePointer holding:
  • At entry, the size of the Buffer;
  • At exit, the size of the pathname.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_BUFFER_TOO_SMALLNo space left in the buffer.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESOut of memory.