Home | History | Annotate | Line # | Download | only in common
dmtbdump.c revision 1.5.2.1
      1      1.1    jruoho /******************************************************************************
      2      1.1    jruoho  *
      3      1.1    jruoho  * Module Name: dmtbdump - Dump ACPI data tables that contain no AML code
      4      1.1    jruoho  *
      5      1.1    jruoho  *****************************************************************************/
      6      1.1    jruoho 
      7      1.2  christos /*
      8      1.4  christos  * Copyright (C) 2000 - 2016, Intel Corp.
      9      1.1    jruoho  * All rights reserved.
     10      1.1    jruoho  *
     11      1.2  christos  * Redistribution and use in source and binary forms, with or without
     12      1.2  christos  * modification, are permitted provided that the following conditions
     13      1.2  christos  * are met:
     14      1.2  christos  * 1. Redistributions of source code must retain the above copyright
     15      1.2  christos  *    notice, this list of conditions, and the following disclaimer,
     16      1.2  christos  *    without modification.
     17      1.2  christos  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     18      1.2  christos  *    substantially similar to the "NO WARRANTY" disclaimer below
     19      1.2  christos  *    ("Disclaimer") and any redistribution must be conditioned upon
     20      1.2  christos  *    including a substantially similar Disclaimer requirement for further
     21      1.2  christos  *    binary redistribution.
     22      1.2  christos  * 3. Neither the names of the above-listed copyright holders nor the names
     23      1.2  christos  *    of any contributors may be used to endorse or promote products derived
     24      1.2  christos  *    from this software without specific prior written permission.
     25      1.2  christos  *
     26      1.2  christos  * Alternatively, this software may be distributed under the terms of the
     27      1.2  christos  * GNU General Public License ("GPL") version 2 as published by the Free
     28      1.2  christos  * Software Foundation.
     29      1.2  christos  *
     30      1.2  christos  * NO WARRANTY
     31      1.2  christos  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     32      1.2  christos  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     33      1.2  christos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
     34      1.2  christos  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     35      1.2  christos  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     36      1.2  christos  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     37      1.2  christos  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     38      1.2  christos  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     39      1.2  christos  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     40      1.2  christos  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     41      1.2  christos  * POSSIBILITY OF SUCH DAMAGES.
     42      1.2  christos  */
     43      1.1    jruoho 
     44      1.1    jruoho #include "acpi.h"
     45      1.1    jruoho #include "accommon.h"
     46      1.1    jruoho #include "acdisasm.h"
     47      1.1    jruoho #include "actables.h"
     48      1.1    jruoho 
     49      1.1    jruoho /* This module used for application-level code only */
     50      1.1    jruoho 
     51      1.1    jruoho #define _COMPONENT          ACPI_CA_DISASSEMBLER
     52      1.1    jruoho         ACPI_MODULE_NAME    ("dmtbdump")
     53      1.1    jruoho 
     54      1.1    jruoho 
     55  1.5.2.1  pgoyette /* Table of revision-dependent FADT sizes */
     56      1.2  christos 
     57  1.5.2.1  pgoyette static const UINT32         FadtRevisionLength [ACPI_FADT_MAX_VERSION + 1] =
     58  1.5.2.1  pgoyette {
     59  1.5.2.1  pgoyette     0,                      /* 0 - illegal */
     60  1.5.2.1  pgoyette     ACPI_FADT_V1_SIZE,      /* 1 - ACPI 1.0 */
     61  1.5.2.1  pgoyette     0,                      /* 2 - illegal */
     62  1.5.2.1  pgoyette     ACPI_FADT_V3_SIZE,      /* 3 - ACPI 2.0 */
     63  1.5.2.1  pgoyette     ACPI_FADT_V4_SIZE,      /* 4 - ACPI 3.0 and ACPI 4.0 */
     64  1.5.2.1  pgoyette     ACPI_FADT_V5_SIZE,      /* 5 - ACPI 5.0 */
     65  1.5.2.1  pgoyette     ACPI_FADT_V6_SIZE       /* 6 - ACPI 6.0 */
     66  1.5.2.1  pgoyette };
     67  1.5.2.1  pgoyette 
     68  1.5.2.1  pgoyette /* Table of revision-dependent FADT info tables */
     69  1.5.2.1  pgoyette 
     70  1.5.2.1  pgoyette ACPI_DMTABLE_INFO           *FadtRevisionInfo [ACPI_FADT_MAX_VERSION + 1] =
     71  1.5.2.1  pgoyette {
     72  1.5.2.1  pgoyette     NULL,                   /* 0 - illegal */
     73  1.5.2.1  pgoyette     AcpiDmTableInfoFadt1,   /* 1 - ACPI 1.0 */
     74  1.5.2.1  pgoyette     NULL,                   /* 2 - illegal */
     75  1.5.2.1  pgoyette     AcpiDmTableInfoFadt3,   /* 3 - ACPI 2.0 */
     76  1.5.2.1  pgoyette     AcpiDmTableInfoFadt4,   /* 4 - ACPI 3.0 and ACPI 4.0 */
     77  1.5.2.1  pgoyette     AcpiDmTableInfoFadt5,   /* 5 - ACPI 5.0 */
     78  1.5.2.1  pgoyette     AcpiDmTableInfoFadt6    /* 6 - ACPI 6.0 */
     79  1.5.2.1  pgoyette };
     80      1.2  christos 
     81      1.2  christos 
     82      1.2  christos /*******************************************************************************
     83      1.2  christos  *
     84      1.2  christos  * FUNCTION:    AcpiDmDumpBuffer
     85      1.2  christos  *
     86      1.2  christos  * PARAMETERS:  Table               - ACPI Table or subtable
     87      1.2  christos  *              BufferOffset        - Offset of buffer from Table above
     88      1.2  christos  *              Length              - Length of the buffer
     89      1.2  christos  *              AbsoluteOffset      - Offset of buffer in the main ACPI table
     90      1.2  christos  *              Header              - Name of the buffer field (printed on the
     91      1.2  christos  *                                    first line only.)
     92      1.2  christos  *
     93      1.2  christos  * RETURN:      None
     94      1.2  christos  *
     95      1.2  christos  * DESCRIPTION: Format the contents of an arbitrary length data buffer (in the
     96      1.2  christos  *              disassembler output format.)
     97      1.2  christos  *
     98      1.2  christos  ******************************************************************************/
     99      1.2  christos 
    100      1.2  christos void
    101      1.2  christos AcpiDmDumpBuffer (
    102      1.2  christos     void                    *Table,
    103      1.2  christos     UINT32                  BufferOffset,
    104      1.2  christos     UINT32                  Length,
    105      1.2  christos     UINT32                  AbsoluteOffset,
    106      1.3  christos     char                    *Header)
    107      1.2  christos {
    108      1.2  christos     UINT8                   *Buffer;
    109      1.2  christos     UINT32                  i;
    110      1.2  christos 
    111      1.2  christos 
    112      1.2  christos     if (!Length)
    113      1.2  christos     {
    114      1.2  christos         return;
    115      1.2  christos     }
    116      1.2  christos 
    117      1.2  christos     Buffer = ACPI_CAST_PTR (UINT8, Table) + BufferOffset;
    118      1.2  christos     i = 0;
    119      1.2  christos 
    120      1.2  christos     while (i < Length)
    121      1.2  christos     {
    122      1.2  christos         if (!(i % 16))
    123      1.2  christos         {
    124      1.3  christos             /* Insert a backslash - line continuation character */
    125      1.3  christos 
    126      1.3  christos             if (Length > 16)
    127      1.2  christos             {
    128      1.2  christos                 AcpiOsPrintf ("\\\n    ");
    129      1.2  christos             }
    130      1.2  christos         }
    131      1.2  christos 
    132      1.2  christos         AcpiOsPrintf ("%.02X ", *Buffer);
    133      1.2  christos         i++;
    134      1.2  christos         Buffer++;
    135      1.2  christos         AbsoluteOffset++;
    136      1.2  christos     }
    137      1.2  christos 
    138      1.2  christos     AcpiOsPrintf ("\n");
    139      1.2  christos }
    140      1.2  christos 
    141      1.2  christos 
    142      1.1    jruoho /*******************************************************************************
    143      1.1    jruoho  *
    144      1.3  christos  * FUNCTION:    AcpiDmDumpUnicode
    145      1.3  christos  *
    146      1.3  christos  * PARAMETERS:  Table               - ACPI Table or subtable
    147      1.3  christos  *              BufferOffset        - Offset of buffer from Table above
    148      1.3  christos  *              ByteLength          - Length of the buffer
    149      1.3  christos  *
    150      1.3  christos  * RETURN:      None
    151      1.3  christos  *
    152      1.3  christos  * DESCRIPTION: Validate and dump the contents of a buffer that contains
    153      1.3  christos  *              unicode data. The output is a standard ASCII string. If it
    154      1.3  christos  *              appears that the data is not unicode, the buffer is dumped
    155      1.3  christos  *              as hex characters.
    156      1.3  christos  *
    157      1.3  christos  ******************************************************************************/
    158      1.3  christos 
    159      1.3  christos void
    160      1.3  christos AcpiDmDumpUnicode (
    161      1.3  christos     void                    *Table,
    162      1.3  christos     UINT32                  BufferOffset,
    163      1.3  christos     UINT32                  ByteLength)
    164      1.3  christos {
    165      1.3  christos     UINT8                   *Buffer;
    166      1.3  christos     UINT32                  Length;
    167      1.3  christos     UINT32                  i;
    168      1.3  christos 
    169      1.3  christos 
    170      1.3  christos     Buffer = ((UINT8 *) Table) + BufferOffset;
    171      1.3  christos     Length = ByteLength - 2; /* Last two bytes are the null terminator */
    172      1.3  christos 
    173      1.3  christos     /* Ensure all low bytes are entirely printable ASCII */
    174      1.3  christos 
    175      1.3  christos     for (i = 0; i < Length; i += 2)
    176      1.3  christos     {
    177      1.3  christos         if (!isprint (Buffer[i]))
    178      1.3  christos         {
    179      1.3  christos             goto DumpRawBuffer;
    180      1.3  christos         }
    181      1.3  christos     }
    182      1.3  christos 
    183      1.3  christos     /* Ensure all high bytes are zero */
    184      1.3  christos 
    185      1.3  christos     for (i = 1; i < Length; i += 2)
    186      1.3  christos     {
    187      1.3  christos         if (Buffer[i])
    188      1.3  christos         {
    189      1.3  christos             goto DumpRawBuffer;
    190      1.3  christos         }
    191      1.3  christos     }
    192      1.3  christos 
    193      1.3  christos     /* Dump the buffer as a normal string */
    194      1.3  christos 
    195      1.3  christos     AcpiOsPrintf ("\"");
    196      1.3  christos     for (i = 0; i < Length; i += 2)
    197      1.3  christos     {
    198      1.3  christos         AcpiOsPrintf ("%c", Buffer[i]);
    199      1.3  christos     }
    200      1.4  christos 
    201      1.3  christos     AcpiOsPrintf ("\"\n");
    202      1.3  christos     return;
    203      1.3  christos 
    204      1.3  christos DumpRawBuffer:
    205      1.3  christos     AcpiDmDumpBuffer (Table, BufferOffset, ByteLength,
    206      1.3  christos         BufferOffset, NULL);
    207      1.3  christos     AcpiOsPrintf ("\n");
    208      1.3  christos }
    209      1.3  christos 
    210      1.3  christos 
    211      1.3  christos /*******************************************************************************
    212      1.3  christos  *
    213      1.1    jruoho  * FUNCTION:    AcpiDmDumpRsdp
    214      1.1    jruoho  *
    215      1.1    jruoho  * PARAMETERS:  Table               - A RSDP
    216      1.1    jruoho  *
    217      1.2  christos  * RETURN:      Length of the table (there is not always a length field,
    218      1.2  christos  *              use revision or length if available (ACPI 2.0+))
    219      1.1    jruoho  *
    220      1.1    jruoho  * DESCRIPTION: Format the contents of a RSDP
    221      1.1    jruoho  *
    222      1.1    jruoho  ******************************************************************************/
    223      1.1    jruoho 
    224      1.1    jruoho UINT32
    225      1.1    jruoho AcpiDmDumpRsdp (
    226      1.1    jruoho     ACPI_TABLE_HEADER       *Table)
    227      1.1    jruoho {
    228      1.2  christos     ACPI_TABLE_RSDP         *Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table);
    229      1.2  christos     UINT32                  Length = sizeof (ACPI_RSDP_COMMON);
    230      1.2  christos     UINT8                   Checksum;
    231      1.3  christos     ACPI_STATUS             Status;
    232      1.1    jruoho 
    233      1.1    jruoho 
    234      1.1    jruoho     /* Dump the common ACPI 1.0 portion */
    235      1.1    jruoho 
    236      1.3  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp1);
    237      1.3  christos     if (ACPI_FAILURE (Status))
    238      1.3  christos     {
    239      1.3  christos         return (Length);
    240      1.3  christos     }
    241      1.1    jruoho 
    242      1.2  christos     /* Validate the first checksum */
    243      1.2  christos 
    244      1.2  christos     Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_RSDP_COMMON),
    245      1.4  christos         Rsdp->Checksum);
    246      1.2  christos     if (Checksum != Rsdp->Checksum)
    247      1.2  christos     {
    248      1.2  christos         AcpiOsPrintf ("/* Incorrect Checksum above, should be 0x%2.2X */\n",
    249      1.2  christos             Checksum);
    250      1.2  christos     }
    251      1.2  christos 
    252      1.2  christos     /* The RSDP for ACPI 2.0+ contains more data and has a Length field */
    253      1.1    jruoho 
    254      1.2  christos     if (Rsdp->Revision > 0)
    255      1.1    jruoho     {
    256      1.2  christos         Length = Rsdp->Length;
    257      1.3  christos         Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp2);
    258      1.3  christos         if (ACPI_FAILURE (Status))
    259      1.3  christos         {
    260      1.3  christos             return (Length);
    261      1.3  christos         }
    262      1.2  christos 
    263      1.2  christos         /* Validate the extended checksum over entire RSDP */
    264      1.2  christos 
    265      1.2  christos         Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_TABLE_RSDP),
    266      1.4  christos             Rsdp->ExtendedChecksum);
    267      1.2  christos         if (Checksum != Rsdp->ExtendedChecksum)
    268      1.2  christos         {
    269      1.2  christos             AcpiOsPrintf (
    270      1.2  christos                 "/* Incorrect Extended Checksum above, should be 0x%2.2X */\n",
    271      1.2  christos                 Checksum);
    272      1.2  christos         }
    273      1.1    jruoho     }
    274      1.1    jruoho 
    275      1.1    jruoho     return (Length);
    276      1.1    jruoho }
    277      1.1    jruoho 
    278      1.1    jruoho 
    279      1.1    jruoho /*******************************************************************************
    280      1.1    jruoho  *
    281      1.1    jruoho  * FUNCTION:    AcpiDmDumpRsdt
    282      1.1    jruoho  *
    283      1.1    jruoho  * PARAMETERS:  Table               - A RSDT
    284      1.1    jruoho  *
    285      1.1    jruoho  * RETURN:      None
    286      1.1    jruoho  *
    287      1.1    jruoho  * DESCRIPTION: Format the contents of a RSDT
    288      1.1    jruoho  *
    289      1.1    jruoho  ******************************************************************************/
    290      1.1    jruoho 
    291      1.1    jruoho void
    292      1.1    jruoho AcpiDmDumpRsdt (
    293      1.1    jruoho     ACPI_TABLE_HEADER       *Table)
    294      1.1    jruoho {
    295      1.1    jruoho     UINT32                  *Array;
    296      1.1    jruoho     UINT32                  Entries;
    297      1.1    jruoho     UINT32                  Offset;
    298      1.1    jruoho     UINT32                  i;
    299      1.1    jruoho 
    300      1.1    jruoho 
    301      1.1    jruoho     /* Point to start of table pointer array */
    302      1.1    jruoho 
    303      1.1    jruoho     Array = ACPI_CAST_PTR (ACPI_TABLE_RSDT, Table)->TableOffsetEntry;
    304      1.1    jruoho     Offset = sizeof (ACPI_TABLE_HEADER);
    305      1.1    jruoho 
    306      1.1    jruoho     /* RSDT uses 32-bit pointers */
    307      1.1    jruoho 
    308      1.1    jruoho     Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT32);
    309      1.1    jruoho 
    310      1.1    jruoho     for (i = 0; i < Entries; i++)
    311      1.1    jruoho     {
    312      1.1    jruoho         AcpiDmLineHeader2 (Offset, sizeof (UINT32), "ACPI Table Address", i);
    313      1.1    jruoho         AcpiOsPrintf ("%8.8X\n", Array[i]);
    314      1.1    jruoho         Offset += sizeof (UINT32);
    315      1.1    jruoho     }
    316      1.1    jruoho }
    317      1.1    jruoho 
    318      1.1    jruoho 
    319      1.1    jruoho /*******************************************************************************
    320      1.1    jruoho  *
    321      1.1    jruoho  * FUNCTION:    AcpiDmDumpXsdt
    322      1.1    jruoho  *
    323      1.1    jruoho  * PARAMETERS:  Table               - A XSDT
    324      1.1    jruoho  *
    325      1.1    jruoho  * RETURN:      None
    326      1.1    jruoho  *
    327      1.1    jruoho  * DESCRIPTION: Format the contents of a XSDT
    328      1.1    jruoho  *
    329      1.1    jruoho  ******************************************************************************/
    330      1.1    jruoho 
    331      1.1    jruoho void
    332      1.1    jruoho AcpiDmDumpXsdt (
    333      1.1    jruoho     ACPI_TABLE_HEADER       *Table)
    334      1.1    jruoho {
    335      1.1    jruoho     UINT64                  *Array;
    336      1.1    jruoho     UINT32                  Entries;
    337      1.1    jruoho     UINT32                  Offset;
    338      1.1    jruoho     UINT32                  i;
    339      1.1    jruoho 
    340      1.1    jruoho 
    341      1.1    jruoho     /* Point to start of table pointer array */
    342      1.1    jruoho 
    343      1.1    jruoho     Array = ACPI_CAST_PTR (ACPI_TABLE_XSDT, Table)->TableOffsetEntry;
    344      1.1    jruoho     Offset = sizeof (ACPI_TABLE_HEADER);
    345      1.1    jruoho 
    346      1.1    jruoho     /* XSDT uses 64-bit pointers */
    347      1.1    jruoho 
    348      1.1    jruoho     Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT64);
    349      1.1    jruoho 
    350      1.1    jruoho     for (i = 0; i < Entries; i++)
    351      1.1    jruoho     {
    352      1.1    jruoho         AcpiDmLineHeader2 (Offset, sizeof (UINT64), "ACPI Table Address", i);
    353      1.1    jruoho         AcpiOsPrintf ("%8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Array[i]));
    354      1.1    jruoho         Offset += sizeof (UINT64);
    355      1.1    jruoho     }
    356      1.1    jruoho }
    357      1.1    jruoho 
    358      1.1    jruoho 
    359      1.1    jruoho /*******************************************************************************
    360      1.1    jruoho  *
    361      1.1    jruoho  * FUNCTION:    AcpiDmDumpFadt
    362      1.1    jruoho  *
    363      1.1    jruoho  * PARAMETERS:  Table               - A FADT
    364      1.1    jruoho  *
    365      1.1    jruoho  * RETURN:      None
    366      1.1    jruoho  *
    367      1.1    jruoho  * DESCRIPTION: Format the contents of a FADT
    368      1.1    jruoho  *
    369  1.5.2.1  pgoyette  *              Check the FADT revision against the expected table length for
    370  1.5.2.1  pgoyette  *              that revision. Issue a warning if the length is not what was
    371  1.5.2.1  pgoyette  *              expected. This seems to be such a common BIOS bug that the
    372  1.5.2.1  pgoyette  *              FADT revision has been rendered virtually meaningless.
    373  1.5.2.1  pgoyette  *
    374      1.2  christos  * NOTE:        We cannot depend on the FADT version to indicate the actual
    375      1.2  christos  *              contents of the FADT because of BIOS bugs. The table length
    376      1.2  christos  *              is the only reliable indicator.
    377      1.2  christos  *
    378      1.1    jruoho  ******************************************************************************/
    379      1.1    jruoho 
    380      1.1    jruoho void
    381      1.1    jruoho AcpiDmDumpFadt (
    382      1.1    jruoho     ACPI_TABLE_HEADER       *Table)
    383      1.1    jruoho {
    384      1.3  christos     ACPI_STATUS             Status;
    385  1.5.2.1  pgoyette     UINT8                   FadtRevision;
    386  1.5.2.1  pgoyette     UINT32                  ExpectedLength;
    387  1.5.2.1  pgoyette     UINT32                  i;
    388      1.3  christos 
    389      1.1    jruoho 
    390  1.5.2.1  pgoyette     FadtRevision = Table->Revision;
    391      1.1    jruoho 
    392  1.5.2.1  pgoyette     /* FADT revision/length validation */
    393  1.5.2.1  pgoyette 
    394  1.5.2.1  pgoyette     if ((FadtRevision == 0) ||
    395  1.5.2.1  pgoyette         (FadtRevision == 2))
    396      1.3  christos     {
    397  1.5.2.1  pgoyette         AcpiOsPrintf (
    398  1.5.2.1  pgoyette             "// ACPI Warning: Invalid or unsupported FADT revision: %u\n",
    399  1.5.2.1  pgoyette             FadtRevision);
    400      1.3  christos         return;
    401      1.3  christos     }
    402      1.1    jruoho 
    403  1.5.2.1  pgoyette     if (FadtRevision > ACPI_FADT_MAX_VERSION)
    404      1.1    jruoho     {
    405  1.5.2.1  pgoyette         AcpiOsPrintf ("// ACPI Warning: Revision %u is not fully supported, "
    406  1.5.2.1  pgoyette             "disassembling known fields (up to revision %u)\n\n",
    407  1.5.2.1  pgoyette             FadtRevision, ACPI_FADT_MAX_VERSION);
    408  1.5.2.1  pgoyette     }
    409  1.5.2.1  pgoyette     else
    410  1.5.2.1  pgoyette     {
    411  1.5.2.1  pgoyette         ExpectedLength = FadtRevisionLength[FadtRevision];
    412  1.5.2.1  pgoyette         if (Table->Length != ExpectedLength)
    413      1.3  christos         {
    414  1.5.2.1  pgoyette             AcpiOsPrintf (
    415  1.5.2.1  pgoyette                 "// ACPI Warning: Input FADT revision %X does not match "
    416  1.5.2.1  pgoyette                 "expected length: found 0x%X expected 0x%X\n",
    417  1.5.2.1  pgoyette                 FadtRevision, Table->Length, ExpectedLength);
    418      1.3  christos         }
    419      1.1    jruoho     }
    420      1.1    jruoho 
    421  1.5.2.1  pgoyette     /*
    422  1.5.2.1  pgoyette      * Dump the input table on a per-version basis, but is actually
    423  1.5.2.1  pgoyette      * based upon the length of the table. Table length must
    424  1.5.2.1  pgoyette      * be larger than the required length of the previous version.
    425  1.5.2.1  pgoyette      */
    426  1.5.2.1  pgoyette     for (i = 1; i <= ACPI_FADT_MAX_VERSION; i++)
    427      1.1    jruoho     {
    428  1.5.2.1  pgoyette         if (!FadtRevisionLength[i]) /* Skip any empty slots */
    429      1.3  christos         {
    430  1.5.2.1  pgoyette             continue;
    431      1.3  christos         }
    432      1.2  christos 
    433  1.5.2.1  pgoyette         /* Dump the fields specific to FADT revision[i] */
    434      1.2  christos 
    435  1.5.2.1  pgoyette         Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
    436  1.5.2.1  pgoyette             FadtRevisionInfo[i]);
    437  1.5.2.1  pgoyette         if (ACPI_FAILURE (Status))
    438      1.2  christos         {
    439  1.5.2.1  pgoyette             return;
    440      1.3  christos         }
    441      1.3  christos 
    442  1.5.2.1  pgoyette         if (Table->Length <= FadtRevisionLength[i])
    443      1.3  christos         {
    444  1.5.2.1  pgoyette             break;  /* End of table */
    445      1.2  christos         }
    446      1.1    jruoho     }
    447      1.1    jruoho 
    448  1.5.2.1  pgoyette     /* Build a local FADT to test some FADT values */
    449      1.1    jruoho 
    450      1.1    jruoho     AcpiTbCreateLocalFadt (Table, Table->Length);
    451      1.1    jruoho }
    452      1.1    jruoho 
    453      1.1    jruoho 
    454      1.1    jruoho /*******************************************************************************
    455      1.1    jruoho  *
    456      1.1    jruoho  * FUNCTION:    AcpiDmDumpAsf
    457      1.1    jruoho  *
    458      1.1    jruoho  * PARAMETERS:  Table               - A ASF table
    459      1.1    jruoho  *
    460      1.1    jruoho  * RETURN:      None
    461      1.1    jruoho  *
    462      1.1    jruoho  * DESCRIPTION: Format the contents of a ASF table
    463      1.1    jruoho  *
    464      1.1    jruoho  ******************************************************************************/
    465      1.1    jruoho 
    466      1.1    jruoho void
    467      1.1    jruoho AcpiDmDumpAsf (
    468      1.1    jruoho     ACPI_TABLE_HEADER       *Table)
    469      1.1    jruoho {
    470      1.1    jruoho     ACPI_STATUS             Status;
    471      1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_HEADER);
    472      1.1    jruoho     ACPI_ASF_INFO           *SubTable;
    473      1.1    jruoho     ACPI_DMTABLE_INFO       *InfoTable;
    474      1.1    jruoho     ACPI_DMTABLE_INFO       *DataInfoTable = NULL;
    475      1.1    jruoho     UINT8                   *DataTable = NULL;
    476      1.1    jruoho     UINT32                  DataCount = 0;
    477      1.1    jruoho     UINT32                  DataLength = 0;
    478      1.1    jruoho     UINT32                  DataOffset = 0;
    479      1.1    jruoho     UINT32                  i;
    480      1.1    jruoho     UINT8                   Type;
    481      1.1    jruoho 
    482      1.1    jruoho 
    483      1.2  christos     /* No main table, only subtables */
    484      1.1    jruoho 
    485      1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset);
    486      1.1    jruoho     while (Offset < Table->Length)
    487      1.1    jruoho     {
    488      1.2  christos         /* Common subtable header */
    489      1.1    jruoho 
    490      1.1    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
    491      1.4  christos             SubTable->Header.Length, AcpiDmTableInfoAsfHdr);
    492      1.1    jruoho         if (ACPI_FAILURE (Status))
    493      1.1    jruoho         {
    494      1.1    jruoho             return;
    495      1.1    jruoho         }
    496      1.1    jruoho 
    497      1.1    jruoho         /* The actual type is the lower 7 bits of Type */
    498      1.1    jruoho 
    499      1.1    jruoho         Type = (UINT8) (SubTable->Header.Type & 0x7F);
    500      1.1    jruoho 
    501      1.1    jruoho         switch (Type)
    502      1.1    jruoho         {
    503      1.1    jruoho         case ACPI_ASF_TYPE_INFO:
    504      1.2  christos 
    505      1.1    jruoho             InfoTable = AcpiDmTableInfoAsf0;
    506      1.1    jruoho             break;
    507      1.1    jruoho 
    508      1.1    jruoho         case ACPI_ASF_TYPE_ALERT:
    509      1.2  christos 
    510      1.1    jruoho             InfoTable = AcpiDmTableInfoAsf1;
    511      1.1    jruoho             DataInfoTable = AcpiDmTableInfoAsf1a;
    512      1.1    jruoho             DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ALERT));
    513      1.1    jruoho             DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->Alerts;
    514      1.1    jruoho             DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->DataLength;
    515      1.1    jruoho             DataOffset = Offset + sizeof (ACPI_ASF_ALERT);
    516      1.1    jruoho             break;
    517      1.1    jruoho 
    518      1.1    jruoho         case ACPI_ASF_TYPE_CONTROL:
    519      1.2  christos 
    520      1.1    jruoho             InfoTable = AcpiDmTableInfoAsf2;
    521      1.1    jruoho             DataInfoTable = AcpiDmTableInfoAsf2a;
    522      1.1    jruoho             DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_REMOTE));
    523      1.1    jruoho             DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->Controls;
    524      1.1    jruoho             DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->DataLength;
    525      1.1    jruoho             DataOffset = Offset + sizeof (ACPI_ASF_REMOTE);
    526      1.1    jruoho             break;
    527      1.1    jruoho 
    528      1.1    jruoho         case ACPI_ASF_TYPE_BOOT:
    529      1.2  christos 
    530      1.1    jruoho             InfoTable = AcpiDmTableInfoAsf3;
    531      1.1    jruoho             break;
    532      1.1    jruoho 
    533      1.1    jruoho         case ACPI_ASF_TYPE_ADDRESS:
    534      1.2  christos 
    535      1.1    jruoho             InfoTable = AcpiDmTableInfoAsf4;
    536      1.1    jruoho             DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ADDRESS));
    537      1.1    jruoho             DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, SubTable)->Devices;
    538      1.1    jruoho             DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS);
    539      1.1    jruoho             break;
    540      1.1    jruoho 
    541      1.1    jruoho         default:
    542      1.2  christos 
    543      1.4  christos             AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n",
    544      1.4  christos                 SubTable->Header.Type);
    545      1.1    jruoho             return;
    546      1.1    jruoho         }
    547      1.1    jruoho 
    548      1.1    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
    549      1.4  christos             SubTable->Header.Length, InfoTable);
    550      1.1    jruoho         if (ACPI_FAILURE (Status))
    551      1.1    jruoho         {
    552      1.1    jruoho             return;
    553      1.1    jruoho         }
    554      1.1    jruoho 
    555      1.1    jruoho         /* Dump variable-length extra data */
    556      1.1    jruoho 
    557      1.1    jruoho         switch (Type)
    558      1.1    jruoho         {
    559      1.1    jruoho         case ACPI_ASF_TYPE_ALERT:
    560      1.1    jruoho         case ACPI_ASF_TYPE_CONTROL:
    561      1.1    jruoho 
    562      1.1    jruoho             for (i = 0; i < DataCount; i++)
    563      1.1    jruoho             {
    564      1.1    jruoho                 AcpiOsPrintf ("\n");
    565      1.1    jruoho                 Status = AcpiDmDumpTable (Table->Length, DataOffset,
    566      1.4  christos                     DataTable, DataLength, DataInfoTable);
    567      1.1    jruoho                 if (ACPI_FAILURE (Status))
    568      1.1    jruoho                 {
    569      1.1    jruoho                     return;
    570      1.1    jruoho                 }
    571      1.1    jruoho 
    572      1.1    jruoho                 DataTable = ACPI_ADD_PTR (UINT8, DataTable, DataLength);
    573      1.1    jruoho                 DataOffset += DataLength;
    574      1.1    jruoho             }
    575      1.1    jruoho             break;
    576      1.1    jruoho 
    577      1.1    jruoho         case ACPI_ASF_TYPE_ADDRESS:
    578      1.1    jruoho 
    579      1.1    jruoho             for (i = 0; i < DataLength; i++)
    580      1.1    jruoho             {
    581      1.1    jruoho                 if (!(i % 16))
    582      1.1    jruoho                 {
    583      1.1    jruoho                     AcpiDmLineHeader (DataOffset, 1, "Addresses");
    584      1.1    jruoho                 }
    585      1.1    jruoho 
    586      1.1    jruoho                 AcpiOsPrintf ("%2.2X ", *DataTable);
    587      1.1    jruoho                 DataTable++;
    588      1.1    jruoho                 DataOffset++;
    589      1.4  christos 
    590      1.1    jruoho                 if (DataOffset > Table->Length)
    591      1.1    jruoho                 {
    592      1.4  christos                     AcpiOsPrintf (
    593      1.4  christos                         "**** ACPI table terminates in the middle of a "
    594      1.4  christos                         "data structure! (ASF! table)\n");
    595      1.1    jruoho                     return;
    596      1.1    jruoho                 }
    597      1.1    jruoho             }
    598      1.1    jruoho 
    599      1.1    jruoho             AcpiOsPrintf ("\n");
    600      1.1    jruoho             break;
    601      1.1    jruoho 
    602      1.1    jruoho         default:
    603      1.2  christos 
    604      1.1    jruoho             break;
    605      1.1    jruoho         }
    606      1.1    jruoho 
    607      1.1    jruoho         AcpiOsPrintf ("\n");
    608      1.1    jruoho 
    609      1.2  christos         /* Point to next subtable */
    610      1.1    jruoho 
    611      1.1    jruoho         if (!SubTable->Header.Length)
    612      1.1    jruoho         {
    613      1.1    jruoho             AcpiOsPrintf ("Invalid zero subtable header length\n");
    614      1.1    jruoho             return;
    615      1.1    jruoho         }
    616      1.1    jruoho 
    617      1.1    jruoho         Offset += SubTable->Header.Length;
    618      1.4  christos         SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, SubTable,
    619      1.4  christos             SubTable->Header.Length);
    620      1.1    jruoho     }
    621      1.1    jruoho }
    622      1.1    jruoho 
    623      1.1    jruoho 
    624      1.1    jruoho /*******************************************************************************
    625      1.1    jruoho  *
    626      1.1    jruoho  * FUNCTION:    AcpiDmDumpCpep
    627      1.1    jruoho  *
    628      1.1    jruoho  * PARAMETERS:  Table               - A CPEP table
    629      1.1    jruoho  *
    630      1.1    jruoho  * RETURN:      None
    631      1.1    jruoho  *
    632      1.1    jruoho  * DESCRIPTION: Format the contents of a CPEP. This table type consists
    633      1.1    jruoho  *              of an open-ended number of subtables.
    634      1.1    jruoho  *
    635      1.1    jruoho  ******************************************************************************/
    636      1.1    jruoho 
    637      1.1    jruoho void
    638      1.1    jruoho AcpiDmDumpCpep (
    639      1.1    jruoho     ACPI_TABLE_HEADER       *Table)
    640      1.1    jruoho {
    641      1.1    jruoho     ACPI_STATUS             Status;
    642      1.1    jruoho     ACPI_CPEP_POLLING       *SubTable;
    643      1.1    jruoho     UINT32                  Length = Table->Length;
    644      1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_CPEP);
    645      1.1    jruoho 
    646      1.1    jruoho 
    647      1.1    jruoho     /* Main table */
    648      1.1    jruoho 
    649      1.1    jruoho     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoCpep);
    650      1.1    jruoho     if (ACPI_FAILURE (Status))
    651      1.1    jruoho     {
    652      1.1    jruoho         return;
    653      1.1    jruoho     }
    654      1.1    jruoho 
    655      1.2  christos     /* Subtables */
    656      1.1    jruoho 
    657      1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset);
    658      1.1    jruoho     while (Offset < Table->Length)
    659      1.1    jruoho     {
    660      1.1    jruoho         AcpiOsPrintf ("\n");
    661      1.1    jruoho         Status = AcpiDmDumpTable (Length, Offset, SubTable,
    662      1.4  christos             SubTable->Header.Length, AcpiDmTableInfoCpep0);
    663      1.1    jruoho         if (ACPI_FAILURE (Status))
    664      1.1    jruoho         {
    665      1.1    jruoho             return;
    666      1.1    jruoho         }
    667      1.1    jruoho 
    668      1.2  christos         /* Point to next subtable */
    669      1.1    jruoho 
    670      1.1    jruoho         Offset += SubTable->Header.Length;
    671      1.1    jruoho         SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable,
    672      1.4  christos             SubTable->Header.Length);
    673      1.1    jruoho     }
    674      1.1    jruoho }
    675      1.1    jruoho 
    676      1.1    jruoho 
    677      1.1    jruoho /*******************************************************************************
    678      1.1    jruoho  *
    679      1.2  christos  * FUNCTION:    AcpiDmDumpCsrt
    680      1.2  christos  *
    681      1.2  christos  * PARAMETERS:  Table               - A CSRT table
    682      1.2  christos  *
    683      1.2  christos  * RETURN:      None
    684      1.2  christos  *
    685      1.2  christos  * DESCRIPTION: Format the contents of a CSRT. This table type consists
    686      1.2  christos  *              of an open-ended number of subtables.
    687      1.2  christos  *
    688      1.2  christos  ******************************************************************************/
    689      1.2  christos 
    690      1.2  christos void
    691      1.2  christos AcpiDmDumpCsrt (
    692      1.2  christos     ACPI_TABLE_HEADER       *Table)
    693      1.2  christos {
    694      1.2  christos     ACPI_STATUS             Status;
    695      1.2  christos     ACPI_CSRT_GROUP         *SubTable;
    696      1.2  christos     ACPI_CSRT_SHARED_INFO   *SharedInfoTable;
    697      1.2  christos     ACPI_CSRT_DESCRIPTOR    *SubSubTable;
    698      1.2  christos     UINT32                  Length = Table->Length;
    699      1.2  christos     UINT32                  Offset = sizeof (ACPI_TABLE_CSRT);
    700      1.2  christos     UINT32                  SubOffset;
    701      1.2  christos     UINT32                  SubSubOffset;
    702      1.2  christos     UINT32                  InfoLength;
    703      1.2  christos 
    704      1.2  christos 
    705      1.2  christos     /* The main table only contains the ACPI header, thus already handled */
    706      1.2  christos 
    707      1.2  christos     /* Subtables (Resource Groups) */
    708      1.2  christos 
    709      1.2  christos     SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset);
    710      1.2  christos     while (Offset < Table->Length)
    711      1.2  christos     {
    712      1.2  christos         /* Resource group subtable */
    713      1.2  christos 
    714      1.2  christos         AcpiOsPrintf ("\n");
    715      1.2  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
    716      1.4  christos             SubTable->Length, AcpiDmTableInfoCsrt0);
    717      1.2  christos         if (ACPI_FAILURE (Status))
    718      1.2  christos         {
    719      1.2  christos             return;
    720      1.2  christos         }
    721      1.2  christos 
    722      1.2  christos         /* Shared info subtable (One per resource group) */
    723      1.2  christos 
    724      1.2  christos         SubOffset = sizeof (ACPI_CSRT_GROUP);
    725      1.2  christos         SharedInfoTable = ACPI_ADD_PTR (ACPI_CSRT_SHARED_INFO, Table,
    726      1.2  christos             Offset + SubOffset);
    727      1.2  christos 
    728      1.2  christos         AcpiOsPrintf ("\n");
    729      1.2  christos         Status = AcpiDmDumpTable (Length, Offset + SubOffset, SharedInfoTable,
    730      1.4  christos             sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1);
    731      1.2  christos         if (ACPI_FAILURE (Status))
    732      1.2  christos         {
    733      1.2  christos             return;
    734      1.2  christos         }
    735      1.2  christos 
    736      1.2  christos         SubOffset += SubTable->SharedInfoLength;
    737      1.2  christos 
    738      1.2  christos         /* Sub-Subtables (Resource Descriptors) */
    739      1.2  christos 
    740      1.2  christos         SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table,
    741      1.2  christos             Offset + SubOffset);
    742      1.2  christos 
    743      1.2  christos         while ((SubOffset < SubTable->Length) &&
    744      1.2  christos               ((Offset + SubOffset) < Table->Length))
    745      1.2  christos         {
    746      1.2  christos             AcpiOsPrintf ("\n");
    747      1.2  christos             Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubTable,
    748      1.4  christos                 SubSubTable->Length, AcpiDmTableInfoCsrt2);
    749      1.2  christos             if (ACPI_FAILURE (Status))
    750      1.2  christos             {
    751      1.2  christos                 return;
    752      1.2  christos             }
    753      1.2  christos 
    754      1.2  christos             SubSubOffset = sizeof (ACPI_CSRT_DESCRIPTOR);
    755      1.2  christos 
    756      1.2  christos             /* Resource-specific info buffer */
    757      1.2  christos 
    758      1.2  christos             InfoLength = SubSubTable->Length - SubSubOffset;
    759      1.3  christos             if (InfoLength)
    760      1.3  christos             {
    761      1.3  christos                 Status = AcpiDmDumpTable (Length,
    762      1.4  christos                     Offset + SubOffset + SubSubOffset, Table,
    763      1.4  christos                     InfoLength, AcpiDmTableInfoCsrt2a);
    764      1.3  christos                 if (ACPI_FAILURE (Status))
    765      1.3  christos                 {
    766      1.3  christos                     return;
    767      1.3  christos                 }
    768      1.3  christos                 SubSubOffset += InfoLength;
    769      1.3  christos             }
    770      1.2  christos 
    771      1.2  christos             /* Point to next sub-subtable */
    772      1.2  christos 
    773      1.2  christos             SubOffset += SubSubTable->Length;
    774      1.2  christos             SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubTable,
    775      1.4  christos                 SubSubTable->Length);
    776      1.2  christos         }
    777      1.2  christos 
    778      1.2  christos         /* Point to next subtable */
    779      1.2  christos 
    780      1.2  christos         Offset += SubTable->Length;
    781      1.2  christos         SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, SubTable,
    782      1.4  christos             SubTable->Length);
    783      1.2  christos     }
    784      1.2  christos }
    785      1.2  christos 
    786      1.2  christos 
    787      1.2  christos /*******************************************************************************
    788      1.2  christos  *
    789      1.2  christos  * FUNCTION:    AcpiDmDumpDbg2
    790      1.2  christos  *
    791      1.2  christos  * PARAMETERS:  Table               - A DBG2 table
    792      1.2  christos  *
    793      1.2  christos  * RETURN:      None
    794      1.2  christos  *
    795      1.2  christos  * DESCRIPTION: Format the contents of a DBG2. This table type consists
    796      1.2  christos  *              of an open-ended number of subtables.
    797      1.2  christos  *
    798      1.2  christos  ******************************************************************************/
    799      1.2  christos 
    800      1.2  christos void
    801      1.2  christos AcpiDmDumpDbg2 (
    802      1.2  christos     ACPI_TABLE_HEADER       *Table)
    803      1.2  christos {
    804      1.2  christos     ACPI_STATUS             Status;
    805      1.2  christos     ACPI_DBG2_DEVICE        *SubTable;
    806      1.2  christos     UINT32                  Length = Table->Length;
    807      1.2  christos     UINT32                  Offset = sizeof (ACPI_TABLE_DBG2);
    808      1.2  christos     UINT32                  i;
    809      1.2  christos     UINT32                  ArrayOffset;
    810      1.2  christos     UINT32                  AbsoluteOffset;
    811      1.2  christos     UINT8                   *Array;
    812      1.2  christos 
    813      1.2  christos 
    814      1.2  christos     /* Main table */
    815      1.2  christos 
    816      1.2  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDbg2);
    817      1.2  christos     if (ACPI_FAILURE (Status))
    818      1.2  christos     {
    819      1.2  christos         return;
    820      1.2  christos     }
    821      1.2  christos 
    822      1.2  christos     /* Subtables */
    823      1.2  christos 
    824      1.2  christos     SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
    825      1.2  christos     while (Offset < Table->Length)
    826      1.2  christos     {
    827      1.2  christos         AcpiOsPrintf ("\n");
    828      1.2  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
    829      1.4  christos             SubTable->Length, AcpiDmTableInfoDbg2Device);
    830      1.2  christos         if (ACPI_FAILURE (Status))
    831      1.2  christos         {
    832      1.2  christos             return;
    833      1.2  christos         }
    834      1.2  christos 
    835      1.2  christos         /* Dump the BaseAddress array */
    836      1.2  christos 
    837      1.2  christos         for (i = 0; i < SubTable->RegisterCount; i++)
    838      1.2  christos         {
    839      1.2  christos             ArrayOffset = SubTable->BaseAddressOffset +
    840      1.2  christos                 (sizeof (ACPI_GENERIC_ADDRESS) * i);
    841      1.2  christos             AbsoluteOffset = Offset + ArrayOffset;
    842      1.2  christos             Array = (UINT8 *) SubTable + ArrayOffset;
    843      1.2  christos 
    844      1.2  christos             Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
    845      1.4  christos                 SubTable->Length, AcpiDmTableInfoDbg2Addr);
    846      1.2  christos             if (ACPI_FAILURE (Status))
    847      1.2  christos             {
    848      1.2  christos                 return;
    849      1.2  christos             }
    850      1.2  christos         }
    851      1.2  christos 
    852      1.2  christos         /* Dump the AddressSize array */
    853      1.2  christos 
    854      1.2  christos         for (i = 0; i < SubTable->RegisterCount; i++)
    855      1.2  christos         {
    856      1.2  christos             ArrayOffset = SubTable->AddressSizeOffset +
    857      1.2  christos                 (sizeof (UINT32) * i);
    858      1.2  christos             AbsoluteOffset = Offset + ArrayOffset;
    859      1.2  christos             Array = (UINT8 *) SubTable + ArrayOffset;
    860      1.2  christos 
    861      1.2  christos             Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
    862      1.4  christos                 SubTable->Length, AcpiDmTableInfoDbg2Size);
    863      1.2  christos             if (ACPI_FAILURE (Status))
    864      1.2  christos             {
    865      1.2  christos                 return;
    866      1.2  christos             }
    867      1.2  christos         }
    868      1.2  christos 
    869      1.2  christos         /* Dump the Namestring (required) */
    870      1.2  christos 
    871      1.2  christos         AcpiOsPrintf ("\n");
    872      1.2  christos         ArrayOffset = SubTable->NamepathOffset;
    873      1.2  christos         AbsoluteOffset = Offset + ArrayOffset;
    874      1.2  christos         Array = (UINT8 *) SubTable + ArrayOffset;
    875      1.2  christos 
    876      1.2  christos         Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
    877      1.4  christos             SubTable->Length, AcpiDmTableInfoDbg2Name);
    878      1.2  christos         if (ACPI_FAILURE (Status))
    879      1.2  christos         {
    880      1.2  christos             return;
    881      1.2  christos         }
    882      1.2  christos 
    883      1.2  christos         /* Dump the OemData (optional) */
    884      1.2  christos 
    885      1.2  christos         if (SubTable->OemDataOffset)
    886      1.2  christos         {
    887      1.3  christos             Status = AcpiDmDumpTable (Length, Offset + SubTable->OemDataOffset,
    888      1.4  christos                 Table, SubTable->OemDataLength,
    889      1.4  christos                 AcpiDmTableInfoDbg2OemData);
    890      1.3  christos             if (ACPI_FAILURE (Status))
    891      1.3  christos             {
    892      1.3  christos                 return;
    893      1.3  christos             }
    894      1.2  christos         }
    895      1.2  christos 
    896      1.2  christos         /* Point to next subtable */
    897      1.2  christos 
    898      1.2  christos         Offset += SubTable->Length;
    899      1.2  christos         SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, SubTable,
    900      1.4  christos             SubTable->Length);
    901      1.2  christos     }
    902      1.2  christos }
    903      1.2  christos 
    904      1.2  christos 
    905      1.2  christos /*******************************************************************************
    906      1.2  christos  *
    907      1.1    jruoho  * FUNCTION:    AcpiDmDumpDmar
    908      1.1    jruoho  *
    909      1.1    jruoho  * PARAMETERS:  Table               - A DMAR table
    910      1.1    jruoho  *
    911      1.1    jruoho  * RETURN:      None
    912      1.1    jruoho  *
    913      1.1    jruoho  * DESCRIPTION: Format the contents of a DMAR. This table type consists
    914      1.1    jruoho  *              of an open-ended number of subtables.
    915      1.1    jruoho  *
    916      1.1    jruoho  ******************************************************************************/
    917      1.1    jruoho 
    918      1.1    jruoho void
    919      1.1    jruoho AcpiDmDumpDmar (
    920      1.1    jruoho     ACPI_TABLE_HEADER       *Table)
    921      1.1    jruoho {
    922      1.1    jruoho     ACPI_STATUS             Status;
    923      1.1    jruoho     ACPI_DMAR_HEADER        *SubTable;
    924      1.1    jruoho     UINT32                  Length = Table->Length;
    925      1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_DMAR);
    926      1.1    jruoho     ACPI_DMTABLE_INFO       *InfoTable;
    927      1.1    jruoho     ACPI_DMAR_DEVICE_SCOPE  *ScopeTable;
    928      1.1    jruoho     UINT32                  ScopeOffset;
    929      1.1    jruoho     UINT8                   *PciPath;
    930      1.1    jruoho     UINT32                  PathOffset;
    931      1.1    jruoho 
    932      1.1    jruoho 
    933      1.1    jruoho     /* Main table */
    934      1.1    jruoho 
    935      1.1    jruoho     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDmar);
    936      1.1    jruoho     if (ACPI_FAILURE (Status))
    937      1.1    jruoho     {
    938      1.1    jruoho         return;
    939      1.1    jruoho     }
    940      1.1    jruoho 
    941      1.2  christos     /* Subtables */
    942      1.1    jruoho 
    943      1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset);
    944      1.1    jruoho     while (Offset < Table->Length)
    945      1.1    jruoho     {
    946      1.2  christos         /* Common subtable header */
    947      1.1    jruoho 
    948      1.1    jruoho         AcpiOsPrintf ("\n");
    949      1.1    jruoho         Status = AcpiDmDumpTable (Length, Offset, SubTable,
    950      1.4  christos             SubTable->Length, AcpiDmTableInfoDmarHdr);
    951      1.1    jruoho         if (ACPI_FAILURE (Status))
    952      1.1    jruoho         {
    953      1.1    jruoho             return;
    954      1.1    jruoho         }
    955      1.4  christos 
    956      1.2  christos         AcpiOsPrintf ("\n");
    957      1.1    jruoho 
    958      1.1    jruoho         switch (SubTable->Type)
    959      1.1    jruoho         {
    960      1.1    jruoho         case ACPI_DMAR_TYPE_HARDWARE_UNIT:
    961      1.2  christos 
    962      1.1    jruoho             InfoTable = AcpiDmTableInfoDmar0;
    963      1.1    jruoho             ScopeOffset = sizeof (ACPI_DMAR_HARDWARE_UNIT);
    964      1.1    jruoho             break;
    965      1.2  christos 
    966      1.1    jruoho         case ACPI_DMAR_TYPE_RESERVED_MEMORY:
    967      1.2  christos 
    968      1.1    jruoho             InfoTable = AcpiDmTableInfoDmar1;
    969      1.1    jruoho             ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY);
    970      1.1    jruoho             break;
    971      1.2  christos 
    972      1.2  christos         case ACPI_DMAR_TYPE_ROOT_ATS:
    973      1.2  christos 
    974      1.1    jruoho             InfoTable = AcpiDmTableInfoDmar2;
    975      1.1    jruoho             ScopeOffset = sizeof (ACPI_DMAR_ATSR);
    976      1.1    jruoho             break;
    977      1.2  christos 
    978      1.2  christos         case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
    979      1.2  christos 
    980      1.1    jruoho             InfoTable = AcpiDmTableInfoDmar3;
    981      1.1    jruoho             ScopeOffset = sizeof (ACPI_DMAR_RHSA);
    982      1.1    jruoho             break;
    983      1.2  christos 
    984      1.2  christos         case ACPI_DMAR_TYPE_NAMESPACE:
    985      1.2  christos 
    986      1.2  christos             InfoTable = AcpiDmTableInfoDmar4;
    987      1.2  christos             ScopeOffset = sizeof (ACPI_DMAR_ANDD);
    988      1.2  christos             break;
    989      1.2  christos 
    990      1.1    jruoho         default:
    991      1.2  christos 
    992      1.4  christos             AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n",
    993      1.4  christos                 SubTable->Type);
    994      1.1    jruoho             return;
    995      1.1    jruoho         }
    996      1.1    jruoho 
    997      1.1    jruoho         Status = AcpiDmDumpTable (Length, Offset, SubTable,
    998      1.4  christos             SubTable->Length, InfoTable);
    999      1.1    jruoho         if (ACPI_FAILURE (Status))
   1000      1.1    jruoho         {
   1001      1.1    jruoho             return;
   1002      1.1    jruoho         }
   1003      1.1    jruoho 
   1004      1.2  christos         /*
   1005      1.2  christos          * Dump the optional device scope entries
   1006      1.2  christos          */
   1007      1.2  christos         if ((SubTable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
   1008      1.2  christos             (SubTable->Type == ACPI_DMAR_TYPE_NAMESPACE))
   1009      1.2  christos         {
   1010      1.2  christos             /* These types do not support device scopes */
   1011      1.2  christos 
   1012      1.2  christos             goto NextSubtable;
   1013      1.2  christos         }
   1014      1.1    jruoho 
   1015      1.1    jruoho         ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset);
   1016      1.1    jruoho         while (ScopeOffset < SubTable->Length)
   1017      1.1    jruoho         {
   1018      1.1    jruoho             AcpiOsPrintf ("\n");
   1019      1.1    jruoho             Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable,
   1020      1.4  christos                 ScopeTable->Length, AcpiDmTableInfoDmarScope);
   1021      1.1    jruoho             if (ACPI_FAILURE (Status))
   1022      1.1    jruoho             {
   1023      1.1    jruoho                 return;
   1024      1.1    jruoho             }
   1025      1.2  christos             AcpiOsPrintf ("\n");
   1026      1.1    jruoho 
   1027      1.1    jruoho             /* Dump the PCI Path entries for this device scope */
   1028      1.1    jruoho 
   1029      1.1    jruoho             PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */
   1030      1.1    jruoho 
   1031      1.1    jruoho             PciPath = ACPI_ADD_PTR (UINT8, ScopeTable,
   1032      1.1    jruoho                 sizeof (ACPI_DMAR_DEVICE_SCOPE));
   1033      1.1    jruoho 
   1034      1.1    jruoho             while (PathOffset < ScopeTable->Length)
   1035      1.1    jruoho             {
   1036      1.4  christos                 AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2,
   1037      1.4  christos                     "PCI Path");
   1038      1.2  christos                 AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath[0], PciPath[1]);
   1039      1.1    jruoho 
   1040      1.1    jruoho                 /* Point to next PCI Path entry */
   1041      1.1    jruoho 
   1042      1.1    jruoho                 PathOffset += 2;
   1043      1.1    jruoho                 PciPath += 2;
   1044      1.2  christos                 AcpiOsPrintf ("\n");
   1045      1.1    jruoho             }
   1046      1.1    jruoho 
   1047      1.1    jruoho             /* Point to next device scope entry */
   1048      1.1    jruoho 
   1049      1.1    jruoho             ScopeOffset += ScopeTable->Length;
   1050      1.1    jruoho             ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE,
   1051      1.1    jruoho                 ScopeTable, ScopeTable->Length);
   1052      1.1    jruoho         }
   1053      1.1    jruoho 
   1054      1.2  christos NextSubtable:
   1055      1.2  christos         /* Point to next subtable */
   1056      1.1    jruoho 
   1057      1.1    jruoho         Offset += SubTable->Length;
   1058      1.4  christos         SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable,
   1059      1.4  christos             SubTable->Length);
   1060      1.1    jruoho     }
   1061      1.1    jruoho }
   1062      1.1    jruoho 
   1063      1.1    jruoho 
   1064      1.1    jruoho /*******************************************************************************
   1065      1.1    jruoho  *
   1066      1.3  christos  * FUNCTION:    AcpiDmDumpDrtm
   1067      1.3  christos  *
   1068      1.3  christos  * PARAMETERS:  Table               - A DRTM table
   1069      1.3  christos  *
   1070      1.3  christos  * RETURN:      None
   1071      1.3  christos  *
   1072      1.3  christos  * DESCRIPTION: Format the contents of a DRTM.
   1073      1.3  christos  *
   1074      1.3  christos  ******************************************************************************/
   1075      1.3  christos 
   1076      1.3  christos void
   1077      1.3  christos AcpiDmDumpDrtm (
   1078      1.3  christos     ACPI_TABLE_HEADER       *Table)
   1079      1.3  christos {
   1080      1.3  christos     ACPI_STATUS             Status;
   1081      1.3  christos     UINT32                  Offset;
   1082      1.3  christos     ACPI_DRTM_VTABLE_LIST   *DrtmVtl;
   1083      1.3  christos     ACPI_DRTM_RESOURCE_LIST *DrtmRl;
   1084      1.3  christos     ACPI_DRTM_DPS_ID        *DrtmDps;
   1085      1.3  christos     UINT32                  Count;
   1086      1.3  christos 
   1087      1.3  christos 
   1088      1.3  christos     /* Main table */
   1089      1.3  christos 
   1090      1.3  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
   1091      1.4  christos         AcpiDmTableInfoDrtm);
   1092      1.3  christos     if (ACPI_FAILURE (Status))
   1093      1.3  christos     {
   1094      1.3  christos         return;
   1095      1.3  christos     }
   1096      1.3  christos 
   1097      1.3  christos     Offset = sizeof (ACPI_TABLE_DRTM);
   1098      1.3  christos 
   1099      1.3  christos     /* Sub-tables */
   1100      1.3  christos 
   1101      1.3  christos     /* Dump ValidatedTable length */
   1102      1.3  christos 
   1103      1.3  christos     DrtmVtl = ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST, Table, Offset);
   1104      1.3  christos     AcpiOsPrintf ("\n");
   1105      1.3  christos     Status = AcpiDmDumpTable (Table->Length, Offset,
   1106      1.4  christos         DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables),
   1107      1.4  christos         AcpiDmTableInfoDrtm0);
   1108      1.3  christos     if (ACPI_FAILURE (Status))
   1109      1.3  christos     {
   1110      1.3  christos             return;
   1111      1.3  christos     }
   1112      1.4  christos 
   1113      1.3  christos     Offset += ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables);
   1114      1.3  christos 
   1115      1.3  christos     /* Dump Validated table addresses */
   1116      1.3  christos 
   1117      1.3  christos     Count = 0;
   1118      1.3  christos     while ((Offset < Table->Length) &&
   1119      1.3  christos             (DrtmVtl->ValidatedTableCount > Count))
   1120      1.3  christos     {
   1121      1.3  christos         Status = AcpiDmDumpTable (Table->Length, Offset,
   1122      1.4  christos             ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64),
   1123      1.4  christos             AcpiDmTableInfoDrtm0a);
   1124      1.3  christos         if (ACPI_FAILURE (Status))
   1125      1.3  christos         {
   1126      1.3  christos             return;
   1127      1.3  christos         }
   1128      1.4  christos 
   1129      1.3  christos         Offset += sizeof (UINT64);
   1130      1.3  christos         Count++;
   1131      1.3  christos     }
   1132      1.3  christos 
   1133      1.3  christos     /* Dump ResourceList length */
   1134      1.3  christos 
   1135      1.3  christos     DrtmRl = ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST, Table, Offset);
   1136      1.3  christos     AcpiOsPrintf ("\n");
   1137      1.3  christos     Status = AcpiDmDumpTable (Table->Length, Offset,
   1138      1.4  christos         DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources),
   1139      1.4  christos         AcpiDmTableInfoDrtm1);
   1140      1.3  christos     if (ACPI_FAILURE (Status))
   1141      1.3  christos     {
   1142      1.3  christos         return;
   1143      1.3  christos     }
   1144      1.3  christos 
   1145      1.3  christos     Offset += ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources);
   1146      1.3  christos 
   1147      1.3  christos     /* Dump the Resource List */
   1148      1.3  christos 
   1149      1.3  christos     Count = 0;
   1150      1.3  christos     while ((Offset < Table->Length) &&
   1151      1.3  christos            (DrtmRl->ResourceCount > Count))
   1152      1.3  christos     {
   1153      1.3  christos         Status = AcpiDmDumpTable (Table->Length, Offset,
   1154      1.4  christos             ACPI_ADD_PTR (void, Table, Offset),
   1155      1.4  christos             sizeof (ACPI_DRTM_RESOURCE), AcpiDmTableInfoDrtm1a);
   1156      1.3  christos         if (ACPI_FAILURE (Status))
   1157      1.3  christos         {
   1158      1.3  christos             return;
   1159      1.3  christos         }
   1160      1.3  christos 
   1161      1.3  christos         Offset += sizeof (ACPI_DRTM_RESOURCE);
   1162      1.3  christos         Count++;
   1163      1.3  christos     }
   1164      1.3  christos 
   1165      1.3  christos     /* Dump DPS */
   1166      1.3  christos 
   1167      1.3  christos     DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset);
   1168      1.3  christos     AcpiOsPrintf ("\n");
   1169      1.3  christos     (void) AcpiDmDumpTable (Table->Length, Offset,
   1170      1.4  christos         DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2);
   1171      1.3  christos }
   1172      1.3  christos 
   1173      1.3  christos 
   1174      1.3  christos /*******************************************************************************
   1175      1.3  christos  *
   1176      1.1    jruoho  * FUNCTION:    AcpiDmDumpEinj
   1177      1.1    jruoho  *
   1178      1.1    jruoho  * PARAMETERS:  Table               - A EINJ table
   1179      1.1    jruoho  *
   1180      1.1    jruoho  * RETURN:      None
   1181      1.1    jruoho  *
   1182      1.1    jruoho  * DESCRIPTION: Format the contents of a EINJ. This table type consists
   1183      1.1    jruoho  *              of an open-ended number of subtables.
   1184      1.1    jruoho  *
   1185      1.1    jruoho  ******************************************************************************/
   1186      1.1    jruoho 
   1187      1.1    jruoho void
   1188      1.1    jruoho AcpiDmDumpEinj (
   1189      1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   1190      1.1    jruoho {
   1191      1.1    jruoho     ACPI_STATUS             Status;
   1192      1.1    jruoho     ACPI_WHEA_HEADER        *SubTable;
   1193      1.1    jruoho     UINT32                  Length = Table->Length;
   1194      1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_EINJ);
   1195      1.1    jruoho 
   1196      1.1    jruoho 
   1197      1.1    jruoho     /* Main table */
   1198      1.1    jruoho 
   1199      1.1    jruoho     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoEinj);
   1200      1.1    jruoho     if (ACPI_FAILURE (Status))
   1201      1.1    jruoho     {
   1202      1.1    jruoho         return;
   1203      1.1    jruoho     }
   1204      1.1    jruoho 
   1205      1.2  christos     /* Subtables */
   1206      1.1    jruoho 
   1207      1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
   1208      1.1    jruoho     while (Offset < Table->Length)
   1209      1.1    jruoho     {
   1210      1.1    jruoho         AcpiOsPrintf ("\n");
   1211      1.1    jruoho         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   1212      1.4  christos             sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
   1213      1.1    jruoho         if (ACPI_FAILURE (Status))
   1214      1.1    jruoho         {
   1215      1.1    jruoho             return;
   1216      1.1    jruoho         }
   1217      1.1    jruoho 
   1218      1.2  christos         /* Point to next subtable (each subtable is of fixed length) */
   1219      1.1    jruoho 
   1220      1.1    jruoho         Offset += sizeof (ACPI_WHEA_HEADER);
   1221      1.1    jruoho         SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
   1222      1.4  christos             sizeof (ACPI_WHEA_HEADER));
   1223      1.1    jruoho     }
   1224      1.1    jruoho }
   1225      1.1    jruoho 
   1226      1.1    jruoho 
   1227      1.1    jruoho /*******************************************************************************
   1228      1.1    jruoho  *
   1229      1.1    jruoho  * FUNCTION:    AcpiDmDumpErst
   1230      1.1    jruoho  *
   1231      1.1    jruoho  * PARAMETERS:  Table               - A ERST table
   1232      1.1    jruoho  *
   1233      1.1    jruoho  * RETURN:      None
   1234      1.1    jruoho  *
   1235      1.1    jruoho  * DESCRIPTION: Format the contents of a ERST. This table type consists
   1236      1.1    jruoho  *              of an open-ended number of subtables.
   1237      1.1    jruoho  *
   1238      1.1    jruoho  ******************************************************************************/
   1239      1.1    jruoho 
   1240      1.1    jruoho void
   1241      1.1    jruoho AcpiDmDumpErst (
   1242      1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   1243      1.1    jruoho {
   1244      1.1    jruoho     ACPI_STATUS             Status;
   1245      1.1    jruoho     ACPI_WHEA_HEADER        *SubTable;
   1246      1.1    jruoho     UINT32                  Length = Table->Length;
   1247      1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_ERST);
   1248      1.1    jruoho 
   1249      1.1    jruoho 
   1250      1.1    jruoho     /* Main table */
   1251      1.1    jruoho 
   1252      1.1    jruoho     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoErst);
   1253      1.1    jruoho     if (ACPI_FAILURE (Status))
   1254      1.1    jruoho     {
   1255      1.1    jruoho         return;
   1256      1.1    jruoho     }
   1257      1.1    jruoho 
   1258      1.2  christos     /* Subtables */
   1259      1.1    jruoho 
   1260      1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
   1261      1.1    jruoho     while (Offset < Table->Length)
   1262      1.1    jruoho     {
   1263      1.1    jruoho         AcpiOsPrintf ("\n");
   1264      1.1    jruoho         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   1265      1.4  christos             sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0);
   1266      1.1    jruoho         if (ACPI_FAILURE (Status))
   1267      1.1    jruoho         {
   1268      1.1    jruoho             return;
   1269      1.1    jruoho         }
   1270      1.1    jruoho 
   1271      1.2  christos         /* Point to next subtable (each subtable is of fixed length) */
   1272      1.1    jruoho 
   1273      1.1    jruoho         Offset += sizeof (ACPI_WHEA_HEADER);
   1274      1.1    jruoho         SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
   1275      1.4  christos             sizeof (ACPI_WHEA_HEADER));
   1276      1.1    jruoho     }
   1277      1.1    jruoho }
   1278      1.1    jruoho 
   1279      1.1    jruoho 
   1280      1.1    jruoho /*******************************************************************************
   1281      1.1    jruoho  *
   1282      1.2  christos  * FUNCTION:    AcpiDmDumpFpdt
   1283      1.1    jruoho  *
   1284      1.2  christos  * PARAMETERS:  Table               - A FPDT table
   1285      1.1    jruoho  *
   1286      1.1    jruoho  * RETURN:      None
   1287      1.1    jruoho  *
   1288      1.2  christos  * DESCRIPTION: Format the contents of a FPDT. This table type consists
   1289      1.1    jruoho  *              of an open-ended number of subtables.
   1290      1.1    jruoho  *
   1291      1.1    jruoho  ******************************************************************************/
   1292      1.1    jruoho 
   1293      1.1    jruoho void
   1294      1.2  christos AcpiDmDumpFpdt (
   1295      1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   1296      1.1    jruoho {
   1297      1.1    jruoho     ACPI_STATUS             Status;
   1298      1.2  christos     ACPI_FPDT_HEADER        *SubTable;
   1299      1.1    jruoho     UINT32                  Length = Table->Length;
   1300      1.2  christos     UINT32                  Offset = sizeof (ACPI_TABLE_FPDT);
   1301      1.2  christos     ACPI_DMTABLE_INFO       *InfoTable;
   1302      1.2  christos 
   1303      1.2  christos 
   1304      1.2  christos     /* There is no main table (other than the standard ACPI header) */
   1305      1.2  christos 
   1306      1.2  christos     /* Subtables */
   1307      1.2  christos 
   1308      1.2  christos     SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset);
   1309      1.2  christos     while (Offset < Table->Length)
   1310      1.2  christos     {
   1311      1.2  christos         /* Common subtable header */
   1312      1.2  christos 
   1313      1.2  christos         AcpiOsPrintf ("\n");
   1314      1.2  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   1315      1.4  christos             SubTable->Length, AcpiDmTableInfoFpdtHdr);
   1316      1.2  christos         if (ACPI_FAILURE (Status))
   1317      1.2  christos         {
   1318      1.2  christos             return;
   1319      1.2  christos         }
   1320      1.2  christos 
   1321      1.2  christos         switch (SubTable->Type)
   1322      1.2  christos         {
   1323      1.2  christos         case ACPI_FPDT_TYPE_BOOT:
   1324      1.2  christos 
   1325      1.2  christos             InfoTable = AcpiDmTableInfoFpdt0;
   1326      1.2  christos             break;
   1327      1.2  christos 
   1328      1.2  christos         case ACPI_FPDT_TYPE_S3PERF:
   1329      1.2  christos 
   1330      1.2  christos             InfoTable = AcpiDmTableInfoFpdt1;
   1331      1.2  christos             break;
   1332      1.2  christos 
   1333      1.2  christos         default:
   1334      1.2  christos 
   1335      1.4  christos             AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n",
   1336      1.4  christos                 SubTable->Type);
   1337      1.2  christos 
   1338      1.2  christos             /* Attempt to continue */
   1339      1.2  christos 
   1340      1.2  christos             if (!SubTable->Length)
   1341      1.2  christos             {
   1342      1.2  christos                 AcpiOsPrintf ("Invalid zero length subtable\n");
   1343      1.2  christos                 return;
   1344      1.2  christos             }
   1345      1.2  christos             goto NextSubTable;
   1346      1.2  christos         }
   1347      1.2  christos 
   1348      1.2  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   1349      1.4  christos             SubTable->Length, InfoTable);
   1350      1.2  christos         if (ACPI_FAILURE (Status))
   1351      1.2  christos         {
   1352      1.2  christos             return;
   1353      1.2  christos         }
   1354      1.2  christos 
   1355      1.2  christos NextSubTable:
   1356      1.2  christos         /* Point to next subtable */
   1357      1.2  christos 
   1358      1.2  christos         Offset += SubTable->Length;
   1359      1.4  christos         SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable,
   1360      1.4  christos             SubTable->Length);
   1361      1.2  christos     }
   1362      1.2  christos }
   1363      1.2  christos 
   1364      1.2  christos 
   1365      1.2  christos /*******************************************************************************
   1366      1.2  christos  *
   1367      1.2  christos  * FUNCTION:    AcpiDmDumpGtdt
   1368      1.2  christos  *
   1369      1.2  christos  * PARAMETERS:  Table               - A GTDT table
   1370      1.2  christos  *
   1371      1.2  christos  * RETURN:      None
   1372      1.2  christos  *
   1373      1.2  christos  * DESCRIPTION: Format the contents of a GTDT. This table type consists
   1374      1.2  christos  *              of an open-ended number of subtables.
   1375      1.2  christos  *
   1376      1.2  christos  ******************************************************************************/
   1377      1.2  christos 
   1378      1.2  christos void
   1379      1.2  christos AcpiDmDumpGtdt (
   1380      1.2  christos     ACPI_TABLE_HEADER       *Table)
   1381      1.2  christos {
   1382      1.2  christos     ACPI_STATUS             Status;
   1383      1.2  christos     ACPI_GTDT_HEADER        *SubTable;
   1384      1.2  christos     UINT32                  Length = Table->Length;
   1385      1.2  christos     UINT32                  Offset = sizeof (ACPI_TABLE_GTDT);
   1386      1.2  christos     ACPI_DMTABLE_INFO       *InfoTable;
   1387      1.2  christos     UINT32                  SubTableLength;
   1388      1.2  christos     UINT32                  GtCount;
   1389      1.2  christos     ACPI_GTDT_TIMER_ENTRY   *GtxTable;
   1390      1.2  christos 
   1391      1.2  christos 
   1392      1.2  christos     /* Main table */
   1393      1.2  christos 
   1394      1.2  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoGtdt);
   1395      1.2  christos     if (ACPI_FAILURE (Status))
   1396      1.2  christos     {
   1397      1.2  christos         return;
   1398      1.2  christos     }
   1399      1.2  christos 
   1400      1.2  christos     /* Subtables */
   1401      1.2  christos 
   1402      1.2  christos     SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
   1403      1.2  christos     while (Offset < Table->Length)
   1404      1.2  christos     {
   1405      1.2  christos         /* Common subtable header */
   1406      1.2  christos 
   1407      1.2  christos         AcpiOsPrintf ("\n");
   1408      1.2  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   1409      1.4  christos             SubTable->Length, AcpiDmTableInfoGtdtHdr);
   1410      1.2  christos         if (ACPI_FAILURE (Status))
   1411      1.2  christos         {
   1412      1.2  christos             return;
   1413      1.2  christos         }
   1414      1.2  christos 
   1415      1.2  christos         GtCount = 0;
   1416      1.2  christos         switch (SubTable->Type)
   1417      1.2  christos         {
   1418      1.2  christos         case ACPI_GTDT_TYPE_TIMER_BLOCK:
   1419      1.2  christos 
   1420      1.2  christos             SubTableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
   1421      1.2  christos             GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
   1422      1.4  christos                 SubTable))->TimerCount;
   1423      1.2  christos 
   1424      1.2  christos             InfoTable = AcpiDmTableInfoGtdt0;
   1425      1.2  christos             break;
   1426      1.2  christos 
   1427      1.2  christos         case ACPI_GTDT_TYPE_WATCHDOG:
   1428      1.2  christos 
   1429      1.2  christos             SubTableLength = sizeof (ACPI_GTDT_WATCHDOG);
   1430      1.2  christos 
   1431      1.2  christos             InfoTable = AcpiDmTableInfoGtdt1;
   1432      1.2  christos             break;
   1433      1.2  christos 
   1434      1.2  christos         default:
   1435      1.2  christos 
   1436      1.2  christos             /* Cannot continue on unknown type - no length */
   1437      1.2  christos 
   1438      1.4  christos             AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n",
   1439      1.4  christos                 SubTable->Type);
   1440      1.2  christos             return;
   1441      1.2  christos         }
   1442      1.2  christos 
   1443      1.2  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   1444      1.4  christos             SubTable->Length, InfoTable);
   1445      1.2  christos         if (ACPI_FAILURE (Status))
   1446      1.2  christos         {
   1447      1.2  christos             return;
   1448      1.2  christos         }
   1449      1.2  christos 
   1450      1.2  christos         /* Point to end of current subtable (each subtable above is of fixed length) */
   1451      1.2  christos 
   1452      1.2  christos         Offset += SubTableLength;
   1453      1.2  christos 
   1454      1.2  christos         /* If there are any Gt Timer Blocks from above, dump them now */
   1455      1.2  christos 
   1456      1.2  christos         if (GtCount)
   1457      1.2  christos         {
   1458      1.4  christos             GtxTable = ACPI_ADD_PTR (
   1459      1.4  christos                 ACPI_GTDT_TIMER_ENTRY, SubTable, SubTableLength);
   1460      1.2  christos             SubTableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY);
   1461      1.2  christos 
   1462      1.2  christos             while (GtCount)
   1463      1.2  christos             {
   1464      1.2  christos                 AcpiOsPrintf ("\n");
   1465      1.2  christos                 Status = AcpiDmDumpTable (Length, Offset, GtxTable,
   1466      1.4  christos                     sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a);
   1467      1.2  christos                 if (ACPI_FAILURE (Status))
   1468      1.2  christos                 {
   1469      1.2  christos                     return;
   1470      1.2  christos                 }
   1471      1.2  christos                 Offset += sizeof (ACPI_GTDT_TIMER_ENTRY);
   1472      1.2  christos                 GtxTable++;
   1473      1.2  christos                 GtCount--;
   1474      1.2  christos             }
   1475      1.2  christos         }
   1476      1.2  christos 
   1477      1.2  christos         /* Point to next subtable */
   1478      1.2  christos 
   1479      1.2  christos         SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, SubTable, SubTableLength);
   1480      1.2  christos     }
   1481      1.2  christos }
   1482      1.2  christos 
   1483      1.2  christos 
   1484      1.2  christos /*******************************************************************************
   1485      1.2  christos  *
   1486      1.2  christos  * FUNCTION:    AcpiDmDumpHest
   1487      1.2  christos  *
   1488      1.2  christos  * PARAMETERS:  Table               - A HEST table
   1489      1.2  christos  *
   1490      1.2  christos  * RETURN:      None
   1491      1.2  christos  *
   1492      1.2  christos  * DESCRIPTION: Format the contents of a HEST. This table type consists
   1493      1.2  christos  *              of an open-ended number of subtables.
   1494      1.2  christos  *
   1495      1.2  christos  ******************************************************************************/
   1496      1.2  christos 
   1497      1.2  christos void
   1498      1.2  christos AcpiDmDumpHest (
   1499      1.2  christos     ACPI_TABLE_HEADER       *Table)
   1500      1.2  christos {
   1501      1.2  christos     ACPI_STATUS             Status;
   1502      1.2  christos     ACPI_HEST_HEADER        *SubTable;
   1503      1.2  christos     UINT32                  Length = Table->Length;
   1504      1.2  christos     UINT32                  Offset = sizeof (ACPI_TABLE_HEST);
   1505      1.1    jruoho     ACPI_DMTABLE_INFO       *InfoTable;
   1506      1.1    jruoho     UINT32                  SubTableLength;
   1507      1.1    jruoho     UINT32                  BankCount;
   1508      1.1    jruoho     ACPI_HEST_IA_ERROR_BANK *BankTable;
   1509      1.1    jruoho 
   1510      1.1    jruoho 
   1511      1.1    jruoho     /* Main table */
   1512      1.1    jruoho 
   1513      1.1    jruoho     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHest);
   1514      1.1    jruoho     if (ACPI_FAILURE (Status))
   1515      1.1    jruoho     {
   1516      1.1    jruoho         return;
   1517      1.1    jruoho     }
   1518      1.1    jruoho 
   1519      1.2  christos     /* Subtables */
   1520      1.1    jruoho 
   1521      1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
   1522      1.1    jruoho     while (Offset < Table->Length)
   1523      1.1    jruoho     {
   1524      1.1    jruoho         BankCount = 0;
   1525      1.1    jruoho         switch (SubTable->Type)
   1526      1.1    jruoho         {
   1527      1.1    jruoho         case ACPI_HEST_TYPE_IA32_CHECK:
   1528      1.2  christos 
   1529      1.1    jruoho             InfoTable = AcpiDmTableInfoHest0;
   1530      1.1    jruoho             SubTableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK);
   1531      1.1    jruoho             BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
   1532      1.4  christos                 SubTable))->NumHardwareBanks;
   1533      1.1    jruoho             break;
   1534      1.1    jruoho 
   1535      1.1    jruoho         case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
   1536      1.2  christos 
   1537      1.1    jruoho             InfoTable = AcpiDmTableInfoHest1;
   1538      1.1    jruoho             SubTableLength = sizeof (ACPI_HEST_IA_CORRECTED);
   1539      1.1    jruoho             BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
   1540      1.4  christos                 SubTable))->NumHardwareBanks;
   1541      1.1    jruoho             break;
   1542      1.1    jruoho 
   1543      1.1    jruoho         case ACPI_HEST_TYPE_IA32_NMI:
   1544      1.2  christos 
   1545      1.1    jruoho             InfoTable = AcpiDmTableInfoHest2;
   1546      1.1    jruoho             SubTableLength = sizeof (ACPI_HEST_IA_NMI);
   1547      1.1    jruoho             break;
   1548      1.1    jruoho 
   1549      1.1    jruoho         case ACPI_HEST_TYPE_AER_ROOT_PORT:
   1550      1.2  christos 
   1551      1.1    jruoho             InfoTable = AcpiDmTableInfoHest6;
   1552      1.1    jruoho             SubTableLength = sizeof (ACPI_HEST_AER_ROOT);
   1553      1.1    jruoho             break;
   1554      1.1    jruoho 
   1555      1.1    jruoho         case ACPI_HEST_TYPE_AER_ENDPOINT:
   1556      1.2  christos 
   1557      1.1    jruoho             InfoTable = AcpiDmTableInfoHest7;
   1558      1.1    jruoho             SubTableLength = sizeof (ACPI_HEST_AER);
   1559      1.1    jruoho             break;
   1560      1.1    jruoho 
   1561      1.1    jruoho         case ACPI_HEST_TYPE_AER_BRIDGE:
   1562      1.2  christos 
   1563      1.1    jruoho             InfoTable = AcpiDmTableInfoHest8;
   1564      1.1    jruoho             SubTableLength = sizeof (ACPI_HEST_AER_BRIDGE);
   1565      1.1    jruoho             break;
   1566      1.1    jruoho 
   1567      1.1    jruoho         case ACPI_HEST_TYPE_GENERIC_ERROR:
   1568      1.2  christos 
   1569      1.1    jruoho             InfoTable = AcpiDmTableInfoHest9;
   1570      1.1    jruoho             SubTableLength = sizeof (ACPI_HEST_GENERIC);
   1571      1.1    jruoho             break;
   1572      1.1    jruoho 
   1573      1.5  christos         case ACPI_HEST_TYPE_GENERIC_ERROR_V2:
   1574      1.5  christos 
   1575      1.5  christos             InfoTable = AcpiDmTableInfoHest10;
   1576      1.5  christos             SubTableLength = sizeof (ACPI_HEST_GENERIC_V2);
   1577      1.5  christos             break;
   1578      1.5  christos 
   1579      1.1    jruoho         default:
   1580      1.2  christos 
   1581      1.1    jruoho             /* Cannot continue on unknown type - no length */
   1582      1.1    jruoho 
   1583      1.4  christos             AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n",
   1584      1.4  christos                 SubTable->Type);
   1585      1.1    jruoho             return;
   1586      1.1    jruoho         }
   1587      1.1    jruoho 
   1588      1.1    jruoho         AcpiOsPrintf ("\n");
   1589      1.1    jruoho         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   1590      1.4  christos             SubTableLength, InfoTable);
   1591      1.1    jruoho         if (ACPI_FAILURE (Status))
   1592      1.1    jruoho         {
   1593      1.1    jruoho             return;
   1594      1.1    jruoho         }
   1595      1.1    jruoho 
   1596      1.1    jruoho         /* Point to end of current subtable (each subtable above is of fixed length) */
   1597      1.1    jruoho 
   1598      1.1    jruoho         Offset += SubTableLength;
   1599      1.1    jruoho 
   1600      1.1    jruoho         /* If there are any (fixed-length) Error Banks from above, dump them now */
   1601      1.1    jruoho 
   1602      1.1    jruoho         if (BankCount)
   1603      1.1    jruoho         {
   1604      1.4  christos             BankTable = ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK, SubTable,
   1605      1.4  christos                 SubTableLength);
   1606      1.3  christos             SubTableLength += BankCount * sizeof (ACPI_HEST_IA_ERROR_BANK);
   1607      1.3  christos 
   1608      1.3  christos             while (BankCount)
   1609      1.3  christos             {
   1610      1.3  christos                 AcpiOsPrintf ("\n");
   1611      1.3  christos                 Status = AcpiDmDumpTable (Length, Offset, BankTable,
   1612      1.4  christos                     sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank);
   1613      1.3  christos                 if (ACPI_FAILURE (Status))
   1614      1.3  christos                 {
   1615      1.3  christos                     return;
   1616      1.3  christos                 }
   1617      1.4  christos 
   1618      1.3  christos                 Offset += sizeof (ACPI_HEST_IA_ERROR_BANK);
   1619      1.3  christos                 BankTable++;
   1620      1.3  christos                 BankCount--;
   1621      1.3  christos             }
   1622      1.3  christos         }
   1623      1.3  christos 
   1624      1.3  christos         /* Point to next subtable */
   1625      1.3  christos 
   1626      1.3  christos         SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, SubTable, SubTableLength);
   1627      1.3  christos     }
   1628      1.3  christos }
   1629      1.3  christos 
   1630      1.3  christos 
   1631      1.3  christos /*******************************************************************************
   1632      1.3  christos  *
   1633      1.3  christos  * FUNCTION:    AcpiDmDumpIort
   1634      1.3  christos  *
   1635      1.3  christos  * PARAMETERS:  Table               - A IORT table
   1636      1.3  christos  *
   1637      1.3  christos  * RETURN:      None
   1638      1.3  christos  *
   1639      1.3  christos  * DESCRIPTION: Format the contents of a IORT
   1640      1.3  christos  *
   1641      1.3  christos  ******************************************************************************/
   1642      1.3  christos 
   1643      1.3  christos void
   1644      1.3  christos AcpiDmDumpIort (
   1645      1.3  christos     ACPI_TABLE_HEADER       *Table)
   1646      1.3  christos {
   1647      1.3  christos     ACPI_STATUS             Status;
   1648      1.3  christos     ACPI_TABLE_IORT         *Iort;
   1649      1.3  christos     ACPI_IORT_NODE          *IortNode;
   1650      1.3  christos     ACPI_IORT_ITS_GROUP     *IortItsGroup = NULL;
   1651      1.3  christos     ACPI_IORT_SMMU          *IortSmmu = NULL;
   1652      1.3  christos     UINT32                  Offset;
   1653      1.3  christos     UINT32                  NodeOffset;
   1654      1.3  christos     UINT32                  Length;
   1655      1.3  christos     ACPI_DMTABLE_INFO       *InfoTable;
   1656      1.3  christos     char                    *String;
   1657      1.3  christos     UINT32                  i;
   1658      1.3  christos 
   1659      1.3  christos 
   1660      1.3  christos     /* Main table */
   1661      1.3  christos 
   1662      1.3  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIort);
   1663      1.3  christos     if (ACPI_FAILURE (Status))
   1664      1.3  christos     {
   1665      1.3  christos         return;
   1666      1.3  christos     }
   1667      1.3  christos 
   1668      1.3  christos     Iort = ACPI_CAST_PTR (ACPI_TABLE_IORT, Table);
   1669      1.3  christos     Offset = sizeof (ACPI_TABLE_IORT);
   1670      1.3  christos 
   1671      1.3  christos     /* Dump the OptionalPadding (optional) */
   1672      1.3  christos 
   1673      1.3  christos     if (Iort->NodeOffset > Offset)
   1674      1.3  christos     {
   1675      1.3  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Table,
   1676      1.4  christos             Iort->NodeOffset - Offset, AcpiDmTableInfoIortPad);
   1677      1.3  christos         if (ACPI_FAILURE (Status))
   1678      1.3  christos         {
   1679      1.3  christos             return;
   1680      1.3  christos         }
   1681      1.3  christos     }
   1682      1.3  christos 
   1683      1.3  christos     Offset = Iort->NodeOffset;
   1684      1.3  christos     while (Offset < Table->Length)
   1685      1.3  christos     {
   1686      1.3  christos         /* Common subtable header */
   1687      1.3  christos 
   1688      1.3  christos         IortNode = ACPI_ADD_PTR (ACPI_IORT_NODE, Table, Offset);
   1689      1.3  christos         AcpiOsPrintf ("\n");
   1690      1.3  christos         Length = ACPI_OFFSET (ACPI_IORT_NODE, NodeData);
   1691      1.3  christos         Status = AcpiDmDumpTable (Table->Length, Offset,
   1692      1.4  christos             IortNode, Length, AcpiDmTableInfoIortHdr);
   1693      1.3  christos         if (ACPI_FAILURE (Status))
   1694      1.3  christos         {
   1695      1.3  christos             return;
   1696      1.3  christos         }
   1697      1.3  christos 
   1698      1.3  christos         NodeOffset = Length;
   1699      1.3  christos 
   1700      1.3  christos         switch (IortNode->Type)
   1701      1.3  christos         {
   1702      1.3  christos         case ACPI_IORT_NODE_ITS_GROUP:
   1703      1.3  christos 
   1704      1.3  christos             InfoTable = AcpiDmTableInfoIort0;
   1705      1.3  christos             Length = ACPI_OFFSET (ACPI_IORT_ITS_GROUP, Identifiers);
   1706      1.3  christos             IortItsGroup = ACPI_ADD_PTR (ACPI_IORT_ITS_GROUP, IortNode, NodeOffset);
   1707      1.3  christos             break;
   1708      1.3  christos 
   1709      1.3  christos         case ACPI_IORT_NODE_NAMED_COMPONENT:
   1710      1.3  christos 
   1711      1.3  christos             InfoTable = AcpiDmTableInfoIort1;
   1712      1.3  christos             Length = ACPI_OFFSET (ACPI_IORT_NAMED_COMPONENT, DeviceName);
   1713      1.3  christos             String = ACPI_ADD_PTR (char, IortNode, NodeOffset + Length);
   1714      1.3  christos             Length += strlen (String) + 1;
   1715      1.3  christos             break;
   1716      1.3  christos 
   1717      1.3  christos         case ACPI_IORT_NODE_PCI_ROOT_COMPLEX:
   1718      1.3  christos 
   1719      1.3  christos             InfoTable = AcpiDmTableInfoIort2;
   1720      1.3  christos             Length = IortNode->Length - NodeOffset;
   1721      1.3  christos             break;
   1722      1.3  christos 
   1723      1.3  christos         case ACPI_IORT_NODE_SMMU:
   1724      1.3  christos 
   1725      1.3  christos             InfoTable = AcpiDmTableInfoIort3;
   1726      1.3  christos             Length = ACPI_OFFSET (ACPI_IORT_SMMU, Interrupts);
   1727      1.3  christos             IortSmmu = ACPI_ADD_PTR (ACPI_IORT_SMMU, IortNode, NodeOffset);
   1728      1.3  christos             break;
   1729      1.3  christos 
   1730      1.5  christos         case ACPI_IORT_NODE_SMMU_V3:
   1731      1.5  christos 
   1732      1.5  christos             InfoTable = AcpiDmTableInfoIort4;
   1733      1.5  christos             Length = IortNode->Length - NodeOffset;
   1734      1.5  christos             break;
   1735      1.5  christos 
   1736      1.3  christos         default:
   1737      1.3  christos 
   1738      1.3  christos             AcpiOsPrintf ("\n**** Unknown IORT node type 0x%X\n",
   1739      1.3  christos                 IortNode->Type);
   1740      1.3  christos 
   1741      1.3  christos             /* Attempt to continue */
   1742      1.3  christos 
   1743      1.3  christos             if (!IortNode->Length)
   1744      1.3  christos             {
   1745      1.3  christos                 AcpiOsPrintf ("Invalid zero length IORT node\n");
   1746      1.3  christos                 return;
   1747      1.3  christos             }
   1748      1.3  christos             goto NextSubTable;
   1749      1.3  christos         }
   1750      1.3  christos 
   1751      1.3  christos         /* Dump the node subtable header */
   1752      1.3  christos 
   1753      1.3  christos         AcpiOsPrintf ("\n");
   1754      1.3  christos         Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
   1755      1.4  christos             ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
   1756      1.4  christos             Length, InfoTable);
   1757      1.3  christos         if (ACPI_FAILURE (Status))
   1758      1.3  christos         {
   1759      1.3  christos             return;
   1760      1.3  christos         }
   1761      1.3  christos 
   1762      1.3  christos         NodeOffset += Length;
   1763      1.3  christos 
   1764      1.3  christos         /* Dump the node specific data */
   1765      1.3  christos 
   1766      1.3  christos         switch (IortNode->Type)
   1767      1.3  christos         {
   1768      1.3  christos         case ACPI_IORT_NODE_ITS_GROUP:
   1769      1.3  christos 
   1770      1.3  christos             /* Validate IortItsGroup to avoid compiler warnings */
   1771      1.3  christos 
   1772      1.3  christos             if (IortItsGroup)
   1773      1.3  christos             {
   1774      1.3  christos                 for (i = 0; i < IortItsGroup->ItsCount; i++)
   1775      1.3  christos                 {
   1776      1.3  christos                     Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
   1777      1.4  christos                         ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
   1778      1.4  christos                         4, AcpiDmTableInfoIort0a);
   1779      1.3  christos                     NodeOffset += 4;
   1780      1.3  christos                 }
   1781      1.3  christos             }
   1782      1.3  christos             break;
   1783      1.3  christos 
   1784      1.3  christos         case ACPI_IORT_NODE_NAMED_COMPONENT:
   1785      1.3  christos 
   1786      1.3  christos             /* Dump the Padding (optional) */
   1787      1.3  christos 
   1788      1.3  christos             if (IortNode->Length > NodeOffset)
   1789      1.3  christos             {
   1790      1.3  christos                 Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
   1791      1.4  christos                     Table, IortNode->Length - NodeOffset,
   1792      1.4  christos                     AcpiDmTableInfoIort1a);
   1793      1.3  christos                 if (ACPI_FAILURE (Status))
   1794      1.3  christos                 {
   1795      1.3  christos                     return;
   1796      1.3  christos                 }
   1797      1.3  christos             }
   1798      1.3  christos             break;
   1799      1.3  christos 
   1800      1.3  christos         case ACPI_IORT_NODE_SMMU:
   1801      1.3  christos 
   1802      1.3  christos             AcpiOsPrintf ("\n");
   1803      1.3  christos 
   1804      1.3  christos             /* Validate IortSmmu to avoid compiler warnings */
   1805      1.3  christos 
   1806      1.3  christos             if (IortSmmu)
   1807      1.3  christos             {
   1808      1.3  christos                 Length = 2 * sizeof (UINT64);
   1809      1.3  christos                 NodeOffset = IortSmmu->GlobalInterruptOffset;
   1810      1.3  christos                 Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
   1811      1.4  christos                     ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
   1812      1.4  christos                     Length, AcpiDmTableInfoIort3a);
   1813      1.3  christos                 if (ACPI_FAILURE (Status))
   1814      1.3  christos                 {
   1815      1.3  christos                     return;
   1816      1.3  christos                 }
   1817      1.3  christos 
   1818      1.3  christos                 NodeOffset = IortSmmu->ContextInterruptOffset;
   1819      1.3  christos                 for (i = 0; i < IortSmmu->ContextInterruptCount; i++)
   1820      1.3  christos                 {
   1821      1.3  christos                     Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
   1822      1.4  christos                         ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
   1823      1.4  christos                         8, AcpiDmTableInfoIort3b);
   1824      1.3  christos                     if (ACPI_FAILURE (Status))
   1825      1.3  christos                     {
   1826      1.3  christos                         return;
   1827      1.3  christos                     }
   1828      1.4  christos 
   1829      1.3  christos                     NodeOffset += 8;
   1830      1.3  christos                 }
   1831      1.3  christos 
   1832      1.3  christos                 NodeOffset = IortSmmu->PmuInterruptOffset;
   1833      1.3  christos                 for (i = 0; i < IortSmmu->PmuInterruptCount; i++)
   1834      1.3  christos                 {
   1835      1.3  christos                     Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
   1836      1.4  christos                         ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
   1837      1.4  christos                         8, AcpiDmTableInfoIort3c);
   1838      1.3  christos                     if (ACPI_FAILURE (Status))
   1839      1.3  christos                     {
   1840      1.3  christos                         return;
   1841      1.3  christos                     }
   1842      1.4  christos 
   1843      1.3  christos                     NodeOffset += 8;
   1844      1.3  christos                 }
   1845      1.3  christos             }
   1846      1.3  christos             break;
   1847      1.3  christos 
   1848      1.3  christos         default:
   1849      1.3  christos 
   1850      1.3  christos             break;
   1851      1.3  christos         }
   1852      1.3  christos 
   1853      1.3  christos         /* Dump the ID mappings */
   1854      1.3  christos 
   1855      1.3  christos         NodeOffset = IortNode->MappingOffset;
   1856      1.3  christos         for (i = 0; i < IortNode->MappingCount; i++)
   1857      1.3  christos         {
   1858      1.3  christos             AcpiOsPrintf ("\n");
   1859      1.3  christos             Length = sizeof (ACPI_IORT_ID_MAPPING);
   1860      1.3  christos             Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
   1861      1.4  christos                 ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
   1862      1.4  christos                 Length, AcpiDmTableInfoIortMap);
   1863      1.3  christos             if (ACPI_FAILURE (Status))
   1864      1.1    jruoho             {
   1865      1.3  christos                 return;
   1866      1.1    jruoho             }
   1867      1.4  christos 
   1868      1.3  christos             NodeOffset += Length;
   1869      1.1    jruoho         }
   1870      1.1    jruoho 
   1871      1.3  christos NextSubTable:
   1872      1.3  christos         /* Point to next node subtable */
   1873      1.1    jruoho 
   1874      1.3  christos         Offset += IortNode->Length;
   1875      1.3  christos         IortNode = ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, IortNode->Length);
   1876      1.1    jruoho     }
   1877      1.1    jruoho }
   1878      1.1    jruoho 
   1879      1.1    jruoho 
   1880      1.1    jruoho /*******************************************************************************
   1881      1.1    jruoho  *
   1882      1.1    jruoho  * FUNCTION:    AcpiDmDumpIvrs
   1883      1.1    jruoho  *
   1884      1.1    jruoho  * PARAMETERS:  Table               - A IVRS table
   1885      1.1    jruoho  *
   1886      1.1    jruoho  * RETURN:      None
   1887      1.1    jruoho  *
   1888      1.1    jruoho  * DESCRIPTION: Format the contents of a IVRS
   1889      1.1    jruoho  *
   1890      1.1    jruoho  ******************************************************************************/
   1891      1.1    jruoho 
   1892      1.1    jruoho static UINT8 EntrySizes[] = {4,8,16,32};
   1893      1.1    jruoho 
   1894      1.1    jruoho void
   1895      1.1    jruoho AcpiDmDumpIvrs (
   1896      1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   1897      1.1    jruoho {
   1898      1.1    jruoho     ACPI_STATUS             Status;
   1899      1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_IVRS);
   1900      1.1    jruoho     UINT32                  EntryOffset;
   1901      1.1    jruoho     UINT32                  EntryLength;
   1902      1.1    jruoho     UINT32                  EntryType;
   1903      1.1    jruoho     ACPI_IVRS_DE_HEADER     *DeviceEntry;
   1904      1.1    jruoho     ACPI_IVRS_HEADER        *SubTable;
   1905      1.1    jruoho     ACPI_DMTABLE_INFO       *InfoTable;
   1906      1.1    jruoho 
   1907      1.1    jruoho 
   1908      1.1    jruoho     /* Main table */
   1909      1.1    jruoho 
   1910      1.1    jruoho     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIvrs);
   1911      1.1    jruoho     if (ACPI_FAILURE (Status))
   1912      1.1    jruoho     {
   1913      1.1    jruoho         return;
   1914      1.1    jruoho     }
   1915      1.1    jruoho 
   1916      1.2  christos     /* Subtables */
   1917      1.1    jruoho 
   1918      1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset);
   1919      1.1    jruoho     while (Offset < Table->Length)
   1920      1.1    jruoho     {
   1921      1.2  christos         /* Common subtable header */
   1922      1.1    jruoho 
   1923      1.1    jruoho         AcpiOsPrintf ("\n");
   1924      1.1    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   1925      1.4  christos             SubTable->Length, AcpiDmTableInfoIvrsHdr);
   1926      1.1    jruoho         if (ACPI_FAILURE (Status))
   1927      1.1    jruoho         {
   1928      1.1    jruoho             return;
   1929      1.1    jruoho         }
   1930      1.1    jruoho 
   1931      1.1    jruoho         switch (SubTable->Type)
   1932      1.1    jruoho         {
   1933      1.1    jruoho         case ACPI_IVRS_TYPE_HARDWARE:
   1934      1.2  christos 
   1935      1.1    jruoho             InfoTable = AcpiDmTableInfoIvrs0;
   1936      1.1    jruoho             break;
   1937      1.2  christos 
   1938      1.1    jruoho         case ACPI_IVRS_TYPE_MEMORY1:
   1939      1.1    jruoho         case ACPI_IVRS_TYPE_MEMORY2:
   1940      1.1    jruoho         case ACPI_IVRS_TYPE_MEMORY3:
   1941      1.2  christos 
   1942      1.1    jruoho             InfoTable = AcpiDmTableInfoIvrs1;
   1943      1.1    jruoho             break;
   1944      1.2  christos 
   1945      1.1    jruoho         default:
   1946      1.2  christos 
   1947      1.2  christos             AcpiOsPrintf ("\n**** Unknown IVRS subtable type 0x%X\n",
   1948      1.1    jruoho                 SubTable->Type);
   1949      1.1    jruoho 
   1950      1.1    jruoho             /* Attempt to continue */
   1951      1.1    jruoho 
   1952      1.1    jruoho             if (!SubTable->Length)
   1953      1.1    jruoho             {
   1954      1.1    jruoho                 AcpiOsPrintf ("Invalid zero length subtable\n");
   1955      1.1    jruoho                 return;
   1956      1.1    jruoho             }
   1957      1.1    jruoho             goto NextSubTable;
   1958      1.1    jruoho         }
   1959      1.1    jruoho 
   1960      1.1    jruoho         /* Dump the subtable */
   1961      1.1    jruoho 
   1962      1.1    jruoho         AcpiOsPrintf ("\n");
   1963      1.1    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   1964      1.4  christos             SubTable->Length, InfoTable);
   1965      1.1    jruoho         if (ACPI_FAILURE (Status))
   1966      1.1    jruoho         {
   1967      1.1    jruoho             return;
   1968      1.1    jruoho         }
   1969      1.1    jruoho 
   1970      1.1    jruoho         /* The hardware subtable can contain multiple device entries */
   1971      1.1    jruoho 
   1972      1.1    jruoho         if (SubTable->Type == ACPI_IVRS_TYPE_HARDWARE)
   1973      1.1    jruoho         {
   1974      1.1    jruoho             EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE);
   1975      1.1    jruoho             DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, SubTable,
   1976      1.4  christos                 sizeof (ACPI_IVRS_HARDWARE));
   1977      1.1    jruoho 
   1978      1.1    jruoho             while (EntryOffset < (Offset + SubTable->Length))
   1979      1.1    jruoho             {
   1980      1.1    jruoho                 AcpiOsPrintf ("\n");
   1981      1.1    jruoho                 /*
   1982      1.1    jruoho                  * Upper 2 bits of Type encode the length of the device entry
   1983      1.1    jruoho                  *
   1984      1.1    jruoho                  * 00 = 4 byte
   1985      1.1    jruoho                  * 01 = 8 byte
   1986      1.1    jruoho                  * 10 = 16 byte - currently no entries defined
   1987      1.1    jruoho                  * 11 = 32 byte - currently no entries defined
   1988      1.1    jruoho                  */
   1989      1.1    jruoho                 EntryType = DeviceEntry->Type;
   1990      1.1    jruoho                 EntryLength = EntrySizes [EntryType >> 6];
   1991      1.1    jruoho 
   1992      1.1    jruoho                 switch (EntryType)
   1993      1.1    jruoho                 {
   1994      1.1    jruoho                 /* 4-byte device entries */
   1995      1.1    jruoho 
   1996      1.1    jruoho                 case ACPI_IVRS_TYPE_PAD4:
   1997      1.1    jruoho                 case ACPI_IVRS_TYPE_ALL:
   1998      1.1    jruoho                 case ACPI_IVRS_TYPE_SELECT:
   1999      1.1    jruoho                 case ACPI_IVRS_TYPE_START:
   2000      1.1    jruoho                 case ACPI_IVRS_TYPE_END:
   2001      1.1    jruoho 
   2002      1.1    jruoho                     InfoTable = AcpiDmTableInfoIvrs4;
   2003      1.1    jruoho                     break;
   2004      1.1    jruoho 
   2005      1.1    jruoho                 /* 8-byte entries, type A */
   2006      1.1    jruoho 
   2007      1.1    jruoho                 case ACPI_IVRS_TYPE_ALIAS_SELECT:
   2008      1.1    jruoho                 case ACPI_IVRS_TYPE_ALIAS_START:
   2009      1.1    jruoho 
   2010      1.1    jruoho                     InfoTable = AcpiDmTableInfoIvrs8a;
   2011      1.1    jruoho                     break;
   2012      1.1    jruoho 
   2013      1.1    jruoho                 /* 8-byte entries, type B */
   2014      1.1    jruoho 
   2015      1.1    jruoho                 case ACPI_IVRS_TYPE_PAD8:
   2016      1.1    jruoho                 case ACPI_IVRS_TYPE_EXT_SELECT:
   2017      1.1    jruoho                 case ACPI_IVRS_TYPE_EXT_START:
   2018      1.1    jruoho 
   2019      1.1    jruoho                     InfoTable = AcpiDmTableInfoIvrs8b;
   2020      1.1    jruoho                     break;
   2021      1.1    jruoho 
   2022      1.1    jruoho                 /* 8-byte entries, type C */
   2023      1.1    jruoho 
   2024      1.1    jruoho                 case ACPI_IVRS_TYPE_SPECIAL:
   2025      1.1    jruoho 
   2026      1.1    jruoho                     InfoTable = AcpiDmTableInfoIvrs8c;
   2027      1.1    jruoho                     break;
   2028      1.1    jruoho 
   2029      1.1    jruoho                 default:
   2030      1.1    jruoho                     InfoTable = AcpiDmTableInfoIvrs4;
   2031      1.1    jruoho                     AcpiOsPrintf (
   2032      1.1    jruoho                         "\n**** Unknown IVRS device entry type/length: "
   2033      1.1    jruoho                         "0x%.2X/0x%X at offset 0x%.4X: (header below)\n",
   2034      1.1    jruoho                         EntryType, EntryLength, EntryOffset);
   2035      1.1    jruoho                     break;
   2036      1.1    jruoho                 }
   2037      1.1    jruoho 
   2038      1.1    jruoho                 /* Dump the Device Entry */
   2039      1.1    jruoho 
   2040      1.1    jruoho                 Status = AcpiDmDumpTable (Table->Length, EntryOffset,
   2041      1.4  christos                     DeviceEntry, EntryLength, InfoTable);
   2042      1.3  christos                 if (ACPI_FAILURE (Status))
   2043      1.3  christos                 {
   2044      1.3  christos                     return;
   2045      1.3  christos                 }
   2046      1.1    jruoho 
   2047      1.1    jruoho                 EntryOffset += EntryLength;
   2048      1.1    jruoho                 DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, DeviceEntry,
   2049      1.4  christos                     EntryLength);
   2050      1.1    jruoho             }
   2051      1.1    jruoho         }
   2052      1.1    jruoho 
   2053      1.1    jruoho NextSubTable:
   2054      1.2  christos         /* Point to next subtable */
   2055      1.1    jruoho 
   2056      1.1    jruoho         Offset += SubTable->Length;
   2057      1.1    jruoho         SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, SubTable, SubTable->Length);
   2058      1.1    jruoho     }
   2059      1.1    jruoho }
   2060      1.1    jruoho 
   2061      1.1    jruoho 
   2062      1.1    jruoho /*******************************************************************************
   2063      1.1    jruoho  *
   2064      1.2  christos  * FUNCTION:    AcpiDmDumpLpit
   2065      1.2  christos  *
   2066      1.2  christos  * PARAMETERS:  Table               - A LPIT table
   2067      1.2  christos  *
   2068      1.2  christos  * RETURN:      None
   2069      1.2  christos  *
   2070      1.2  christos  * DESCRIPTION: Format the contents of a LPIT. This table type consists
   2071      1.2  christos  *              of an open-ended number of subtables. Note: There are no
   2072      1.2  christos  *              entries in the main table. An LPIT consists of the table
   2073      1.2  christos  *              header and then subtables only.
   2074      1.2  christos  *
   2075      1.2  christos  ******************************************************************************/
   2076      1.2  christos 
   2077      1.2  christos void
   2078      1.2  christos AcpiDmDumpLpit (
   2079      1.2  christos     ACPI_TABLE_HEADER       *Table)
   2080      1.2  christos {
   2081      1.2  christos     ACPI_STATUS             Status;
   2082      1.2  christos     ACPI_LPIT_HEADER        *SubTable;
   2083      1.2  christos     UINT32                  Length = Table->Length;
   2084      1.2  christos     UINT32                  Offset = sizeof (ACPI_TABLE_LPIT);
   2085      1.2  christos     ACPI_DMTABLE_INFO       *InfoTable;
   2086      1.2  christos     UINT32                  SubTableLength;
   2087      1.2  christos 
   2088      1.2  christos 
   2089      1.2  christos     /* Subtables */
   2090      1.2  christos 
   2091      1.2  christos     SubTable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, Table, Offset);
   2092      1.2  christos     while (Offset < Table->Length)
   2093      1.2  christos     {
   2094      1.2  christos         /* Common subtable header */
   2095      1.2  christos 
   2096      1.2  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   2097      1.4  christos             sizeof (ACPI_LPIT_HEADER), AcpiDmTableInfoLpitHdr);
   2098      1.2  christos         if (ACPI_FAILURE (Status))
   2099      1.2  christos         {
   2100      1.2  christos             return;
   2101      1.2  christos         }
   2102      1.2  christos 
   2103      1.2  christos         switch (SubTable->Type)
   2104      1.2  christos         {
   2105      1.2  christos         case ACPI_LPIT_TYPE_NATIVE_CSTATE:
   2106      1.2  christos 
   2107      1.2  christos             InfoTable = AcpiDmTableInfoLpit0;
   2108      1.2  christos             SubTableLength = sizeof (ACPI_LPIT_NATIVE);
   2109      1.2  christos             break;
   2110      1.2  christos 
   2111      1.2  christos         default:
   2112      1.2  christos 
   2113      1.2  christos             /* Cannot continue on unknown type - no length */
   2114      1.2  christos 
   2115      1.4  christos             AcpiOsPrintf ("\n**** Unknown LPIT subtable type 0x%X\n",
   2116      1.4  christos                 SubTable->Type);
   2117      1.2  christos             return;
   2118      1.2  christos         }
   2119      1.2  christos 
   2120      1.2  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   2121      1.4  christos             SubTableLength, InfoTable);
   2122      1.2  christos         if (ACPI_FAILURE (Status))
   2123      1.2  christos         {
   2124      1.2  christos             return;
   2125      1.2  christos         }
   2126      1.4  christos 
   2127      1.2  christos         AcpiOsPrintf ("\n");
   2128      1.2  christos 
   2129      1.2  christos         /* Point to next subtable */
   2130      1.2  christos 
   2131      1.2  christos         Offset += SubTableLength;
   2132      1.2  christos         SubTable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, SubTable, SubTableLength);
   2133      1.2  christos     }
   2134      1.2  christos }
   2135      1.2  christos 
   2136      1.2  christos 
   2137      1.2  christos /*******************************************************************************
   2138      1.2  christos  *
   2139      1.1    jruoho  * FUNCTION:    AcpiDmDumpMadt
   2140      1.1    jruoho  *
   2141      1.1    jruoho  * PARAMETERS:  Table               - A MADT table
   2142      1.1    jruoho  *
   2143      1.1    jruoho  * RETURN:      None
   2144      1.1    jruoho  *
   2145      1.1    jruoho  * DESCRIPTION: Format the contents of a MADT. This table type consists
   2146      1.1    jruoho  *              of an open-ended number of subtables.
   2147      1.1    jruoho  *
   2148      1.1    jruoho  ******************************************************************************/
   2149      1.1    jruoho 
   2150      1.1    jruoho void
   2151      1.1    jruoho AcpiDmDumpMadt (
   2152      1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   2153      1.1    jruoho {
   2154      1.1    jruoho     ACPI_STATUS             Status;
   2155      1.1    jruoho     ACPI_SUBTABLE_HEADER    *SubTable;
   2156      1.1    jruoho     UINT32                  Length = Table->Length;
   2157      1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_MADT);
   2158      1.1    jruoho     ACPI_DMTABLE_INFO       *InfoTable;
   2159      1.1    jruoho 
   2160      1.1    jruoho 
   2161      1.1    jruoho     /* Main table */
   2162      1.1    jruoho 
   2163      1.1    jruoho     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoMadt);
   2164      1.1    jruoho     if (ACPI_FAILURE (Status))
   2165      1.1    jruoho     {
   2166      1.1    jruoho         return;
   2167      1.1    jruoho     }
   2168      1.1    jruoho 
   2169      1.2  christos     /* Subtables */
   2170      1.1    jruoho 
   2171      1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
   2172      1.1    jruoho     while (Offset < Table->Length)
   2173      1.1    jruoho     {
   2174      1.2  christos         /* Common subtable header */
   2175      1.1    jruoho 
   2176      1.1    jruoho         AcpiOsPrintf ("\n");
   2177      1.1    jruoho         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   2178      1.4  christos             SubTable->Length, AcpiDmTableInfoMadtHdr);
   2179      1.1    jruoho         if (ACPI_FAILURE (Status))
   2180      1.1    jruoho         {
   2181      1.1    jruoho             return;
   2182      1.1    jruoho         }
   2183      1.1    jruoho 
   2184      1.1    jruoho         switch (SubTable->Type)
   2185      1.1    jruoho         {
   2186      1.1    jruoho         case ACPI_MADT_TYPE_LOCAL_APIC:
   2187      1.2  christos 
   2188      1.1    jruoho             InfoTable = AcpiDmTableInfoMadt0;
   2189      1.1    jruoho             break;
   2190      1.2  christos 
   2191      1.1    jruoho         case ACPI_MADT_TYPE_IO_APIC:
   2192      1.2  christos 
   2193      1.1    jruoho             InfoTable = AcpiDmTableInfoMadt1;
   2194      1.1    jruoho             break;
   2195      1.2  christos 
   2196      1.1    jruoho         case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE:
   2197      1.2  christos 
   2198      1.1    jruoho             InfoTable = AcpiDmTableInfoMadt2;
   2199      1.1    jruoho             break;
   2200      1.2  christos 
   2201      1.1    jruoho         case ACPI_MADT_TYPE_NMI_SOURCE:
   2202      1.2  christos 
   2203      1.1    jruoho             InfoTable = AcpiDmTableInfoMadt3;
   2204      1.1    jruoho             break;
   2205      1.2  christos 
   2206      1.1    jruoho         case ACPI_MADT_TYPE_LOCAL_APIC_NMI:
   2207      1.2  christos 
   2208      1.1    jruoho             InfoTable = AcpiDmTableInfoMadt4;
   2209      1.1    jruoho             break;
   2210      1.2  christos 
   2211      1.1    jruoho         case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE:
   2212      1.2  christos 
   2213      1.1    jruoho             InfoTable = AcpiDmTableInfoMadt5;
   2214      1.1    jruoho             break;
   2215      1.2  christos 
   2216      1.1    jruoho         case ACPI_MADT_TYPE_IO_SAPIC:
   2217      1.2  christos 
   2218      1.1    jruoho             InfoTable = AcpiDmTableInfoMadt6;
   2219      1.1    jruoho             break;
   2220      1.2  christos 
   2221      1.1    jruoho         case ACPI_MADT_TYPE_LOCAL_SAPIC:
   2222      1.2  christos 
   2223      1.1    jruoho             InfoTable = AcpiDmTableInfoMadt7;
   2224      1.1    jruoho             break;
   2225      1.2  christos 
   2226      1.1    jruoho         case ACPI_MADT_TYPE_INTERRUPT_SOURCE:
   2227      1.2  christos 
   2228      1.1    jruoho             InfoTable = AcpiDmTableInfoMadt8;
   2229      1.1    jruoho             break;
   2230      1.2  christos 
   2231      1.1    jruoho         case ACPI_MADT_TYPE_LOCAL_X2APIC:
   2232      1.2  christos 
   2233      1.1    jruoho             InfoTable = AcpiDmTableInfoMadt9;
   2234      1.1    jruoho             break;
   2235      1.2  christos 
   2236      1.1    jruoho         case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI:
   2237      1.2  christos 
   2238      1.1    jruoho             InfoTable = AcpiDmTableInfoMadt10;
   2239      1.1    jruoho             break;
   2240      1.2  christos 
   2241      1.2  christos         case ACPI_MADT_TYPE_GENERIC_INTERRUPT:
   2242      1.2  christos 
   2243      1.2  christos             InfoTable = AcpiDmTableInfoMadt11;
   2244      1.2  christos             break;
   2245      1.2  christos 
   2246      1.2  christos         case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR:
   2247      1.2  christos 
   2248      1.2  christos             InfoTable = AcpiDmTableInfoMadt12;
   2249      1.2  christos             break;
   2250      1.2  christos 
   2251      1.2  christos         case ACPI_MADT_TYPE_GENERIC_MSI_FRAME:
   2252      1.2  christos 
   2253      1.2  christos             InfoTable = AcpiDmTableInfoMadt13;
   2254      1.2  christos             break;
   2255      1.2  christos 
   2256      1.2  christos         case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR:
   2257      1.2  christos 
   2258      1.2  christos             InfoTable = AcpiDmTableInfoMadt14;
   2259      1.2  christos             break;
   2260      1.2  christos 
   2261      1.3  christos         case ACPI_MADT_TYPE_GENERIC_TRANSLATOR:
   2262      1.3  christos 
   2263      1.3  christos             InfoTable = AcpiDmTableInfoMadt15;
   2264      1.3  christos             break;
   2265      1.3  christos 
   2266      1.1    jruoho         default:
   2267      1.2  christos 
   2268      1.4  christos             AcpiOsPrintf ("\n**** Unknown MADT subtable type 0x%X\n\n",
   2269      1.4  christos                 SubTable->Type);
   2270      1.1    jruoho 
   2271      1.1    jruoho             /* Attempt to continue */
   2272      1.1    jruoho 
   2273      1.1    jruoho             if (!SubTable->Length)
   2274      1.1    jruoho             {
   2275      1.1    jruoho                 AcpiOsPrintf ("Invalid zero length subtable\n");
   2276      1.1    jruoho                 return;
   2277      1.1    jruoho             }
   2278      1.4  christos 
   2279      1.1    jruoho             goto NextSubTable;
   2280      1.1    jruoho         }
   2281      1.1    jruoho 
   2282      1.1    jruoho         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   2283      1.4  christos             SubTable->Length, InfoTable);
   2284      1.1    jruoho         if (ACPI_FAILURE (Status))
   2285      1.1    jruoho         {
   2286      1.1    jruoho             return;
   2287      1.1    jruoho         }
   2288      1.1    jruoho 
   2289      1.1    jruoho NextSubTable:
   2290      1.2  christos         /* Point to next subtable */
   2291      1.1    jruoho 
   2292      1.1    jruoho         Offset += SubTable->Length;
   2293      1.4  christos         SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable,
   2294      1.4  christos             SubTable->Length);
   2295      1.1    jruoho     }
   2296      1.1    jruoho }
   2297      1.1    jruoho 
   2298      1.1    jruoho 
   2299      1.1    jruoho /*******************************************************************************
   2300      1.1    jruoho  *
   2301      1.1    jruoho  * FUNCTION:    AcpiDmDumpMcfg
   2302      1.1    jruoho  *
   2303      1.1    jruoho  * PARAMETERS:  Table               - A MCFG Table
   2304      1.1    jruoho  *
   2305      1.1    jruoho  * RETURN:      None
   2306      1.1    jruoho  *
   2307      1.1    jruoho  * DESCRIPTION: Format the contents of a MCFG table
   2308      1.1    jruoho  *
   2309      1.1    jruoho  ******************************************************************************/
   2310      1.1    jruoho 
   2311      1.1    jruoho void
   2312      1.1    jruoho AcpiDmDumpMcfg (
   2313      1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   2314      1.1    jruoho {
   2315      1.1    jruoho     ACPI_STATUS             Status;
   2316      1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_MCFG);
   2317      1.1    jruoho     ACPI_MCFG_ALLOCATION    *SubTable;
   2318      1.1    jruoho 
   2319      1.1    jruoho 
   2320      1.1    jruoho     /* Main table */
   2321      1.1    jruoho 
   2322      1.1    jruoho     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMcfg);
   2323      1.1    jruoho     if (ACPI_FAILURE (Status))
   2324      1.1    jruoho     {
   2325      1.1    jruoho         return;
   2326      1.1    jruoho     }
   2327      1.1    jruoho 
   2328      1.2  christos     /* Subtables */
   2329      1.1    jruoho 
   2330      1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset);
   2331      1.1    jruoho     while (Offset < Table->Length)
   2332      1.1    jruoho     {
   2333      1.1    jruoho         if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length)
   2334      1.1    jruoho         {
   2335      1.1    jruoho             AcpiOsPrintf ("Warning: there are %u invalid trailing bytes\n",
   2336      1.1    jruoho                 sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length));
   2337      1.1    jruoho             return;
   2338      1.1    jruoho         }
   2339      1.1    jruoho 
   2340      1.1    jruoho         AcpiOsPrintf ("\n");
   2341      1.1    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   2342      1.4  christos             sizeof (ACPI_MCFG_ALLOCATION), AcpiDmTableInfoMcfg0);
   2343      1.1    jruoho         if (ACPI_FAILURE (Status))
   2344      1.1    jruoho         {
   2345      1.1    jruoho             return;
   2346      1.1    jruoho         }
   2347      1.1    jruoho 
   2348      1.2  christos         /* Point to next subtable (each subtable is of fixed length) */
   2349      1.1    jruoho 
   2350      1.1    jruoho         Offset += sizeof (ACPI_MCFG_ALLOCATION);
   2351      1.1    jruoho         SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, SubTable,
   2352      1.4  christos             sizeof (ACPI_MCFG_ALLOCATION));
   2353      1.1    jruoho     }
   2354      1.1    jruoho }
   2355      1.1    jruoho 
   2356      1.1    jruoho 
   2357      1.1    jruoho /*******************************************************************************
   2358      1.1    jruoho  *
   2359      1.2  christos  * FUNCTION:    AcpiDmDumpMpst
   2360      1.2  christos  *
   2361      1.2  christos  * PARAMETERS:  Table               - A MPST Table
   2362      1.2  christos  *
   2363      1.2  christos  * RETURN:      None
   2364      1.2  christos  *
   2365      1.2  christos  * DESCRIPTION: Format the contents of a MPST table
   2366      1.2  christos  *
   2367      1.2  christos  ******************************************************************************/
   2368      1.2  christos 
   2369      1.2  christos void
   2370      1.2  christos AcpiDmDumpMpst (
   2371      1.2  christos     ACPI_TABLE_HEADER       *Table)
   2372      1.2  christos {
   2373      1.2  christos     ACPI_STATUS             Status;
   2374      1.2  christos     UINT32                  Offset = sizeof (ACPI_TABLE_MPST);
   2375      1.2  christos     ACPI_MPST_POWER_NODE    *SubTable0;
   2376      1.2  christos     ACPI_MPST_POWER_STATE   *SubTable0A;
   2377      1.2  christos     ACPI_MPST_COMPONENT     *SubTable0B;
   2378      1.2  christos     ACPI_MPST_DATA_HDR      *SubTable1;
   2379      1.2  christos     ACPI_MPST_POWER_DATA    *SubTable2;
   2380      1.2  christos     UINT16                  SubtableCount;
   2381      1.2  christos     UINT32                  PowerStateCount;
   2382      1.2  christos     UINT32                  ComponentCount;
   2383      1.2  christos 
   2384      1.2  christos 
   2385      1.2  christos     /* Main table */
   2386      1.2  christos 
   2387      1.2  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMpst);
   2388      1.2  christos     if (ACPI_FAILURE (Status))
   2389      1.2  christos     {
   2390      1.2  christos         return;
   2391      1.2  christos     }
   2392      1.2  christos 
   2393      1.2  christos     /* Subtable: Memory Power Node(s) */
   2394      1.2  christos 
   2395      1.2  christos     SubtableCount = (ACPI_CAST_PTR (ACPI_TABLE_MPST, Table))->PowerNodeCount;
   2396      1.2  christos     SubTable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, Table, Offset);
   2397      1.2  christos 
   2398      1.2  christos     while ((Offset < Table->Length) && SubtableCount)
   2399      1.2  christos     {
   2400      1.2  christos         AcpiOsPrintf ("\n");
   2401      1.2  christos         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0,
   2402      1.4  christos             sizeof (ACPI_MPST_POWER_NODE), AcpiDmTableInfoMpst0);
   2403      1.2  christos         if (ACPI_FAILURE (Status))
   2404      1.2  christos         {
   2405      1.2  christos             return;
   2406      1.2  christos         }
   2407      1.2  christos 
   2408      1.2  christos         /* Extract the sub-subtable counts */
   2409      1.2  christos 
   2410      1.2  christos         PowerStateCount = SubTable0->NumPowerStates;
   2411      1.2  christos         ComponentCount = SubTable0->NumPhysicalComponents;
   2412      1.2  christos         Offset += sizeof (ACPI_MPST_POWER_NODE);
   2413      1.2  christos 
   2414      1.2  christos         /* Sub-subtables - Memory Power State Structure(s) */
   2415      1.2  christos 
   2416      1.2  christos         SubTable0A = ACPI_ADD_PTR (ACPI_MPST_POWER_STATE, SubTable0,
   2417      1.2  christos             sizeof (ACPI_MPST_POWER_NODE));
   2418      1.2  christos 
   2419      1.2  christos         while (PowerStateCount)
   2420      1.2  christos         {
   2421      1.2  christos             AcpiOsPrintf ("\n");
   2422      1.2  christos             Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0A,
   2423      1.4  christos                 sizeof (ACPI_MPST_POWER_STATE), AcpiDmTableInfoMpst0A);
   2424      1.2  christos             if (ACPI_FAILURE (Status))
   2425      1.2  christos             {
   2426      1.2  christos                 return;
   2427      1.2  christos             }
   2428      1.2  christos 
   2429      1.2  christos             SubTable0A++;
   2430      1.2  christos             PowerStateCount--;
   2431      1.2  christos             Offset += sizeof (ACPI_MPST_POWER_STATE);
   2432      1.2  christos        }
   2433      1.2  christos 
   2434      1.2  christos         /* Sub-subtables - Physical Component ID Structure(s) */
   2435      1.2  christos 
   2436      1.2  christos         SubTable0B = ACPI_CAST_PTR (ACPI_MPST_COMPONENT, SubTable0A);
   2437      1.2  christos 
   2438      1.2  christos         if (ComponentCount)
   2439      1.2  christos         {
   2440      1.2  christos             AcpiOsPrintf ("\n");
   2441      1.2  christos         }
   2442      1.2  christos 
   2443      1.2  christos         while (ComponentCount)
   2444      1.2  christos         {
   2445      1.2  christos             Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0B,
   2446      1.4  christos                 sizeof (ACPI_MPST_COMPONENT), AcpiDmTableInfoMpst0B);
   2447      1.2  christos             if (ACPI_FAILURE (Status))
   2448      1.2  christos             {
   2449      1.2  christos                 return;
   2450      1.2  christos             }
   2451      1.2  christos 
   2452      1.2  christos             SubTable0B++;
   2453      1.2  christos             ComponentCount--;
   2454      1.2  christos             Offset += sizeof (ACPI_MPST_COMPONENT);
   2455      1.2  christos         }
   2456      1.2  christos 
   2457      1.2  christos         /* Point to next Memory Power Node subtable */
   2458      1.2  christos 
   2459      1.2  christos         SubtableCount--;
   2460      1.2  christos         SubTable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, SubTable0,
   2461      1.2  christos             sizeof (ACPI_MPST_POWER_NODE) +
   2462      1.2  christos             (sizeof (ACPI_MPST_POWER_STATE) * SubTable0->NumPowerStates) +
   2463      1.2  christos             (sizeof (ACPI_MPST_COMPONENT) * SubTable0->NumPhysicalComponents));
   2464      1.2  christos     }
   2465      1.2  christos 
   2466      1.2  christos     /* Subtable: Count of Memory Power State Characteristic structures */
   2467      1.2  christos 
   2468      1.2  christos     AcpiOsPrintf ("\n");
   2469      1.2  christos     SubTable1 = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, SubTable0);
   2470      1.2  christos     Status = AcpiDmDumpTable (Table->Length, Offset, SubTable1,
   2471      1.4  christos         sizeof (ACPI_MPST_DATA_HDR), AcpiDmTableInfoMpst1);
   2472      1.2  christos     if (ACPI_FAILURE (Status))
   2473      1.2  christos     {
   2474      1.2  christos         return;
   2475      1.2  christos     }
   2476      1.2  christos 
   2477      1.2  christos     SubtableCount = SubTable1->CharacteristicsCount;
   2478      1.2  christos     Offset += sizeof (ACPI_MPST_DATA_HDR);
   2479      1.2  christos 
   2480      1.2  christos     /* Subtable: Memory Power State Characteristics structure(s) */
   2481      1.2  christos 
   2482      1.4  christos     SubTable2 = ACPI_ADD_PTR (ACPI_MPST_POWER_DATA, SubTable1,
   2483      1.4  christos         sizeof (ACPI_MPST_DATA_HDR));
   2484      1.2  christos 
   2485      1.2  christos     while ((Offset < Table->Length) && SubtableCount)
   2486      1.2  christos     {
   2487      1.2  christos         AcpiOsPrintf ("\n");
   2488      1.2  christos         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable2,
   2489      1.4  christos             sizeof (ACPI_MPST_POWER_DATA), AcpiDmTableInfoMpst2);
   2490      1.2  christos         if (ACPI_FAILURE (Status))
   2491      1.2  christos         {
   2492      1.2  christos             return;
   2493      1.2  christos         }
   2494      1.2  christos 
   2495      1.2  christos         SubTable2++;
   2496      1.2  christos         SubtableCount--;
   2497      1.2  christos         Offset += sizeof (ACPI_MPST_POWER_DATA);
   2498      1.2  christos     }
   2499      1.2  christos }
   2500      1.2  christos 
   2501      1.2  christos 
   2502      1.2  christos /*******************************************************************************
   2503      1.2  christos  *
   2504      1.1    jruoho  * FUNCTION:    AcpiDmDumpMsct
   2505      1.1    jruoho  *
   2506      1.1    jruoho  * PARAMETERS:  Table               - A MSCT table
   2507      1.1    jruoho  *
   2508      1.1    jruoho  * RETURN:      None
   2509      1.1    jruoho  *
   2510      1.1    jruoho  * DESCRIPTION: Format the contents of a MSCT
   2511      1.1    jruoho  *
   2512      1.1    jruoho  ******************************************************************************/
   2513      1.1    jruoho 
   2514      1.1    jruoho void
   2515      1.1    jruoho AcpiDmDumpMsct (
   2516      1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   2517      1.1    jruoho {
   2518      1.1    jruoho     ACPI_STATUS             Status;
   2519      1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_MSCT);
   2520      1.1    jruoho     ACPI_MSCT_PROXIMITY     *SubTable;
   2521      1.1    jruoho 
   2522      1.1    jruoho 
   2523      1.1    jruoho     /* Main table */
   2524      1.1    jruoho 
   2525      1.1    jruoho     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMsct);
   2526      1.1    jruoho     if (ACPI_FAILURE (Status))
   2527      1.1    jruoho     {
   2528      1.1    jruoho         return;
   2529      1.1    jruoho     }
   2530      1.1    jruoho 
   2531      1.2  christos     /* Subtables */
   2532      1.1    jruoho 
   2533      1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset);
   2534      1.1    jruoho     while (Offset < Table->Length)
   2535      1.1    jruoho     {
   2536      1.2  christos         /* Common subtable header */
   2537      1.1    jruoho 
   2538      1.1    jruoho         AcpiOsPrintf ("\n");
   2539      1.1    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   2540      1.4  christos             sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0);
   2541      1.1    jruoho         if (ACPI_FAILURE (Status))
   2542      1.1    jruoho         {
   2543      1.1    jruoho             return;
   2544      1.1    jruoho         }
   2545      1.1    jruoho 
   2546      1.2  christos         /* Point to next subtable */
   2547      1.1    jruoho 
   2548      1.1    jruoho         Offset += sizeof (ACPI_MSCT_PROXIMITY);
   2549      1.4  christos         SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, SubTable,
   2550      1.4  christos             sizeof (ACPI_MSCT_PROXIMITY));
   2551      1.1    jruoho     }
   2552      1.1    jruoho }
   2553      1.1    jruoho 
   2554      1.1    jruoho 
   2555      1.1    jruoho /*******************************************************************************
   2556      1.1    jruoho  *
   2557      1.2  christos  * FUNCTION:    AcpiDmDumpMtmr
   2558      1.2  christos  *
   2559      1.2  christos  * PARAMETERS:  Table               - A MTMR table
   2560      1.2  christos  *
   2561      1.2  christos  * RETURN:      None
   2562      1.2  christos  *
   2563      1.2  christos  * DESCRIPTION: Format the contents of a MTMR
   2564      1.2  christos  *
   2565      1.2  christos  ******************************************************************************/
   2566      1.2  christos 
   2567      1.2  christos void
   2568      1.2  christos AcpiDmDumpMtmr (
   2569      1.2  christos     ACPI_TABLE_HEADER       *Table)
   2570      1.2  christos {
   2571      1.2  christos     ACPI_STATUS             Status;
   2572      1.2  christos     UINT32                  Offset = sizeof (ACPI_TABLE_MTMR);
   2573      1.2  christos     ACPI_MTMR_ENTRY         *SubTable;
   2574      1.2  christos 
   2575      1.2  christos 
   2576      1.2  christos     /* Main table */
   2577      1.2  christos 
   2578      1.2  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMtmr);
   2579      1.2  christos     if (ACPI_FAILURE (Status))
   2580      1.2  christos     {
   2581      1.2  christos         return;
   2582      1.2  christos     }
   2583      1.2  christos 
   2584      1.2  christos     /* Subtables */
   2585      1.2  christos 
   2586      1.2  christos     SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, Table, Offset);
   2587      1.2  christos     while (Offset < Table->Length)
   2588      1.2  christos     {
   2589      1.2  christos         /* Common subtable header */
   2590      1.2  christos 
   2591      1.2  christos         AcpiOsPrintf ("\n");
   2592      1.2  christos         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   2593      1.4  christos             sizeof (ACPI_MTMR_ENTRY), AcpiDmTableInfoMtmr0);
   2594      1.2  christos         if (ACPI_FAILURE (Status))
   2595      1.2  christos         {
   2596      1.2  christos             return;
   2597      1.2  christos         }
   2598      1.2  christos 
   2599      1.2  christos         /* Point to next subtable */
   2600      1.2  christos 
   2601      1.2  christos         Offset += sizeof (ACPI_MTMR_ENTRY);
   2602      1.4  christos         SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, SubTable,
   2603      1.4  christos             sizeof (ACPI_MTMR_ENTRY));
   2604      1.2  christos     }
   2605      1.2  christos }
   2606      1.2  christos 
   2607      1.2  christos 
   2608      1.2  christos /*******************************************************************************
   2609      1.2  christos  *
   2610      1.3  christos  * FUNCTION:    AcpiDmDumpNfit
   2611      1.3  christos  *
   2612      1.3  christos  * PARAMETERS:  Table               - A NFIT table
   2613      1.3  christos  *
   2614      1.3  christos  * RETURN:      None
   2615      1.3  christos  *
   2616      1.3  christos  * DESCRIPTION: Format the contents of an NFIT.
   2617      1.3  christos  *
   2618      1.3  christos  ******************************************************************************/
   2619      1.3  christos 
   2620      1.3  christos void
   2621      1.3  christos AcpiDmDumpNfit (
   2622      1.3  christos     ACPI_TABLE_HEADER       *Table)
   2623      1.3  christos {
   2624      1.3  christos     ACPI_STATUS             Status;
   2625      1.3  christos     UINT32                  Offset = sizeof (ACPI_TABLE_NFIT);
   2626      1.3  christos     UINT32                  FieldOffset = 0;
   2627      1.3  christos     UINT32                  Length;
   2628      1.3  christos     ACPI_NFIT_HEADER        *SubTable;
   2629      1.3  christos     ACPI_DMTABLE_INFO       *InfoTable;
   2630      1.3  christos     ACPI_NFIT_INTERLEAVE    *Interleave = NULL;
   2631      1.3  christos     ACPI_NFIT_SMBIOS        *SmbiosInfo = NULL;
   2632      1.3  christos     ACPI_NFIT_FLUSH_ADDRESS *Hint = NULL;
   2633      1.3  christos     UINT32                  i;
   2634      1.3  christos 
   2635      1.3  christos 
   2636      1.3  christos     /* Main table */
   2637      1.3  christos 
   2638      1.3  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoNfit);
   2639      1.3  christos     if (ACPI_FAILURE (Status))
   2640      1.3  christos     {
   2641      1.3  christos         return;
   2642      1.3  christos     }
   2643      1.3  christos 
   2644      1.3  christos     /* Subtables */
   2645      1.3  christos 
   2646      1.3  christos     SubTable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, Table, Offset);
   2647      1.3  christos     while (Offset < Table->Length)
   2648      1.3  christos     {
   2649      1.3  christos         /* NFIT subtable header */
   2650      1.3  christos 
   2651      1.3  christos         AcpiOsPrintf ("\n");
   2652      1.3  christos         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   2653      1.4  christos             SubTable->Length, AcpiDmTableInfoNfitHdr);
   2654      1.3  christos         if (ACPI_FAILURE (Status))
   2655      1.3  christos         {
   2656      1.3  christos             return;
   2657      1.3  christos         }
   2658      1.3  christos 
   2659      1.3  christos         switch (SubTable->Type)
   2660      1.3  christos         {
   2661      1.3  christos         case ACPI_NFIT_TYPE_SYSTEM_ADDRESS:
   2662      1.3  christos 
   2663      1.3  christos             InfoTable = AcpiDmTableInfoNfit0;
   2664      1.3  christos             break;
   2665      1.3  christos 
   2666      1.3  christos         case ACPI_NFIT_TYPE_MEMORY_MAP:
   2667      1.3  christos 
   2668      1.3  christos             InfoTable = AcpiDmTableInfoNfit1;
   2669      1.3  christos             break;
   2670      1.3  christos 
   2671      1.3  christos         case ACPI_NFIT_TYPE_INTERLEAVE:
   2672      1.3  christos 
   2673      1.3  christos             /* Has a variable number of 32-bit values at the end */
   2674      1.3  christos 
   2675      1.3  christos             InfoTable = AcpiDmTableInfoNfit2;
   2676      1.3  christos             Interleave = ACPI_CAST_PTR (ACPI_NFIT_INTERLEAVE, SubTable);
   2677      1.3  christos             FieldOffset = sizeof (ACPI_NFIT_INTERLEAVE);
   2678      1.3  christos             break;
   2679      1.3  christos 
   2680      1.3  christos         case ACPI_NFIT_TYPE_SMBIOS:
   2681      1.3  christos 
   2682      1.3  christos             SmbiosInfo = ACPI_CAST_PTR (ACPI_NFIT_SMBIOS, SubTable);
   2683      1.3  christos             InfoTable = AcpiDmTableInfoNfit3;
   2684      1.3  christos             break;
   2685      1.3  christos 
   2686      1.3  christos         case ACPI_NFIT_TYPE_CONTROL_REGION:
   2687      1.3  christos 
   2688      1.3  christos             InfoTable = AcpiDmTableInfoNfit4;
   2689      1.3  christos             break;
   2690      1.3  christos 
   2691      1.3  christos         case ACPI_NFIT_TYPE_DATA_REGION:
   2692      1.3  christos 
   2693      1.3  christos             InfoTable = AcpiDmTableInfoNfit5;
   2694      1.3  christos             break;
   2695      1.3  christos 
   2696      1.3  christos         case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
   2697      1.3  christos 
   2698      1.3  christos             /* Has a variable number of 64-bit addresses at the end */
   2699      1.3  christos 
   2700      1.3  christos             InfoTable = AcpiDmTableInfoNfit6;
   2701      1.3  christos             Hint = ACPI_CAST_PTR (ACPI_NFIT_FLUSH_ADDRESS, SubTable);
   2702      1.3  christos             FieldOffset = sizeof (ACPI_NFIT_FLUSH_ADDRESS) - sizeof (UINT64);
   2703      1.3  christos             break;
   2704      1.3  christos 
   2705      1.3  christos         default:
   2706      1.4  christos             AcpiOsPrintf ("\n**** Unknown NFIT subtable type 0x%X\n",
   2707      1.4  christos                 SubTable->Type);
   2708      1.3  christos 
   2709      1.3  christos             /* Attempt to continue */
   2710      1.3  christos 
   2711      1.3  christos             if (!SubTable->Length)
   2712      1.3  christos             {
   2713      1.3  christos                 AcpiOsPrintf ("Invalid zero length subtable\n");
   2714      1.3  christos                 return;
   2715      1.3  christos             }
   2716      1.3  christos             goto NextSubTable;
   2717      1.3  christos         }
   2718      1.3  christos 
   2719      1.3  christos         AcpiOsPrintf ("\n");
   2720      1.3  christos         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   2721      1.4  christos             SubTable->Length, InfoTable);
   2722      1.3  christos         if (ACPI_FAILURE (Status))
   2723      1.3  christos         {
   2724      1.3  christos             return;
   2725      1.3  christos         }
   2726      1.3  christos 
   2727      1.3  christos         /* Per-subtable variable-length fields */
   2728      1.3  christos 
   2729      1.3  christos         switch (SubTable->Type)
   2730      1.3  christos         {
   2731      1.3  christos         case ACPI_NFIT_TYPE_INTERLEAVE:
   2732      1.3  christos 
   2733      1.3  christos             for (i = 0; i < Interleave->LineCount; i++)
   2734      1.3  christos             {
   2735      1.3  christos                 Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
   2736      1.4  christos                     &Interleave->LineOffset[i],
   2737      1.4  christos                     sizeof (UINT32), AcpiDmTableInfoNfit2a);
   2738      1.3  christos                 if (ACPI_FAILURE (Status))
   2739      1.3  christos                 {
   2740      1.3  christos                     return;
   2741      1.3  christos                 }
   2742      1.3  christos 
   2743      1.3  christos                 FieldOffset += sizeof (UINT32);
   2744      1.3  christos             }
   2745      1.3  christos             break;
   2746      1.3  christos 
   2747      1.3  christos         case ACPI_NFIT_TYPE_SMBIOS:
   2748      1.3  christos 
   2749      1.4  christos             Length = SubTable->Length -
   2750      1.4  christos                 sizeof (ACPI_NFIT_SMBIOS) + sizeof (UINT8);
   2751      1.4  christos 
   2752      1.3  christos             if (Length)
   2753      1.3  christos             {
   2754      1.3  christos                 Status = AcpiDmDumpTable (Table->Length,
   2755      1.4  christos                     sizeof (ACPI_NFIT_SMBIOS) - sizeof (UINT8),
   2756      1.4  christos                     SmbiosInfo,
   2757      1.4  christos                     Length, AcpiDmTableInfoNfit3a);
   2758      1.3  christos                 if (ACPI_FAILURE (Status))
   2759      1.3  christos                 {
   2760      1.3  christos                     return;
   2761      1.3  christos                 }
   2762      1.3  christos             }
   2763      1.3  christos 
   2764      1.3  christos             break;
   2765      1.3  christos 
   2766      1.3  christos         case ACPI_NFIT_TYPE_FLUSH_ADDRESS:
   2767      1.3  christos 
   2768      1.3  christos             for (i = 0; i < Hint->HintCount; i++)
   2769      1.3  christos             {
   2770      1.3  christos                 Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
   2771      1.4  christos                     &Hint->HintAddress[i],
   2772      1.4  christos                     sizeof (UINT64), AcpiDmTableInfoNfit6a);
   2773      1.3  christos                 if (ACPI_FAILURE (Status))
   2774      1.3  christos                 {
   2775      1.3  christos                     return;
   2776      1.3  christos                 }
   2777      1.3  christos 
   2778      1.3  christos                 FieldOffset += sizeof (UINT64);
   2779      1.3  christos             }
   2780      1.3  christos             break;
   2781      1.3  christos 
   2782      1.3  christos         default:
   2783      1.3  christos             break;
   2784      1.3  christos         }
   2785      1.3  christos 
   2786      1.3  christos NextSubTable:
   2787      1.3  christos         /* Point to next subtable */
   2788      1.3  christos 
   2789      1.3  christos         Offset += SubTable->Length;
   2790      1.3  christos         SubTable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, SubTable, SubTable->Length);
   2791      1.3  christos     }
   2792      1.3  christos }
   2793      1.3  christos 
   2794      1.3  christos 
   2795      1.3  christos /*******************************************************************************
   2796      1.3  christos  *
   2797      1.2  christos  * FUNCTION:    AcpiDmDumpPcct
   2798      1.2  christos  *
   2799      1.2  christos  * PARAMETERS:  Table               - A PCCT table
   2800      1.2  christos  *
   2801      1.2  christos  * RETURN:      None
   2802      1.2  christos  *
   2803      1.2  christos  * DESCRIPTION: Format the contents of a PCCT. This table type consists
   2804      1.2  christos  *              of an open-ended number of subtables.
   2805      1.2  christos  *
   2806      1.2  christos  ******************************************************************************/
   2807      1.2  christos 
   2808      1.2  christos void
   2809      1.2  christos AcpiDmDumpPcct (
   2810      1.2  christos     ACPI_TABLE_HEADER       *Table)
   2811      1.2  christos {
   2812      1.2  christos     ACPI_STATUS             Status;
   2813      1.2  christos     ACPI_PCCT_SUBSPACE      *SubTable;
   2814      1.2  christos     ACPI_DMTABLE_INFO       *InfoTable;
   2815      1.2  christos     UINT32                  Length = Table->Length;
   2816      1.2  christos     UINT32                  Offset = sizeof (ACPI_TABLE_PCCT);
   2817      1.2  christos 
   2818      1.2  christos 
   2819      1.2  christos     /* Main table */
   2820      1.2  christos 
   2821      1.2  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPcct);
   2822      1.2  christos     if (ACPI_FAILURE (Status))
   2823      1.2  christos     {
   2824      1.2  christos         return;
   2825      1.2  christos     }
   2826      1.2  christos 
   2827      1.2  christos     /* Subtables */
   2828      1.2  christos 
   2829      1.2  christos     SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Table, Offset);
   2830      1.2  christos     while (Offset < Table->Length)
   2831      1.2  christos     {
   2832      1.2  christos         /* Common subtable header */
   2833      1.2  christos 
   2834      1.2  christos         AcpiOsPrintf ("\n");
   2835      1.2  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   2836      1.4  christos             SubTable->Header.Length, AcpiDmTableInfoPcctHdr);
   2837      1.2  christos         if (ACPI_FAILURE (Status))
   2838      1.2  christos         {
   2839      1.2  christos             return;
   2840      1.2  christos         }
   2841      1.2  christos 
   2842      1.2  christos         switch (SubTable->Header.Type)
   2843      1.2  christos         {
   2844      1.2  christos         case ACPI_PCCT_TYPE_GENERIC_SUBSPACE:
   2845      1.2  christos 
   2846      1.2  christos             InfoTable = AcpiDmTableInfoPcct0;
   2847      1.2  christos             break;
   2848      1.2  christos 
   2849      1.2  christos         case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE:
   2850      1.2  christos 
   2851      1.2  christos             InfoTable = AcpiDmTableInfoPcct1;
   2852      1.2  christos             break;
   2853      1.2  christos 
   2854      1.5  christos         case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2:
   2855      1.5  christos 
   2856      1.5  christos             InfoTable = AcpiDmTableInfoPcct2;
   2857      1.5  christos             break;
   2858      1.5  christos 
   2859      1.2  christos         default:
   2860      1.2  christos 
   2861      1.2  christos             AcpiOsPrintf (
   2862      1.2  christos                 "\n**** Unexpected or unknown PCCT subtable type 0x%X\n\n",
   2863      1.2  christos                 SubTable->Header.Type);
   2864      1.2  christos             return;
   2865      1.2  christos         }
   2866      1.2  christos 
   2867      1.2  christos         AcpiOsPrintf ("\n");
   2868      1.2  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   2869      1.4  christos             SubTable->Header.Length, InfoTable);
   2870      1.2  christos         if (ACPI_FAILURE (Status))
   2871      1.2  christos         {
   2872      1.2  christos             return;
   2873      1.2  christos         }
   2874      1.2  christos 
   2875      1.2  christos         /* Point to next subtable */
   2876      1.2  christos 
   2877      1.2  christos         Offset += SubTable->Header.Length;
   2878      1.2  christos         SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, SubTable,
   2879      1.4  christos             SubTable->Header.Length);
   2880      1.2  christos     }
   2881      1.2  christos }
   2882      1.2  christos 
   2883      1.2  christos 
   2884      1.2  christos /*******************************************************************************
   2885      1.2  christos  *
   2886      1.2  christos  * FUNCTION:    AcpiDmDumpPmtt
   2887      1.2  christos  *
   2888      1.2  christos  * PARAMETERS:  Table               - A PMTT table
   2889      1.2  christos  *
   2890      1.2  christos  * RETURN:      None
   2891      1.2  christos  *
   2892      1.2  christos  * DESCRIPTION: Format the contents of a PMTT. This table type consists
   2893      1.2  christos  *              of an open-ended number of subtables.
   2894      1.2  christos  *
   2895      1.2  christos  ******************************************************************************/
   2896      1.2  christos 
   2897      1.2  christos void
   2898      1.2  christos AcpiDmDumpPmtt (
   2899      1.2  christos     ACPI_TABLE_HEADER       *Table)
   2900      1.2  christos {
   2901      1.2  christos     ACPI_STATUS             Status;
   2902      1.2  christos     ACPI_PMTT_HEADER        *SubTable;
   2903      1.2  christos     ACPI_PMTT_HEADER        *MemSubTable;
   2904      1.2  christos     ACPI_PMTT_HEADER        *DimmSubTable;
   2905      1.2  christos     ACPI_PMTT_DOMAIN        *DomainArray;
   2906      1.2  christos     UINT32                  Length = Table->Length;
   2907      1.2  christos     UINT32                  Offset = sizeof (ACPI_TABLE_PMTT);
   2908      1.2  christos     UINT32                  MemOffset;
   2909      1.2  christos     UINT32                  DimmOffset;
   2910      1.2  christos     UINT32                  DomainOffset;
   2911      1.2  christos     UINT32                  DomainCount;
   2912      1.2  christos 
   2913      1.2  christos 
   2914      1.2  christos     /* Main table */
   2915      1.2  christos 
   2916      1.2  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPmtt);
   2917      1.2  christos     if (ACPI_FAILURE (Status))
   2918      1.2  christos     {
   2919      1.2  christos         return;
   2920      1.2  christos     }
   2921      1.2  christos 
   2922      1.2  christos     /* Subtables */
   2923      1.2  christos 
   2924      1.2  christos     SubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Table, Offset);
   2925      1.2  christos     while (Offset < Table->Length)
   2926      1.2  christos     {
   2927      1.2  christos         /* Common subtable header */
   2928      1.2  christos 
   2929      1.2  christos         AcpiOsPrintf ("\n");
   2930      1.2  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   2931      1.4  christos             SubTable->Length, AcpiDmTableInfoPmttHdr);
   2932      1.2  christos         if (ACPI_FAILURE (Status))
   2933      1.2  christos         {
   2934      1.2  christos             return;
   2935      1.2  christos         }
   2936      1.2  christos 
   2937      1.2  christos         /* Only Socket subtables are expected at this level */
   2938      1.2  christos 
   2939      1.2  christos         if (SubTable->Type != ACPI_PMTT_TYPE_SOCKET)
   2940      1.2  christos         {
   2941      1.2  christos             AcpiOsPrintf (
   2942      1.2  christos                 "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n",
   2943      1.2  christos                 SubTable->Type);
   2944      1.2  christos             return;
   2945      1.2  christos         }
   2946      1.2  christos 
   2947      1.2  christos         /* Dump the fixed-length portion of the subtable */
   2948      1.2  christos 
   2949      1.2  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   2950      1.4  christos             SubTable->Length, AcpiDmTableInfoPmtt0);
   2951      1.2  christos         if (ACPI_FAILURE (Status))
   2952      1.2  christos         {
   2953      1.2  christos             return;
   2954      1.2  christos         }
   2955      1.2  christos 
   2956      1.2  christos         /* Walk the memory controller subtables */
   2957      1.2  christos 
   2958      1.2  christos         MemOffset = sizeof (ACPI_PMTT_SOCKET);
   2959      1.2  christos         MemSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, SubTable,
   2960      1.2  christos             sizeof (ACPI_PMTT_SOCKET));
   2961      1.2  christos 
   2962      1.2  christos         while (((Offset + MemOffset) < Table->Length) &&
   2963      1.2  christos             (MemOffset < SubTable->Length))
   2964      1.2  christos         {
   2965      1.2  christos             /* Common subtable header */
   2966      1.2  christos 
   2967      1.2  christos             AcpiOsPrintf ("\n");
   2968      1.2  christos             Status = AcpiDmDumpTable (Length,
   2969      1.4  christos                 Offset + MemOffset, MemSubTable,
   2970      1.4  christos                 MemSubTable->Length, AcpiDmTableInfoPmttHdr);
   2971      1.2  christos             if (ACPI_FAILURE (Status))
   2972      1.2  christos             {
   2973      1.2  christos                 return;
   2974      1.2  christos             }
   2975      1.2  christos 
   2976      1.2  christos             /* Only memory controller subtables are expected at this level */
   2977      1.2  christos 
   2978      1.2  christos             if (MemSubTable->Type != ACPI_PMTT_TYPE_CONTROLLER)
   2979      1.2  christos             {
   2980      1.2  christos                 AcpiOsPrintf (
   2981      1.2  christos                     "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n",
   2982      1.2  christos                     MemSubTable->Type);
   2983      1.2  christos                 return;
   2984      1.2  christos             }
   2985      1.2  christos 
   2986      1.2  christos             /* Dump the fixed-length portion of the controller subtable */
   2987      1.2  christos 
   2988      1.2  christos             Status = AcpiDmDumpTable (Length,
   2989      1.4  christos                 Offset + MemOffset, MemSubTable,
   2990      1.4  christos                 MemSubTable->Length, AcpiDmTableInfoPmtt1);
   2991      1.2  christos             if (ACPI_FAILURE (Status))
   2992      1.2  christos             {
   2993      1.2  christos                 return;
   2994      1.2  christos             }
   2995      1.2  christos 
   2996      1.2  christos             /* Walk the variable count of proximity domains */
   2997      1.2  christos 
   2998      1.2  christos             DomainCount = ((ACPI_PMTT_CONTROLLER *) MemSubTable)->DomainCount;
   2999      1.2  christos             DomainOffset = sizeof (ACPI_PMTT_CONTROLLER);
   3000      1.2  christos             DomainArray = ACPI_ADD_PTR (ACPI_PMTT_DOMAIN, MemSubTable,
   3001      1.2  christos                 sizeof (ACPI_PMTT_CONTROLLER));
   3002      1.2  christos 
   3003      1.2  christos             while (((Offset + MemOffset + DomainOffset) < Table->Length) &&
   3004      1.2  christos                 ((MemOffset + DomainOffset) < SubTable->Length) &&
   3005      1.2  christos                 DomainCount)
   3006      1.2  christos             {
   3007      1.2  christos                 Status = AcpiDmDumpTable (Length,
   3008      1.4  christos                     Offset + MemOffset + DomainOffset, DomainArray,
   3009      1.4  christos                     sizeof (ACPI_PMTT_DOMAIN), AcpiDmTableInfoPmtt1a);
   3010      1.2  christos                 if (ACPI_FAILURE (Status))
   3011      1.2  christos                 {
   3012      1.2  christos                     return;
   3013      1.2  christos                 }
   3014      1.2  christos 
   3015      1.2  christos                 DomainOffset += sizeof (ACPI_PMTT_DOMAIN);
   3016      1.2  christos                 DomainArray++;
   3017      1.2  christos                 DomainCount--;
   3018      1.2  christos             }
   3019      1.2  christos 
   3020      1.2  christos             if (DomainCount)
   3021      1.2  christos             {
   3022      1.2  christos                 AcpiOsPrintf (
   3023      1.2  christos                     "\n**** DomainCount exceeds subtable length\n\n");
   3024      1.2  christos             }
   3025      1.2  christos 
   3026      1.2  christos             /* Walk the physical component (DIMM) subtables */
   3027      1.2  christos 
   3028      1.2  christos             DimmOffset = DomainOffset;
   3029      1.2  christos             DimmSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, MemSubTable,
   3030      1.2  christos                 DomainOffset);
   3031      1.2  christos 
   3032      1.2  christos             while (((Offset + MemOffset + DimmOffset) < Table->Length) &&
   3033      1.2  christos                 (DimmOffset < MemSubTable->Length))
   3034      1.2  christos             {
   3035      1.2  christos                 /* Common subtable header */
   3036      1.2  christos 
   3037      1.2  christos                 AcpiOsPrintf ("\n");
   3038      1.2  christos                 Status = AcpiDmDumpTable (Length,
   3039      1.4  christos                     Offset + MemOffset + DimmOffset, DimmSubTable,
   3040      1.4  christos                     DimmSubTable->Length, AcpiDmTableInfoPmttHdr);
   3041      1.2  christos                 if (ACPI_FAILURE (Status))
   3042      1.2  christos                 {
   3043      1.2  christos                     return;
   3044      1.2  christos                 }
   3045      1.2  christos 
   3046      1.2  christos                 /* Only DIMM subtables are expected at this level */
   3047      1.2  christos 
   3048      1.2  christos                 if (DimmSubTable->Type != ACPI_PMTT_TYPE_DIMM)
   3049      1.2  christos                 {
   3050      1.2  christos                     AcpiOsPrintf (
   3051      1.2  christos                         "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n",
   3052      1.2  christos                         DimmSubTable->Type);
   3053      1.2  christos                     return;
   3054      1.2  christos                 }
   3055      1.2  christos 
   3056      1.2  christos                 /* Dump the fixed-length DIMM subtable */
   3057      1.2  christos 
   3058      1.2  christos                 Status = AcpiDmDumpTable (Length,
   3059      1.4  christos                     Offset + MemOffset + DimmOffset, DimmSubTable,
   3060      1.4  christos                     DimmSubTable->Length, AcpiDmTableInfoPmtt2);
   3061      1.2  christos                 if (ACPI_FAILURE (Status))
   3062      1.2  christos                 {
   3063      1.2  christos                     return;
   3064      1.2  christos                 }
   3065      1.2  christos 
   3066      1.2  christos                 /* Point to next DIMM subtable */
   3067      1.2  christos 
   3068      1.2  christos                 DimmOffset += DimmSubTable->Length;
   3069      1.2  christos                 DimmSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
   3070      1.2  christos                     DimmSubTable, DimmSubTable->Length);
   3071      1.2  christos             }
   3072      1.2  christos 
   3073      1.2  christos             /* Point to next Controller subtable */
   3074      1.2  christos 
   3075      1.2  christos             MemOffset += MemSubTable->Length;
   3076      1.2  christos             MemSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
   3077      1.2  christos                 MemSubTable, MemSubTable->Length);
   3078      1.2  christos         }
   3079      1.2  christos 
   3080      1.2  christos         /* Point to next Socket subtable */
   3081      1.2  christos 
   3082      1.2  christos         Offset += SubTable->Length;
   3083      1.2  christos         SubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
   3084      1.2  christos             SubTable, SubTable->Length);
   3085      1.2  christos     }
   3086      1.2  christos }
   3087      1.2  christos 
   3088      1.2  christos 
   3089      1.2  christos /*******************************************************************************
   3090      1.2  christos  *
   3091      1.2  christos  * FUNCTION:    AcpiDmDumpS3pt
   3092      1.2  christos  *
   3093      1.2  christos  * PARAMETERS:  Table               - A S3PT table
   3094      1.2  christos  *
   3095      1.2  christos  * RETURN:      Length of the table
   3096      1.2  christos  *
   3097      1.2  christos  * DESCRIPTION: Format the contents of a S3PT
   3098      1.2  christos  *
   3099      1.2  christos  ******************************************************************************/
   3100      1.2  christos 
   3101      1.2  christos UINT32
   3102      1.2  christos AcpiDmDumpS3pt (
   3103      1.2  christos     ACPI_TABLE_HEADER       *Tables)
   3104      1.2  christos {
   3105      1.2  christos     ACPI_STATUS             Status;
   3106      1.2  christos     UINT32                  Offset = sizeof (ACPI_TABLE_S3PT);
   3107      1.5  christos     ACPI_FPDT_HEADER        *SubTable;
   3108      1.2  christos     ACPI_DMTABLE_INFO       *InfoTable;
   3109      1.2  christos     ACPI_TABLE_S3PT         *S3ptTable = ACPI_CAST_PTR (ACPI_TABLE_S3PT, Tables);
   3110      1.2  christos 
   3111      1.2  christos 
   3112      1.2  christos     /* Main table */
   3113      1.2  christos 
   3114      1.2  christos     Status = AcpiDmDumpTable (Offset, 0, S3ptTable, 0, AcpiDmTableInfoS3pt);
   3115      1.2  christos     if (ACPI_FAILURE (Status))
   3116      1.2  christos     {
   3117      1.2  christos         return 0;
   3118      1.2  christos     }
   3119      1.2  christos 
   3120      1.5  christos     SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, S3ptTable, Offset);
   3121      1.2  christos     while (Offset < S3ptTable->Length)
   3122      1.2  christos     {
   3123      1.2  christos         /* Common subtable header */
   3124      1.2  christos 
   3125      1.2  christos         AcpiOsPrintf ("\n");
   3126      1.2  christos         Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable,
   3127      1.4  christos             SubTable->Length, AcpiDmTableInfoS3ptHdr);
   3128      1.2  christos         if (ACPI_FAILURE (Status))
   3129      1.2  christos         {
   3130      1.2  christos             return 0;
   3131      1.2  christos         }
   3132      1.2  christos 
   3133      1.2  christos         switch (SubTable->Type)
   3134      1.2  christos         {
   3135      1.2  christos         case ACPI_S3PT_TYPE_RESUME:
   3136      1.2  christos 
   3137      1.2  christos             InfoTable = AcpiDmTableInfoS3pt0;
   3138      1.2  christos             break;
   3139      1.2  christos 
   3140      1.2  christos         case ACPI_S3PT_TYPE_SUSPEND:
   3141      1.2  christos 
   3142      1.2  christos             InfoTable = AcpiDmTableInfoS3pt1;
   3143      1.2  christos             break;
   3144      1.2  christos 
   3145      1.2  christos         default:
   3146      1.2  christos 
   3147      1.4  christos             AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n",
   3148      1.4  christos                 SubTable->Type);
   3149      1.2  christos 
   3150      1.2  christos             /* Attempt to continue */
   3151      1.2  christos 
   3152      1.2  christos             if (!SubTable->Length)
   3153      1.2  christos             {
   3154      1.2  christos                 AcpiOsPrintf ("Invalid zero length subtable\n");
   3155      1.2  christos                 return 0;
   3156      1.2  christos             }
   3157      1.2  christos             goto NextSubTable;
   3158      1.2  christos         }
   3159      1.2  christos 
   3160      1.2  christos         AcpiOsPrintf ("\n");
   3161      1.2  christos         Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable,
   3162      1.4  christos             SubTable->Length, InfoTable);
   3163      1.2  christos         if (ACPI_FAILURE (Status))
   3164      1.2  christos         {
   3165      1.2  christos             return 0;
   3166      1.2  christos         }
   3167      1.2  christos 
   3168      1.2  christos NextSubTable:
   3169      1.2  christos         /* Point to next subtable */
   3170      1.2  christos 
   3171      1.2  christos         Offset += SubTable->Length;
   3172      1.5  christos         SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable, SubTable->Length);
   3173      1.2  christos     }
   3174      1.2  christos 
   3175      1.2  christos     return (S3ptTable->Length);
   3176      1.2  christos }
   3177      1.2  christos 
   3178      1.2  christos 
   3179      1.2  christos /*******************************************************************************
   3180      1.2  christos  *
   3181      1.2  christos  * FUNCTION:    AcpiDmDumpSlic
   3182      1.2  christos  *
   3183      1.2  christos  * PARAMETERS:  Table               - A SLIC table
   3184      1.2  christos  *
   3185      1.2  christos  * RETURN:      None
   3186      1.2  christos  *
   3187      1.2  christos  * DESCRIPTION: Format the contents of a SLIC
   3188      1.2  christos  *
   3189      1.2  christos  ******************************************************************************/
   3190      1.2  christos 
   3191      1.2  christos void
   3192      1.2  christos AcpiDmDumpSlic (
   3193      1.2  christos     ACPI_TABLE_HEADER       *Table)
   3194      1.2  christos {
   3195      1.4  christos 
   3196      1.3  christos     (void) AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table,
   3197      1.4  christos         Table->Length - sizeof (*Table), AcpiDmTableInfoSlic);
   3198      1.2  christos }
   3199      1.2  christos 
   3200      1.2  christos 
   3201      1.2  christos /*******************************************************************************
   3202      1.2  christos  *
   3203      1.1    jruoho  * FUNCTION:    AcpiDmDumpSlit
   3204      1.1    jruoho  *
   3205      1.1    jruoho  * PARAMETERS:  Table               - An SLIT
   3206      1.1    jruoho  *
   3207      1.1    jruoho  * RETURN:      None
   3208      1.1    jruoho  *
   3209      1.1    jruoho  * DESCRIPTION: Format the contents of a SLIT
   3210      1.1    jruoho  *
   3211      1.1    jruoho  ******************************************************************************/
   3212      1.1    jruoho 
   3213      1.1    jruoho void
   3214      1.1    jruoho AcpiDmDumpSlit (
   3215      1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   3216      1.1    jruoho {
   3217      1.1    jruoho     ACPI_STATUS             Status;
   3218      1.1    jruoho     UINT32                  Offset;
   3219      1.1    jruoho     UINT8                   *Row;
   3220      1.1    jruoho     UINT32                  Localities;
   3221      1.1    jruoho     UINT32                  i;
   3222      1.1    jruoho     UINT32                  j;
   3223      1.1    jruoho 
   3224      1.1    jruoho 
   3225      1.1    jruoho     /* Main table */
   3226      1.1    jruoho 
   3227      1.1    jruoho     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSlit);
   3228      1.1    jruoho     if (ACPI_FAILURE (Status))
   3229      1.1    jruoho     {
   3230      1.1    jruoho         return;
   3231      1.1    jruoho     }
   3232      1.1    jruoho 
   3233      1.1    jruoho     /* Display the Locality NxN Matrix */
   3234      1.1    jruoho 
   3235      1.1    jruoho     Localities = (UINT32) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount;
   3236      1.1    jruoho     Offset = ACPI_OFFSET (ACPI_TABLE_SLIT, Entry[0]);
   3237      1.1    jruoho     Row = (UINT8 *) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->Entry;
   3238      1.1    jruoho 
   3239      1.1    jruoho     for (i = 0; i < Localities; i++)
   3240      1.1    jruoho     {
   3241      1.1    jruoho         /* Display one row of the matrix */
   3242      1.1    jruoho 
   3243      1.1    jruoho         AcpiDmLineHeader2 (Offset, Localities, "Locality", i);
   3244      1.1    jruoho         for  (j = 0; j < Localities; j++)
   3245      1.1    jruoho         {
   3246      1.1    jruoho             /* Check for beyond EOT */
   3247      1.1    jruoho 
   3248      1.1    jruoho             if (Offset >= Table->Length)
   3249      1.1    jruoho             {
   3250      1.4  christos                 AcpiOsPrintf (
   3251      1.4  christos                     "\n**** Not enough room in table for all localities\n");
   3252      1.1    jruoho                 return;
   3253      1.1    jruoho             }
   3254      1.1    jruoho 
   3255      1.2  christos             AcpiOsPrintf ("%2.2X", Row[j]);
   3256      1.1    jruoho             Offset++;
   3257      1.1    jruoho 
   3258      1.1    jruoho             /* Display up to 16 bytes per output row */
   3259      1.1    jruoho 
   3260      1.2  christos             if ((j+1) < Localities)
   3261      1.1    jruoho             {
   3262      1.2  christos                 AcpiOsPrintf (" ");
   3263      1.2  christos 
   3264      1.2  christos                 if (j && (((j+1) % 16) == 0))
   3265      1.2  christos                 {
   3266      1.2  christos                     AcpiOsPrintf ("\\\n"); /* With line continuation char */
   3267      1.2  christos                     AcpiDmLineHeader (Offset, 0, NULL);
   3268      1.2  christos                 }
   3269      1.1    jruoho             }
   3270      1.1    jruoho         }
   3271      1.1    jruoho 
   3272      1.1    jruoho         /* Point to next row */
   3273      1.1    jruoho 
   3274      1.1    jruoho         AcpiOsPrintf ("\n");
   3275      1.1    jruoho         Row += Localities;
   3276      1.1    jruoho     }
   3277      1.1    jruoho }
   3278      1.1    jruoho 
   3279      1.1    jruoho 
   3280      1.1    jruoho /*******************************************************************************
   3281      1.1    jruoho  *
   3282      1.1    jruoho  * FUNCTION:    AcpiDmDumpSrat
   3283      1.1    jruoho  *
   3284      1.1    jruoho  * PARAMETERS:  Table               - A SRAT table
   3285      1.1    jruoho  *
   3286      1.1    jruoho  * RETURN:      None
   3287      1.1    jruoho  *
   3288      1.1    jruoho  * DESCRIPTION: Format the contents of a SRAT
   3289      1.1    jruoho  *
   3290      1.1    jruoho  ******************************************************************************/
   3291      1.1    jruoho 
   3292      1.1    jruoho void
   3293      1.1    jruoho AcpiDmDumpSrat (
   3294      1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   3295      1.1    jruoho {
   3296      1.1    jruoho     ACPI_STATUS             Status;
   3297      1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_SRAT);
   3298      1.1    jruoho     ACPI_SUBTABLE_HEADER    *SubTable;
   3299      1.1    jruoho     ACPI_DMTABLE_INFO       *InfoTable;
   3300      1.1    jruoho 
   3301      1.1    jruoho 
   3302      1.1    jruoho     /* Main table */
   3303      1.1    jruoho 
   3304      1.1    jruoho     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSrat);
   3305      1.1    jruoho     if (ACPI_FAILURE (Status))
   3306      1.1    jruoho     {
   3307      1.1    jruoho         return;
   3308      1.1    jruoho     }
   3309      1.1    jruoho 
   3310      1.2  christos     /* Subtables */
   3311      1.1    jruoho 
   3312      1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
   3313      1.1    jruoho     while (Offset < Table->Length)
   3314      1.1    jruoho     {
   3315      1.2  christos         /* Common subtable header */
   3316      1.1    jruoho 
   3317      1.1    jruoho         AcpiOsPrintf ("\n");
   3318      1.1    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   3319      1.4  christos             SubTable->Length, AcpiDmTableInfoSratHdr);
   3320      1.1    jruoho         if (ACPI_FAILURE (Status))
   3321      1.1    jruoho         {
   3322      1.1    jruoho             return;
   3323      1.1    jruoho         }
   3324      1.1    jruoho 
   3325      1.1    jruoho         switch (SubTable->Type)
   3326      1.1    jruoho         {
   3327      1.1    jruoho         case ACPI_SRAT_TYPE_CPU_AFFINITY:
   3328      1.2  christos 
   3329      1.1    jruoho             InfoTable = AcpiDmTableInfoSrat0;
   3330      1.1    jruoho             break;
   3331      1.2  christos 
   3332      1.1    jruoho         case ACPI_SRAT_TYPE_MEMORY_AFFINITY:
   3333      1.2  christos 
   3334      1.1    jruoho             InfoTable = AcpiDmTableInfoSrat1;
   3335      1.1    jruoho             break;
   3336      1.2  christos 
   3337      1.1    jruoho         case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY:
   3338      1.2  christos 
   3339      1.1    jruoho             InfoTable = AcpiDmTableInfoSrat2;
   3340      1.1    jruoho             break;
   3341      1.2  christos 
   3342      1.2  christos         case ACPI_SRAT_TYPE_GICC_AFFINITY:
   3343      1.2  christos 
   3344      1.2  christos             InfoTable = AcpiDmTableInfoSrat3;
   3345      1.2  christos             break;
   3346      1.2  christos 
   3347      1.1    jruoho         default:
   3348      1.4  christos             AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n",
   3349      1.4  christos                 SubTable->Type);
   3350      1.1    jruoho 
   3351      1.1    jruoho             /* Attempt to continue */
   3352      1.1    jruoho 
   3353      1.1    jruoho             if (!SubTable->Length)
   3354      1.1    jruoho             {
   3355      1.1    jruoho                 AcpiOsPrintf ("Invalid zero length subtable\n");
   3356      1.1    jruoho                 return;
   3357      1.1    jruoho             }
   3358      1.1    jruoho             goto NextSubTable;
   3359      1.1    jruoho         }
   3360      1.1    jruoho 
   3361      1.1    jruoho         AcpiOsPrintf ("\n");
   3362      1.1    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   3363      1.4  christos             SubTable->Length, InfoTable);
   3364      1.1    jruoho         if (ACPI_FAILURE (Status))
   3365      1.1    jruoho         {
   3366      1.1    jruoho             return;
   3367      1.1    jruoho         }
   3368      1.1    jruoho 
   3369      1.1    jruoho NextSubTable:
   3370      1.2  christos         /* Point to next subtable */
   3371      1.1    jruoho 
   3372      1.1    jruoho         Offset += SubTable->Length;
   3373      1.4  christos         SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable,
   3374      1.4  christos             SubTable->Length);
   3375      1.1    jruoho     }
   3376      1.1    jruoho }
   3377      1.1    jruoho 
   3378      1.1    jruoho 
   3379      1.1    jruoho /*******************************************************************************
   3380      1.1    jruoho  *
   3381      1.3  christos  * FUNCTION:    AcpiDmDumpStao
   3382      1.3  christos  *
   3383      1.3  christos  * PARAMETERS:  Table               - A STAO table
   3384      1.3  christos  *
   3385      1.3  christos  * RETURN:      None
   3386      1.3  christos  *
   3387      1.3  christos  * DESCRIPTION: Format the contents of a STAO. This is a variable-length
   3388      1.3  christos  *              table that contains an open-ended number of ASCII strings
   3389      1.3  christos  *              at the end of the table.
   3390      1.3  christos  *
   3391      1.3  christos  ******************************************************************************/
   3392      1.3  christos 
   3393      1.3  christos void
   3394      1.3  christos AcpiDmDumpStao (
   3395      1.3  christos     ACPI_TABLE_HEADER       *Table)
   3396      1.3  christos {
   3397      1.3  christos     ACPI_STATUS             Status;
   3398      1.3  christos     char                    *Namepath;
   3399      1.3  christos     UINT32                  Length = Table->Length;
   3400      1.3  christos     UINT32                  StringLength;
   3401      1.3  christos     UINT32                  Offset = sizeof (ACPI_TABLE_STAO);
   3402      1.3  christos 
   3403      1.3  christos 
   3404      1.3  christos     /* Main table */
   3405      1.3  christos 
   3406      1.3  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoStao);
   3407      1.3  christos     if (ACPI_FAILURE (Status))
   3408      1.3  christos     {
   3409      1.3  christos         return;
   3410      1.3  christos     }
   3411      1.3  christos 
   3412      1.3  christos     /* The rest of the table consists of Namepath strings */
   3413      1.3  christos 
   3414      1.3  christos     while (Offset < Table->Length)
   3415      1.3  christos     {
   3416      1.3  christos         Namepath = ACPI_ADD_PTR (char, Table, Offset);
   3417      1.3  christos         StringLength = strlen (Namepath) + 1;
   3418      1.3  christos 
   3419      1.3  christos         AcpiDmLineHeader (Offset, StringLength, "Namestring");
   3420      1.3  christos         AcpiOsPrintf ("\"%s\"\n", Namepath);
   3421      1.3  christos 
   3422      1.3  christos         /* Point to next namepath */
   3423      1.3  christos 
   3424      1.3  christos         Offset += StringLength;
   3425      1.3  christos     }
   3426      1.3  christos }
   3427      1.3  christos 
   3428      1.3  christos 
   3429      1.3  christos /*******************************************************************************
   3430      1.3  christos  *
   3431      1.3  christos  * FUNCTION:    AcpiDmDumpTcpa
   3432      1.3  christos  *
   3433      1.3  christos  * PARAMETERS:  Table               - A TCPA table
   3434      1.3  christos  *
   3435      1.3  christos  * RETURN:      None
   3436      1.3  christos  *
   3437      1.3  christos  * DESCRIPTION: Format the contents of a TCPA.
   3438      1.3  christos  *
   3439      1.3  christos  * NOTE:        There are two versions of the table with the same signature:
   3440      1.3  christos  *              the client version and the server version. The common
   3441      1.3  christos  *              PlatformClass field is used to differentiate the two types of
   3442      1.3  christos  *              tables.
   3443      1.3  christos  *
   3444      1.3  christos  ******************************************************************************/
   3445      1.3  christos 
   3446      1.3  christos void
   3447      1.3  christos AcpiDmDumpTcpa (
   3448      1.3  christos     ACPI_TABLE_HEADER       *Table)
   3449      1.3  christos {
   3450      1.3  christos     UINT32                  Offset = sizeof (ACPI_TABLE_TCPA_HDR);
   3451      1.3  christos     ACPI_TABLE_TCPA_HDR     *CommonHeader = ACPI_CAST_PTR (
   3452      1.3  christos                                 ACPI_TABLE_TCPA_HDR, Table);
   3453      1.3  christos     ACPI_TABLE_TCPA_HDR     *SubTable = ACPI_ADD_PTR (
   3454      1.3  christos                                 ACPI_TABLE_TCPA_HDR, Table, Offset);
   3455      1.3  christos     ACPI_STATUS             Status;
   3456      1.3  christos 
   3457      1.3  christos 
   3458      1.3  christos     /* Main table */
   3459      1.3  christos 
   3460      1.3  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table,
   3461      1.3  christos         0, AcpiDmTableInfoTcpaHdr);
   3462      1.3  christos     if (ACPI_FAILURE (Status))
   3463      1.3  christos     {
   3464      1.3  christos         return;
   3465      1.3  christos     }
   3466      1.3  christos 
   3467      1.3  christos     /*
   3468      1.3  christos      * Examine the PlatformClass field to determine the table type.
   3469      1.3  christos      * Either a client or server table. Only one.
   3470      1.3  christos      */
   3471      1.3  christos     switch (CommonHeader->PlatformClass)
   3472      1.3  christos     {
   3473      1.3  christos     case ACPI_TCPA_CLIENT_TABLE:
   3474      1.3  christos 
   3475      1.3  christos         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   3476      1.3  christos             Table->Length - Offset, AcpiDmTableInfoTcpaClient);
   3477      1.3  christos         break;
   3478      1.3  christos 
   3479      1.3  christos     case ACPI_TCPA_SERVER_TABLE:
   3480      1.3  christos 
   3481      1.3  christos         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   3482      1.3  christos             Table->Length - Offset, AcpiDmTableInfoTcpaServer);
   3483      1.3  christos         break;
   3484      1.3  christos 
   3485      1.3  christos     default:
   3486      1.3  christos 
   3487      1.3  christos         AcpiOsPrintf ("\n**** Unknown TCPA Platform Class 0x%X\n",
   3488      1.3  christos             CommonHeader->PlatformClass);
   3489      1.3  christos         Status = AE_ERROR;
   3490      1.3  christos         break;
   3491      1.3  christos     }
   3492      1.3  christos 
   3493      1.3  christos     if (ACPI_FAILURE (Status))
   3494      1.3  christos     {
   3495      1.3  christos         AcpiOsPrintf ("\n**** Cannot disassemble TCPA table\n");
   3496      1.3  christos     }
   3497      1.3  christos }
   3498      1.3  christos 
   3499      1.3  christos 
   3500      1.3  christos /*******************************************************************************
   3501      1.3  christos  *
   3502      1.2  christos  * FUNCTION:    AcpiDmDumpVrtc
   3503      1.2  christos  *
   3504      1.2  christos  * PARAMETERS:  Table               - A VRTC table
   3505      1.2  christos  *
   3506      1.2  christos  * RETURN:      None
   3507      1.2  christos  *
   3508      1.2  christos  * DESCRIPTION: Format the contents of a VRTC
   3509      1.2  christos  *
   3510      1.2  christos  ******************************************************************************/
   3511      1.2  christos 
   3512      1.2  christos void
   3513      1.2  christos AcpiDmDumpVrtc (
   3514      1.2  christos     ACPI_TABLE_HEADER       *Table)
   3515      1.2  christos {
   3516      1.2  christos     ACPI_STATUS             Status;
   3517      1.2  christos     UINT32                  Offset = sizeof (ACPI_TABLE_VRTC);
   3518      1.2  christos     ACPI_VRTC_ENTRY         *SubTable;
   3519      1.2  christos 
   3520      1.2  christos 
   3521      1.2  christos     /* Main table */
   3522      1.2  christos 
   3523      1.2  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoVrtc);
   3524      1.2  christos     if (ACPI_FAILURE (Status))
   3525      1.2  christos     {
   3526      1.2  christos         return;
   3527      1.2  christos     }
   3528      1.2  christos 
   3529      1.2  christos     /* Subtables */
   3530      1.2  christos 
   3531      1.2  christos     SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, Table, Offset);
   3532      1.2  christos     while (Offset < Table->Length)
   3533      1.2  christos     {
   3534      1.2  christos         /* Common subtable header */
   3535      1.2  christos 
   3536      1.2  christos         AcpiOsPrintf ("\n");
   3537      1.2  christos         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   3538      1.4  christos             sizeof (ACPI_VRTC_ENTRY), AcpiDmTableInfoVrtc0);
   3539      1.2  christos         if (ACPI_FAILURE (Status))
   3540      1.2  christos         {
   3541      1.2  christos             return;
   3542      1.2  christos         }
   3543      1.2  christos 
   3544      1.2  christos         /* Point to next subtable */
   3545      1.2  christos 
   3546      1.2  christos         Offset += sizeof (ACPI_VRTC_ENTRY);
   3547      1.4  christos         SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, SubTable,
   3548      1.4  christos             sizeof (ACPI_VRTC_ENTRY));
   3549      1.2  christos     }
   3550      1.2  christos }
   3551      1.2  christos 
   3552      1.2  christos 
   3553      1.2  christos /*******************************************************************************
   3554      1.2  christos  *
   3555      1.1    jruoho  * FUNCTION:    AcpiDmDumpWdat
   3556      1.1    jruoho  *
   3557      1.1    jruoho  * PARAMETERS:  Table               - A WDAT table
   3558      1.1    jruoho  *
   3559      1.1    jruoho  * RETURN:      None
   3560      1.1    jruoho  *
   3561      1.1    jruoho  * DESCRIPTION: Format the contents of a WDAT
   3562      1.1    jruoho  *
   3563      1.1    jruoho  ******************************************************************************/
   3564      1.1    jruoho 
   3565      1.1    jruoho void
   3566      1.1    jruoho AcpiDmDumpWdat (
   3567      1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   3568      1.1    jruoho {
   3569      1.1    jruoho     ACPI_STATUS             Status;
   3570      1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_WDAT);
   3571      1.1    jruoho     ACPI_WDAT_ENTRY         *SubTable;
   3572      1.1    jruoho 
   3573      1.1    jruoho 
   3574      1.1    jruoho     /* Main table */
   3575      1.1    jruoho 
   3576      1.1    jruoho     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoWdat);
   3577      1.1    jruoho     if (ACPI_FAILURE (Status))
   3578      1.1    jruoho     {
   3579      1.1    jruoho         return;
   3580      1.1    jruoho     }
   3581      1.1    jruoho 
   3582      1.2  christos     /* Subtables */
   3583      1.1    jruoho 
   3584      1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset);
   3585      1.1    jruoho     while (Offset < Table->Length)
   3586      1.1    jruoho     {
   3587      1.2  christos         /* Common subtable header */
   3588      1.1    jruoho 
   3589      1.1    jruoho         AcpiOsPrintf ("\n");
   3590      1.1    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   3591      1.4  christos             sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0);
   3592      1.1    jruoho         if (ACPI_FAILURE (Status))
   3593      1.1    jruoho         {
   3594      1.1    jruoho             return;
   3595      1.1    jruoho         }
   3596      1.1    jruoho 
   3597      1.2  christos         /* Point to next subtable */
   3598      1.1    jruoho 
   3599      1.1    jruoho         Offset += sizeof (ACPI_WDAT_ENTRY);
   3600      1.4  christos         SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, SubTable,
   3601      1.4  christos             sizeof (ACPI_WDAT_ENTRY));
   3602      1.1    jruoho     }
   3603      1.1    jruoho }
   3604      1.3  christos 
   3605      1.4  christos 
   3606      1.3  christos /*******************************************************************************
   3607      1.3  christos  *
   3608      1.3  christos  * FUNCTION:    AcpiDmDumpWpbt
   3609      1.3  christos  *
   3610      1.3  christos  * PARAMETERS:  Table               - A WPBT table
   3611      1.3  christos  *
   3612      1.3  christos  * RETURN:      None
   3613      1.3  christos  *
   3614      1.3  christos  * DESCRIPTION: Format the contents of a WPBT. This table type consists
   3615      1.3  christos  *              of an open-ended arguments buffer at the end of the table.
   3616      1.3  christos  *
   3617      1.3  christos  ******************************************************************************/
   3618      1.3  christos 
   3619      1.3  christos void
   3620      1.3  christos AcpiDmDumpWpbt (
   3621      1.3  christos     ACPI_TABLE_HEADER       *Table)
   3622      1.3  christos {
   3623      1.3  christos     ACPI_STATUS             Status;
   3624      1.3  christos     ACPI_TABLE_WPBT         *SubTable;
   3625      1.3  christos     UINT32                  Length = Table->Length;
   3626      1.3  christos     UINT16                  ArgumentsLength;
   3627      1.3  christos 
   3628      1.3  christos 
   3629      1.3  christos     /* Dump the main table */
   3630      1.3  christos 
   3631      1.3  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoWpbt);
   3632      1.3  christos     if (ACPI_FAILURE (Status))
   3633      1.3  christos     {
   3634      1.3  christos         return;
   3635      1.3  christos     }
   3636      1.3  christos 
   3637      1.3  christos     /* Extract the arguments buffer length from the main table */
   3638      1.3  christos 
   3639      1.3  christos     SubTable = ACPI_CAST_PTR (ACPI_TABLE_WPBT, Table);
   3640      1.3  christos     ArgumentsLength = SubTable->ArgumentsLength;
   3641      1.3  christos 
   3642      1.3  christos     /* Dump the arguments buffer */
   3643      1.3  christos 
   3644      1.3  christos     (void) AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength,
   3645      1.3  christos         AcpiDmTableInfoWpbt0);
   3646      1.3  christos }
   3647