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