DynamicTablesPkg: AmlLib APIs
AmlLib library implements an AML parser, AML tree interface, serialiser, code generator and other interfaces to generate Definition Block tables. The AmlLib APIs are a collection of interfaces that enable parsing, iterating, modifying, adding, and serialising AML data to generate a Definition Block table. The AmlLib APIs are declared in Include\AmlLib\AmlLib.h Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
This commit is contained in:
committed by
mergify[bot]
parent
3196253710
commit
c85ac5245c
93
DynamicTablesPkg/Library/Common/AmlLib/Api/AmlApiHelper.h
Normal file
93
DynamicTablesPkg/Library/Common/AmlLib/Api/AmlApiHelper.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/** @file
|
||||
AML Helper.
|
||||
|
||||
Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
**/
|
||||
|
||||
#ifndef AML_HELPER_H_
|
||||
#define AML_HELPER_H_
|
||||
|
||||
#include <AmlNodeDefines.h>
|
||||
#include <ResourceData/AmlResourceData.h>
|
||||
|
||||
/** Compare the NameString defined by the "Name ()" ASL function,
|
||||
and stored in the NameOpNode, with the input NameString.
|
||||
|
||||
An ASL NameString is expected to be NULL terminated, and can be composed
|
||||
of NameSegs that have less that 4 chars, like "DEV". "DEV" will be expanded
|
||||
as "DEV_".
|
||||
|
||||
An AML NameString is not NULL terminated and is is only composed of
|
||||
4 chars long NameSegs.
|
||||
|
||||
@param [in] NameOpNode NameOp object node defining a variable.
|
||||
Must have an AML_NAME_OP/0 OpCode/SubOpCode.
|
||||
NameOp object nodes are defined in ASL
|
||||
using the "Name ()" function.
|
||||
@param [in] AslName ASL NameString to compare the NameOp's name with.
|
||||
Must be NULL terminated.
|
||||
|
||||
@retval TRUE If the AslName and the AmlName defined by the NameOp node
|
||||
are similar.
|
||||
@retval FALSE Otherwise.
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
AmlNameOpCompareName (
|
||||
IN AML_OBJECT_NODE_HANDLE NameOpNode,
|
||||
IN CHAR8 * AslName
|
||||
);
|
||||
|
||||
/** Check whether ObjectNode has the input OpCode/SubOpcode couple.
|
||||
|
||||
@param [in] ObjectNode Pointer to an object node.
|
||||
@param [in] OpCode OpCode to check
|
||||
@param [in] SubOpCode SubOpCode to check
|
||||
|
||||
@retval TRUE The node is an object node and
|
||||
the Opcode and SubOpCode match.
|
||||
@retval FALSE Otherwise.
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
AmlNodeHasOpCode (
|
||||
IN AML_OBJECT_NODE_HANDLE ObjectNode,
|
||||
IN UINT8 OpCode,
|
||||
IN UINT8 SubOpCode
|
||||
);
|
||||
|
||||
/** Check whether DataNode has the input DataType.
|
||||
|
||||
@param [in] DataNode Pointer to a data node.
|
||||
@param [in] DataType DataType to check.
|
||||
|
||||
@retval TRUE The node is a data node and
|
||||
the DataType match.
|
||||
@retval FALSE Otherwise.
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
AmlNodeHasDataType (
|
||||
IN AML_DATA_NODE_HANDLE DataNode,
|
||||
IN EAML_NODE_DATA_TYPE DataType
|
||||
);
|
||||
|
||||
/** Check whether RdNode has the input RdDataType.
|
||||
|
||||
@param [in] RdNode Pointer to a data node.
|
||||
@param [in] RdDataType DataType to check.
|
||||
|
||||
@retval TRUE The node is a Resource Data node and
|
||||
the RdDataType match.
|
||||
@retval FALSE Otherwise.
|
||||
**/
|
||||
BOOLEAN
|
||||
EFIAPI
|
||||
AmlNodeHasRdDataType (
|
||||
IN AML_DATA_NODE_HANDLE RdNode,
|
||||
IN AML_RD_HEADER RdDataType
|
||||
);
|
||||
|
||||
#endif // AML_HELPER_H_
|
Reference in New Issue
Block a user