FreeBSD/sys/contrib/dev/acpica/common/dmtable.c
/*******************************************************************************
 *
 * FUNCTION:    AcpiDmDumpDataTable
 *
 * PARAMETERS:  Table               - An ACPI table
 *
 * RETURN:      None.
 *
 * DESCRIPTION: Format the contents of an ACPI data table (any table other
 *              than an SSDT or DSDT that does not contain executable AML code)
 *
 ******************************************************************************/
AcpiDmDumpDataTable
PARAMETERS:  Table               - An ACPI table

None.

Format the contents of an ACPI data table (any table other
than an SSDT or DSDT that does not contain executable AML code)
AcpiDmDumpDataTable PARAMETERS : Table - An ACPI table None . Format the contents of an ACPI data table ( any table other than an SSDT or DSDT that does not contain executable AML code )
void
AcpiDmDumpDataTable (
    ACPI_TABLE_HEADER       *Table)
{
    ACPI_STATUS             Status;
    const ACPI_DMTABLE_DATA *TableData;
    UINT32                  Length;
    if (AcpiUtIsAmlTable (Table))
    {
        if (Gbl_VerboseTemplates)
        {
            Length = Table->Length;
            AcpiOsPrintf ("\n/*\n%s: Length %d (0x%X)\n\n",
                ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
            AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table),
                Length, DB_BYTE_DISPLAY, 0);
            AcpiOsPrintf (" */\n");
        }
        return;
    }
    if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS))
    {
        Length = Table->Length;
        Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoFacs);
        if (ACPI_FAILURE (Status))
        {
            return;
        }
    }
    else if (ACPI_VALIDATE_RSDP_SIG (Table->Signature))
    {
        Length = AcpiDmDumpRsdp (Table);
    }
    else if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_S3PT))
    {
        Length = AcpiDmDumpS3pt (Table);
    }
    else
    {
        Length = Table->Length;
        Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHeader);
        if (ACPI_FAILURE (Status))
        {
            return;
        }
        AcpiOsPrintf ("\n");
        TableData = AcpiDmGetTableData (Table->Signature);
        if (!TableData)
        {
            if (!strncmp (Table->Signature, "OEM", 3))
            {
                AcpiOsPrintf ("\n**** OEM-defined ACPI table [%4.4s], unknown contents\n\n",
                    Table->Signature);
            }
            else
            {
                AcpiOsPrintf ("\n**** Unknown ACPI table signature [%4.4s]\n\n",
                    Table->Signature);
                fprintf (stderr, "Unknown ACPI table signature [%4.4s], ",
                    Table->Signature);
                if (!AcpiGbl_ForceAmlDisassembly)
                {
                    fprintf (stderr, "decoding ACPI table header only\n");
                }
                else
                {
                    fprintf (stderr, "assuming table contains valid AML code\n");
                }
            }
        }
        else if (TableData->TableHandler)
        {
            TableData->TableHandler (Table);
        }
        else if (TableData->TableInfo)
        {
            Status = AcpiDmDumpTable (Length, 0, Table, 0, TableData->TableInfo);
            if (ACPI_FAILURE (Status))
            {
                return;
            }
        }
    }
    if (!Gbl_DoTemplates || Gbl_VerboseTemplates)
    {
        AcpiOsPrintf ("\n%s: Length %d (0x%X)\n\n",
            ACPI_RAW_TABLE_DATA_HEADER, Length, Length);
        AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, Table),
            Length, DB_BYTE_DISPLAY, 0);
    }
}
void AcpiDmDumpDataTable ( ACPI_TABLE_HEADER * Table ) { ACPI_STATUS Status ; const ACPI_DMTABLE_DATA * TableData ; UINT32 Length ; if ( AcpiUtIsAmlTable ( Table ) ) { if ( Gbl_VerboseTemplates ) { Length = Table -> Length ; AcpiOsPrintf ( " \n \n \n \n " , ACPI_RAW_TABLE_DATA_HEADER , Length , Length ) ; AcpiUtDumpBuffer ( ACPI_CAST_PTR ( UINT8 , Table ) , Length , DB_BYTE_DISPLAY , 0 ) ; AcpiOsPrintf ( " \n " ) ; } return ; } if ( ACPI_COMPARE_NAME ( Table -> Signature , ACPI_SIG_FACS ) ) { Length = Table -> Length ; Status = AcpiDmDumpTable ( Length , 0 , Table , 0 , AcpiDmTableInfoFacs ) ; if ( ACPI_FAILURE ( Status ) ) { return ; } } else if ( ACPI_VALIDATE_RSDP_SIG ( Table -> Signature ) ) { Length = AcpiDmDumpRsdp ( Table ) ; } else if ( ACPI_COMPARE_NAME ( Table -> Signature , ACPI_SIG_S3PT ) ) { Length = AcpiDmDumpS3pt ( Table ) ; } else { Length = Table -> Length ; Status = AcpiDmDumpTable ( Length , 0 , Table , 0 , AcpiDmTableInfoHeader ) ; if ( ACPI_FAILURE ( Status ) ) { return ; } AcpiOsPrintf ( " \n " ) ; TableData = AcpiDmGetTableData ( Table -> Signature ) ; if ( ! TableData ) { if ( ! strncmp ( Table -> Signature , " " , 3 ) ) { AcpiOsPrintf ( " \n \n \n " , Table -> Signature ) ; } else { AcpiOsPrintf ( " \n \n \n " , Table -> Signature ) ; fprintf ( stderr , " " , Table -> Signature ) ; if ( ! AcpiGbl_ForceAmlDisassembly ) { fprintf ( stderr , " \n " ) ; } else { fprintf ( stderr , " \n " ) ; } } } else if ( TableData -> TableHandler ) { TableData -> TableHandler ( Table ) ; } else if ( TableData -> TableInfo ) { Status = AcpiDmDumpTable ( Length , 0 , Table , 0 , TableData -> TableInfo ) ; if ( ACPI_FAILURE ( Status ) ) { return ; } } } if ( ! Gbl_DoTemplates || Gbl_VerboseTemplates ) { AcpiOsPrintf ( " \n \n \n " , ACPI_RAW_TABLE_DATA_HEADER , Length , Length ) ; AcpiUtDumpBuffer ( ACPI_CAST_PTR ( UINT8 , Table ) , Length , DB_BYTE_DISPLAY , 0 ) ; } }
FUNCTION:    AcpiDmDumpDataTable
 PARAMETERS:  Table               - An ACPI table
FUNCTION : AcpiDmDumpDataTable PARAMETERS : Table - An ACPI table
/* Ignore tables that contain AML */ /* Dump the raw table data */ /*
     * Handle tables that don't use the common ACPI table header structure.
     * Currently, these are the FACS, RSDP, and S3PT.
     */ /*
         * All other tables must use the common ACPI table header, dump it now
         */ /* Match signature and dispatch appropriately */ /* Complex table, has a handler */ /* Simple table, just walk the info table */ /* Dump the raw table data */