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