]> git.proxmox.com Git - mirror_edk2.git/blame - ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Facs/FacsParser.c
ShellPkg: Apply uncrustify changes
[mirror_edk2.git] / ShellPkg / Library / UefiShellAcpiViewCommandLib / Parsers / Facs / FacsParser.c
CommitLineData
d5cf0fba
SM
1/** @file\r
2 FACS table parser\r
3\r
4 Copyright (c) 2019, ARM Limited. All rights reserved.\r
5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
6\r
7 @par Reference(s):\r
8 - ACPI 6.3 Specification - January 2019\r
9**/\r
10\r
11#include <IndustryStandard/Acpi.h>\r
12#include <Library/UefiLib.h>\r
13#include "AcpiParser.h"\r
14#include "AcpiTableParser.h"\r
15\r
16/**\r
17 An ACPI_PARSER array describing the ACPI FACS Table.\r
18**/\r
47d20b54
MK
19STATIC CONST ACPI_PARSER FacsParser[] = {\r
20 { L"Signature", 4, 0, L"%c%c%c%c", Dump4Chars, NULL, NULL, NULL },\r
21 { L"Length", 4, 4, L"%d", NULL, NULL, NULL, NULL },\r
22 { L"Hardware Signature", 4, 8, L"0x%x", NULL, NULL, NULL, NULL },\r
23 { L"Firmware Waking Vector", 4, 12, L"0x%x", NULL, NULL, NULL, NULL },\r
24 { L"Global Lock", 4, 16, L"0x%x", NULL, NULL, NULL, NULL },\r
25 { L"Flags", 4, 20, L"0x%x", NULL, NULL, NULL, NULL },\r
26 { L"X Firmware Walking Vector", 8, 24, L"0x%lx", NULL, NULL, NULL, NULL },\r
27 { L"Version", 1, 32, L"%d", NULL, NULL, NULL, NULL },\r
28 { L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, NULL, NULL },\r
29 { L"OSPM Flags", 4, 36, L"0x%x", NULL, NULL, NULL, NULL },\r
30 { L"Reserved", 8, 40, L"%x %x %x %x %x %x %x %x", Dump8Chars, NULL, NULL,\r
31 NULL },\r
32 { L"Reserved", 8, 48, L"%x %x %x %x %x %x %x %x", Dump8Chars, NULL, NULL,\r
33 NULL },\r
34 { L"Reserved", 8, 56, L"%x %x %x %x %x %x %x %x", Dump8Chars, NULL, NULL,\r
35 NULL }\r
d5cf0fba
SM
36};\r
37\r
38/**\r
39 This function parses the ACPI FACS table.\r
40 When trace is enabled this function parses the FACS 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
49**/\r
50VOID\r
51EFIAPI\r
52ParseAcpiFacs (\r
47d20b54
MK
53 IN BOOLEAN Trace,\r
54 IN UINT8 *Ptr,\r
55 IN UINT32 AcpiTableLength,\r
56 IN UINT8 AcpiTableRevision\r
d5cf0fba
SM
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 "FACS",\r
67 Ptr,\r
68 AcpiTableLength,\r
69 PARSER_PARAMS (FacsParser)\r
70 );\r
71}\r