|
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 CONST 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) |
|
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.
◆ AmlCloneTree()
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. |
◆ AmlDeleteTree()
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. |
◆ AmlDetachNode()
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. |
◆ AmlDeviceOpUpdateName()
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. |
Definition at line 41 of file AmlApi.c.
◆ AmlNameOpGetFirstRdNode()
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. |
Definition at line 259 of file AmlApi.c.
◆ AmlNameOpGetNextRdNode()
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. |
Definition at line 339 of file AmlApi.c.
◆ AmlNameOpUpdateInteger()
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. |
Definition at line 119 of file AmlApi.c.
◆ AmlNameOpUpdateString()
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. |
Definition at line 176 of file AmlApi.c.
◆ AmlParseDefinitionBlock()
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. |
◆ AmlSerializeDefinitionBlock()
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. |
◆ AmlUpdateRdInterrupt()
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. |
Definition at line 43 of file AmlResourceDataApi.c.
◆ AmlUpdateRdQWord()
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. |
Definition at line 254 of file AmlResourceDataApi.c.