FreeBSD/sys/contrib/dev/acpica/components/debugger/dbutils.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiDbDumpExternalObject
 *
 * PARAMETERS:  ObjDesc         - External ACPI object to dump
 *              Level           - Nesting level.
 *
 * RETURN:      None
 *
 * DESCRIPTION: Dump the contents of an ACPI external object
 *
 ******************************************************************************/
AcpiDbDumpExternalObject
PARAMETERS:  ObjDesc         - External ACPI object to dump
Level           - Nesting level.

None

Dump the contents of an ACPI external object
AcpiDbDumpExternalObject PARAMETERS : ObjDesc - External ACPI object to dump Level - Nesting level . None Dump the contents of an ACPI external object
void
AcpiDbDumpExternalObject (
    ACPI_OBJECT             *ObjDesc,
    UINT32                  Level)
{
    UINT32                  i;
    if (!ObjDesc)
    {
        AcpiOsPrintf ("[Null Object]\n");
        return;
    }
    for (i = 0; i < Level; i++)
    {
        AcpiOsPrintf ("  ");
    }
    switch (ObjDesc->Type)
    {
    case ACPI_TYPE_ANY:
        AcpiOsPrintf ("[Null Object] (Type=0)\n");
        break;
    case ACPI_TYPE_INTEGER:
        AcpiOsPrintf ("[Integer] = %8.8X%8.8X\n",
            ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
        break;
    case ACPI_TYPE_STRING:
        AcpiOsPrintf ("[String] Length %.2X = ", ObjDesc->String.Length);
        AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX);
        AcpiOsPrintf ("\n");
        break;
    case ACPI_TYPE_BUFFER:
        AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length);
        if (ObjDesc->Buffer.Length)
        {
            if (ObjDesc->Buffer.Length > 16)
            {
                AcpiOsPrintf ("\n");
            }
            AcpiUtDebugDumpBuffer (
                ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
                ObjDesc->Buffer.Length, DB_BYTE_DISPLAY, _COMPONENT);
        }
        else
        {
            AcpiOsPrintf ("\n");
        }
        break;
    case ACPI_TYPE_PACKAGE:
        AcpiOsPrintf ("[Package] Contains %u Elements:\n",
            ObjDesc->Package.Count);
        for (i = 0; i < ObjDesc->Package.Count; i++)
        {
            AcpiDbDumpExternalObject (
                &ObjDesc->Package.Elements[i], Level+1);
        }
        break;
    case ACPI_TYPE_LOCAL_REFERENCE:
        AcpiOsPrintf ("[Object Reference] = ");
        AcpiDbDisplayInternalObject (ObjDesc->Reference.Handle, NULL);
        break;
    case ACPI_TYPE_PROCESSOR:
        AcpiOsPrintf ("[Processor]\n");
        break;
    case ACPI_TYPE_POWER:
        AcpiOsPrintf ("[Power Resource]\n");
        break;
    default:
        AcpiOsPrintf ("[Unknown Type] %X\n", ObjDesc->Type);
        break;
    }
}
void AcpiDbDumpExternalObject ( ACPI_OBJECT * ObjDesc , UINT32 Level ) { UINT32 i ; if ( ! ObjDesc ) { AcpiOsPrintf ( " \n " ) ; return ; } for ( i = 0 ; i < Level ; i ++ ) { AcpiOsPrintf ( " " ) ; } switch ( ObjDesc -> Type ) { case ACPI_TYPE_ANY : AcpiOsPrintf ( " \n " ) ; break ; case ACPI_TYPE_INTEGER : AcpiOsPrintf ( " \n " , ACPI_FORMAT_UINT64 ( ObjDesc -> Integer . Value ) ) ; break ; case ACPI_TYPE_STRING : AcpiOsPrintf ( " " , ObjDesc -> String . Length ) ; AcpiUtPrintString ( ObjDesc -> String . Pointer , ACPI_UINT8_MAX ) ; AcpiOsPrintf ( " \n " ) ; break ; case ACPI_TYPE_BUFFER : AcpiOsPrintf ( " " , ObjDesc -> Buffer . Length ) ; if ( ObjDesc -> Buffer . Length ) { if ( ObjDesc -> Buffer . Length > 16 ) { AcpiOsPrintf ( " \n " ) ; } AcpiUtDebugDumpBuffer ( ACPI_CAST_PTR ( UINT8 , ObjDesc -> Buffer . Pointer ) , ObjDesc -> Buffer . Length , DB_BYTE_DISPLAY , _COMPONENT ) ; } else { AcpiOsPrintf ( " \n " ) ; } break ; case ACPI_TYPE_PACKAGE : AcpiOsPrintf ( " \n " , ObjDesc -> Package . Count ) ; for ( i = 0 ; i < ObjDesc -> Package . Count ; i ++ ) { AcpiDbDumpExternalObject ( & ObjDesc -> Package . Elements [ i ] , Level + 1 ) ; } break ; case ACPI_TYPE_LOCAL_REFERENCE : AcpiOsPrintf ( " " ) ; AcpiDbDisplayInternalObject ( ObjDesc -> Reference . Handle , NULL ) ; break ; case ACPI_TYPE_PROCESSOR : AcpiOsPrintf ( " \n " ) ; break ; case ACPI_TYPE_POWER : AcpiOsPrintf ( " \n " ) ; break ; default : AcpiOsPrintf ( " \n " , ObjDesc -> Type ) ; break ; } }
FUNCTION:    AcpiDbDumpExternalObject
 PARAMETERS:  ObjDesc         - External ACPI object to dump
              Level           - Nesting level.
FUNCTION : AcpiDbDumpExternalObject PARAMETERS : ObjDesc - External ACPI object to dump Level - Nesting level .