void DtWriteTableToListing ( void) { UINT8 *Buffer; if (!Gbl_ListingFlag) { return; } /* Read the entire table from the output file */ Buffer = UtLocalCalloc (Gbl_TableLength); FlSeekFile (ASL_FILE_AML_OUTPUT, 0); FlReadFile (ASL_FILE_AML_OUTPUT, Buffer, Gbl_TableLength); /* Dump the raw table data */ AcpiOsRedirectOutput (Gbl_Files[ASL_FILE_LISTING_OUTPUT].Handle); AcpiOsPrintf ("\n%s: Length %d (0x%X)\n\n", ACPI_RAW_TABLE_DATA_HEADER, Gbl_TableLength, Gbl_TableLength); AcpiUtDumpBuffer2 (Buffer, Gbl_TableLength, DB_BYTE_DISPLAY); AcpiOsRedirectOutput (stdout); }
void AcpiUtDumpBuffer ( UINT8 *Buffer, UINT32 Count, UINT32 Display, UINT32 ComponentId) { /* Only dump the buffer if tracing is enabled */ if (!((ACPI_LV_TABLES & AcpiDbgLevel) && (ComponentId & AcpiDbgLayer))) { return; } AcpiUtDumpBuffer2 (Buffer, Count, Display); }
void AcpiExDoDebugObject ( ACPI_OPERAND_OBJECT *SourceDesc, UINT32 Level, UINT32 Index) { UINT32 i; ACPI_FUNCTION_TRACE_PTR (ExDoDebugObject, SourceDesc); /* Output must be enabled via the DebugObject global or the DbgLevel */ if (!AcpiGbl_EnableAmlDebugObject && !(AcpiDbgLevel & ACPI_LV_DEBUG_OBJECT)) { return_VOID; } /* * Print line header as long as we are not in the middle of an * object display */ if (!((Level > 0) && Index == 0)) { AcpiOsPrintf ("[ACPI Debug] %*s", Level, " "); } /* Display the index for package output only */ if (Index > 0) { AcpiOsPrintf ("(%.2u) ", Index-1); } if (!SourceDesc) { AcpiOsPrintf ("[Null Object]\n"); return_VOID; } if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_OPERAND) { AcpiOsPrintf ("%s ", AcpiUtGetObjectTypeName (SourceDesc)); if (!AcpiUtValidInternalObject (SourceDesc)) { AcpiOsPrintf ("%p, Invalid Internal Object!\n", SourceDesc); return_VOID; } } else if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_NAMED) { AcpiOsPrintf ("%s: %p\n", AcpiUtGetTypeName (((ACPI_NAMESPACE_NODE *) SourceDesc)->Type), SourceDesc); return_VOID; } else { return_VOID; } /* SourceDesc is of type ACPI_DESC_TYPE_OPERAND */ switch (SourceDesc->Common.Type) { case ACPI_TYPE_INTEGER: /* Output correct integer width */ if (AcpiGbl_IntegerByteWidth == 4) { AcpiOsPrintf ("0x%8.8X\n", (UINT32) SourceDesc->Integer.Value); } else { AcpiOsPrintf ("0x%8.8X%8.8X\n", ACPI_FORMAT_UINT64 (SourceDesc->Integer.Value)); } break; case ACPI_TYPE_BUFFER: AcpiOsPrintf ("[0x%.2X]\n", (UINT32) SourceDesc->Buffer.Length); AcpiUtDumpBuffer2 (SourceDesc->Buffer.Pointer, (SourceDesc->Buffer.Length < 256) ? SourceDesc->Buffer.Length : 256, DB_BYTE_DISPLAY); break; case ACPI_TYPE_STRING: AcpiOsPrintf ("[0x%.2X] \"%s\"\n", SourceDesc->String.Length, SourceDesc->String.Pointer); break; case ACPI_TYPE_PACKAGE: AcpiOsPrintf ("[Contains 0x%.2X Elements]\n", SourceDesc->Package.Count); /* Output the entire contents of the package */ for (i = 0; i < SourceDesc->Package.Count; i++) { AcpiExDoDebugObject (SourceDesc->Package.Elements[i], Level+4, i+1); } break; case ACPI_TYPE_LOCAL_REFERENCE: AcpiOsPrintf ("[%s] ", AcpiUtGetReferenceName (SourceDesc)); /* Decode the reference */ switch (SourceDesc->Reference.Class) { case ACPI_REFCLASS_INDEX: AcpiOsPrintf ("0x%X\n", SourceDesc->Reference.Value); break; case ACPI_REFCLASS_TABLE: /* Case for DdbHandle */ AcpiOsPrintf ("Table Index 0x%X\n", SourceDesc->Reference.Value); return; default: break; } AcpiOsPrintf (" "); /* Check for valid node first, then valid object */ if (SourceDesc->Reference.Node) { if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Node) != ACPI_DESC_TYPE_NAMED) { AcpiOsPrintf (" %p - Not a valid namespace node\n", SourceDesc->Reference.Node); } else { AcpiOsPrintf ("Node %p [%4.4s] ", SourceDesc->Reference.Node, (SourceDesc->Reference.Node)->Name.Ascii); switch ((SourceDesc->Reference.Node)->Type) { /* These types have no attached object */ case ACPI_TYPE_DEVICE: AcpiOsPrintf ("Device\n"); break; case ACPI_TYPE_THERMAL: AcpiOsPrintf ("Thermal Zone\n"); break; default: AcpiExDoDebugObject ((SourceDesc->Reference.Node)->Object, Level+4, 0); break; } } } else if (SourceDesc->Reference.Object) { if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Object) == ACPI_DESC_TYPE_NAMED) { AcpiExDoDebugObject (((ACPI_NAMESPACE_NODE *) SourceDesc->Reference.Object)->Object, Level+4, 0); } else { AcpiExDoDebugObject (SourceDesc->Reference.Object, Level+4, 0); } } break; default: AcpiOsPrintf ("%p\n", SourceDesc); break; } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "\n")); return_VOID; }