]> git.proxmox.com Git - mirror_edk2.git/blob - DynamicTablesPkg/Library/Common/AmlLib/Parser/AmlResourceDataParser.h
13dfb352c416ff2be86d28dc5020529c9442fa2a
[mirror_edk2.git] / DynamicTablesPkg / Library / Common / AmlLib / Parser / AmlResourceDataParser.h
1 /** @file
2 AML Resource Data Parser.
3
4 Copyright (c) 2019 - 2020, Arm Limited. All rights reserved.<BR>
5
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 @par Glossary:
9 - Rd or RD - Resource Data
10 - Rds or RDS - Resource Data Small
11 - Rdl or RDL - Resource Data Large
12 **/
13
14 #ifndef AML_RESOURCE_DATA_PARSER_H_
15 #define AML_RESOURCE_DATA_PARSER_H_
16
17 #include <AmlNodeDefines.h>
18 #include <Stream/AmlStream.h>
19 #include <ResourceData/AmlResourceData.h>
20
21 /** Check whether the input stream is pointing to a valid list
22 of resource data elements.
23
24 The check is based on the size of resource data elements.
25 This means that a buffer can pass this check with non-existing descriptor Ids
26 that have a correct size.
27
28 A list of resource data elements can contain one unique resource data
29 element, without an end tag resource data. This is the case for
30 a FieldList.
31
32 @param [in] FStream Forward stream ideally pointing to a resource
33 data element. The stream is not
34 modified/progressing.
35 The stream must not be at its end.
36
37 @retval TRUE The buffer is holding a valid list of resource data elements.
38 @retval FALSE Otherwise.
39 **/
40 BOOLEAN
41 EFIAPI
42 AmlRdIsResourceDataBuffer (
43 IN CONST AML_STREAM * FStream
44 );
45
46 /** Parse a ResourceDataBuffer.
47
48 For each resource data element, create a data node
49 and add them to the variable list of arguments of the BufferNode.
50
51 The input stream is expected to point to a valid list of resource data
52 elements. A function is available to check it for the caller.
53
54 @param [in] BufferNode Buffer node.
55 @param [in] FStream Forward stream pointing to a resource data
56 element.
57 The stream must not be at its end.
58
59 @retval EFI_SUCCESS The function completed successfully.
60 @retval EFI_INVALID_PARAMETER Invalid parameter.
61 @retval EFI_OUT_OF_RESOURCES Could not allocate memory.
62 **/
63 EFI_STATUS
64 EFIAPI
65 AmlParseResourceData (
66 IN AML_OBJECT_NODE * BufferNode,
67 IN AML_STREAM * FStream
68 );
69
70 #endif // AML_RESOURCE_DATA_PARSER_H_
71