]> git.proxmox.com Git - mirror_edk2.git/blob - ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.h
ShellPkg/UefiShellAcpiViewCommandLib: Fix ECC issues
[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 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 **/
13
14 #ifndef ACPITABLEPARSER_H_
15 #define ACPITABLEPARSER_H_
16
17 /**
18 The maximum number of ACPI table parsers.
19 */
20 #define MAX_ACPI_TABLE_PARSERS 16
21
22 /** An invalid/NULL signature value.
23 */
24 #define ACPI_PARSER_SIGNATURE_NULL 0
25
26 /**
27 A function that parses the ACPI table.
28
29 @param [in] Trace If TRUE, trace the ACPI fields.
30 @param [in] Ptr Pointer to the start of the buffer.
31 @param [in] AcpiTableLength Length of the ACPI table.
32 @param [in] AcpiTableRevision Revision of the ACPI table.
33 **/
34 typedef
35 VOID
36 (EFIAPI * PARSE_ACPI_TABLE_PROC) (
37 IN BOOLEAN Trace,
38 IN UINT8* Ptr,
39 IN UINT32 AcpiTableLength,
40 IN UINT8 AcpiTableRevision
41 );
42
43 /**
44 The ACPI table parser information
45 **/
46 typedef struct AcpiTableParser {
47 /// ACPI table signature
48 UINT32 Signature;
49
50 /// The ACPI table parser function.
51 PARSE_ACPI_TABLE_PROC Parser;
52 } ACPI_TABLE_PARSER;
53
54 /**
55 Register the ACPI table Parser
56
57 This function registers the ACPI table parser.
58
59 @param [in] Signature The ACPI table signature.
60 @param [in] ParserProc The ACPI table parser.
61
62 @retval EFI_SUCCESS The parser is registered.
63 @retval EFI_INVALID_PARAMETER A parameter is invalid.
64 @retval EFI_ALREADY_STARTED The parser for the Table
65 was already registered.
66 @retval EFI_OUT_OF_RESOURCES No space to register the
67 parser.
68 **/
69 EFI_STATUS
70 EFIAPI
71 RegisterParser (
72 IN UINT32 Signature,
73 IN PARSE_ACPI_TABLE_PROC ParserProc
74 );
75
76 /**
77 Deregister the ACPI table Parser
78
79 This function deregisters the ACPI table parser.
80
81 @param [in] Signature The ACPI table signature.
82
83 @retval EFI_SUCCESS The parser was deregistered.
84 @retval EFI_INVALID_PARAMETER A parameter is invalid.
85 @retval EFI_NOT_FOUND A registered parser was not found.
86 **/
87 EFI_STATUS
88 EFIAPI
89 DeregisterParser (
90 IN UINT32 Signature
91 );
92
93 /**
94 This function processes the ACPI tables.
95 This function calls ProcessTableReportOptions() to list the ACPI
96 tables, perform binary dump of the tables and determine if the
97 ACPI fields should be traced.
98
99 This function also invokes the parser for the ACPI tables.
100
101 This function also performs a RAW dump of the ACPI table including
102 the unknown/unparsed ACPI tables and validates the checksum.
103
104 @param [in] Ptr Pointer to the start of the ACPI
105 table data buffer.
106 **/
107 VOID
108 EFIAPI
109 ProcessAcpiTable (
110 IN UINT8* Ptr
111 );
112
113 /**
114 Get the ACPI table Parser
115
116 This function returns the ACPI table parser proc from the list of
117 registered parsers.
118
119 @param [in] Signature The ACPI table signature.
120 @param [out] ParserProc Pointer to a ACPI table parser proc.
121
122 @retval EFI_SUCCESS The parser was returned successfully.
123 @retval EFI_INVALID_PARAMETER A parameter is invalid.
124 @retval EFI_NOT_FOUND A registered parser was not found.
125 **/
126 EFI_STATUS
127 EFIAPI
128 GetParser (
129 IN UINT32 Signature,
130 OUT PARSE_ACPI_TABLE_PROC * ParserProc
131 );
132
133 #endif // ACPITABLEPARSER_H_