]> git.proxmox.com Git - mirror_edk2.git/blame - ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Bgrt/BgrtParser.c
ShellPkg/UefiShellAcpiViewCommandLib: Fix ECC issues
[mirror_edk2.git] / ShellPkg / Library / UefiShellAcpiViewCommandLib / Parsers / Bgrt / BgrtParser.c
CommitLineData
a6eaba4d 1/** @file\r
ee4dc24f
RN
2 BGRT table parser\r
3\r
4 Copyright (c) 2017 - 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 @par Reference(s):\r
14 - ACPI 6.2 Specification - Errata A, September 2017\r
15**/\r
16\r
17#include <IndustryStandard/Acpi.h>\r
18#include <Library/UefiLib.h>\r
19#include "AcpiParser.h"\r
20#include "AcpiTableParser.h"\r
21\r
22// Local variables\r
23STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;\r
24\r
a6eaba4d
DB
25/**\r
26 An ACPI_PARSER array describing the ACPI BDRT Table.\r
27**/\r
ee4dc24f
RN
28STATIC CONST ACPI_PARSER BgrtParser[] = {\r
29 PARSE_ACPI_HEADER (&AcpiHdrInfo),\r
30 {L"Version", 2, 36, L"0x%x", NULL, NULL, NULL, NULL},\r
31 {L"Status", 1, 38, L"0x%x", NULL, NULL, NULL, NULL},\r
32 {L"Image Type", 1, 39, L"0x%x", NULL, NULL, NULL, NULL},\r
33 {L"Image Address", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL},\r
34 {L"Image Offset X", 4, 48, L"%d", NULL, NULL, NULL, NULL},\r
35 {L"Image Offset Y", 4, 52, L"%d", NULL, NULL, NULL, NULL}\r
36};\r
37\r
a6eaba4d
DB
38/**\r
39 This function parses the ACPI BGRT table.\r
ee4dc24f
RN
40 When trace is enabled this function parses the BGRT table and\r
41 traces the ACPI table fields.\r
42\r
43 This function also performs validation of the ACPI table fields.\r
44\r
45 @param [in] Trace If TRUE, trace the ACPI fields.\r
46 @param [in] Ptr Pointer to the start of the buffer.\r
47 @param [in] AcpiTableLength Length of the ACPI table.\r
48 @param [in] AcpiTableRevision Revision of the ACPI table.\r
a6eaba4d 49**/\r
ee4dc24f
RN
50VOID\r
51EFIAPI\r
52ParseAcpiBgrt (\r
53 IN BOOLEAN Trace,\r
54 IN UINT8* Ptr,\r
55 IN UINT32 AcpiTableLength,\r
56 IN UINT8 AcpiTableRevision\r
57 )\r
58{\r
59 if (!Trace) {\r
60 return;\r
61 }\r
62\r
63 ParseAcpi (\r
64 Trace,\r
65 0,\r
66 "BGRT",\r
67 Ptr,\r
68 AcpiTableLength,\r
69 PARSER_PARAMS (BgrtParser)\r
70 );\r
71}\r