]> git.proxmox.com Git - mirror_edk2.git/blob - ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.h
ShellPkg: Display VENDOR_ID in ASCII when parsing PPTT
[mirror_edk2.git] / ShellPkg / Library / UefiShellAcpiViewCommandLib / AcpiTableParser.h
1 /** @file
2 Header file for ACPI table parser
3
4 Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6 **/
7
8 #ifndef ACPITABLEPARSER_H_
9 #define ACPITABLEPARSER_H_
10
11 /**
12 The maximum number of ACPI table parsers.
13 */
14 #define MAX_ACPI_TABLE_PARSERS 16
15
16 /** An invalid/NULL signature value.
17 */
18 #define ACPI_PARSER_SIGNATURE_NULL 0
19
20 /**
21 A function that parses the ACPI table.
22
23 @param [in] Trace If TRUE, trace the ACPI fields.
24 @param [in] Ptr Pointer to the start of the buffer.
25 @param [in] AcpiTableLength Length of the ACPI table.
26 @param [in] AcpiTableRevision Revision of the ACPI table.
27 **/
28 typedef
29 VOID
30 (EFIAPI * PARSE_ACPI_TABLE_PROC) (
31 IN BOOLEAN Trace,
32 IN UINT8* Ptr,
33 IN UINT32 AcpiTableLength,
34 IN UINT8 AcpiTableRevision
35 );
36
37 /**
38 The ACPI table parser information
39 **/
40 typedef struct AcpiTableParser {
41 /// ACPI table signature
42 UINT32 Signature;
43
44 /// The ACPI table parser function.
45 PARSE_ACPI_TABLE_PROC Parser;
46 } ACPI_TABLE_PARSER;
47
48 /**
49 Register the ACPI table Parser
50
51 This function registers the ACPI table parser.
52
53 @param [in] Signature The ACPI table signature.
54 @param [in] ParserProc The ACPI table parser.
55
56 @retval EFI_SUCCESS The parser is registered.
57 @retval EFI_INVALID_PARAMETER A parameter is invalid.
58 @retval EFI_ALREADY_STARTED The parser for the Table
59 was already registered.
60 @retval EFI_OUT_OF_RESOURCES No space to register the
61 parser.
62 **/
63 EFI_STATUS
64 EFIAPI
65 RegisterParser (
66 IN UINT32 Signature,
67 IN PARSE_ACPI_TABLE_PROC ParserProc
68 );
69
70 /**
71 Deregister the ACPI table Parser
72
73 This function deregisters the ACPI table parser.
74
75 @param [in] Signature The ACPI table signature.
76
77 @retval EFI_SUCCESS The parser was deregistered.
78 @retval EFI_INVALID_PARAMETER A parameter is invalid.
79 @retval EFI_NOT_FOUND A registered parser was not found.
80 **/
81 EFI_STATUS
82 EFIAPI
83 DeregisterParser (
84 IN UINT32 Signature
85 );
86
87 /**
88 This function processes the ACPI tables.
89 This function calls ProcessTableReportOptions() to list the ACPI
90 tables, perform binary dump of the tables and determine if the
91 ACPI fields should be traced.
92
93 This function also invokes the parser for the ACPI tables.
94
95 This function also performs a RAW dump of the ACPI table including
96 the unknown/unparsed ACPI tables and validates the checksum.
97
98 @param [in] Ptr Pointer to the start of the ACPI
99 table data buffer.
100 **/
101 VOID
102 EFIAPI
103 ProcessAcpiTable (
104 IN UINT8* Ptr
105 );
106
107 /**
108 Get the ACPI table Parser
109
110 This function returns the ACPI table parser proc from the list of
111 registered parsers.
112
113 @param [in] Signature The ACPI table signature.
114 @param [out] ParserProc Pointer to a ACPI table parser proc.
115
116 @retval EFI_SUCCESS The parser was returned successfully.
117 @retval EFI_INVALID_PARAMETER A parameter is invalid.
118 @retval EFI_NOT_FOUND A registered parser was not found.
119 **/
120 EFI_STATUS
121 EFIAPI
122 GetParser (
123 IN UINT32 Signature,
124 OUT PARSE_ACPI_TABLE_PROC * ParserProc
125 );
126
127 #endif // ACPITABLEPARSER_H_