TianoCore EDK2 master
Loading...
Searching...
No Matches
SpcrParser.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
20
30VOID
31EFIAPI
33 IN UINT8 *Ptr,
34 IN UINT32 Length,
35 IN VOID *Context
36 )
37{
38 #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
39 UINT8 InterruptType;
40
41 InterruptType = *Ptr;
42
43 if (InterruptType !=
45 {
47 Print (
48 L"\nERROR: InterruptType = %d. This must be 8 on ARM Platforms",
49 InterruptType
50 );
51 }
52
53 #endif
54}
55
65VOID
66EFIAPI
68 IN UINT8 *Ptr,
69 IN UINT32 Length,
70 IN VOID *Context
71 )
72{
73 #if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
74 UINT8 Irq;
75
76 Irq = *Ptr;
77
78 if (Irq != 0) {
80 Print (
81 L"\nERROR: Irq = %d. This must be zero on ARM Platforms\n",
82 Irq
83 );
84 }
85
86 #endif
87}
88
93 PARSE_ACPI_HEADER (&AcpiHdrInfo),
94 { L"Interface Type", 1, 36, L"%d", NULL, NULL, NULL, NULL },
95 { L"Reserved", 3, 37, L"%x %x %x", Dump3Chars, NULL, NULL, NULL },
96 { L"Base Address", 12, 40, NULL, DumpGas, NULL, NULL, NULL },
97 { L"Interrupt Type", 1, 52, L"%d", NULL, NULL, ValidateInterruptType, NULL },
98 { L"IRQ", 1, 53, L"%d", NULL, NULL, ValidateIrq, NULL },
99 { L"Global System Interrupt", 4, 54, L"0x%x", NULL, NULL, NULL, NULL },
100 { L"Baud Rate", 1, 58, L"%d", NULL, NULL, NULL, NULL },
101 { L"Parity", 1, 59, L"%d", NULL, NULL, NULL, NULL },
102 { L"Stop Bits", 1, 60, L"%d", NULL, NULL, NULL, NULL },
103 { L"Flow Control", 1, 61, L"0x%x", NULL, NULL, NULL, NULL },
104 { L"Terminal Type", 1, 62, L"%d", NULL, NULL, NULL, NULL },
105 { L"Reserved", 1, 63, L"%x", NULL, NULL, NULL, NULL },
106
107 { L"PCI Device ID", 2, 64, L"0x%x", NULL, NULL, NULL, NULL },
108 { L"PCI Vendor ID", 2, 66, L"0x%x", NULL, NULL, NULL, NULL },
109 { L"PCI Bus Number", 1, 68, L"0x%x", NULL, NULL, NULL, NULL },
110 { L"PCI Device Number", 1, 69, L"0x%x", NULL, NULL, NULL, NULL },
111 { L"PCI Function Number", 1, 70, L"0x%x", NULL, NULL, NULL, NULL },
112 { L"PCI Flags", 4, 71, L"0x%x", NULL, NULL, NULL, NULL },
113 { L"PCI Segment", 1, 75, L"0x%x", NULL, NULL, NULL, NULL },
114 { L"Reserved", 4, 76, L"%x", NULL, NULL, NULL, NULL }
115};
116
129VOID
130EFIAPI
132 IN BOOLEAN Trace,
133 IN UINT8 *Ptr,
134 IN UINT32 AcpiTableLength,
135 IN UINT8 AcpiTableRevision
136 )
137{
138 if (!Trace) {
139 return;
140 }
141
142 // Dump the SPCR
143 ParseAcpi (
144 TRUE,
145 0,
146 "SPCR",
147 Ptr,
148 AcpiTableLength,
150 );
151}
VOID EFIAPI DumpGas(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
Definition: AcpiParser.c:867
VOID EFIAPI Dump3Chars(IN CONST CHAR16 *Format OPTIONAL, IN UINT8 *Ptr, IN UINT32 Length)
Definition: AcpiParser.c:326
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
#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
#define EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_INTERRUPT_TYPE_GIC
STATIC CONST ACPI_PARSER SpcrParser[]
Definition: SpcrParser.c:92
STATIC VOID EFIAPI ValidateInterruptType(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: SpcrParser.c:32
STATIC VOID EFIAPI ValidateIrq(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
Definition: SpcrParser.c:67
VOID EFIAPI ParseAcpiSpcr(IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
Definition: SpcrParser.c:131
UINTN EFIAPI Print(IN CONST CHAR16 *Format,...)
Definition: UefiLibPrint.c:113