]> git.proxmox.com Git - mirror_edk2.git/blob - ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.h
a69d56da6cf728bb98df265de3ae030d85120494
[mirror_edk2.git] / ShellPkg / Library / UefiShellAcpiViewCommandLib / AcpiTableParser.h
1 /**
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 /** The maximum number of ACPI table parsers.
18 */
19 #define MAX_ACPI_TABLE_PARSERS 16
20
21 /** An invalid/NULL signature value.
22 */
23 #define ACPI_PARSER_SIGNATURE_NULL 0
24
25 /** A function that parses the ACPI table.
26
27 @param [in] Trace If TRUE, trace the ACPI fields.
28 @param [in] Ptr Pointer to the start of the buffer.
29 @param [in] AcpiTableLength Length of the ACPI table.
30 @param [in] AcpiTableRevision Revision of the ACPI table.
31 */
32 typedef
33 VOID
34 (EFIAPI * PARSE_ACPI_TABLE_PROC) (
35 IN BOOLEAN Trace,
36 IN UINT8* Ptr,
37 IN UINT32 AcpiTableLength,
38 IN UINT8 AcpiTableRevision
39 );
40
41 /** The ACPI table parser information
42 */
43 typedef struct AcpiTableParser {
44 /// ACPI table signature
45 UINT32 Signature;
46
47 /// The ACPI table parser function.
48 PARSE_ACPI_TABLE_PROC Parser;
49 } ACPI_TABLE_PARSER;
50
51 /** Register the ACPI table Parser
52
53 This function registers the ACPI table parser.
54
55 @param [in] Signature The ACPI table signature.
56 @param [in] ParserProc The ACPI table parser.
57
58 @retval EFI_SUCCESS The parser is registered.
59 @retval EFI_INVALID_PARAMETER A parameter is invalid.
60 @retval EFI_ALREADY_STARTED The parser for the Table
61 was already registered.
62 @retval EFI_OUT_OF_RESOURCES No space to register the
63 parser.
64 */
65 EFI_STATUS
66 EFIAPI
67 RegisterParser (
68 IN UINT32 Signature,
69 IN PARSE_ACPI_TABLE_PROC ParserProc
70 );
71
72 /** Deregister the ACPI table Parser
73
74 This function deregisters the ACPI table parser.
75
76 @param [in] Signature The ACPI table signature.
77
78 @retval EFI_SUCCESS The parser was deregistered.
79 @retval EFI_INVALID_PARAMETER A parameter is invalid.
80 @retval EFI_NOT_FOUND A registered parser was not found.
81 */
82 EFI_STATUS
83 EFIAPI
84 DeregisterParser (
85 IN UINT32 Signature
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 /** Get the ACPI table Parser
108
109 This function returns the ACPI table parser proc from the list of
110 registered parsers.
111
112 @param [in] Signature The ACPI table signature.
113 @param [out] ParserProc Pointer to a ACPI table parser proc.
114
115 @retval EFI_SUCCESS The parser was returned successfully.
116 @retval EFI_INVALID_PARAMETER A parameter is invalid.
117 @retval EFI_NOT_FOUND A registered parser was not found.
118 */
119 EFI_STATUS
120 EFIAPI
121 GetParser (
122 IN UINT32 Signature,
123 OUT PARSE_ACPI_TABLE_PROC * ParserProc
124 );
125
126 #endif // ACPITABLEPARSER_H_