TianoCore EDK2 master
Loading...
Searching...
No Matches
ApmtParser.c
Go to the documentation of this file.
1
14#include <Library/UefiLib.h>
15#include "AcpiParser.h"
16#include "AcpiTableParser.h"
17
18// Local variables
20STATIC CONST UINT16 *NodeLength;
21
26 PARSE_ACPI_HEADER (&AcpiHdrInfo)
27};
28
33 { L"Length", 2, 0, L"0x%x", NULL, (VOID **)&NodeLength, NULL, NULL },
34 { L"Node flags", 1, 2, L"0x%x", NULL, NULL, NULL, NULL },
35 { L"Node type", 1, 3, L"0x%x", NULL, NULL, NULL, NULL },
36 { L"Identifier", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },
37 { L"Node Instance primary", 8, 8, L"0x%lx", NULL, NULL, NULL, NULL },
38 { L"Node Instance secondary", 4, 16, L"0x%x", NULL, NULL, NULL, NULL },
39 { L"Base address 0", 8, 20, L"0x%lx", NULL, NULL, NULL, NULL },
40 { L"Base address 1", 8, 28, L"0x%lx", NULL, NULL, NULL, NULL },
41 { L"Overflow interrupt", 4, 36, L"0x%x", NULL, NULL, NULL, NULL },
42 { L"Reserved1", 4, 40, L"0x%x", NULL, NULL, NULL, NULL },
43 { L"Overflow interrupt flags", 4, 44, L"0x%x", NULL, NULL, NULL, NULL },
44 { L"Processor affinity", 4, 48, L"0x%x", NULL, NULL, NULL, NULL },
45 { L"Implementation ID", 4, 52, L"0x%x", NULL, NULL, NULL, NULL }
46};
47
60VOID
61EFIAPI
63 IN BOOLEAN Trace,
64 IN UINT8 *Ptr,
65 IN UINT32 AcpiTableLength,
66 IN UINT8 AcpiTableRevision
67 )
68{
69 UINT32 Offset;
70
71 if (!Trace) {
72 return;
73 }
74
75 ParseAcpi (
76 Trace,
77 0,
78 "APMT",
79 Ptr,
80 AcpiTableLength,
82 );
83 Offset = sizeof (EFI_ACPI_DESCRIPTION_HEADER);
84
85 while (Offset < AcpiTableLength) {
86 ParseAcpi (
87 Trace,
88 2,
89 "Arm PMU node",
90 Ptr + Offset,
91 (AcpiTableLength - Offset),
93 );
94 if (NodeLength == NULL) {
95 Print (
96 L"ERROR: Insufficient remaining table buffer length to read the " \
97 L"Node structure. Length = %d.\n",
98 (AcpiTableLength - Offset)
99 );
101 break;
102 }
103
104 Offset += *NodeLength;
105 }
106}
VOID EFIAPI IncrementErrorCount(VOID)
Definition: AcpiParser.c:83
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
STATIC CONST ACPI_PARSER ArmPmuNodeParser[]
Definition: ApmtParser.c:32
STATIC CONST ACPI_PARSER ApmtParser[]
Definition: ApmtParser.c:25
VOID EFIAPI ParseAcpiApmt(IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
Definition: ApmtParser.c:62
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define STATIC
Definition: Base.h:264
#define IN
Definition: Base.h:279
UINTN EFIAPI Print(IN CONST CHAR16 *Format,...)
Definition: UefiLibPrint.c:113