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