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