|
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 | AmlDeviceOpUpdateName (IN AML_OBJECT_NODE_HANDLE DeviceOpNode, IN 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 | AmlNameOpCrsGetFirstRdNode (IN AML_OBJECT_NODE_HANDLE NameOpCrsNode, OUT AML_DATA_NODE_HANDLE *OutRdNode) |
|
EFI_STATUS EFIAPI | AmlNameOpCrsGetNextRdNode (IN AML_DATA_NODE_HANDLE CurrRdNode, OUT AML_DATA_NODE_HANDLE *OutRdNode) |
|
User APIs are implemented to ease most common actions that might be done using the AmlLib. They allow to find specific objects like "_UID" or "_CRS" and to update their value. It also shows what can be done using AmlLib functions.
Clone a node and its children (clone a tree branch).
The cloned branch returned is not attached to any tree.
- Parameters
-
[in] | Node | Pointer to a node. Node is the head of the branch to clone. |
[out] | ClonedNode | Pointer holding the head of the created cloned branch. |
- Return values
-
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_OUT_OF_RESOURCES | Could not allocate memory. |
Delete a Node and its children.
The Node must be removed from the tree first, or must be the root node.
- Parameters
-
[in] | Node | Pointer to the node to delete. |
- Return values
-
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
Detach the Node from the tree.
The function will fail if the Node is in its parent's fixed argument list. The Node is not deleted. The deletion is done separately from the removal.
- Parameters
-
[in] | Node | Pointer to a Node. Must be a data node or an object node. |
- Return values
-
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
Update the name of a DeviceOp object node.
- Parameters
-
[in] | DeviceOpNode | Object node representing a Device. Must have an OpCode=AML_NAME_OP, SubOpCode=0. OpCode/SubOpCode. DeviceOp object nodes are defined in ASL using the "Device ()" function. |
[in] | NewNameString | The new Device's name. Must be a NULL-terminated ASL NameString e.g.: "DEV0", "DV15.DEV0", etc. The input string is copied. |
- Return values
-
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
DEPRECATED API
Get the first Resource Data element contained in a "_CRS" object.
In the following ASL code, the function will return the Resource Data node corresponding to the "QWordMemory ()" ASL macro. Name (_CRS, ResourceTemplate() { QWordMemory (...) {...}, Interrupt (...) {...} } )
Note:
- The "_CRS" object must be declared using ASL "Name (Declare Named Object)".
- "_CRS" declared using ASL "Method (Declare Control Method)" is not supported.
- Parameters
-
[in] | NameOpCrsNode | NameOp object node defining a "_CRS" object. Must have an OpCode=AML_NAME_OP, SubOpCode=0. NameOp object nodes are defined in ASL using the "Name ()" function. |
[out] | OutRdNode | Pointer to the first Resource Data element of the "_CRS" object. A Resource Data element is stored in a data node. |
- Return values
-
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
DEPRECATED API
Get the Resource Data element following the CurrRdNode Resource Data.
In the following ASL code, if CurrRdNode corresponds to the first "QWordMemory ()" ASL macro, the function will return the Resource Data node corresponding to the "Interrupt ()" ASL macro. Name (_CRS, ResourceTemplate() { QwordMemory (...) {...}, Interrupt (...) {...} } )
The CurrRdNode Resource Data node must be defined in an object named "_CRS" and defined by a "Name ()" ASL function.
- Parameters
-
[in] | CurrRdNode | Pointer to the current Resource Data element of the "_CRS" variable. |
[out] | OutRdNode | Pointer to the Resource Data element following the CurrRdNode. Contain a NULL pointer if CurrRdNode is the last Resource Data element in the list. The "End Tag" is not considered as a resource data element and is not returned. |
- Return values
-
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
Get the first Resource Data element contained in a named object.
In the following ASL code, the function will return the Resource Data node corresponding to the "QWordMemory ()" ASL macro. Name (_CRS, ResourceTemplate() { QWordMemory (...) {...}, Interrupt (...) {...} } )
Note: "_CRS" names defined as methods are not handled by this function. They must be defined as names, using the "Name ()" statement.
- Parameters
-
[in] | NameOpNode | NameOp object node defining a named object. Must have an OpCode=AML_NAME_OP, SubOpCode=0. NameOp object nodes are defined in ASL using the "Name ()" function. |
[out] | OutRdNode | Pointer to the first Resource Data element of the named object. A Resource Data element is stored in a data node. |
- Return values
-
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
Get the Resource Data element following the CurrRdNode Resource Data.
In the following ASL code, if CurrRdNode corresponds to the first "QWordMemory ()" ASL macro, the function will return the Resource Data node corresponding to the "Interrupt ()" ASL macro. Name (_CRS, ResourceTemplate() { QwordMemory (...) {...}, Interrupt (...) {...} } )
Note: "_CRS" names defined as methods are not handled by this function. They must be defined as names, using the "Name ()" statement.
- Parameters
-
[in] | CurrRdNode | Pointer to the current Resource Data element of the named object. |
[out] | OutRdNode | Pointer to the Resource Data element following the CurrRdNode. Contain a NULL pointer if CurrRdNode is the last Resource Data element in the list. The "End Tag" is not considered as a resource data element and is not returned. |
- Return values
-
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
Update an integer value defined by a NameOp object node.
For compatibility reasons, the NameOpNode must initially contain an integer.
- Parameters
-
[in] | NameOpNode | NameOp object node. Must have an OpCode=AML_NAME_OP, SubOpCode=0. NameOp object nodes are defined in ASL using the "Name ()" function. |
[in] | NewInt | New Integer value to assign. Must be a UINT64. |
- Return values
-
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
Update a string value defined by a NameOp object node.
The NameOpNode must initially contain a string. The EISAID ASL macro converts a string to an integer. This, it is not accepted.
- Parameters
-
[in] | NameOpNode | NameOp object node. Must have an OpCode=AML_NAME_OP, SubOpCode=0. NameOp object nodes are defined in ASL using the "Name ()" function. |
[in] | NewName | New NULL terminated string to assign to the NameOpNode. The input string is copied. |
- Return values
-
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
Parse the definition block.
The function parses the whole AML blob. It starts with the ACPI DSDT/SSDT header and then parses the AML bytestream. A tree structure is returned via the RootPtr. The tree must be deleted with the AmlDeleteTree function.
- Parameters
-
[in] | DefinitionBlock | Pointer to the definition block. |
[out] | RootPtr | Pointer to the root node of the AML tree. |
- Return values
-
EFI_SUCCESS | The function completed successfully. |
EFI_BUFFER_TOO_SMALL | No space left in the buffer. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_OUT_OF_RESOURCES | Could not allocate memory. |
Serialize an AML definition block.
This functions allocates memory with the "AllocateZeroPool ()" function. This memory is used to serialize the AML tree and is returned in the Table.
- Parameters
-
[in] | RootNode | Root node of the tree. |
[out] | Table | On return, hold the serialized definition block. |
- Return values
-
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_OUT_OF_RESOURCES | Could not allocate memory. |
Update the first interrupt of an Interrupt resource data node.
The flags of the Interrupt resource data are left unchanged.
The InterruptRdNode corresponds to the Resource Data created by the "Interrupt ()" ASL macro. It is an Extended Interrupt Resource Data. See ACPI 6.3 specification, s6.4.3.6 "Extended Interrupt Descriptor" for more information about Extended Interrupt Resource Data.
- Parameters
-
[in] | InterruptRdNode | Pointer to the an extended interrupt resource data node. |
[in] | Irq | Interrupt value to update. |
- Return values
-
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_OUT_OF_RESOURCES | Out of resources. |
Update the base address and length of a QWord resource data node.
- Parameters
-
[in] | QWordRdNode | Pointer a QWord resource data node. |
[in] | BaseAddress | Base address. |
[in] | BaseAddressLength | Base address length. |
- Return values
-
EFI_SUCCESS | The function completed successfully. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_OUT_OF_RESOURCES | Out of resources. |