46 UINT16 NameSpaceStrLen;
48 NameSpaceStrLen = *(UINT16 *)Ptr;
50 if (NameSpaceStrLen < 2) {
53 L
"\nERROR: NamespaceString Length = %d. If no Namespace device exists, " \
54 L
"NamespaceString[] must contain a period '.'",
63 { L
"OffsetDbgDeviceInfo", 4, 36, L
"0x%x",
NULL,
64 (VOID **)&OffsetDbgDeviceInfo,
NULL,
NULL },
65 { L
"NumberDbgDeviceInfo", 4, 40, L
"%d",
NULL,
66 (VOID **)&NumberDbgDeviceInfo,
NULL,
NULL }
73 { L
"Length", 2, 1, L
"%d",
NULL, (VOID **)&DbgDevInfoLen,
NULL,
NULL }
81 { L
"Generic Address Registers Count", 1, 3, L
"0x%x",
NULL,
83 { L
"NameSpace String Length", 2, 4, L
"%d",
NULL,
85 { L
"NameSpace String Offset", 2, 6, L
"0x%x",
NULL,
86 (VOID **)&NameSpaceStringOffset,
NULL,
NULL },
87 { L
"OEM Data Length", 2, 8, L
"%d",
NULL, (VOID **)&OEMDataLength,
89 { L
"OEM Data Offset", 2, 10, L
"0x%x",
NULL, (VOID **)&OEMDataOffset,
96 { L
"Base Address Register Offset", 2, 18, L
"0x%x",
NULL,
97 (VOID **)&BaseAddrRegOffset,
NULL,
NULL },
98 { L
"Address Size Offset", 2, 20, L
"0x%x",
NULL,
99 (VOID **)&AddrSizeOffset,
NULL,
NULL }
130 if ((GasCount ==
NULL) ||
131 (NameSpaceStringLength ==
NULL) ||
132 (NameSpaceStringOffset ==
NULL) ||
133 (OEMDataLength ==
NULL) ||
134 (OEMDataOffset ==
NULL) ||
135 (BaseAddrRegOffset ==
NULL) ||
136 (AddrSizeOffset ==
NULL))
140 L
"ERROR: Insufficient Debug Device Information Structure length. " \
149 Offset = *BaseAddrRegOffset;
150 while ((Index++ < *GasCount) &&
163 if ((*AddrSizeOffset + (*GasCount *
sizeof (UINT32))) > Length) {
166 L
"ERROR: Invalid GAS count. GasCount = %d. RemainingBufferLength = %d. " \
167 L
"Parsing of the Debug Device Information structure aborted.\n",
169 Length - *AddrSizeOffset
176 Offset = *AddrSizeOffset;
177 while ((Index++ < *GasCount) &&
181 Print (L
"0x%x\n", *((UINT32 *)(Ptr + Offset)));
182 Offset +=
sizeof (UINT32);
187 Offset = *NameSpaceStringOffset;
189 while ((Index++ < *NameSpaceStringLength) &&
192 Print (L
"%c", *(Ptr + Offset));
199 if (*OEMDataOffset != 0) {
201 Offset = *OEMDataOffset;
203 while ((Index++ < *OEMDataLength) &&
206 Print (L
"%x ", *(Ptr + Offset));
207 if ((Index & 7) == 0) {
208 Print (L
"\n%-*s ", OUTPUT_FIELD_COLUMN_WIDTH, L
"");
235 IN UINT32 AcpiTableLength,
236 IN UINT8 AcpiTableRevision
257 if ((OffsetDbgDeviceInfo ==
NULL) ||
258 (NumberDbgDeviceInfo ==
NULL))
262 L
"ERROR: Insufficient table length. AcpiTableLength = %d\n",
268 Offset = *OffsetDbgDeviceInfo;
271 while (Index++ < *NumberDbgDeviceInfo) {
278 AcpiTableLength - Offset,
284 if (DbgDevInfoLen ==
NULL) {
287 L
"ERROR: Insufficient remaining table buffer length to read the " \
288 L
"Debug Device Information structure's 'Length' field. " \
289 L
"RemainingTableBufferLength = %d.\n",
290 AcpiTableLength - Offset
296 if ((*DbgDevInfoLen == 0) ||
297 ((Offset + (*DbgDevInfoLen)) > AcpiTableLength))
301 L
"ERROR: Invalid Debug Device Information Structure length. " \
302 L
"Length = %d. Offset = %d. AcpiTableLength = %d.\n",
311 Offset += (*DbgDevInfoLen);
UINT32 EFIAPI DumpGasStruct(IN UINT8 *Ptr, IN UINT32 Indent, IN UINT32 Length)
VOID EFIAPI PrintFieldName(IN UINT32 Indent, IN CONST CHAR16 *FieldName)
VOID EFIAPI IncrementErrorCount(VOID)
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)
#define PARSER_PARAMS(Parser)
#define PARSE_ACPI_HEADER(Info)
STATIC CONST ACPI_PARSER Dbg2Parser[]
An ACPI_PARSER array describing the ACPI DBG2 table.
STATIC VOID EFIAPI DumpDbgDeviceInfo(IN UINT8 *Ptr, IN UINT16 Length)
STATIC CONST ACPI_PARSER DbgDevInfoParser[]
An ACPI_PARSER array describing the debug device information.
VOID EFIAPI ParseAcpiDbg2(IN BOOLEAN Trace, IN UINT8 *Ptr, IN UINT32 AcpiTableLength, IN UINT8 AcpiTableRevision)
STATIC VOID EFIAPI ValidateNameSpaceStrLen(IN UINT8 *Ptr, IN UINT32 Length, IN VOID *Context)
STATIC CONST ACPI_PARSER DbgDevInfoHeaderParser[]
UINTN EFIAPI Print(IN CONST CHAR16 *Format,...)