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