]>
Commit | Line | Data |
---|---|---|
ee4dc24f RN |
1 | /**\r |
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 | |
23 | STATIC ACPI_DESCRIPTION_HEADER_INFO AcpiHdrInfo;\r | |
24 | \r | |
25 | /** An ACPI_PARSER array describing the ACPI BDRT Table.\r | |
26 | */\r | |
27 | STATIC CONST ACPI_PARSER BgrtParser[] = {\r | |
28 | PARSE_ACPI_HEADER (&AcpiHdrInfo),\r | |
29 | {L"Version", 2, 36, L"0x%x", NULL, NULL, NULL, NULL},\r | |
30 | {L"Status", 1, 38, L"0x%x", NULL, NULL, NULL, NULL},\r | |
31 | {L"Image Type", 1, 39, L"0x%x", NULL, NULL, NULL, NULL},\r | |
32 | {L"Image Address", 8, 40, L"0x%lx", NULL, NULL, NULL, NULL},\r | |
33 | {L"Image Offset X", 4, 48, L"%d", NULL, NULL, NULL, NULL},\r | |
34 | {L"Image Offset Y", 4, 52, L"%d", NULL, NULL, NULL, NULL}\r | |
35 | };\r | |
36 | \r | |
37 | /** This function parses the ACPI BGRT table.\r | |
38 | When trace is enabled this function parses the BGRT table and\r | |
39 | traces the ACPI table fields.\r | |
40 | \r | |
41 | This function also performs validation of the ACPI table fields.\r | |
42 | \r | |
43 | @param [in] Trace If TRUE, trace the ACPI fields.\r | |
44 | @param [in] Ptr Pointer to the start of the buffer.\r | |
45 | @param [in] AcpiTableLength Length of the ACPI table.\r | |
46 | @param [in] AcpiTableRevision Revision of the ACPI table.\r | |
47 | */\r | |
48 | VOID\r | |
49 | EFIAPI\r | |
50 | ParseAcpiBgrt (\r | |
51 | IN BOOLEAN Trace,\r | |
52 | IN UINT8* Ptr,\r | |
53 | IN UINT32 AcpiTableLength,\r | |
54 | IN UINT8 AcpiTableRevision\r | |
55 | )\r | |
56 | {\r | |
57 | if (!Trace) {\r | |
58 | return;\r | |
59 | }\r | |
60 | \r | |
61 | ParseAcpi (\r | |
62 | Trace,\r | |
63 | 0,\r | |
64 | "BGRT",\r | |
65 | Ptr,\r | |
66 | AcpiTableLength,\r | |
67 | PARSER_PARAMS (BgrtParser)\r | |
68 | );\r | |
69 | }\r |