TianoCore EDK2 master
Loading...
Searching...
No Matches
Ras2Parser.c
Go to the documentation of this file.
1
11#include <Library/PrintLib.h>
12#include <Library/BaseLib.h>
13#include <Library/UefiLib.h>
14#include "AcpiParser.h"
15#include "AcpiView.h"
16
17// Local variables
18STATIC CONST UINT16 *Ras2PccDescriptors;
19
21
26 PARSE_ACPI_HEADER (&AcpiHdrInfo),
27 { L"Reserved", 2, 36, L"0x%x", NULL, NULL, NULL, NULL },
28 { L"PCC Descriptors", 2, 38, L"%d", NULL, (VOID **)&Ras2PccDescriptors, NULL, NULL }
29};
30
35 { L"PCC ID", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },
36 { L"Reserved", 1, 1, L"0x%x", NULL, NULL, NULL, NULL },
37 { L"Reserved", 1, 2, L"0x%x", NULL, NULL, NULL, NULL },
38 { L"Feature Type", 1, 3, L"0x%x", NULL, NULL, NULL, NULL },
39 { L"Instance", 4, 4, L"0x%x", NULL, NULL, NULL, NULL }
40};
41
43VOID
44DumpPccEntry (
45 IN UINT8 *Ptr,
46 IN UINT32 Length
47 )
48{
49 ParseAcpi (
50 TRUE,
51 2,
52 "PCC Descriptor Entry",
53 Ptr,
54 Length,
56 );
57}
58
77VOID
78EFIAPI
80 IN BOOLEAN Trace,
81 IN UINT8 *Ptr,
82 IN UINT32 AcpiTableLength,
83 IN UINT8 AcpiTableRevision
84 )
85{
86 UINT32 Offset;
87
88 if (!Trace) {
89 return;
90 }
91
92 // Parse ACPI Header + RAS2 "fixed" fields
93 Offset = ParseAcpi (
94 Trace,
95 0,
96 "RAS2",
97 Ptr,
98 AcpiTableLength,
100 );
101
102 // Table is too small to contain data
103 if (Offset >= AcpiTableLength) {
104 return;
105 }
106
107 // Loop over rest of table for PCC Entries and dump them
108 while (Offset <= (AcpiTableLength - sizeof (EFI_ACPI_RAS2_PCC_DESCRIPTOR))) {
109 DumpPccEntry (
110 Ptr + Offset,
112 );
113 Offset += sizeof (EFI_ACPI_RAS2_PCC_DESCRIPTOR);
114 } // while
115}
UINT32 EFIAPI ParseAcpi(IN BOOLEAN Trace, IN UINT32 Indent, IN CONST CHAR8 *AsciiName OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length, IN CONST ACPI_PARSER *Parser, IN UINT32 ParserItems)
Definition: AcpiParser.c:683
#define PARSER_PARAMS(Parser)
Definition: AcpiParser.h:494
#define PARSE_ACPI_HEADER(Info)
Definition: AcpiParser.h:501
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define STATIC
Definition: Base.h:264
#define TRUE
Definition: Base.h:301
#define IN
Definition: Base.h:279
VOID EFIAPI ParseAcpiRas2(IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
Definition: Ras2Parser.c:79
STATIC CONST ACPI_PARSER Ras2StructurePccDescriptor[]
Definition: Ras2Parser.c:34
STATIC CONST ACPI_PARSER Ras2Parser[]
Definition: Ras2Parser.c:25