dmtbdump.c revision 199767f8919635c4928607450d9e0abb932109ce
/******************************************************************************
*
* Module Name: dmtbdump - Dump ACPI data tables that contain no AML code
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
/* This module used for application-level code only */
#define _COMPONENT ACPI_CA_DISASSEMBLER
ACPI_MODULE_NAME ("dmtbdump")
/* Local prototypes */
static void
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpBuffer
*
* PARAMETERS: Table - ACPI Table or subtable
* BufferOffset - Offset of buffer from Table above
* Length - Length of the buffer
* AbsoluteOffset - Offset of buffer in the main ACPI table
* Header - Name of the buffer field (printed on the
* first line only.)
*
* RETURN: None
*
* DESCRIPTION: Format the contents of an arbitrary length data buffer (in the
* disassembler output format.)
*
******************************************************************************/
void
void *Table,
char *Header)
{
UINT32 i;
if (!Length)
{
return;
}
i = 0;
while (i < Length)
{
if (!(i % 16))
{
/* Insert a backslash - line continuation character */
if (Length > 16)
{
AcpiOsPrintf ("\\\n ");
}
}
i++;
Buffer++;
}
AcpiOsPrintf ("\n");
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpUnicode
*
* PARAMETERS: Table - ACPI Table or subtable
* BufferOffset - Offset of buffer from Table above
* ByteLength - Length of the buffer
*
* RETURN: None
*
* DESCRIPTION: Validate and dump the contents of a buffer that contains
* unicode data. The output is a standard ASCII string. If it
* appears that the data is not unicode, the buffer is dumped
* as hex characters.
*
******************************************************************************/
void
void *Table,
{
UINT32 i;
/* Ensure all low bytes are entirely printable ASCII */
for (i = 0; i < Length; i += 2)
{
{
goto DumpRawBuffer;
}
}
/* Ensure all high bytes are zero */
{
if (Buffer[i])
{
goto DumpRawBuffer;
}
}
/* Dump the buffer as a normal string */
AcpiOsPrintf ("\"");
for (i = 0; i < Length; i += 2)
{
}
AcpiOsPrintf ("\"\n");
return;
BufferOffset, NULL);
AcpiOsPrintf ("\n");
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpRsdp
*
* PARAMETERS: Table - A RSDP
*
* RETURN: Length of the table (there is not always a length field,
* use revision or length if available (ACPI 2.0+))
*
* DESCRIPTION: Format the contents of a RSDP
*
******************************************************************************/
{
/* Dump the common ACPI 1.0 portion */
if (ACPI_FAILURE (Status))
{
return (Length);
}
/* Validate the first checksum */
{
AcpiOsPrintf ("/* Incorrect Checksum above, should be 0x%2.2X */\n",
Checksum);
}
/* The RSDP for ACPI 2.0+ contains more data and has a Length field */
{
if (ACPI_FAILURE (Status))
{
return (Length);
}
/* Validate the extended checksum over entire RSDP */
{
"/* Incorrect Extended Checksum above, should be 0x%2.2X */\n",
Checksum);
}
}
return (Length);
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpRsdt
*
* PARAMETERS: Table - A RSDT
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a RSDT
*
******************************************************************************/
void
{
UINT32 i;
/* Point to start of table pointer array */
Offset = sizeof (ACPI_TABLE_HEADER);
/* RSDT uses 32-bit pointers */
for (i = 0; i < Entries; i++)
{
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpXsdt
*
* PARAMETERS: Table - A XSDT
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a XSDT
*
******************************************************************************/
void
{
UINT32 i;
/* Point to start of table pointer array */
Offset = sizeof (ACPI_TABLE_HEADER);
/* XSDT uses 64-bit pointers */
for (i = 0; i < Entries; i++)
{
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpFadt
*
* PARAMETERS: Table - A FADT
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a FADT
*
* NOTE: We cannot depend on the FADT version to indicate the actual
* contents of the FADT because of BIOS bugs. The table length
* is the only reliable indicator.
*
******************************************************************************/
void
{
/* Always dump the minimum FADT revision 1 fields (ACPI 1.0) */
if (ACPI_FAILURE (Status))
{
return;
}
/* Check for FADT revision 2 fields (ACPI 1.0B MS extensions) */
{
if (ACPI_FAILURE (Status))
{
return;
}
}
/* Check for FADT revision 3/4 fields and up (ACPI 2.0+ extended data) */
{
if (ACPI_FAILURE (Status))
{
return;
}
/* Check for FADT revision 5 fields and up (ACPI 5.0+) */
{
if (ACPI_FAILURE (Status))
{
return;
}
}
/* Check for FADT revision 6 fields and up (ACPI 6.0+) */
{
if (ACPI_FAILURE (Status))
{
return;
}
}
}
/* Validate various fields in the FADT, including length */
/* Validate FADT length against the revision */
}
/*******************************************************************************
*
* FUNCTION: AcpiDmValidateFadtLength
*
* PARAMETERS: Revision - FADT revision (Header->Revision)
* Length - FADT length (Header->Length
*
* RETURN: None
*
* DESCRIPTION: Check the FADT revision against the expected table length for
* that revision. Issue a warning if the length is not what was
* expected. This seems to be such a common BIOS bug that the
* FADT revision has been rendered virtually meaningless.
*
******************************************************************************/
static void
{
switch (Revision)
{
case 0:
AcpiOsPrintf ("// ACPI Warning: Invalid FADT revision: 0\n");
return;
case 1:
break;
case 2:
break;
case 3:
case 4:
break;
case 5:
break;
default:
return;
}
if (Length == ExpectedLength)
{
return;
}
"\n// ACPI Warning: FADT revision %X does not match length: found %X expected %X\n",
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpAsf
*
* PARAMETERS: Table - A ASF table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a ASF table
*
******************************************************************************/
void
{
UINT32 DataLength = 0;
UINT32 DataOffset = 0;
UINT32 i;
/* No main table, only subtables */
{
/* Common subtable header */
if (ACPI_FAILURE (Status))
{
return;
}
/* The actual type is the lower 7 bits of Type */
switch (Type)
{
case ACPI_ASF_TYPE_INFO:
break;
case ACPI_ASF_TYPE_ALERT:
break;
case ACPI_ASF_TYPE_CONTROL:
break;
case ACPI_ASF_TYPE_BOOT:
break;
case ACPI_ASF_TYPE_ADDRESS:
break;
default:
return;
}
if (ACPI_FAILURE (Status))
{
return;
}
/* Dump variable-length extra data */
switch (Type)
{
case ACPI_ASF_TYPE_ALERT:
case ACPI_ASF_TYPE_CONTROL:
for (i = 0; i < DataCount; i++)
{
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
DataOffset += DataLength;
}
break;
case ACPI_ASF_TYPE_ADDRESS:
for (i = 0; i < DataLength; i++)
{
if (!(i % 16))
{
}
DataTable++;
DataOffset++;
{
AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure! (ASF! table)\n");
return;
}
}
AcpiOsPrintf ("\n");
break;
default:
break;
}
AcpiOsPrintf ("\n");
/* Point to next subtable */
{
AcpiOsPrintf ("Invalid zero subtable header length\n");
return;
}
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpCpep
*
* PARAMETERS: Table - A CPEP table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a CPEP. This table type consists
* of an open-ended number of subtables.
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
{
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
/* Point to next subtable */
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpCsrt
*
* PARAMETERS: Table - A CSRT table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a CSRT. This table type consists
* of an open-ended number of subtables.
*
******************************************************************************/
void
{
/* The main table only contains the ACPI header, thus already handled */
/* Subtables (Resource Groups) */
{
/* Resource group subtable */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
/* Shared info subtable (One per resource group) */
SubOffset = sizeof (ACPI_CSRT_GROUP);
AcpiOsPrintf ("\n");
sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1);
if (ACPI_FAILURE (Status))
{
return;
}
/* Sub-Subtables (Resource Descriptors) */
{
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
SubSubOffset = sizeof (ACPI_CSRT_DESCRIPTOR);
/* Resource-specific info buffer */
if (InfoLength)
{
if (ACPI_FAILURE (Status))
{
return;
}
}
/* Point to next sub-subtable */
}
/* Point to next subtable */
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpDbg2
*
* PARAMETERS: Table - A DBG2 table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a DBG2. This table type consists
* of an open-ended number of subtables.
*
******************************************************************************/
void
{
UINT32 i;
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
{
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
/* Dump the BaseAddress array */
for (i = 0; i < SubTable->RegisterCount; i++)
{
(sizeof (ACPI_GENERIC_ADDRESS) * i);
if (ACPI_FAILURE (Status))
{
return;
}
}
/* Dump the AddressSize array */
for (i = 0; i < SubTable->RegisterCount; i++)
{
(sizeof (UINT32) * i);
if (ACPI_FAILURE (Status))
{
return;
}
}
/* Dump the Namestring (required) */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
/* Dump the OemData (optional) */
if (SubTable->OemDataOffset)
{
if (ACPI_FAILURE (Status))
{
return;
}
}
/* Point to next subtable */
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpDmar
*
* PARAMETERS: Table - A DMAR table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a DMAR. This table type consists
* of an open-ended number of subtables.
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
{
/* Common subtable header */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
AcpiOsPrintf ("\n");
{
ScopeOffset = sizeof (ACPI_DMAR_HARDWARE_UNIT);
break;
ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY);
break;
case ACPI_DMAR_TYPE_ROOT_ATS:
ScopeOffset = sizeof (ACPI_DMAR_ATSR);
break;
ScopeOffset = sizeof (ACPI_DMAR_RHSA);
break;
case ACPI_DMAR_TYPE_NAMESPACE:
ScopeOffset = sizeof (ACPI_DMAR_ANDD);
break;
default:
return;
}
if (ACPI_FAILURE (Status))
{
return;
}
/*
* Dump the optional device scope entries
*/
{
/* These types do not support device scopes */
goto NextSubtable;
}
{
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
AcpiOsPrintf ("\n");
/* Dump the PCI Path entries for this device scope */
sizeof (ACPI_DMAR_DEVICE_SCOPE));
{
/* Point to next PCI Path entry */
PathOffset += 2;
PciPath += 2;
AcpiOsPrintf ("\n");
}
/* Point to next device scope entry */
}
/* Point to next subtable */
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpDrtm
*
* PARAMETERS: Table - A DRTM table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a DRTM.
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
Offset = sizeof (ACPI_TABLE_DRTM);
/* Sub-tables */
/* Dump ValidatedTable length */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
/* Dump Validated table addresses */
Count = 0;
{
if (ACPI_FAILURE (Status))
{
return;
}
Count++;
}
/* Dump ResourceList length */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
/* Dump the Resource List */
Count = 0;
{
sizeof (ACPI_DRTM_RESOURCE),
if (ACPI_FAILURE (Status))
{
return;
}
Offset += sizeof (ACPI_DRTM_RESOURCE);
Count++;
}
/* Dump DPS */
AcpiOsPrintf ("\n");
DrtmDps, sizeof (ACPI_DRTM_DPS_ID),
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpEinj
*
* PARAMETERS: Table - A EINJ table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a EINJ. This table type consists
* of an open-ended number of subtables.
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
{
AcpiOsPrintf ("\n");
sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
if (ACPI_FAILURE (Status))
{
return;
}
/* Point to next subtable (each subtable is of fixed length) */
Offset += sizeof (ACPI_WHEA_HEADER);
sizeof (ACPI_WHEA_HEADER));
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpErst
*
* PARAMETERS: Table - A ERST table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a ERST. This table type consists
* of an open-ended number of subtables.
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
{
AcpiOsPrintf ("\n");
sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0);
if (ACPI_FAILURE (Status))
{
return;
}
/* Point to next subtable (each subtable is of fixed length) */
Offset += sizeof (ACPI_WHEA_HEADER);
sizeof (ACPI_WHEA_HEADER));
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpFpdt
*
* PARAMETERS: Table - A FPDT table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a FPDT. This table type consists
* of an open-ended number of subtables.
*
******************************************************************************/
void
{
/* There is no main table (other than the standard ACPI header) */
/* Subtables */
{
/* Common subtable header */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
{
case ACPI_FPDT_TYPE_BOOT:
break;
case ACPI_FPDT_TYPE_S3PERF:
break;
default:
/* Attempt to continue */
{
AcpiOsPrintf ("Invalid zero length subtable\n");
return;
}
goto NextSubTable;
}
if (ACPI_FAILURE (Status))
{
return;
}
/* Point to next subtable */
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpGtdt
*
* PARAMETERS: Table - A GTDT table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a GTDT. This table type consists
* of an open-ended number of subtables.
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
{
/* Common subtable header */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
GtCount = 0;
{
SubTableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
SubTable))->TimerCount;
break;
case ACPI_GTDT_TYPE_WATCHDOG:
SubTableLength = sizeof (ACPI_GTDT_WATCHDOG);
break;
default:
/* Cannot continue on unknown type - no length */
return;
}
if (ACPI_FAILURE (Status))
{
return;
}
/* Point to end of current subtable (each subtable above is of fixed length) */
Offset += SubTableLength;
/* If there are any Gt Timer Blocks from above, dump them now */
if (GtCount)
{
while (GtCount)
{
AcpiOsPrintf ("\n");
sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a);
if (ACPI_FAILURE (Status))
{
return;
}
Offset += sizeof (ACPI_GTDT_TIMER_ENTRY);
GtxTable++;
GtCount--;
}
}
/* Point to next subtable */
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpHest
*
* PARAMETERS: Table - A HEST table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a HEST. This table type consists
* of an open-ended number of subtables.
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
{
BankCount = 0;
{
SubTableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK);
break;
SubTableLength = sizeof (ACPI_HEST_IA_CORRECTED);
break;
case ACPI_HEST_TYPE_IA32_NMI:
SubTableLength = sizeof (ACPI_HEST_IA_NMI);
break;
SubTableLength = sizeof (ACPI_HEST_AER_ROOT);
break;
SubTableLength = sizeof (ACPI_HEST_AER);
break;
SubTableLength = sizeof (ACPI_HEST_AER_BRIDGE);
break;
SubTableLength = sizeof (ACPI_HEST_GENERIC);
break;
default:
/* Cannot continue on unknown type - no length */
return;
}
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
/* Point to end of current subtable (each subtable above is of fixed length) */
Offset += SubTableLength;
/* If there are any (fixed-length) Error Banks from above, dump them now */
if (BankCount)
{
while (BankCount)
{
AcpiOsPrintf ("\n");
sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank);
if (ACPI_FAILURE (Status))
{
return;
}
Offset += sizeof (ACPI_HEST_IA_ERROR_BANK);
BankTable++;
BankCount--;
}
}
/* Point to next subtable */
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpIort
*
* PARAMETERS: Table - A IORT table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a IORT
*
******************************************************************************/
void
{
char *String;
UINT32 i;
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
Offset = sizeof (ACPI_TABLE_IORT);
/* Dump the OptionalPadding (optional) */
{
if (ACPI_FAILURE (Status))
{
return;
}
}
{
/* Common subtable header */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
NodeOffset = Length;
{
case ACPI_IORT_NODE_ITS_GROUP:
break;
break;
break;
case ACPI_IORT_NODE_SMMU:
break;
default:
AcpiOsPrintf ("\n**** Unknown IORT node type 0x%X\n",
/* Attempt to continue */
{
AcpiOsPrintf ("Invalid zero length IORT node\n");
return;
}
goto NextSubTable;
}
/* Dump the node subtable header */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
NodeOffset += Length;
/* Dump the node specific data */
{
case ACPI_IORT_NODE_ITS_GROUP:
/* Validate IortItsGroup to avoid compiler warnings */
if (IortItsGroup)
{
for (i = 0; i < IortItsGroup->ItsCount; i++)
{
NodeOffset += 4;
}
}
break;
/* Dump the Padding (optional) */
{
if (ACPI_FAILURE (Status))
{
return;
}
}
break;
case ACPI_IORT_NODE_SMMU:
AcpiOsPrintf ("\n");
/* Validate IortSmmu to avoid compiler warnings */
if (IortSmmu)
{
if (ACPI_FAILURE (Status))
{
return;
}
for (i = 0; i < IortSmmu->ContextInterruptCount; i++)
{
if (ACPI_FAILURE (Status))
{
return;
}
NodeOffset += 8;
}
for (i = 0; i < IortSmmu->PmuInterruptCount; i++)
{
if (ACPI_FAILURE (Status))
{
return;
}
NodeOffset += 8;
}
}
break;
default:
break;
}
/* Dump the ID mappings */
for (i = 0; i < IortNode->MappingCount; i++)
{
AcpiOsPrintf ("\n");
Length = sizeof (ACPI_IORT_ID_MAPPING);
if (ACPI_FAILURE (Status))
{
return;
}
NodeOffset += Length;
}
/* Point to next node subtable */
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpIvrs
*
* PARAMETERS: Table - A IVRS table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a IVRS
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
{
/* Common subtable header */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
{
case ACPI_IVRS_TYPE_HARDWARE:
break;
case ACPI_IVRS_TYPE_MEMORY1:
case ACPI_IVRS_TYPE_MEMORY2:
case ACPI_IVRS_TYPE_MEMORY3:
break;
default:
AcpiOsPrintf ("\n**** Unknown IVRS subtable type 0x%X\n",
/* Attempt to continue */
{
AcpiOsPrintf ("Invalid zero length subtable\n");
return;
}
goto NextSubTable;
}
/* Dump the subtable */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
/* The hardware subtable can contain multiple device entries */
{
sizeof (ACPI_IVRS_HARDWARE));
{
AcpiOsPrintf ("\n");
/*
* Upper 2 bits of Type encode the length of the device entry
*
* 00 = 4 byte
* 01 = 8 byte
* 10 = 16 byte - currently no entries defined
* 11 = 32 byte - currently no entries defined
*/
switch (EntryType)
{
/* 4-byte device entries */
case ACPI_IVRS_TYPE_PAD4:
case ACPI_IVRS_TYPE_ALL:
case ACPI_IVRS_TYPE_SELECT:
case ACPI_IVRS_TYPE_START:
case ACPI_IVRS_TYPE_END:
break;
/* 8-byte entries, type A */
break;
/* 8-byte entries, type B */
case ACPI_IVRS_TYPE_PAD8:
case ACPI_IVRS_TYPE_EXT_START:
break;
/* 8-byte entries, type C */
case ACPI_IVRS_TYPE_SPECIAL:
break;
default:
"0x%.2X/0x%X at offset 0x%.4X: (header below)\n",
break;
}
/* Dump the Device Entry */
if (ACPI_FAILURE (Status))
{
return;
}
}
}
/* Point to next subtable */
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpLpit
*
* PARAMETERS: Table - A LPIT table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a LPIT. This table type consists
* of an open-ended number of subtables. Note: There are no
* entries in the main table. An LPIT consists of the table
* header and then subtables only.
*
******************************************************************************/
void
{
/* Subtables */
{
/* Common subtable header */
sizeof (ACPI_LPIT_HEADER), AcpiDmTableInfoLpitHdr);
if (ACPI_FAILURE (Status))
{
return;
}
{
SubTableLength = sizeof (ACPI_LPIT_NATIVE);
break;
default:
/* Cannot continue on unknown type - no length */
return;
}
if (ACPI_FAILURE (Status))
{
return;
}
AcpiOsPrintf ("\n");
/* Point to next subtable */
Offset += SubTableLength;
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpMadt
*
* PARAMETERS: Table - A MADT table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a MADT. This table type consists
* of an open-ended number of subtables.
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
{
/* Common subtable header */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
{
break;
case ACPI_MADT_TYPE_IO_APIC:
break;
break;
break;
break;
break;
case ACPI_MADT_TYPE_IO_SAPIC:
break;
break;
break;
break;
break;
break;
break;
break;
break;
break;
default:
/* Attempt to continue */
{
AcpiOsPrintf ("Invalid zero length subtable\n");
return;
}
goto NextSubTable;
}
if (ACPI_FAILURE (Status))
{
return;
}
/* Point to next subtable */
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpMcfg
*
* PARAMETERS: Table - A MCFG Table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a MCFG table
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
{
{
AcpiOsPrintf ("Warning: there are %u invalid trailing bytes\n",
return;
}
AcpiOsPrintf ("\n");
sizeof (ACPI_MCFG_ALLOCATION), AcpiDmTableInfoMcfg0);
if (ACPI_FAILURE (Status))
{
return;
}
/* Point to next subtable (each subtable is of fixed length) */
Offset += sizeof (ACPI_MCFG_ALLOCATION);
sizeof (ACPI_MCFG_ALLOCATION));
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpMpst
*
* PARAMETERS: Table - A MPST Table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a MPST table
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtable: Memory Power Node(s) */
{
AcpiOsPrintf ("\n");
sizeof (ACPI_MPST_POWER_NODE), AcpiDmTableInfoMpst0);
if (ACPI_FAILURE (Status))
{
return;
}
/* Extract the sub-subtable counts */
Offset += sizeof (ACPI_MPST_POWER_NODE);
/* Sub-subtables - Memory Power State Structure(s) */
sizeof (ACPI_MPST_POWER_NODE));
while (PowerStateCount)
{
AcpiOsPrintf ("\n");
sizeof (ACPI_MPST_POWER_STATE), AcpiDmTableInfoMpst0A);
if (ACPI_FAILURE (Status))
{
return;
}
SubTable0A++;
Offset += sizeof (ACPI_MPST_POWER_STATE);
}
/* Sub-subtables - Physical Component ID Structure(s) */
if (ComponentCount)
{
AcpiOsPrintf ("\n");
}
while (ComponentCount)
{
sizeof (ACPI_MPST_COMPONENT), AcpiDmTableInfoMpst0B);
if (ACPI_FAILURE (Status))
{
return;
}
SubTable0B++;
Offset += sizeof (ACPI_MPST_COMPONENT);
}
/* Point to next Memory Power Node subtable */
sizeof (ACPI_MPST_POWER_NODE) +
}
/* Subtable: Count of Memory Power State Characteristic structures */
AcpiOsPrintf ("\n");
sizeof (ACPI_MPST_DATA_HDR), AcpiDmTableInfoMpst1);
if (ACPI_FAILURE (Status))
{
return;
}
Offset += sizeof (ACPI_MPST_DATA_HDR);
/* Subtable: Memory Power State Characteristics structure(s) */
{
AcpiOsPrintf ("\n");
sizeof (ACPI_MPST_POWER_DATA), AcpiDmTableInfoMpst2);
if (ACPI_FAILURE (Status))
{
return;
}
SubTable2++;
Offset += sizeof (ACPI_MPST_POWER_DATA);
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpMsct
*
* PARAMETERS: Table - A MSCT table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a MSCT
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
{
/* Common subtable header */
AcpiOsPrintf ("\n");
sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0);
if (ACPI_FAILURE (Status))
{
return;
}
/* Point to next subtable */
Offset += sizeof (ACPI_MSCT_PROXIMITY);
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpMtmr
*
* PARAMETERS: Table - A MTMR table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a MTMR
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
{
/* Common subtable header */
AcpiOsPrintf ("\n");
sizeof (ACPI_MTMR_ENTRY), AcpiDmTableInfoMtmr0);
if (ACPI_FAILURE (Status))
{
return;
}
/* Point to next subtable */
Offset += sizeof (ACPI_MTMR_ENTRY);
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpNfit
*
* PARAMETERS: Table - A NFIT table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of an NFIT.
*
******************************************************************************/
void
{
UINT32 FieldOffset = 0;
UINT32 i;
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
{
/* NFIT subtable header */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
{
break;
break;
/* Has a variable number of 32-bit values at the end */
FieldOffset = sizeof (ACPI_NFIT_INTERLEAVE);
break;
case ACPI_NFIT_TYPE_SMBIOS:
break;
break;
break;
/* Has a variable number of 64-bit addresses at the end */
break;
default:
/* Attempt to continue */
{
AcpiOsPrintf ("Invalid zero length subtable\n");
return;
}
goto NextSubTable;
}
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
/* Per-subtable variable-length fields */
{
for (i = 0; i < Interleave->LineCount; i++)
{
&Interleave->LineOffset[i],
sizeof (UINT32), AcpiDmTableInfoNfit2a);
if (ACPI_FAILURE (Status))
{
return;
}
FieldOffset += sizeof (UINT32);
}
break;
case ACPI_NFIT_TYPE_SMBIOS:
if (Length)
{
sizeof (ACPI_NFIT_SMBIOS) - sizeof (UINT8),
if (ACPI_FAILURE (Status))
{
return;
}
}
break;
{
&Hint->HintAddress[i],
sizeof (UINT64), AcpiDmTableInfoNfit6a);
if (ACPI_FAILURE (Status))
{
return;
}
FieldOffset += sizeof (UINT64);
}
break;
default:
break;
}
/* Point to next subtable */
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpPcct
*
* PARAMETERS: Table - A PCCT table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a PCCT. This table type consists
* of an open-ended number of subtables.
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
{
/* Common subtable header */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
{
break;
break;
default:
"\n**** Unexpected or unknown PCCT subtable type 0x%X\n\n",
return;
}
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
/* Point to next subtable */
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpPmtt
*
* PARAMETERS: Table - A PMTT table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a PMTT. This table type consists
* of an open-ended number of subtables.
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
{
/* Common subtable header */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
/* Only Socket subtables are expected at this level */
{
"\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n",
return;
}
/* Dump the fixed-length portion of the subtable */
if (ACPI_FAILURE (Status))
{
return;
}
/* Walk the memory controller subtables */
MemOffset = sizeof (ACPI_PMTT_SOCKET);
sizeof (ACPI_PMTT_SOCKET));
{
/* Common subtable header */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
/* Only memory controller subtables are expected at this level */
{
"\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n",
MemSubTable->Type);
return;
}
/* Dump the fixed-length portion of the controller subtable */
if (ACPI_FAILURE (Status))
{
return;
}
/* Walk the variable count of proximity domains */
DomainOffset = sizeof (ACPI_PMTT_CONTROLLER);
sizeof (ACPI_PMTT_CONTROLLER));
{
sizeof (ACPI_PMTT_DOMAIN), AcpiDmTableInfoPmtt1a);
if (ACPI_FAILURE (Status))
{
return;
}
DomainOffset += sizeof (ACPI_PMTT_DOMAIN);
DomainArray++;
DomainCount--;
}
if (DomainCount)
{
"\n**** DomainCount exceeds subtable length\n\n");
}
/* Walk the physical component (DIMM) subtables */
{
/* Common subtable header */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
/* Only DIMM subtables are expected at this level */
{
"\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n",
DimmSubTable->Type);
return;
}
/* Dump the fixed-length DIMM subtable */
if (ACPI_FAILURE (Status))
{
return;
}
/* Point to next DIMM subtable */
}
/* Point to next Controller subtable */
}
/* Point to next Socket subtable */
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpS3pt
*
* PARAMETERS: Table - A S3PT table
*
* RETURN: Length of the table
*
* DESCRIPTION: Format the contents of a S3PT
*
******************************************************************************/
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return 0;
}
{
/* Common subtable header */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return 0;
}
{
case ACPI_S3PT_TYPE_RESUME:
break;
case ACPI_S3PT_TYPE_SUSPEND:
break;
default:
/* Attempt to continue */
{
AcpiOsPrintf ("Invalid zero length subtable\n");
return 0;
}
goto NextSubTable;
}
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return 0;
}
/* Point to next subtable */
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpSlic
*
* PARAMETERS: Table - A SLIC table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a SLIC
*
******************************************************************************/
void
{
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpSlit
*
* PARAMETERS: Table - An SLIT
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a SLIT
*
******************************************************************************/
void
{
UINT32 i;
UINT32 j;
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Display the Locality NxN Matrix */
for (i = 0; i < Localities; i++)
{
/* Display one row of the matrix */
for (j = 0; j < Localities; j++)
{
/* Check for beyond EOT */
{
AcpiOsPrintf ("\n**** Not enough room in table for all localities\n");
return;
}
Offset++;
/* Display up to 16 bytes per output row */
if ((j+1) < Localities)
{
AcpiOsPrintf (" ");
if (j && (((j+1) % 16) == 0))
{
}
}
}
/* Point to next row */
AcpiOsPrintf ("\n");
Row += Localities;
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpSrat
*
* PARAMETERS: Table - A SRAT table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a SRAT
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
{
/* Common subtable header */
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
{
break;
break;
break;
break;
default:
/* Attempt to continue */
{
AcpiOsPrintf ("Invalid zero length subtable\n");
return;
}
goto NextSubTable;
}
AcpiOsPrintf ("\n");
if (ACPI_FAILURE (Status))
{
return;
}
/* Point to next subtable */
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpStao
*
* PARAMETERS: Table - A STAO table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a STAO. This is a variable-length
* table that contains an open-ended number of ASCII strings
* at the end of the table.
*
******************************************************************************/
void
{
char *Namepath;
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* The rest of the table consists of Namepath strings */
{
/* Point to next namepath */
Offset += StringLength;
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpTcpa
*
* PARAMETERS: Table - A TCPA table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a TCPA.
*
* NOTE: There are two versions of the table with the same signature:
* the client version and the server version. The common
* PlatformClass field is used to differentiate the two types of
* tables.
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/*
* Examine the PlatformClass field to determine the table type.
* Either a client or server table. Only one.
*/
switch (CommonHeader->PlatformClass)
{
case ACPI_TCPA_CLIENT_TABLE:
break;
case ACPI_TCPA_SERVER_TABLE:
break;
default:
AcpiOsPrintf ("\n**** Unknown TCPA Platform Class 0x%X\n",
break;
}
if (ACPI_FAILURE (Status))
{
AcpiOsPrintf ("\n**** Cannot disassemble TCPA table\n");
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpVrtc
*
* PARAMETERS: Table - A VRTC table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a VRTC
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
{
/* Common subtable header */
AcpiOsPrintf ("\n");
sizeof (ACPI_VRTC_ENTRY), AcpiDmTableInfoVrtc0);
if (ACPI_FAILURE (Status))
{
return;
}
/* Point to next subtable */
Offset += sizeof (ACPI_VRTC_ENTRY);
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpWdat
*
* PARAMETERS: Table - A WDAT table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a WDAT
*
******************************************************************************/
void
{
/* Main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Subtables */
{
/* Common subtable header */
AcpiOsPrintf ("\n");
sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0);
if (ACPI_FAILURE (Status))
{
return;
}
/* Point to next subtable */
Offset += sizeof (ACPI_WDAT_ENTRY);
}
}
/*******************************************************************************
*
* FUNCTION: AcpiDmDumpWpbt
*
* PARAMETERS: Table - A WPBT table
*
* RETURN: None
*
* DESCRIPTION: Format the contents of a WPBT. This table type consists
* of an open-ended arguments buffer at the end of the table.
*
******************************************************************************/
void
{
/* Dump the main table */
if (ACPI_FAILURE (Status))
{
return;
}
/* Extract the arguments buffer length from the main table */
/* Dump the arguments buffer */
}