]> git.proxmox.com Git - mirror_edk2.git/blob - ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Bgrt/BgrtParser.c
0b3f9a79012a97d03d88eb3e160b77d869fce394
[mirror_edk2.git] / ShellPkg / Library / UefiShellAcpiViewCommandLib / Parsers / Bgrt / BgrtParser.c
1 /**
2 BGRT table parser
3
4 Copyright (c) 2017 - 2018, ARM Limited. All rights reserved.
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 @par Reference(s):
14 - ACPI 6.2 Specification - Errata A, September 2017
15 **/
16
17 #include <IndustryStandard/Acpi.h>
18 #include <Library/UefiLib.h>
19 #include "AcpiParser.h"
20 #include "AcpiTableParser.h"
21
22 // Local variables
23 STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;
24
25 /** An ACPI_PARSER array describing the ACPI BDRT Table.
26 */
27 STATIC CONST ACPI_PARSER BgrtParser[] = {
28 PARSE_ACPI_HEADER (&AcpiHdrInfo),
29 {L"Version", 2, 36, L"0x%x", NULL, NULL, NULL, NULL},
30 {L"Status", 1, 38, L"0x%x", NULL, NULL, NULL, NULL},
31 {L"Image Type", 1, 39, L"0x%x", NULL, NULL, NULL, NULL},
32 {L"Image Address", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL},
33 {L"Image Offset X", 4, 48, L"%d", NULL, NULL, NULL, NULL},
34 {L"Image Offset Y", 4, 52, L"%d", NULL, NULL, NULL, NULL}
35 };
36
37 /** This function parses the ACPI BGRT table.
38 When trace is enabled this function parses the BGRT table and
39 traces the ACPI table fields.
40
41 This function also performs validation of the ACPI table fields.
42
43 @param [in] Trace If TRUE, trace the ACPI fields.
44 @param [in] Ptr Pointer to the start of the buffer.
45 @param [in] AcpiTableLength Length of the ACPI table.
46 @param [in] AcpiTableRevision Revision of the ACPI table.
47 */
48 VOID
49 EFIAPI
50 ParseAcpiBgrt (
51 IN BOOLEAN Trace,
52 IN UINT8* Ptr,
53 IN UINT32 AcpiTableLength,
54 IN UINT8 AcpiTableRevision
55 )
56 {
57 if (!Trace) {
58 return;
59 }
60
61 ParseAcpi (
62 Trace,
63 0,
64 "BGRT",
65 Ptr,
66 AcpiTableLength,
67 PARSER_PARAMS (BgrtParser)
68 );
69 }