]> git.proxmox.com Git - mirror_edk2.git/blob - DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlParser.h
096a9596e161848bf5786f87a736946aee69d4e3
[mirror_edk2.git] / DynamicTablesPkg / Library / Common / AmlLib / Parser / AmlParser.h
1 /** @file
2 AML Parser.
3
4 Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7 **/
8
9 #ifndef AML_PARSER_H_
10 #define AML_PARSER_H_
11
12 #include <AmlNodeDefines.h>
13 #include <Stream/AmlStream.h>
14
15 /** Parse the list of fixed arguments of the input ObjectNode.
16
17 For each argument, create a node and add it to the fixed argument list
18 of the Node.
19 If a fixed argument has children, parse them.
20
21 @param [in] ObjectNode Object node to parse the fixed arguments
22 from.
23 @param [in] FStream Forward stream containing the AML
24 bytecode to parse.
25 The stream must not be at its end.
26 @param [in] NameSpaceRefList List of namespace reference nodes.
27
28 @retval EFI_SUCCESS The function completed successfully.
29 @retval EFI_BUFFER_TOO_SMALL No space left in the buffer.
30 @retval EFI_INVALID_PARAMETER Invalid parameter.
31 @retval EFI_OUT_OF_RESOURCES Could not allocate memory.
32 **/
33 EFI_STATUS
34 EFIAPI
35 AmlParseFixedArguments (
36 IN AML_OBJECT_NODE * ObjectNode,
37 IN AML_STREAM * FStream,
38 IN LIST_ENTRY * NameSpaceRefList
39 );
40
41 /** Parse the variable list of arguments of the input ObjectNode.
42
43 For each variable argument, create a node and add it to the variable list of
44 arguments of the Node.
45 If a variable argument has children, parse them recursively.
46
47 The arguments of method invocation nodes are added to the variable list of
48 arguments of the method invocation node. It is necessary to first get
49 the number of arguments to parse for this kind of node. A method invocation
50 can have at most 7 fixed arguments.
51
52 @param [in] Node Node to parse the variable arguments
53 from.
54 @param [in] FStream Forward stream containing the AML
55 bytecode to parse.
56 The stream must not be at its end.
57 @param [in] NameSpaceRefList List of namespace reference nodes.
58
59 @retval EFI_SUCCESS The function completed successfully.
60 @retval EFI_BUFFER_TOO_SMALL No space left in the buffer.
61 @retval EFI_INVALID_PARAMETER Invalid parameter.
62 @retval EFI_OUT_OF_RESOURCES Could not allocate memory.
63 **/
64 EFI_STATUS
65 EFIAPI
66 AmlParseVariableArguments (
67 IN AML_NODE_HEADER * Node,
68 IN AML_STREAM * FStream,
69 IN LIST_ENTRY * NameSpaceRefList
70 );
71
72 #endif // AML_PARSER_H_