]> git.proxmox.com Git - mirror_edk2.git/blob - DynamicTablesPkg/Library/Common/AmlLib/Api/AmlApiHelper.h
DynamicTablesPkg: AmlLib APIs
[mirror_edk2.git] / DynamicTablesPkg / Library / Common / AmlLib / Api / AmlApiHelper.h
1 /** @file
2 AML Helper.
3
4 Copyright (c) 2020, Arm Limited. All rights reserved.<BR>
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7 **/
8
9 #ifndef AML_HELPER_H_
10 #define AML_HELPER_H_
11
12 #include <AmlNodeDefines.h>
13 #include <ResourceData/AmlResourceData.h>
14
15 /** Compare the NameString defined by the "Name ()" ASL function,
16 and stored in the NameOpNode, with the input NameString.
17
18 An ASL NameString is expected to be NULL terminated, and can be composed
19 of NameSegs that have less that 4 chars, like "DEV". "DEV" will be expanded
20 as "DEV_".
21
22 An AML NameString is not NULL terminated and is is only composed of
23 4 chars long NameSegs.
24
25 @param [in] NameOpNode NameOp object node defining a variable.
26 Must have an AML_NAME_OP/0 OpCode/SubOpCode.
27 NameOp object nodes are defined in ASL
28 using the "Name ()" function.
29 @param [in] AslName ASL NameString to compare the NameOp's name with.
30 Must be NULL terminated.
31
32 @retval TRUE If the AslName and the AmlName defined by the NameOp node
33 are similar.
34 @retval FALSE Otherwise.
35 **/
36 BOOLEAN
37 EFIAPI
38 AmlNameOpCompareName (
39 IN AML_OBJECT_NODE_HANDLE NameOpNode,
40 IN CHAR8 * AslName
41 );
42
43 /** Check whether ObjectNode has the input OpCode/SubOpcode couple.
44
45 @param [in] ObjectNode Pointer to an object node.
46 @param [in] OpCode OpCode to check
47 @param [in] SubOpCode SubOpCode to check
48
49 @retval TRUE The node is an object node and
50 the Opcode and SubOpCode match.
51 @retval FALSE Otherwise.
52 **/
53 BOOLEAN
54 EFIAPI
55 AmlNodeHasOpCode (
56 IN AML_OBJECT_NODE_HANDLE ObjectNode,
57 IN UINT8 OpCode,
58 IN UINT8 SubOpCode
59 );
60
61 /** Check whether DataNode has the input DataType.
62
63 @param [in] DataNode Pointer to a data node.
64 @param [in] DataType DataType to check.
65
66 @retval TRUE The node is a data node and
67 the DataType match.
68 @retval FALSE Otherwise.
69 **/
70 BOOLEAN
71 EFIAPI
72 AmlNodeHasDataType (
73 IN AML_DATA_NODE_HANDLE DataNode,
74 IN EAML_NODE_DATA_TYPE DataType
75 );
76
77 /** Check whether RdNode has the input RdDataType.
78
79 @param [in] RdNode Pointer to a data node.
80 @param [in] RdDataType DataType to check.
81
82 @retval TRUE The node is a Resource Data node and
83 the RdDataType match.
84 @retval FALSE Otherwise.
85 **/
86 BOOLEAN
87 EFIAPI
88 AmlNodeHasRdDataType (
89 IN AML_DATA_NODE_HANDLE RdNode,
90 IN AML_RD_HEADER RdDataType
91 );
92
93 #endif // AML_HELPER_H_