18#if !defined (MDEPKG_NDEBUG)
23 "EAmlNodeDataTypeNone",
24 "EAmlNodeDataTypeReserved1",
25 "EAmlNodeDataTypeReserved2",
26 "EAmlNodeDataTypeReserved3",
27 "EAmlNodeDataTypeReserved4",
28 "EAmlNodeDataTypeReserved5",
29 "EAmlNodeDataTypeNameString",
30 "EAmlNodeDataTypeString",
31 "EAmlNodeDataTypeUInt",
32 "EAmlNodeDataTypeRaw",
33 "EAmlNodeDataTypeResourceData",
34 "EAmlNodeDataTypeFieldPkgLen",
69 for (i = 0; i < Size; i++) {
70 DEBUG ((ErrorLevel,
"%c", Buffer[i]));
90 DEBUG ((DEBUG_INFO,
"%c", Buffer[0]));
91 if ((Buffer[1] == AML_NAME_CHAR__) &&
92 (Buffer[2] == AML_NAME_CHAR__) &&
93 (Buffer[3] == AML_NAME_CHAR__))
98 DEBUG ((DEBUG_INFO,
"%c", Buffer[1]));
99 if ((Buffer[2] == AML_NAME_CHAR__) &&
100 (Buffer[3] == AML_NAME_CHAR__))
105 DEBUG ((DEBUG_INFO,
"%c", Buffer[2]));
106 if (Buffer[3] == AML_NAME_CHAR__) {
110 DEBUG ((DEBUG_INFO,
"%c", Buffer[3]));
129 if (Buffer ==
NULL) {
135 if (*Buffer == AML_ROOT_CHAR) {
137 DEBUG ((DEBUG_INFO,
"\\"));
138 }
else if (*Buffer == AML_PARENT_PREFIX_CHAR) {
141 DEBUG ((DEBUG_INFO,
"^"));
142 }
while (*Buffer == AML_PARENT_PREFIX_CHAR);
146 if (*Buffer == AML_DUAL_NAME_PREFIX) {
149 }
else if (*Buffer == AML_MULTI_NAME_PREFIX) {
163 }
else if (*Buffer == AML_ZERO_OP) {
172 AMLDBG_PRINT_NAMESEG (Buffer);
173 Buffer += AML_NAME_SEG_SIZE;
174 for (Index = 0; Index < SegCount - 1; Index++) {
175 DEBUG ((DEBUG_INFO,
"."));
176 AMLDBG_PRINT_NAMESEG (Buffer);
177 Buffer += AML_NAME_SEG_SIZE;
182 DEBUG ((DEBUG_INFO,
"\n"));
237 DEBUG ((DEBUG_INFO,
"0x%04x | ", DataNode->Size));
244 (
CONST CHAR8 *)DataNode->Buffer,
248 switch (DataNode->Size) {
251 DEBUG ((DEBUG_INFO,
"0x%0x", *((UINT8 *)DataNode->Buffer)));
256 DEBUG ((DEBUG_INFO,
"0x%0x", *((UINT16 *)DataNode->Buffer)));
261 DEBUG ((DEBUG_INFO,
"0x%0lx", *((UINT32 *)DataNode->Buffer)));
266 DEBUG ((DEBUG_INFO,
"0x%0llx", *((UINT64 *)DataNode->Buffer)));
277 for (Idx = 0; Idx < DataNode->Size; Idx++) {
278 DEBUG ((DEBUG_INFO,
"%02x ", DataNode->Buffer[Idx]));
282 DEBUG ((DEBUG_INFO,
"\n"));
305 DEBUG ((DEBUG_INFO,
"0x%02x | ", ObjectNode->AmlByteEncoding->OpCode));
306 DEBUG ((DEBUG_INFO,
"0x%02x | ", ObjectNode->AmlByteEncoding->SubOpCode));
314 ObjectNode->AmlByteEncoding->OpCode,
324 ObjectNode->AmlByteEncoding->OpCode,
325 ObjectNode->AmlByteEncoding->SubOpCode
330 DEBUG ((DEBUG_INFO,
"%3d | ", ObjectNode->AmlByteEncoding->MaxIndex));
331 DEBUG ((DEBUG_INFO,
"0x%08x | ", ObjectNode->AmlByteEncoding->Attribute));
332 DEBUG ((DEBUG_INFO,
"0x%04x | ", ObjectNode->PkgLen));
334 AMLDBG_PRINT_NAMESTR (
340 DEBUG ((DEBUG_INFO,
"\n"));
363 DEBUG ((DEBUG_INFO,
"%8x | ", RootNode->SdtHeader->Signature));
364 DEBUG ((DEBUG_INFO,
"0x%08x | ", RootNode->SdtHeader->Length));
365 DEBUG ((DEBUG_INFO,
"%3d | ", RootNode->SdtHeader->Revision));
366 DEBUG ((DEBUG_INFO,
"0x%02x | ", RootNode->SdtHeader->Checksum));
370 RootNode->SdtHeader->OemId[0],
371 RootNode->SdtHeader->OemId[1],
372 RootNode->SdtHeader->OemId[2],
373 RootNode->SdtHeader->OemId[3],
374 RootNode->SdtHeader->OemId[4],
375 RootNode->SdtHeader->OemId[5]
377 DEBUG ((DEBUG_INFO,
"%-16llx | ", RootNode->SdtHeader->OemTableId));
378 DEBUG ((DEBUG_INFO,
"%8x | ", RootNode->SdtHeader->OemRevision));
379 DEBUG ((DEBUG_INFO,
"%8x | ", RootNode->SdtHeader->CreatorId));
380 DEBUG ((DEBUG_INFO,
"%8x", RootNode->SdtHeader->CreatorRevision));
381 DEBUG ((DEBUG_INFO,
"\n"));
393 DEBUG ((DEBUG_INFO,
"Lvl | Node Type |\n"));
396 " | %-15a | Signature| Length | Rev | CSum | OemId | "
397 "OemTableId | OemRev | CreatorId| CreatorRev\n",
402 " | %-15a | Op | SubOp| OpName | MaxI| Attribute | "
403 "PkgLen | NodeName (opt)\n",
408 " | %-15a | Data Type | Size | "
414 "---------------------------------------"
415 "---------------------------------------\n"
462 while (ChildNode !=
NULL) {
463 ASSERT (Level < MAX_UINT8);
512 UINT32 PartLineChars;
513 UINT32 AsciiBufferIndex;
514 CHAR8 AsciiBuffer[17];
517 AsciiBufferIndex = 0;
519 DEBUG ((DEBUG_VERBOSE,
"Address : 0x%p\n", Ptr));
520 DEBUG ((DEBUG_VERBOSE,
"Length : %lld", Length));
522 while (ByteCount < Length) {
523 if ((ByteCount & 0x0F) == 0) {
524 AsciiBuffer[AsciiBufferIndex] =
'\0';
525 DEBUG ((DEBUG_VERBOSE,
" %a\n%08X : ", AsciiBuffer, ByteCount));
526 AsciiBufferIndex = 0;
527 }
else if ((ByteCount & 0x07) == 0) {
528 DEBUG ((DEBUG_VERBOSE,
"- "));
531 if ((*Ptr >=
' ') && (*Ptr < 0x7F)) {
532 AsciiBuffer[AsciiBufferIndex++] = *Ptr;
534 AsciiBuffer[AsciiBufferIndex++] =
'.';
537 DEBUG ((DEBUG_VERBOSE,
"%02X ", *Ptr++));
544 PartLineChars = (Length & 0x0F);
545 if (PartLineChars != 0) {
546 PartLineChars = 48 - (PartLineChars * 3);
547 if ((Length & 0x0F) <= 8) {
551 while (PartLineChars > 0) {
552 DEBUG ((DEBUG_VERBOSE,
" "));
558 AsciiBuffer[AsciiBufferIndex] =
'\0';
559 DEBUG ((DEBUG_VERBOSE,
" %a\n\n", AsciiBuffer));
#define AML_IS_FIELD_ELEMENT
STATIC VOID EFIAPI AmlDbgPrintTableHeader(VOID)
VOID EFIAPI AmlDbgPrintNameString(IN CONST CHAR8 *Buffer, IN BOOLEAN NewLine)
STATIC VOID EFIAPI AmlDbgPrintNodeHeader(IN AML_NODE_HEADER *Node, IN UINT8 Level)
STATIC VOID EFIAPI AmlDbgPrintTreeInternal(IN AML_NODE_HEADER *Node, IN BOOLEAN Recurse, IN UINT8 Level)
VOID EFIAPI AmlDbgPrintNameSeg(IN CONST CHAR8 *Buffer)
STATIC VOID EFIAPI AmlDbgPrintRootNode(IN AML_ROOT_NODE *RootNode, IN UINT8 Level)
VOID EFIAPI AmlDbgDumpRaw(IN CONST UINT8 *Ptr, IN UINT32 Length)
VOID EFIAPI AmlDbgPrintNode(IN AML_NODE_HEADER *Node)
CONST CHAR8 * NodeDataTypeStrTbl[]
STATIC VOID EFIAPI AmlDbgPrintDataNode(IN AML_DATA_NODE *DataNode, IN UINT8 Level)
VOID EFIAPI AmlDbgPrintTree(IN AML_NODE_HEADER *Node)
CONST CHAR8 * NodeTypeStrTbl[]
STATIC VOID EFIAPI AmlDbgPrintObjectNode(IN AML_OBJECT_NODE *ObjectNode, IN UINT8 Level)
BOOLEAN EFIAPI AmlNodeHasAttribute(IN CONST AML_OBJECT_NODE *ObjectNode, IN AML_OP_ATTRIBUTE Attribute)
CHAR8 *EFIAPI AmlNodeGetName(IN CONST AML_OBJECT_NODE *ObjectNode)
#define IS_AML_ROOT_NODE(Node)
#define IS_AML_OBJECT_NODE(Node)
#define IS_AML_DATA_NODE(Node)
#define IS_AML_NODE_VALID(Node)
AML_NODE_HEADER *EFIAPI AmlGetNextSibling(IN CONST AML_NODE_HEADER *Node, IN CONST AML_NODE_HEADER *ChildNode)
CONST CHAR8 * AmlGetOpCodeStr(IN UINT8 OpCode, IN UINT8 SubOpCode)
CONST CHAR8 * AmlGetFieldOpCodeStr(IN UINT8 OpCode, IN UINT8 SubOpCode)
BOOLEAN EFIAPI AmlIsLeadNameChar(IN CHAR8 Ch)
BOOLEAN EFIAPI AmlIsNameSeg(IN CONST CHAR8 *AmlBuffer)
#define DEBUG(Expression)
VOID EFIAPI AmlDbgPrintChars(IN UINT32 ErrorLevel, IN CONST CHAR8 *Buffer, IN UINT32 Size)
@ EAmlNodeRoot
AML Root Node, typically represents a DefinitionBlock.
@ EAmlNodeDataTypeString
EAmlString, NULL terminated string.
@ EAmlNodeDataTypeNameString