]> git.proxmox.com Git - mirror_edk2.git/blob - DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerObjectParser.h
DynamicTablesPkg: Apply uncrustify changes
[mirror_edk2.git] / DynamicTablesPkg / Library / Common / TableHelperLib / ConfigurationManagerObjectParser.h
1 /** @file
2 Configuration Manager Object parser.
3
4 Copyright (c) 2021, ARM Limited. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef CONFIGURATION_MANAGER_OBJECT_PARSER_H_
10 #define CONFIGURATION_MANAGER_OBJECT_PARSER_H_
11
12 #define OUTPUT_FIELD_COLUMN_WIDTH 32
13
14 /** Function prototype to format a field print.
15
16 @param [in] Format Format string for tracing the data as specified by
17 the 'Format' member of ACPI_PARSER.
18 @param [in] Ptr Pointer to the start of the buffer.
19 **/
20 typedef VOID (EFIAPI *FNPTR_PRINT_FORMATTER)(CONST CHAR8 *Format, UINT8 *Ptr);
21
22 /**
23 The CM_OBJ_PARSER structure describes the fields of an CmObject and
24 provides means for the parser to interpret and trace appropriately.
25
26 ParseAcpi() uses the format string specified by 'Format' for tracing
27 the field data.
28 */
29 typedef struct CmObjParser CM_OBJ_PARSER;
30 struct CmObjParser {
31 /// String describing the Cm Object
32 CONST CHAR8 *NameStr;
33
34 /// The length of the field.
35 UINT32 Length;
36
37 /// Optional Print() style format string for tracing the data. If not
38 /// used this must be set to NULL.
39 CONST CHAR8 *Format;
40
41 /// Optional pointer to a print formatter function which
42 /// is typically used to trace complex field information.
43 /// If not used this must be set to NULL.
44 /// The Format string is passed to the PrintFormatter function
45 /// but may be ignored by the implementation code.
46 FNPTR_PRINT_FORMATTER PrintFormatter;
47
48 /// Optional pointer to print the fields of another CM_OBJ_PARSER
49 /// structure. This is useful to print sub-structures.
50 CONST CM_OBJ_PARSER *SubObjParser;
51
52 /// Count of items in the SubObj.
53 UINTN SubObjItemCount;
54 };
55
56 /**
57 A structure mapping an array of Configuration Manager Object parsers
58 with their object names.
59 */
60 typedef struct CmObjParserArray {
61 /// Object name
62 CONST CHAR8 *ObjectName;
63
64 /// Function pointer to the parser
65 CONST CM_OBJ_PARSER *Parser;
66
67 /// Count of items
68 UINTN ItemCount;
69 } CM_OBJ_PARSER_ARRAY;
70
71 #endif // CONFIGURATION_MANAGER_OBJECT_PARSER_H_