Home | History | Annotate | Line # | Download | only in common
dmtbdump.c revision 1.1.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.1.1.2    jruoho /*
      8  1.1.1.5.2.1     skrll  * Copyright (C) 2000 - 2015, Intel Corp.
      9          1.1    jruoho  * All rights reserved.
     10          1.1    jruoho  *
     11      1.1.1.2    jruoho  * Redistribution and use in source and binary forms, with or without
     12      1.1.1.2    jruoho  * modification, are permitted provided that the following conditions
     13      1.1.1.2    jruoho  * are met:
     14      1.1.1.2    jruoho  * 1. Redistributions of source code must retain the above copyright
     15      1.1.1.2    jruoho  *    notice, this list of conditions, and the following disclaimer,
     16      1.1.1.2    jruoho  *    without modification.
     17      1.1.1.2    jruoho  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     18      1.1.1.2    jruoho  *    substantially similar to the "NO WARRANTY" disclaimer below
     19      1.1.1.2    jruoho  *    ("Disclaimer") and any redistribution must be conditioned upon
     20      1.1.1.2    jruoho  *    including a substantially similar Disclaimer requirement for further
     21      1.1.1.2    jruoho  *    binary redistribution.
     22      1.1.1.2    jruoho  * 3. Neither the names of the above-listed copyright holders nor the names
     23      1.1.1.2    jruoho  *    of any contributors may be used to endorse or promote products derived
     24      1.1.1.2    jruoho  *    from this software without specific prior written permission.
     25      1.1.1.2    jruoho  *
     26      1.1.1.2    jruoho  * Alternatively, this software may be distributed under the terms of the
     27      1.1.1.2    jruoho  * GNU General Public License ("GPL") version 2 as published by the Free
     28      1.1.1.2    jruoho  * Software Foundation.
     29      1.1.1.2    jruoho  *
     30      1.1.1.2    jruoho  * NO WARRANTY
     31      1.1.1.2    jruoho  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     32      1.1.1.2    jruoho  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     33      1.1.1.2    jruoho  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
     34      1.1.1.2    jruoho  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     35      1.1.1.2    jruoho  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     36      1.1.1.2    jruoho  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     37      1.1.1.2    jruoho  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     38      1.1.1.2    jruoho  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     39      1.1.1.2    jruoho  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     40      1.1.1.2    jruoho  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     41      1.1.1.2    jruoho  * POSSIBILITY OF SUCH DAMAGES.
     42      1.1.1.2    jruoho  */
     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.1.1.4  christos /* Local prototypes */
     56      1.1.1.4  christos 
     57      1.1.1.2    jruoho static void
     58      1.1.1.2    jruoho AcpiDmValidateFadtLength (
     59      1.1.1.2    jruoho     UINT32                  Revision,
     60      1.1.1.2    jruoho     UINT32                  Length);
     61      1.1.1.2    jruoho 
     62      1.1.1.4  christos 
     63      1.1.1.4  christos /*******************************************************************************
     64      1.1.1.4  christos  *
     65      1.1.1.4  christos  * FUNCTION:    AcpiDmDumpBuffer
     66      1.1.1.4  christos  *
     67      1.1.1.4  christos  * PARAMETERS:  Table               - ACPI Table or subtable
     68      1.1.1.4  christos  *              BufferOffset        - Offset of buffer from Table above
     69      1.1.1.4  christos  *              Length              - Length of the buffer
     70      1.1.1.4  christos  *              AbsoluteOffset      - Offset of buffer in the main ACPI table
     71      1.1.1.4  christos  *              Header              - Name of the buffer field (printed on the
     72      1.1.1.4  christos  *                                    first line only.)
     73  1.1.1.5.2.1     skrll  *              MultiLine           - TRUE if a large, multi-line buffer
     74      1.1.1.4  christos  *
     75      1.1.1.4  christos  * RETURN:      None
     76      1.1.1.4  christos  *
     77      1.1.1.4  christos  * DESCRIPTION: Format the contents of an arbitrary length data buffer (in the
     78      1.1.1.4  christos  *              disassembler output format.)
     79      1.1.1.4  christos  *
     80      1.1.1.4  christos  ******************************************************************************/
     81      1.1.1.4  christos 
     82  1.1.1.5.2.1     skrll void
     83      1.1.1.4  christos AcpiDmDumpBuffer (
     84      1.1.1.4  christos     void                    *Table,
     85      1.1.1.4  christos     UINT32                  BufferOffset,
     86      1.1.1.4  christos     UINT32                  Length,
     87      1.1.1.4  christos     UINT32                  AbsoluteOffset,
     88  1.1.1.5.2.1     skrll     char                    *Header,
     89  1.1.1.5.2.1     skrll     BOOLEAN                 MultiLine)
     90      1.1.1.4  christos {
     91      1.1.1.4  christos     UINT8                   *Buffer;
     92      1.1.1.4  christos     UINT32                  i;
     93      1.1.1.4  christos 
     94      1.1.1.4  christos 
     95      1.1.1.4  christos     if (!Length)
     96      1.1.1.4  christos     {
     97      1.1.1.4  christos         return;
     98      1.1.1.4  christos     }
     99      1.1.1.4  christos 
    100      1.1.1.4  christos     Buffer = ACPI_CAST_PTR (UINT8, Table) + BufferOffset;
    101      1.1.1.4  christos     i = 0;
    102      1.1.1.4  christos 
    103      1.1.1.4  christos     while (i < Length)
    104      1.1.1.4  christos     {
    105      1.1.1.4  christos         if (!(i % 16))
    106      1.1.1.4  christos         {
    107  1.1.1.5.2.1     skrll             if (MultiLine)
    108  1.1.1.5.2.1     skrll             {
    109  1.1.1.5.2.1     skrll                 /* Insert a backslash - line continuation character */
    110  1.1.1.5.2.1     skrll 
    111  1.1.1.5.2.1     skrll                 AcpiOsPrintf ("\\\n    ");
    112  1.1.1.5.2.1     skrll             }
    113  1.1.1.5.2.1     skrll             else
    114  1.1.1.5.2.1     skrll             {
    115  1.1.1.5.2.1     skrll                 AcpiOsPrintf ("\n");
    116  1.1.1.5.2.1     skrll                 AcpiDmLineHeader (AbsoluteOffset,
    117  1.1.1.5.2.1     skrll                     ((Length - i) > 16) ? 16 : (Length - i), Header);
    118  1.1.1.5.2.1     skrll                 Header = NULL;
    119  1.1.1.5.2.1     skrll             }
    120      1.1.1.4  christos         }
    121      1.1.1.4  christos 
    122      1.1.1.4  christos         AcpiOsPrintf ("%.02X ", *Buffer);
    123      1.1.1.4  christos         i++;
    124      1.1.1.4  christos         Buffer++;
    125      1.1.1.4  christos         AbsoluteOffset++;
    126      1.1.1.4  christos     }
    127      1.1.1.4  christos 
    128      1.1.1.4  christos     AcpiOsPrintf ("\n");
    129      1.1.1.4  christos }
    130      1.1.1.4  christos 
    131      1.1.1.2    jruoho 
    132          1.1    jruoho /*******************************************************************************
    133          1.1    jruoho  *
    134          1.1    jruoho  * FUNCTION:    AcpiDmDumpRsdp
    135          1.1    jruoho  *
    136          1.1    jruoho  * PARAMETERS:  Table               - A RSDP
    137          1.1    jruoho  *
    138      1.1.1.2    jruoho  * RETURN:      Length of the table (there is not always a length field,
    139      1.1.1.2    jruoho  *              use revision or length if available (ACPI 2.0+))
    140          1.1    jruoho  *
    141          1.1    jruoho  * DESCRIPTION: Format the contents of a RSDP
    142          1.1    jruoho  *
    143          1.1    jruoho  ******************************************************************************/
    144          1.1    jruoho 
    145          1.1    jruoho UINT32
    146          1.1    jruoho AcpiDmDumpRsdp (
    147          1.1    jruoho     ACPI_TABLE_HEADER       *Table)
    148          1.1    jruoho {
    149      1.1.1.2    jruoho     ACPI_TABLE_RSDP         *Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table);
    150      1.1.1.2    jruoho     UINT32                  Length = sizeof (ACPI_RSDP_COMMON);
    151      1.1.1.2    jruoho     UINT8                   Checksum;
    152          1.1    jruoho 
    153          1.1    jruoho 
    154          1.1    jruoho     /* Dump the common ACPI 1.0 portion */
    155          1.1    jruoho 
    156          1.1    jruoho     AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp1);
    157          1.1    jruoho 
    158      1.1.1.2    jruoho     /* Validate the first checksum */
    159          1.1    jruoho 
    160      1.1.1.2    jruoho     Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_RSDP_COMMON),
    161      1.1.1.2    jruoho                 Rsdp->Checksum);
    162      1.1.1.2    jruoho     if (Checksum != Rsdp->Checksum)
    163          1.1    jruoho     {
    164      1.1.1.2    jruoho         AcpiOsPrintf ("/* Incorrect Checksum above, should be 0x%2.2X */\n",
    165      1.1.1.2    jruoho             Checksum);
    166      1.1.1.2    jruoho     }
    167      1.1.1.2    jruoho 
    168      1.1.1.2    jruoho     /* The RSDP for ACPI 2.0+ contains more data and has a Length field */
    169      1.1.1.2    jruoho 
    170      1.1.1.2    jruoho     if (Rsdp->Revision > 0)
    171      1.1.1.2    jruoho     {
    172      1.1.1.2    jruoho         Length = Rsdp->Length;
    173          1.1    jruoho         AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp2);
    174      1.1.1.2    jruoho 
    175      1.1.1.2    jruoho         /* Validate the extended checksum over entire RSDP */
    176      1.1.1.2    jruoho 
    177      1.1.1.2    jruoho         Checksum = AcpiDmGenerateChecksum (Rsdp, sizeof (ACPI_TABLE_RSDP),
    178      1.1.1.2    jruoho                     Rsdp->ExtendedChecksum);
    179      1.1.1.2    jruoho         if (Checksum != Rsdp->ExtendedChecksum)
    180      1.1.1.2    jruoho         {
    181      1.1.1.2    jruoho             AcpiOsPrintf (
    182      1.1.1.2    jruoho                 "/* Incorrect Extended Checksum above, should be 0x%2.2X */\n",
    183      1.1.1.2    jruoho                 Checksum);
    184      1.1.1.2    jruoho         }
    185          1.1    jruoho     }
    186          1.1    jruoho 
    187          1.1    jruoho     return (Length);
    188          1.1    jruoho }
    189          1.1    jruoho 
    190          1.1    jruoho 
    191          1.1    jruoho /*******************************************************************************
    192          1.1    jruoho  *
    193          1.1    jruoho  * FUNCTION:    AcpiDmDumpRsdt
    194          1.1    jruoho  *
    195          1.1    jruoho  * PARAMETERS:  Table               - A RSDT
    196          1.1    jruoho  *
    197          1.1    jruoho  * RETURN:      None
    198          1.1    jruoho  *
    199          1.1    jruoho  * DESCRIPTION: Format the contents of a RSDT
    200          1.1    jruoho  *
    201          1.1    jruoho  ******************************************************************************/
    202          1.1    jruoho 
    203          1.1    jruoho void
    204          1.1    jruoho AcpiDmDumpRsdt (
    205          1.1    jruoho     ACPI_TABLE_HEADER       *Table)
    206          1.1    jruoho {
    207          1.1    jruoho     UINT32                  *Array;
    208          1.1    jruoho     UINT32                  Entries;
    209          1.1    jruoho     UINT32                  Offset;
    210          1.1    jruoho     UINT32                  i;
    211          1.1    jruoho 
    212          1.1    jruoho 
    213          1.1    jruoho     /* Point to start of table pointer array */
    214          1.1    jruoho 
    215          1.1    jruoho     Array = ACPI_CAST_PTR (ACPI_TABLE_RSDT, Table)->TableOffsetEntry;
    216          1.1    jruoho     Offset = sizeof (ACPI_TABLE_HEADER);
    217          1.1    jruoho 
    218          1.1    jruoho     /* RSDT uses 32-bit pointers */
    219          1.1    jruoho 
    220          1.1    jruoho     Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT32);
    221          1.1    jruoho 
    222          1.1    jruoho     for (i = 0; i < Entries; i++)
    223          1.1    jruoho     {
    224          1.1    jruoho         AcpiDmLineHeader2 (Offset, sizeof (UINT32), "ACPI Table Address", i);
    225          1.1    jruoho         AcpiOsPrintf ("%8.8X\n", Array[i]);
    226          1.1    jruoho         Offset += sizeof (UINT32);
    227          1.1    jruoho     }
    228          1.1    jruoho }
    229          1.1    jruoho 
    230          1.1    jruoho 
    231          1.1    jruoho /*******************************************************************************
    232          1.1    jruoho  *
    233          1.1    jruoho  * FUNCTION:    AcpiDmDumpXsdt
    234          1.1    jruoho  *
    235          1.1    jruoho  * PARAMETERS:  Table               - A XSDT
    236          1.1    jruoho  *
    237          1.1    jruoho  * RETURN:      None
    238          1.1    jruoho  *
    239          1.1    jruoho  * DESCRIPTION: Format the contents of a XSDT
    240          1.1    jruoho  *
    241          1.1    jruoho  ******************************************************************************/
    242          1.1    jruoho 
    243          1.1    jruoho void
    244          1.1    jruoho AcpiDmDumpXsdt (
    245          1.1    jruoho     ACPI_TABLE_HEADER       *Table)
    246          1.1    jruoho {
    247          1.1    jruoho     UINT64                  *Array;
    248          1.1    jruoho     UINT32                  Entries;
    249          1.1    jruoho     UINT32                  Offset;
    250          1.1    jruoho     UINT32                  i;
    251          1.1    jruoho 
    252          1.1    jruoho 
    253          1.1    jruoho     /* Point to start of table pointer array */
    254          1.1    jruoho 
    255          1.1    jruoho     Array = ACPI_CAST_PTR (ACPI_TABLE_XSDT, Table)->TableOffsetEntry;
    256          1.1    jruoho     Offset = sizeof (ACPI_TABLE_HEADER);
    257          1.1    jruoho 
    258          1.1    jruoho     /* XSDT uses 64-bit pointers */
    259          1.1    jruoho 
    260          1.1    jruoho     Entries = (Table->Length - sizeof (ACPI_TABLE_HEADER)) / sizeof (UINT64);
    261          1.1    jruoho 
    262          1.1    jruoho     for (i = 0; i < Entries; i++)
    263          1.1    jruoho     {
    264          1.1    jruoho         AcpiDmLineHeader2 (Offset, sizeof (UINT64), "ACPI Table Address", i);
    265          1.1    jruoho         AcpiOsPrintf ("%8.8X%8.8X\n", ACPI_FORMAT_UINT64 (Array[i]));
    266          1.1    jruoho         Offset += sizeof (UINT64);
    267          1.1    jruoho     }
    268          1.1    jruoho }
    269          1.1    jruoho 
    270          1.1    jruoho 
    271          1.1    jruoho /*******************************************************************************
    272          1.1    jruoho  *
    273          1.1    jruoho  * FUNCTION:    AcpiDmDumpFadt
    274          1.1    jruoho  *
    275          1.1    jruoho  * PARAMETERS:  Table               - A FADT
    276          1.1    jruoho  *
    277          1.1    jruoho  * RETURN:      None
    278          1.1    jruoho  *
    279          1.1    jruoho  * DESCRIPTION: Format the contents of a FADT
    280          1.1    jruoho  *
    281      1.1.1.2    jruoho  * NOTE:        We cannot depend on the FADT version to indicate the actual
    282      1.1.1.2    jruoho  *              contents of the FADT because of BIOS bugs. The table length
    283      1.1.1.2    jruoho  *              is the only reliable indicator.
    284      1.1.1.2    jruoho  *
    285          1.1    jruoho  ******************************************************************************/
    286          1.1    jruoho 
    287          1.1    jruoho void
    288          1.1    jruoho AcpiDmDumpFadt (
    289          1.1    jruoho     ACPI_TABLE_HEADER       *Table)
    290          1.1    jruoho {
    291          1.1    jruoho 
    292      1.1.1.2    jruoho     /* Always dump the minimum FADT revision 1 fields (ACPI 1.0) */
    293          1.1    jruoho 
    294          1.1    jruoho     AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt1);
    295          1.1    jruoho 
    296      1.1.1.2    jruoho     /* Check for FADT revision 2 fields (ACPI 1.0B MS extensions) */
    297          1.1    jruoho 
    298      1.1.1.2    jruoho     if ((Table->Length > ACPI_FADT_V1_SIZE) &&
    299      1.1.1.2    jruoho         (Table->Length <= ACPI_FADT_V2_SIZE))
    300          1.1    jruoho     {
    301          1.1    jruoho         AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt2);
    302          1.1    jruoho     }
    303          1.1    jruoho 
    304      1.1.1.4  christos     /* Check for FADT revision 3/4 fields and up (ACPI 2.0+ extended data) */
    305          1.1    jruoho 
    306      1.1.1.2    jruoho     else if (Table->Length > ACPI_FADT_V2_SIZE)
    307          1.1    jruoho     {
    308          1.1    jruoho         AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt3);
    309      1.1.1.4  christos 
    310      1.1.1.4  christos         /* Check for FADT revision 5 fields and up (ACPI 5.0+) */
    311      1.1.1.4  christos 
    312      1.1.1.4  christos         if (Table->Length > ACPI_FADT_V3_SIZE)
    313      1.1.1.4  christos         {
    314      1.1.1.4  christos             AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt5);
    315      1.1.1.4  christos         }
    316          1.1    jruoho     }
    317          1.1    jruoho 
    318          1.1    jruoho     /* Validate various fields in the FADT, including length */
    319          1.1    jruoho 
    320          1.1    jruoho     AcpiTbCreateLocalFadt (Table, Table->Length);
    321      1.1.1.2    jruoho 
    322      1.1.1.2    jruoho     /* Validate FADT length against the revision */
    323      1.1.1.2    jruoho 
    324      1.1.1.2    jruoho     AcpiDmValidateFadtLength (Table->Revision, Table->Length);
    325      1.1.1.2    jruoho }
    326      1.1.1.2    jruoho 
    327      1.1.1.2    jruoho 
    328      1.1.1.2    jruoho /*******************************************************************************
    329      1.1.1.2    jruoho  *
    330      1.1.1.2    jruoho  * FUNCTION:    AcpiDmValidateFadtLength
    331      1.1.1.2    jruoho  *
    332      1.1.1.2    jruoho  * PARAMETERS:  Revision            - FADT revision (Header->Revision)
    333      1.1.1.2    jruoho  *              Length              - FADT length (Header->Length
    334      1.1.1.2    jruoho  *
    335      1.1.1.2    jruoho  * RETURN:      None
    336      1.1.1.2    jruoho  *
    337      1.1.1.2    jruoho  * DESCRIPTION: Check the FADT revision against the expected table length for
    338      1.1.1.2    jruoho  *              that revision. Issue a warning if the length is not what was
    339      1.1.1.2    jruoho  *              expected. This seems to be such a common BIOS bug that the
    340      1.1.1.2    jruoho  *              FADT revision has been rendered virtually meaningless.
    341      1.1.1.2    jruoho  *
    342      1.1.1.2    jruoho  ******************************************************************************/
    343      1.1.1.2    jruoho 
    344      1.1.1.2    jruoho static void
    345      1.1.1.2    jruoho AcpiDmValidateFadtLength (
    346      1.1.1.2    jruoho     UINT32                  Revision,
    347      1.1.1.2    jruoho     UINT32                  Length)
    348      1.1.1.2    jruoho {
    349      1.1.1.2    jruoho     UINT32                  ExpectedLength;
    350      1.1.1.2    jruoho 
    351      1.1.1.2    jruoho 
    352      1.1.1.2    jruoho     switch (Revision)
    353      1.1.1.2    jruoho     {
    354      1.1.1.2    jruoho     case 0:
    355      1.1.1.4  christos 
    356      1.1.1.2    jruoho         AcpiOsPrintf ("// ACPI Warning: Invalid FADT revision: 0\n");
    357      1.1.1.2    jruoho         return;
    358      1.1.1.2    jruoho 
    359      1.1.1.2    jruoho     case 1:
    360      1.1.1.4  christos 
    361      1.1.1.2    jruoho         ExpectedLength = ACPI_FADT_V1_SIZE;
    362      1.1.1.2    jruoho         break;
    363      1.1.1.2    jruoho 
    364      1.1.1.2    jruoho     case 2:
    365      1.1.1.4  christos 
    366      1.1.1.2    jruoho         ExpectedLength = ACPI_FADT_V2_SIZE;
    367      1.1.1.2    jruoho         break;
    368      1.1.1.2    jruoho 
    369      1.1.1.2    jruoho     case 3:
    370      1.1.1.2    jruoho     case 4:
    371      1.1.1.4  christos 
    372      1.1.1.2    jruoho         ExpectedLength = ACPI_FADT_V3_SIZE;
    373      1.1.1.2    jruoho         break;
    374      1.1.1.2    jruoho 
    375      1.1.1.4  christos     case 5:
    376      1.1.1.4  christos 
    377      1.1.1.4  christos         ExpectedLength = ACPI_FADT_V5_SIZE;
    378      1.1.1.4  christos         break;
    379      1.1.1.4  christos 
    380      1.1.1.2    jruoho     default:
    381      1.1.1.4  christos 
    382      1.1.1.2    jruoho         return;
    383      1.1.1.2    jruoho     }
    384      1.1.1.2    jruoho 
    385      1.1.1.2    jruoho     if (Length == ExpectedLength)
    386      1.1.1.2    jruoho     {
    387      1.1.1.2    jruoho         return;
    388      1.1.1.2    jruoho     }
    389      1.1.1.2    jruoho 
    390      1.1.1.2    jruoho     AcpiOsPrintf (
    391      1.1.1.2    jruoho         "\n// ACPI Warning: FADT revision %X does not match length: found %X expected %X\n",
    392      1.1.1.2    jruoho         Revision, Length, ExpectedLength);
    393          1.1    jruoho }
    394          1.1    jruoho 
    395          1.1    jruoho 
    396          1.1    jruoho /*******************************************************************************
    397          1.1    jruoho  *
    398          1.1    jruoho  * FUNCTION:    AcpiDmDumpAsf
    399          1.1    jruoho  *
    400          1.1    jruoho  * PARAMETERS:  Table               - A ASF table
    401          1.1    jruoho  *
    402          1.1    jruoho  * RETURN:      None
    403          1.1    jruoho  *
    404          1.1    jruoho  * DESCRIPTION: Format the contents of a ASF table
    405          1.1    jruoho  *
    406          1.1    jruoho  ******************************************************************************/
    407          1.1    jruoho 
    408          1.1    jruoho void
    409          1.1    jruoho AcpiDmDumpAsf (
    410          1.1    jruoho     ACPI_TABLE_HEADER       *Table)
    411          1.1    jruoho {
    412          1.1    jruoho     ACPI_STATUS             Status;
    413          1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_HEADER);
    414          1.1    jruoho     ACPI_ASF_INFO           *SubTable;
    415          1.1    jruoho     ACPI_DMTABLE_INFO       *InfoTable;
    416          1.1    jruoho     ACPI_DMTABLE_INFO       *DataInfoTable = NULL;
    417          1.1    jruoho     UINT8                   *DataTable = NULL;
    418          1.1    jruoho     UINT32                  DataCount = 0;
    419          1.1    jruoho     UINT32                  DataLength = 0;
    420          1.1    jruoho     UINT32                  DataOffset = 0;
    421          1.1    jruoho     UINT32                  i;
    422          1.1    jruoho     UINT8                   Type;
    423          1.1    jruoho 
    424          1.1    jruoho 
    425      1.1.1.5  christos     /* No main table, only subtables */
    426          1.1    jruoho 
    427          1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset);
    428          1.1    jruoho     while (Offset < Table->Length)
    429          1.1    jruoho     {
    430      1.1.1.5  christos         /* Common subtable header */
    431          1.1    jruoho 
    432          1.1    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
    433          1.1    jruoho                     SubTable->Header.Length, AcpiDmTableInfoAsfHdr);
    434          1.1    jruoho         if (ACPI_FAILURE (Status))
    435          1.1    jruoho         {
    436          1.1    jruoho             return;
    437          1.1    jruoho         }
    438          1.1    jruoho 
    439          1.1    jruoho         /* The actual type is the lower 7 bits of Type */
    440          1.1    jruoho 
    441          1.1    jruoho         Type = (UINT8) (SubTable->Header.Type & 0x7F);
    442          1.1    jruoho 
    443          1.1    jruoho         switch (Type)
    444          1.1    jruoho         {
    445          1.1    jruoho         case ACPI_ASF_TYPE_INFO:
    446      1.1.1.4  christos 
    447          1.1    jruoho             InfoTable = AcpiDmTableInfoAsf0;
    448          1.1    jruoho             break;
    449          1.1    jruoho 
    450          1.1    jruoho         case ACPI_ASF_TYPE_ALERT:
    451      1.1.1.4  christos 
    452          1.1    jruoho             InfoTable = AcpiDmTableInfoAsf1;
    453          1.1    jruoho             DataInfoTable = AcpiDmTableInfoAsf1a;
    454          1.1    jruoho             DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ALERT));
    455          1.1    jruoho             DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->Alerts;
    456          1.1    jruoho             DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, SubTable)->DataLength;
    457          1.1    jruoho             DataOffset = Offset + sizeof (ACPI_ASF_ALERT);
    458          1.1    jruoho             break;
    459          1.1    jruoho 
    460          1.1    jruoho         case ACPI_ASF_TYPE_CONTROL:
    461      1.1.1.4  christos 
    462          1.1    jruoho             InfoTable = AcpiDmTableInfoAsf2;
    463          1.1    jruoho             DataInfoTable = AcpiDmTableInfoAsf2a;
    464          1.1    jruoho             DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_REMOTE));
    465          1.1    jruoho             DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->Controls;
    466          1.1    jruoho             DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, SubTable)->DataLength;
    467          1.1    jruoho             DataOffset = Offset + sizeof (ACPI_ASF_REMOTE);
    468          1.1    jruoho             break;
    469          1.1    jruoho 
    470          1.1    jruoho         case ACPI_ASF_TYPE_BOOT:
    471      1.1.1.4  christos 
    472          1.1    jruoho             InfoTable = AcpiDmTableInfoAsf3;
    473          1.1    jruoho             break;
    474          1.1    jruoho 
    475          1.1    jruoho         case ACPI_ASF_TYPE_ADDRESS:
    476      1.1.1.4  christos 
    477          1.1    jruoho             InfoTable = AcpiDmTableInfoAsf4;
    478          1.1    jruoho             DataTable = ACPI_ADD_PTR (UINT8, SubTable, sizeof (ACPI_ASF_ADDRESS));
    479          1.1    jruoho             DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, SubTable)->Devices;
    480          1.1    jruoho             DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS);
    481          1.1    jruoho             break;
    482          1.1    jruoho 
    483          1.1    jruoho         default:
    484      1.1.1.4  christos 
    485      1.1.1.5  christos             AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n", SubTable->Header.Type);
    486          1.1    jruoho             return;
    487          1.1    jruoho         }
    488          1.1    jruoho 
    489          1.1    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
    490          1.1    jruoho                     SubTable->Header.Length, InfoTable);
    491          1.1    jruoho         if (ACPI_FAILURE (Status))
    492          1.1    jruoho         {
    493          1.1    jruoho             return;
    494          1.1    jruoho         }
    495          1.1    jruoho 
    496          1.1    jruoho         /* Dump variable-length extra data */
    497          1.1    jruoho 
    498          1.1    jruoho         switch (Type)
    499          1.1    jruoho         {
    500          1.1    jruoho         case ACPI_ASF_TYPE_ALERT:
    501          1.1    jruoho         case ACPI_ASF_TYPE_CONTROL:
    502          1.1    jruoho 
    503          1.1    jruoho             for (i = 0; i < DataCount; i++)
    504          1.1    jruoho             {
    505          1.1    jruoho                 AcpiOsPrintf ("\n");
    506          1.1    jruoho                 Status = AcpiDmDumpTable (Table->Length, DataOffset,
    507          1.1    jruoho                             DataTable, DataLength, DataInfoTable);
    508          1.1    jruoho                 if (ACPI_FAILURE (Status))
    509          1.1    jruoho                 {
    510          1.1    jruoho                     return;
    511          1.1    jruoho                 }
    512          1.1    jruoho 
    513          1.1    jruoho                 DataTable = ACPI_ADD_PTR (UINT8, DataTable, DataLength);
    514          1.1    jruoho                 DataOffset += DataLength;
    515          1.1    jruoho             }
    516          1.1    jruoho             break;
    517          1.1    jruoho 
    518          1.1    jruoho         case ACPI_ASF_TYPE_ADDRESS:
    519          1.1    jruoho 
    520          1.1    jruoho             for (i = 0; i < DataLength; i++)
    521          1.1    jruoho             {
    522          1.1    jruoho                 if (!(i % 16))
    523          1.1    jruoho                 {
    524          1.1    jruoho                     AcpiDmLineHeader (DataOffset, 1, "Addresses");
    525          1.1    jruoho                 }
    526          1.1    jruoho 
    527          1.1    jruoho                 AcpiOsPrintf ("%2.2X ", *DataTable);
    528          1.1    jruoho                 DataTable++;
    529          1.1    jruoho                 DataOffset++;
    530          1.1    jruoho                 if (DataOffset > Table->Length)
    531          1.1    jruoho                 {
    532  1.1.1.5.2.1     skrll                     AcpiOsPrintf ("**** ACPI table terminates in the middle of a data structure! (ASF! table)\n");
    533          1.1    jruoho                     return;
    534          1.1    jruoho                 }
    535          1.1    jruoho             }
    536          1.1    jruoho 
    537          1.1    jruoho             AcpiOsPrintf ("\n");
    538          1.1    jruoho             break;
    539          1.1    jruoho 
    540          1.1    jruoho         default:
    541      1.1.1.4  christos 
    542          1.1    jruoho             break;
    543          1.1    jruoho         }
    544          1.1    jruoho 
    545          1.1    jruoho         AcpiOsPrintf ("\n");
    546          1.1    jruoho 
    547      1.1.1.5  christos         /* Point to next subtable */
    548          1.1    jruoho 
    549          1.1    jruoho         if (!SubTable->Header.Length)
    550          1.1    jruoho         {
    551          1.1    jruoho             AcpiOsPrintf ("Invalid zero subtable header length\n");
    552          1.1    jruoho             return;
    553          1.1    jruoho         }
    554          1.1    jruoho 
    555          1.1    jruoho         Offset += SubTable->Header.Length;
    556          1.1    jruoho         SubTable = ACPI_ADD_PTR (ACPI_ASF_INFO, SubTable, SubTable->Header.Length);
    557          1.1    jruoho     }
    558          1.1    jruoho }
    559          1.1    jruoho 
    560          1.1    jruoho 
    561          1.1    jruoho /*******************************************************************************
    562          1.1    jruoho  *
    563          1.1    jruoho  * FUNCTION:    AcpiDmDumpCpep
    564          1.1    jruoho  *
    565          1.1    jruoho  * PARAMETERS:  Table               - A CPEP table
    566          1.1    jruoho  *
    567          1.1    jruoho  * RETURN:      None
    568          1.1    jruoho  *
    569          1.1    jruoho  * DESCRIPTION: Format the contents of a CPEP. This table type consists
    570          1.1    jruoho  *              of an open-ended number of subtables.
    571          1.1    jruoho  *
    572          1.1    jruoho  ******************************************************************************/
    573          1.1    jruoho 
    574          1.1    jruoho void
    575          1.1    jruoho AcpiDmDumpCpep (
    576          1.1    jruoho     ACPI_TABLE_HEADER       *Table)
    577          1.1    jruoho {
    578          1.1    jruoho     ACPI_STATUS             Status;
    579          1.1    jruoho     ACPI_CPEP_POLLING       *SubTable;
    580          1.1    jruoho     UINT32                  Length = Table->Length;
    581          1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_CPEP);
    582          1.1    jruoho 
    583          1.1    jruoho 
    584          1.1    jruoho     /* Main table */
    585          1.1    jruoho 
    586          1.1    jruoho     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoCpep);
    587          1.1    jruoho     if (ACPI_FAILURE (Status))
    588          1.1    jruoho     {
    589          1.1    jruoho         return;
    590          1.1    jruoho     }
    591          1.1    jruoho 
    592      1.1.1.5  christos     /* Subtables */
    593          1.1    jruoho 
    594          1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset);
    595          1.1    jruoho     while (Offset < Table->Length)
    596          1.1    jruoho     {
    597          1.1    jruoho         AcpiOsPrintf ("\n");
    598          1.1    jruoho         Status = AcpiDmDumpTable (Length, Offset, SubTable,
    599          1.1    jruoho                     SubTable->Header.Length, AcpiDmTableInfoCpep0);
    600          1.1    jruoho         if (ACPI_FAILURE (Status))
    601          1.1    jruoho         {
    602          1.1    jruoho             return;
    603          1.1    jruoho         }
    604          1.1    jruoho 
    605      1.1.1.5  christos         /* Point to next subtable */
    606          1.1    jruoho 
    607          1.1    jruoho         Offset += SubTable->Header.Length;
    608          1.1    jruoho         SubTable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, SubTable,
    609          1.1    jruoho                     SubTable->Header.Length);
    610          1.1    jruoho     }
    611          1.1    jruoho }
    612          1.1    jruoho 
    613          1.1    jruoho 
    614          1.1    jruoho /*******************************************************************************
    615          1.1    jruoho  *
    616      1.1.1.4  christos  * FUNCTION:    AcpiDmDumpCsrt
    617      1.1.1.4  christos  *
    618      1.1.1.4  christos  * PARAMETERS:  Table               - A CSRT table
    619      1.1.1.4  christos  *
    620      1.1.1.4  christos  * RETURN:      None
    621      1.1.1.4  christos  *
    622      1.1.1.4  christos  * DESCRIPTION: Format the contents of a CSRT. This table type consists
    623      1.1.1.4  christos  *              of an open-ended number of subtables.
    624      1.1.1.4  christos  *
    625      1.1.1.4  christos  ******************************************************************************/
    626      1.1.1.4  christos 
    627      1.1.1.4  christos void
    628      1.1.1.4  christos AcpiDmDumpCsrt (
    629      1.1.1.4  christos     ACPI_TABLE_HEADER       *Table)
    630      1.1.1.4  christos {
    631      1.1.1.4  christos     ACPI_STATUS             Status;
    632      1.1.1.4  christos     ACPI_CSRT_GROUP         *SubTable;
    633      1.1.1.4  christos     ACPI_CSRT_SHARED_INFO   *SharedInfoTable;
    634      1.1.1.4  christos     ACPI_CSRT_DESCRIPTOR    *SubSubTable;
    635      1.1.1.4  christos     UINT32                  Length = Table->Length;
    636      1.1.1.4  christos     UINT32                  Offset = sizeof (ACPI_TABLE_CSRT);
    637      1.1.1.4  christos     UINT32                  SubOffset;
    638      1.1.1.4  christos     UINT32                  SubSubOffset;
    639      1.1.1.4  christos     UINT32                  InfoLength;
    640      1.1.1.4  christos 
    641      1.1.1.4  christos 
    642      1.1.1.4  christos     /* The main table only contains the ACPI header, thus already handled */
    643      1.1.1.4  christos 
    644      1.1.1.5  christos     /* Subtables (Resource Groups) */
    645      1.1.1.4  christos 
    646      1.1.1.4  christos     SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset);
    647      1.1.1.4  christos     while (Offset < Table->Length)
    648      1.1.1.4  christos     {
    649      1.1.1.4  christos         /* Resource group subtable */
    650      1.1.1.4  christos 
    651      1.1.1.4  christos         AcpiOsPrintf ("\n");
    652      1.1.1.4  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
    653      1.1.1.4  christos                     SubTable->Length, AcpiDmTableInfoCsrt0);
    654      1.1.1.4  christos         if (ACPI_FAILURE (Status))
    655      1.1.1.4  christos         {
    656      1.1.1.4  christos             return;
    657      1.1.1.4  christos         }
    658      1.1.1.4  christos 
    659      1.1.1.4  christos         /* Shared info subtable (One per resource group) */
    660      1.1.1.4  christos 
    661      1.1.1.4  christos         SubOffset = sizeof (ACPI_CSRT_GROUP);
    662      1.1.1.4  christos         SharedInfoTable = ACPI_ADD_PTR (ACPI_CSRT_SHARED_INFO, Table,
    663      1.1.1.4  christos             Offset + SubOffset);
    664      1.1.1.4  christos 
    665      1.1.1.4  christos         AcpiOsPrintf ("\n");
    666      1.1.1.4  christos         Status = AcpiDmDumpTable (Length, Offset + SubOffset, SharedInfoTable,
    667      1.1.1.4  christos                     sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1);
    668      1.1.1.4  christos         if (ACPI_FAILURE (Status))
    669      1.1.1.4  christos         {
    670      1.1.1.4  christos             return;
    671      1.1.1.4  christos         }
    672      1.1.1.4  christos 
    673      1.1.1.4  christos         SubOffset += SubTable->SharedInfoLength;
    674      1.1.1.4  christos 
    675      1.1.1.4  christos         /* Sub-Subtables (Resource Descriptors) */
    676      1.1.1.4  christos 
    677      1.1.1.4  christos         SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table,
    678      1.1.1.4  christos             Offset + SubOffset);
    679      1.1.1.4  christos 
    680      1.1.1.4  christos         while ((SubOffset < SubTable->Length) &&
    681      1.1.1.4  christos               ((Offset + SubOffset) < Table->Length))
    682      1.1.1.4  christos         {
    683      1.1.1.4  christos             AcpiOsPrintf ("\n");
    684      1.1.1.4  christos             Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubTable,
    685      1.1.1.4  christos                         SubSubTable->Length, AcpiDmTableInfoCsrt2);
    686      1.1.1.4  christos             if (ACPI_FAILURE (Status))
    687      1.1.1.4  christos             {
    688      1.1.1.4  christos                 return;
    689      1.1.1.4  christos             }
    690      1.1.1.4  christos 
    691      1.1.1.4  christos             SubSubOffset = sizeof (ACPI_CSRT_DESCRIPTOR);
    692      1.1.1.4  christos 
    693      1.1.1.4  christos             /* Resource-specific info buffer */
    694      1.1.1.4  christos 
    695      1.1.1.4  christos             InfoLength = SubSubTable->Length - SubSubOffset;
    696      1.1.1.4  christos 
    697      1.1.1.4  christos             AcpiDmDumpBuffer (SubSubTable, SubSubOffset, InfoLength,
    698  1.1.1.5.2.1     skrll                 Offset + SubOffset + SubSubOffset, "ResourceInfo", FALSE);
    699      1.1.1.4  christos             SubSubOffset += InfoLength;
    700      1.1.1.4  christos 
    701      1.1.1.4  christos             /* Point to next sub-subtable */
    702      1.1.1.4  christos 
    703      1.1.1.4  christos             SubOffset += SubSubTable->Length;
    704      1.1.1.4  christos             SubSubTable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubTable,
    705      1.1.1.4  christos                         SubSubTable->Length);
    706      1.1.1.4  christos         }
    707      1.1.1.4  christos 
    708      1.1.1.5  christos         /* Point to next subtable */
    709      1.1.1.4  christos 
    710      1.1.1.4  christos         Offset += SubTable->Length;
    711      1.1.1.4  christos         SubTable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, SubTable,
    712      1.1.1.4  christos                     SubTable->Length);
    713      1.1.1.4  christos     }
    714      1.1.1.4  christos }
    715      1.1.1.4  christos 
    716      1.1.1.4  christos 
    717      1.1.1.4  christos /*******************************************************************************
    718      1.1.1.4  christos  *
    719      1.1.1.4  christos  * FUNCTION:    AcpiDmDumpDbg2
    720      1.1.1.4  christos  *
    721      1.1.1.4  christos  * PARAMETERS:  Table               - A DBG2 table
    722      1.1.1.4  christos  *
    723      1.1.1.4  christos  * RETURN:      None
    724      1.1.1.4  christos  *
    725      1.1.1.4  christos  * DESCRIPTION: Format the contents of a DBG2. This table type consists
    726      1.1.1.4  christos  *              of an open-ended number of subtables.
    727      1.1.1.4  christos  *
    728      1.1.1.4  christos  ******************************************************************************/
    729      1.1.1.4  christos 
    730      1.1.1.4  christos void
    731      1.1.1.4  christos AcpiDmDumpDbg2 (
    732      1.1.1.4  christos     ACPI_TABLE_HEADER       *Table)
    733      1.1.1.4  christos {
    734      1.1.1.4  christos     ACPI_STATUS             Status;
    735      1.1.1.4  christos     ACPI_DBG2_DEVICE        *SubTable;
    736      1.1.1.4  christos     UINT32                  Length = Table->Length;
    737      1.1.1.4  christos     UINT32                  Offset = sizeof (ACPI_TABLE_DBG2);
    738      1.1.1.4  christos     UINT32                  i;
    739      1.1.1.4  christos     UINT32                  ArrayOffset;
    740      1.1.1.4  christos     UINT32                  AbsoluteOffset;
    741      1.1.1.4  christos     UINT8                   *Array;
    742      1.1.1.4  christos 
    743      1.1.1.4  christos 
    744      1.1.1.4  christos     /* Main table */
    745      1.1.1.4  christos 
    746      1.1.1.4  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDbg2);
    747      1.1.1.4  christos     if (ACPI_FAILURE (Status))
    748      1.1.1.4  christos     {
    749      1.1.1.4  christos         return;
    750      1.1.1.4  christos     }
    751      1.1.1.4  christos 
    752      1.1.1.5  christos     /* Subtables */
    753      1.1.1.4  christos 
    754      1.1.1.4  christos     SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
    755      1.1.1.4  christos     while (Offset < Table->Length)
    756      1.1.1.4  christos     {
    757      1.1.1.4  christos         AcpiOsPrintf ("\n");
    758      1.1.1.4  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
    759      1.1.1.4  christos                     SubTable->Length, AcpiDmTableInfoDbg2Device);
    760      1.1.1.4  christos         if (ACPI_FAILURE (Status))
    761      1.1.1.4  christos         {
    762      1.1.1.4  christos             return;
    763      1.1.1.4  christos         }
    764      1.1.1.4  christos 
    765      1.1.1.4  christos         /* Dump the BaseAddress array */
    766      1.1.1.4  christos 
    767      1.1.1.4  christos         for (i = 0; i < SubTable->RegisterCount; i++)
    768      1.1.1.4  christos         {
    769      1.1.1.4  christos             ArrayOffset = SubTable->BaseAddressOffset +
    770      1.1.1.4  christos                 (sizeof (ACPI_GENERIC_ADDRESS) * i);
    771      1.1.1.4  christos             AbsoluteOffset = Offset + ArrayOffset;
    772      1.1.1.4  christos             Array = (UINT8 *) SubTable + ArrayOffset;
    773      1.1.1.4  christos 
    774      1.1.1.4  christos             Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
    775      1.1.1.4  christos                         SubTable->Length, AcpiDmTableInfoDbg2Addr);
    776      1.1.1.4  christos             if (ACPI_FAILURE (Status))
    777      1.1.1.4  christos             {
    778      1.1.1.4  christos                 return;
    779      1.1.1.4  christos             }
    780      1.1.1.4  christos         }
    781      1.1.1.4  christos 
    782      1.1.1.4  christos         /* Dump the AddressSize array */
    783      1.1.1.4  christos 
    784      1.1.1.4  christos         for (i = 0; i < SubTable->RegisterCount; i++)
    785      1.1.1.4  christos         {
    786      1.1.1.4  christos             ArrayOffset = SubTable->AddressSizeOffset +
    787      1.1.1.4  christos                 (sizeof (UINT32) * i);
    788      1.1.1.4  christos             AbsoluteOffset = Offset + ArrayOffset;
    789      1.1.1.4  christos             Array = (UINT8 *) SubTable + ArrayOffset;
    790      1.1.1.4  christos 
    791      1.1.1.4  christos             Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
    792      1.1.1.4  christos                         SubTable->Length, AcpiDmTableInfoDbg2Size);
    793      1.1.1.4  christos             if (ACPI_FAILURE (Status))
    794      1.1.1.4  christos             {
    795      1.1.1.4  christos                 return;
    796      1.1.1.4  christos             }
    797      1.1.1.4  christos         }
    798      1.1.1.4  christos 
    799      1.1.1.4  christos         /* Dump the Namestring (required) */
    800      1.1.1.4  christos 
    801      1.1.1.4  christos         AcpiOsPrintf ("\n");
    802      1.1.1.4  christos         ArrayOffset = SubTable->NamepathOffset;
    803      1.1.1.4  christos         AbsoluteOffset = Offset + ArrayOffset;
    804      1.1.1.4  christos         Array = (UINT8 *) SubTable + ArrayOffset;
    805      1.1.1.4  christos 
    806      1.1.1.4  christos         Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
    807      1.1.1.4  christos                     SubTable->Length, AcpiDmTableInfoDbg2Name);
    808      1.1.1.4  christos         if (ACPI_FAILURE (Status))
    809      1.1.1.4  christos         {
    810      1.1.1.4  christos             return;
    811      1.1.1.4  christos         }
    812      1.1.1.4  christos 
    813      1.1.1.4  christos         /* Dump the OemData (optional) */
    814      1.1.1.4  christos 
    815      1.1.1.4  christos         if (SubTable->OemDataOffset)
    816      1.1.1.4  christos         {
    817      1.1.1.4  christos             AcpiDmDumpBuffer (SubTable, SubTable->OemDataOffset, SubTable->OemDataLength,
    818  1.1.1.5.2.1     skrll                 Offset + SubTable->OemDataOffset, "OEM Data", FALSE);
    819      1.1.1.4  christos         }
    820      1.1.1.4  christos 
    821      1.1.1.5  christos         /* Point to next subtable */
    822      1.1.1.4  christos 
    823      1.1.1.4  christos         Offset += SubTable->Length;
    824      1.1.1.4  christos         SubTable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, SubTable,
    825      1.1.1.4  christos                     SubTable->Length);
    826      1.1.1.4  christos     }
    827      1.1.1.4  christos }
    828      1.1.1.4  christos 
    829      1.1.1.4  christos 
    830      1.1.1.4  christos /*******************************************************************************
    831      1.1.1.4  christos  *
    832          1.1    jruoho  * FUNCTION:    AcpiDmDumpDmar
    833          1.1    jruoho  *
    834          1.1    jruoho  * PARAMETERS:  Table               - A DMAR table
    835          1.1    jruoho  *
    836          1.1    jruoho  * RETURN:      None
    837          1.1    jruoho  *
    838          1.1    jruoho  * DESCRIPTION: Format the contents of a DMAR. This table type consists
    839          1.1    jruoho  *              of an open-ended number of subtables.
    840          1.1    jruoho  *
    841          1.1    jruoho  ******************************************************************************/
    842          1.1    jruoho 
    843      1.1.1.4  christos 
    844          1.1    jruoho void
    845          1.1    jruoho AcpiDmDumpDmar (
    846          1.1    jruoho     ACPI_TABLE_HEADER       *Table)
    847          1.1    jruoho {
    848          1.1    jruoho     ACPI_STATUS             Status;
    849          1.1    jruoho     ACPI_DMAR_HEADER        *SubTable;
    850          1.1    jruoho     UINT32                  Length = Table->Length;
    851          1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_DMAR);
    852          1.1    jruoho     ACPI_DMTABLE_INFO       *InfoTable;
    853          1.1    jruoho     ACPI_DMAR_DEVICE_SCOPE  *ScopeTable;
    854          1.1    jruoho     UINT32                  ScopeOffset;
    855          1.1    jruoho     UINT8                   *PciPath;
    856          1.1    jruoho     UINT32                  PathOffset;
    857          1.1    jruoho 
    858          1.1    jruoho 
    859          1.1    jruoho     /* Main table */
    860          1.1    jruoho 
    861          1.1    jruoho     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDmar);
    862          1.1    jruoho     if (ACPI_FAILURE (Status))
    863          1.1    jruoho     {
    864          1.1    jruoho         return;
    865          1.1    jruoho     }
    866          1.1    jruoho 
    867      1.1.1.5  christos     /* Subtables */
    868          1.1    jruoho 
    869          1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset);
    870          1.1    jruoho     while (Offset < Table->Length)
    871          1.1    jruoho     {
    872      1.1.1.5  christos         /* Common subtable header */
    873          1.1    jruoho 
    874          1.1    jruoho         AcpiOsPrintf ("\n");
    875          1.1    jruoho         Status = AcpiDmDumpTable (Length, Offset, SubTable,
    876          1.1    jruoho                     SubTable->Length, AcpiDmTableInfoDmarHdr);
    877          1.1    jruoho         if (ACPI_FAILURE (Status))
    878          1.1    jruoho         {
    879          1.1    jruoho             return;
    880          1.1    jruoho         }
    881      1.1.1.4  christos         AcpiOsPrintf ("\n");
    882          1.1    jruoho 
    883          1.1    jruoho         switch (SubTable->Type)
    884          1.1    jruoho         {
    885          1.1    jruoho         case ACPI_DMAR_TYPE_HARDWARE_UNIT:
    886      1.1.1.4  christos 
    887          1.1    jruoho             InfoTable = AcpiDmTableInfoDmar0;
    888          1.1    jruoho             ScopeOffset = sizeof (ACPI_DMAR_HARDWARE_UNIT);
    889          1.1    jruoho             break;
    890      1.1.1.4  christos 
    891          1.1    jruoho         case ACPI_DMAR_TYPE_RESERVED_MEMORY:
    892      1.1.1.4  christos 
    893          1.1    jruoho             InfoTable = AcpiDmTableInfoDmar1;
    894          1.1    jruoho             ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY);
    895          1.1    jruoho             break;
    896      1.1.1.4  christos 
    897      1.1.1.5  christos         case ACPI_DMAR_TYPE_ROOT_ATS:
    898      1.1.1.4  christos 
    899          1.1    jruoho             InfoTable = AcpiDmTableInfoDmar2;
    900          1.1    jruoho             ScopeOffset = sizeof (ACPI_DMAR_ATSR);
    901          1.1    jruoho             break;
    902      1.1.1.4  christos 
    903      1.1.1.5  christos         case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
    904      1.1.1.4  christos 
    905          1.1    jruoho             InfoTable = AcpiDmTableInfoDmar3;
    906          1.1    jruoho             ScopeOffset = sizeof (ACPI_DMAR_RHSA);
    907          1.1    jruoho             break;
    908      1.1.1.4  christos 
    909      1.1.1.5  christos         case ACPI_DMAR_TYPE_NAMESPACE:
    910      1.1.1.5  christos 
    911      1.1.1.5  christos             InfoTable = AcpiDmTableInfoDmar4;
    912      1.1.1.5  christos             ScopeOffset = sizeof (ACPI_DMAR_ANDD);
    913      1.1.1.5  christos             break;
    914      1.1.1.5  christos 
    915          1.1    jruoho         default:
    916      1.1.1.4  christos 
    917      1.1.1.5  christos             AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n", SubTable->Type);
    918          1.1    jruoho             return;
    919          1.1    jruoho         }
    920          1.1    jruoho 
    921          1.1    jruoho         Status = AcpiDmDumpTable (Length, Offset, SubTable,
    922          1.1    jruoho                     SubTable->Length, InfoTable);
    923          1.1    jruoho         if (ACPI_FAILURE (Status))
    924          1.1    jruoho         {
    925          1.1    jruoho             return;
    926          1.1    jruoho         }
    927          1.1    jruoho 
    928      1.1.1.5  christos         /*
    929      1.1.1.5  christos          * Dump the optional device scope entries
    930      1.1.1.5  christos          */
    931      1.1.1.5  christos         if ((SubTable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
    932      1.1.1.5  christos             (SubTable->Type == ACPI_DMAR_TYPE_NAMESPACE))
    933      1.1.1.5  christos         {
    934      1.1.1.5  christos             /* These types do not support device scopes */
    935      1.1.1.5  christos 
    936      1.1.1.5  christos             goto NextSubtable;
    937      1.1.1.5  christos         }
    938          1.1    jruoho 
    939          1.1    jruoho         ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, SubTable, ScopeOffset);
    940          1.1    jruoho         while (ScopeOffset < SubTable->Length)
    941          1.1    jruoho         {
    942          1.1    jruoho             AcpiOsPrintf ("\n");
    943          1.1    jruoho             Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable,
    944          1.1    jruoho                         ScopeTable->Length, AcpiDmTableInfoDmarScope);
    945          1.1    jruoho             if (ACPI_FAILURE (Status))
    946          1.1    jruoho             {
    947          1.1    jruoho                 return;
    948          1.1    jruoho             }
    949      1.1.1.4  christos             AcpiOsPrintf ("\n");
    950          1.1    jruoho 
    951          1.1    jruoho             /* Dump the PCI Path entries for this device scope */
    952          1.1    jruoho 
    953          1.1    jruoho             PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */
    954          1.1    jruoho 
    955          1.1    jruoho             PciPath = ACPI_ADD_PTR (UINT8, ScopeTable,
    956          1.1    jruoho                 sizeof (ACPI_DMAR_DEVICE_SCOPE));
    957          1.1    jruoho 
    958          1.1    jruoho             while (PathOffset < ScopeTable->Length)
    959          1.1    jruoho             {
    960          1.1    jruoho                 AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2, "PCI Path");
    961      1.1.1.2    jruoho                 AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath[0], PciPath[1]);
    962          1.1    jruoho 
    963          1.1    jruoho                 /* Point to next PCI Path entry */
    964          1.1    jruoho 
    965          1.1    jruoho                 PathOffset += 2;
    966          1.1    jruoho                 PciPath += 2;
    967      1.1.1.4  christos                 AcpiOsPrintf ("\n");
    968          1.1    jruoho             }
    969          1.1    jruoho 
    970          1.1    jruoho             /* Point to next device scope entry */
    971          1.1    jruoho 
    972          1.1    jruoho             ScopeOffset += ScopeTable->Length;
    973          1.1    jruoho             ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE,
    974          1.1    jruoho                 ScopeTable, ScopeTable->Length);
    975          1.1    jruoho         }
    976          1.1    jruoho 
    977      1.1.1.5  christos NextSubtable:
    978      1.1.1.5  christos         /* Point to next subtable */
    979          1.1    jruoho 
    980          1.1    jruoho         Offset += SubTable->Length;
    981          1.1    jruoho         SubTable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, SubTable, SubTable->Length);
    982          1.1    jruoho     }
    983          1.1    jruoho }
    984          1.1    jruoho 
    985          1.1    jruoho 
    986          1.1    jruoho /*******************************************************************************
    987          1.1    jruoho  *
    988          1.1    jruoho  * FUNCTION:    AcpiDmDumpEinj
    989          1.1    jruoho  *
    990          1.1    jruoho  * PARAMETERS:  Table               - A EINJ table
    991          1.1    jruoho  *
    992          1.1    jruoho  * RETURN:      None
    993          1.1    jruoho  *
    994          1.1    jruoho  * DESCRIPTION: Format the contents of a EINJ. This table type consists
    995          1.1    jruoho  *              of an open-ended number of subtables.
    996          1.1    jruoho  *
    997          1.1    jruoho  ******************************************************************************/
    998          1.1    jruoho 
    999          1.1    jruoho void
   1000          1.1    jruoho AcpiDmDumpEinj (
   1001          1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   1002          1.1    jruoho {
   1003          1.1    jruoho     ACPI_STATUS             Status;
   1004          1.1    jruoho     ACPI_WHEA_HEADER        *SubTable;
   1005          1.1    jruoho     UINT32                  Length = Table->Length;
   1006          1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_EINJ);
   1007          1.1    jruoho 
   1008          1.1    jruoho 
   1009          1.1    jruoho     /* Main table */
   1010          1.1    jruoho 
   1011          1.1    jruoho     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoEinj);
   1012          1.1    jruoho     if (ACPI_FAILURE (Status))
   1013          1.1    jruoho     {
   1014          1.1    jruoho         return;
   1015          1.1    jruoho     }
   1016          1.1    jruoho 
   1017      1.1.1.5  christos     /* Subtables */
   1018          1.1    jruoho 
   1019          1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
   1020          1.1    jruoho     while (Offset < Table->Length)
   1021          1.1    jruoho     {
   1022          1.1    jruoho         AcpiOsPrintf ("\n");
   1023          1.1    jruoho         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   1024          1.1    jruoho                     sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
   1025          1.1    jruoho         if (ACPI_FAILURE (Status))
   1026          1.1    jruoho         {
   1027          1.1    jruoho             return;
   1028          1.1    jruoho         }
   1029          1.1    jruoho 
   1030      1.1.1.5  christos         /* Point to next subtable (each subtable is of fixed length) */
   1031          1.1    jruoho 
   1032          1.1    jruoho         Offset += sizeof (ACPI_WHEA_HEADER);
   1033          1.1    jruoho         SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
   1034          1.1    jruoho                         sizeof (ACPI_WHEA_HEADER));
   1035          1.1    jruoho     }
   1036          1.1    jruoho }
   1037          1.1    jruoho 
   1038          1.1    jruoho 
   1039          1.1    jruoho /*******************************************************************************
   1040          1.1    jruoho  *
   1041          1.1    jruoho  * FUNCTION:    AcpiDmDumpErst
   1042          1.1    jruoho  *
   1043          1.1    jruoho  * PARAMETERS:  Table               - A ERST table
   1044          1.1    jruoho  *
   1045          1.1    jruoho  * RETURN:      None
   1046          1.1    jruoho  *
   1047          1.1    jruoho  * DESCRIPTION: Format the contents of a ERST. This table type consists
   1048          1.1    jruoho  *              of an open-ended number of subtables.
   1049          1.1    jruoho  *
   1050          1.1    jruoho  ******************************************************************************/
   1051          1.1    jruoho 
   1052          1.1    jruoho void
   1053          1.1    jruoho AcpiDmDumpErst (
   1054          1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   1055          1.1    jruoho {
   1056          1.1    jruoho     ACPI_STATUS             Status;
   1057          1.1    jruoho     ACPI_WHEA_HEADER        *SubTable;
   1058          1.1    jruoho     UINT32                  Length = Table->Length;
   1059          1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_ERST);
   1060          1.1    jruoho 
   1061          1.1    jruoho 
   1062          1.1    jruoho     /* Main table */
   1063          1.1    jruoho 
   1064          1.1    jruoho     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoErst);
   1065          1.1    jruoho     if (ACPI_FAILURE (Status))
   1066          1.1    jruoho     {
   1067          1.1    jruoho         return;
   1068          1.1    jruoho     }
   1069          1.1    jruoho 
   1070      1.1.1.5  christos     /* Subtables */
   1071          1.1    jruoho 
   1072          1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
   1073          1.1    jruoho     while (Offset < Table->Length)
   1074          1.1    jruoho     {
   1075          1.1    jruoho         AcpiOsPrintf ("\n");
   1076          1.1    jruoho         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   1077      1.1.1.2    jruoho                     sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0);
   1078          1.1    jruoho         if (ACPI_FAILURE (Status))
   1079          1.1    jruoho         {
   1080          1.1    jruoho             return;
   1081          1.1    jruoho         }
   1082          1.1    jruoho 
   1083      1.1.1.5  christos         /* Point to next subtable (each subtable is of fixed length) */
   1084          1.1    jruoho 
   1085          1.1    jruoho         Offset += sizeof (ACPI_WHEA_HEADER);
   1086          1.1    jruoho         SubTable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, SubTable,
   1087          1.1    jruoho                         sizeof (ACPI_WHEA_HEADER));
   1088          1.1    jruoho     }
   1089          1.1    jruoho }
   1090          1.1    jruoho 
   1091          1.1    jruoho 
   1092          1.1    jruoho /*******************************************************************************
   1093          1.1    jruoho  *
   1094      1.1.1.4  christos  * FUNCTION:    AcpiDmDumpFpdt
   1095          1.1    jruoho  *
   1096      1.1.1.4  christos  * PARAMETERS:  Table               - A FPDT table
   1097          1.1    jruoho  *
   1098          1.1    jruoho  * RETURN:      None
   1099          1.1    jruoho  *
   1100      1.1.1.4  christos  * DESCRIPTION: Format the contents of a FPDT. This table type consists
   1101          1.1    jruoho  *              of an open-ended number of subtables.
   1102          1.1    jruoho  *
   1103          1.1    jruoho  ******************************************************************************/
   1104          1.1    jruoho 
   1105          1.1    jruoho void
   1106      1.1.1.4  christos AcpiDmDumpFpdt (
   1107          1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   1108          1.1    jruoho {
   1109          1.1    jruoho     ACPI_STATUS             Status;
   1110      1.1.1.4  christos     ACPI_FPDT_HEADER        *SubTable;
   1111          1.1    jruoho     UINT32                  Length = Table->Length;
   1112      1.1.1.4  christos     UINT32                  Offset = sizeof (ACPI_TABLE_FPDT);
   1113          1.1    jruoho     ACPI_DMTABLE_INFO       *InfoTable;
   1114          1.1    jruoho 
   1115          1.1    jruoho 
   1116      1.1.1.4  christos     /* There is no main table (other than the standard ACPI header) */
   1117          1.1    jruoho 
   1118      1.1.1.5  christos     /* Subtables */
   1119          1.1    jruoho 
   1120      1.1.1.4  christos     SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset);
   1121          1.1    jruoho     while (Offset < Table->Length)
   1122          1.1    jruoho     {
   1123      1.1.1.5  christos         /* Common subtable header */
   1124      1.1.1.4  christos 
   1125      1.1.1.4  christos         AcpiOsPrintf ("\n");
   1126      1.1.1.4  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   1127      1.1.1.4  christos                     SubTable->Length, AcpiDmTableInfoFpdtHdr);
   1128      1.1.1.4  christos         if (ACPI_FAILURE (Status))
   1129      1.1.1.4  christos         {
   1130      1.1.1.4  christos             return;
   1131      1.1.1.4  christos         }
   1132      1.1.1.4  christos 
   1133          1.1    jruoho         switch (SubTable->Type)
   1134          1.1    jruoho         {
   1135      1.1.1.4  christos         case ACPI_FPDT_TYPE_BOOT:
   1136          1.1    jruoho 
   1137      1.1.1.4  christos             InfoTable = AcpiDmTableInfoFpdt0;
   1138          1.1    jruoho             break;
   1139          1.1    jruoho 
   1140      1.1.1.4  christos         case ACPI_FPDT_TYPE_S3PERF:
   1141          1.1    jruoho 
   1142      1.1.1.4  christos             InfoTable = AcpiDmTableInfoFpdt1;
   1143          1.1    jruoho             break;
   1144          1.1    jruoho 
   1145      1.1.1.4  christos         default:
   1146          1.1    jruoho 
   1147      1.1.1.5  christos             AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n", SubTable->Type);
   1148          1.1    jruoho 
   1149      1.1.1.4  christos             /* Attempt to continue */
   1150      1.1.1.4  christos 
   1151      1.1.1.4  christos             if (!SubTable->Length)
   1152      1.1.1.4  christos             {
   1153      1.1.1.4  christos                 AcpiOsPrintf ("Invalid zero length subtable\n");
   1154      1.1.1.4  christos                 return;
   1155      1.1.1.4  christos             }
   1156      1.1.1.4  christos             goto NextSubTable;
   1157      1.1.1.4  christos         }
   1158      1.1.1.4  christos 
   1159      1.1.1.4  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   1160      1.1.1.4  christos                     SubTable->Length, InfoTable);
   1161      1.1.1.4  christos         if (ACPI_FAILURE (Status))
   1162      1.1.1.4  christos         {
   1163      1.1.1.4  christos             return;
   1164      1.1.1.4  christos         }
   1165      1.1.1.4  christos 
   1166      1.1.1.4  christos NextSubTable:
   1167      1.1.1.5  christos         /* Point to next subtable */
   1168      1.1.1.4  christos 
   1169      1.1.1.4  christos         Offset += SubTable->Length;
   1170      1.1.1.4  christos         SubTable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, SubTable, SubTable->Length);
   1171      1.1.1.4  christos     }
   1172      1.1.1.4  christos }
   1173      1.1.1.4  christos 
   1174      1.1.1.4  christos 
   1175      1.1.1.4  christos /*******************************************************************************
   1176      1.1.1.4  christos  *
   1177      1.1.1.5  christos  * FUNCTION:    AcpiDmDumpGtdt
   1178      1.1.1.5  christos  *
   1179      1.1.1.5  christos  * PARAMETERS:  Table               - A GTDT table
   1180      1.1.1.5  christos  *
   1181      1.1.1.5  christos  * RETURN:      None
   1182      1.1.1.5  christos  *
   1183      1.1.1.5  christos  * DESCRIPTION: Format the contents of a GTDT. This table type consists
   1184      1.1.1.5  christos  *              of an open-ended number of subtables.
   1185      1.1.1.5  christos  *
   1186      1.1.1.5  christos  ******************************************************************************/
   1187      1.1.1.5  christos 
   1188      1.1.1.5  christos void
   1189      1.1.1.5  christos AcpiDmDumpGtdt (
   1190      1.1.1.5  christos     ACPI_TABLE_HEADER       *Table)
   1191      1.1.1.5  christos {
   1192      1.1.1.5  christos     ACPI_STATUS             Status;
   1193      1.1.1.5  christos     ACPI_GTDT_HEADER        *SubTable;
   1194      1.1.1.5  christos     UINT32                  Length = Table->Length;
   1195      1.1.1.5  christos     UINT32                  Offset = sizeof (ACPI_TABLE_GTDT);
   1196      1.1.1.5  christos     ACPI_DMTABLE_INFO       *InfoTable;
   1197      1.1.1.5  christos     UINT32                  SubTableLength;
   1198      1.1.1.5  christos     UINT32                  GtCount;
   1199      1.1.1.5  christos     ACPI_GTDT_TIMER_ENTRY   *GtxTable;
   1200      1.1.1.5  christos 
   1201      1.1.1.5  christos 
   1202      1.1.1.5  christos     /* Main table */
   1203      1.1.1.5  christos 
   1204      1.1.1.5  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoGtdt);
   1205      1.1.1.5  christos     if (ACPI_FAILURE (Status))
   1206      1.1.1.5  christos     {
   1207      1.1.1.5  christos         return;
   1208      1.1.1.5  christos     }
   1209      1.1.1.5  christos 
   1210      1.1.1.5  christos     /* Subtables */
   1211      1.1.1.5  christos 
   1212      1.1.1.5  christos     SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
   1213      1.1.1.5  christos     while (Offset < Table->Length)
   1214      1.1.1.5  christos     {
   1215      1.1.1.5  christos         /* Common subtable header */
   1216      1.1.1.5  christos 
   1217      1.1.1.5  christos         AcpiOsPrintf ("\n");
   1218      1.1.1.5  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   1219      1.1.1.5  christos                     SubTable->Length, AcpiDmTableInfoGtdtHdr);
   1220      1.1.1.5  christos         if (ACPI_FAILURE (Status))
   1221      1.1.1.5  christos         {
   1222      1.1.1.5  christos             return;
   1223      1.1.1.5  christos         }
   1224      1.1.1.5  christos 
   1225      1.1.1.5  christos         GtCount = 0;
   1226      1.1.1.5  christos         switch (SubTable->Type)
   1227      1.1.1.5  christos         {
   1228      1.1.1.5  christos         case ACPI_GTDT_TYPE_TIMER_BLOCK:
   1229      1.1.1.5  christos 
   1230      1.1.1.5  christos             SubTableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
   1231      1.1.1.5  christos             GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
   1232      1.1.1.5  christos                         SubTable))->TimerCount;
   1233      1.1.1.5  christos 
   1234      1.1.1.5  christos             InfoTable = AcpiDmTableInfoGtdt0;
   1235      1.1.1.5  christos             break;
   1236      1.1.1.5  christos 
   1237      1.1.1.5  christos         case ACPI_GTDT_TYPE_WATCHDOG:
   1238      1.1.1.5  christos 
   1239      1.1.1.5  christos             SubTableLength = sizeof (ACPI_GTDT_WATCHDOG);
   1240      1.1.1.5  christos 
   1241      1.1.1.5  christos             InfoTable = AcpiDmTableInfoGtdt1;
   1242      1.1.1.5  christos             break;
   1243      1.1.1.5  christos 
   1244      1.1.1.5  christos         default:
   1245      1.1.1.5  christos 
   1246      1.1.1.5  christos             /* Cannot continue on unknown type - no length */
   1247      1.1.1.5  christos 
   1248      1.1.1.5  christos             AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n", SubTable->Type);
   1249      1.1.1.5  christos             return;
   1250      1.1.1.5  christos         }
   1251      1.1.1.5  christos 
   1252      1.1.1.5  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   1253      1.1.1.5  christos                     SubTable->Length, InfoTable);
   1254      1.1.1.5  christos         if (ACPI_FAILURE (Status))
   1255      1.1.1.5  christos         {
   1256      1.1.1.5  christos             return;
   1257      1.1.1.5  christos         }
   1258      1.1.1.5  christos 
   1259      1.1.1.5  christos         /* Point to end of current subtable (each subtable above is of fixed length) */
   1260      1.1.1.5  christos 
   1261      1.1.1.5  christos         Offset += SubTableLength;
   1262      1.1.1.5  christos 
   1263      1.1.1.5  christos         /* If there are any Gt Timer Blocks from above, dump them now */
   1264      1.1.1.5  christos 
   1265      1.1.1.5  christos         if (GtCount)
   1266      1.1.1.5  christos         {
   1267      1.1.1.5  christos             GtxTable = ACPI_ADD_PTR (ACPI_GTDT_TIMER_ENTRY, SubTable, SubTableLength);
   1268      1.1.1.5  christos             SubTableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY);
   1269      1.1.1.5  christos 
   1270      1.1.1.5  christos             while (GtCount)
   1271      1.1.1.5  christos             {
   1272      1.1.1.5  christos                 AcpiOsPrintf ("\n");
   1273      1.1.1.5  christos                 Status = AcpiDmDumpTable (Length, Offset, GtxTable,
   1274      1.1.1.5  christos                             sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a);
   1275      1.1.1.5  christos                 if (ACPI_FAILURE (Status))
   1276      1.1.1.5  christos                 {
   1277      1.1.1.5  christos                     return;
   1278      1.1.1.5  christos                 }
   1279      1.1.1.5  christos                 Offset += sizeof (ACPI_GTDT_TIMER_ENTRY);
   1280      1.1.1.5  christos                 GtxTable++;
   1281      1.1.1.5  christos                 GtCount--;
   1282      1.1.1.5  christos             }
   1283      1.1.1.5  christos         }
   1284      1.1.1.5  christos 
   1285      1.1.1.5  christos         /* Point to next subtable */
   1286      1.1.1.5  christos 
   1287      1.1.1.5  christos         SubTable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, SubTable, SubTableLength);
   1288      1.1.1.5  christos     }
   1289      1.1.1.5  christos }
   1290      1.1.1.5  christos 
   1291      1.1.1.5  christos 
   1292      1.1.1.5  christos /*******************************************************************************
   1293      1.1.1.5  christos  *
   1294      1.1.1.4  christos  * FUNCTION:    AcpiDmDumpHest
   1295      1.1.1.4  christos  *
   1296      1.1.1.4  christos  * PARAMETERS:  Table               - A HEST table
   1297      1.1.1.4  christos  *
   1298      1.1.1.4  christos  * RETURN:      None
   1299      1.1.1.4  christos  *
   1300      1.1.1.4  christos  * DESCRIPTION: Format the contents of a HEST. This table type consists
   1301      1.1.1.4  christos  *              of an open-ended number of subtables.
   1302      1.1.1.4  christos  *
   1303      1.1.1.4  christos  ******************************************************************************/
   1304      1.1.1.4  christos 
   1305      1.1.1.4  christos void
   1306      1.1.1.4  christos AcpiDmDumpHest (
   1307      1.1.1.4  christos     ACPI_TABLE_HEADER       *Table)
   1308      1.1.1.4  christos {
   1309      1.1.1.4  christos     ACPI_STATUS             Status;
   1310      1.1.1.4  christos     ACPI_HEST_HEADER        *SubTable;
   1311      1.1.1.4  christos     UINT32                  Length = Table->Length;
   1312      1.1.1.4  christos     UINT32                  Offset = sizeof (ACPI_TABLE_HEST);
   1313      1.1.1.4  christos     ACPI_DMTABLE_INFO       *InfoTable;
   1314      1.1.1.4  christos     UINT32                  SubTableLength;
   1315      1.1.1.4  christos     UINT32                  BankCount;
   1316      1.1.1.4  christos     ACPI_HEST_IA_ERROR_BANK *BankTable;
   1317      1.1.1.4  christos 
   1318      1.1.1.4  christos 
   1319      1.1.1.4  christos     /* Main table */
   1320      1.1.1.4  christos 
   1321      1.1.1.4  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHest);
   1322      1.1.1.4  christos     if (ACPI_FAILURE (Status))
   1323      1.1.1.4  christos     {
   1324      1.1.1.4  christos         return;
   1325      1.1.1.4  christos     }
   1326      1.1.1.4  christos 
   1327      1.1.1.5  christos     /* Subtables */
   1328      1.1.1.4  christos 
   1329      1.1.1.4  christos     SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
   1330      1.1.1.4  christos     while (Offset < Table->Length)
   1331      1.1.1.4  christos     {
   1332      1.1.1.4  christos         BankCount = 0;
   1333      1.1.1.4  christos         switch (SubTable->Type)
   1334      1.1.1.4  christos         {
   1335      1.1.1.4  christos         case ACPI_HEST_TYPE_IA32_CHECK:
   1336      1.1.1.4  christos 
   1337      1.1.1.4  christos             InfoTable = AcpiDmTableInfoHest0;
   1338      1.1.1.4  christos             SubTableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK);
   1339      1.1.1.4  christos             BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
   1340      1.1.1.4  christos                             SubTable))->NumHardwareBanks;
   1341      1.1.1.4  christos             break;
   1342      1.1.1.4  christos 
   1343      1.1.1.4  christos         case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
   1344      1.1.1.4  christos 
   1345      1.1.1.4  christos             InfoTable = AcpiDmTableInfoHest1;
   1346      1.1.1.4  christos             SubTableLength = sizeof (ACPI_HEST_IA_CORRECTED);
   1347      1.1.1.4  christos             BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
   1348      1.1.1.4  christos                             SubTable))->NumHardwareBanks;
   1349      1.1.1.4  christos             break;
   1350      1.1.1.4  christos 
   1351      1.1.1.4  christos         case ACPI_HEST_TYPE_IA32_NMI:
   1352      1.1.1.4  christos 
   1353      1.1.1.4  christos             InfoTable = AcpiDmTableInfoHest2;
   1354      1.1.1.4  christos             SubTableLength = sizeof (ACPI_HEST_IA_NMI);
   1355      1.1.1.4  christos             break;
   1356      1.1.1.4  christos 
   1357      1.1.1.4  christos         case ACPI_HEST_TYPE_AER_ROOT_PORT:
   1358      1.1.1.4  christos 
   1359      1.1.1.4  christos             InfoTable = AcpiDmTableInfoHest6;
   1360      1.1.1.4  christos             SubTableLength = sizeof (ACPI_HEST_AER_ROOT);
   1361      1.1.1.4  christos             break;
   1362      1.1.1.4  christos 
   1363      1.1.1.4  christos         case ACPI_HEST_TYPE_AER_ENDPOINT:
   1364      1.1.1.4  christos 
   1365      1.1.1.4  christos             InfoTable = AcpiDmTableInfoHest7;
   1366      1.1.1.4  christos             SubTableLength = sizeof (ACPI_HEST_AER);
   1367      1.1.1.4  christos             break;
   1368      1.1.1.4  christos 
   1369      1.1.1.4  christos         case ACPI_HEST_TYPE_AER_BRIDGE:
   1370      1.1.1.4  christos 
   1371      1.1.1.4  christos             InfoTable = AcpiDmTableInfoHest8;
   1372      1.1.1.4  christos             SubTableLength = sizeof (ACPI_HEST_AER_BRIDGE);
   1373      1.1.1.4  christos             break;
   1374      1.1.1.4  christos 
   1375      1.1.1.4  christos         case ACPI_HEST_TYPE_GENERIC_ERROR:
   1376      1.1.1.4  christos 
   1377      1.1.1.4  christos             InfoTable = AcpiDmTableInfoHest9;
   1378      1.1.1.4  christos             SubTableLength = sizeof (ACPI_HEST_GENERIC);
   1379      1.1.1.4  christos             break;
   1380          1.1    jruoho 
   1381          1.1    jruoho         default:
   1382      1.1.1.4  christos 
   1383          1.1    jruoho             /* Cannot continue on unknown type - no length */
   1384          1.1    jruoho 
   1385      1.1.1.5  christos             AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n", SubTable->Type);
   1386          1.1    jruoho             return;
   1387          1.1    jruoho         }
   1388          1.1    jruoho 
   1389          1.1    jruoho         AcpiOsPrintf ("\n");
   1390          1.1    jruoho         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   1391          1.1    jruoho                     SubTableLength, InfoTable);
   1392          1.1    jruoho         if (ACPI_FAILURE (Status))
   1393          1.1    jruoho         {
   1394          1.1    jruoho             return;
   1395          1.1    jruoho         }
   1396          1.1    jruoho 
   1397          1.1    jruoho         /* Point to end of current subtable (each subtable above is of fixed length) */
   1398          1.1    jruoho 
   1399          1.1    jruoho         Offset += SubTableLength;
   1400          1.1    jruoho 
   1401          1.1    jruoho         /* If there are any (fixed-length) Error Banks from above, dump them now */
   1402          1.1    jruoho 
   1403          1.1    jruoho         if (BankCount)
   1404          1.1    jruoho         {
   1405          1.1    jruoho             BankTable = ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK, SubTable, SubTableLength);
   1406          1.1    jruoho             SubTableLength += BankCount * sizeof (ACPI_HEST_IA_ERROR_BANK);
   1407          1.1    jruoho 
   1408          1.1    jruoho             while (BankCount)
   1409          1.1    jruoho             {
   1410          1.1    jruoho                 AcpiOsPrintf ("\n");
   1411          1.1    jruoho                 Status = AcpiDmDumpTable (Length, Offset, BankTable,
   1412          1.1    jruoho                             sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank);
   1413          1.1    jruoho                 if (ACPI_FAILURE (Status))
   1414          1.1    jruoho                 {
   1415          1.1    jruoho                     return;
   1416          1.1    jruoho                 }
   1417          1.1    jruoho                 Offset += sizeof (ACPI_HEST_IA_ERROR_BANK);
   1418          1.1    jruoho                 BankTable++;
   1419          1.1    jruoho                 BankCount--;
   1420          1.1    jruoho             }
   1421          1.1    jruoho         }
   1422          1.1    jruoho 
   1423      1.1.1.5  christos         /* Point to next subtable */
   1424          1.1    jruoho 
   1425          1.1    jruoho         SubTable = ACPI_ADD_PTR (ACPI_HEST_HEADER, SubTable, SubTableLength);
   1426          1.1    jruoho     }
   1427          1.1    jruoho }
   1428          1.1    jruoho 
   1429          1.1    jruoho 
   1430          1.1    jruoho /*******************************************************************************
   1431          1.1    jruoho  *
   1432          1.1    jruoho  * FUNCTION:    AcpiDmDumpIvrs
   1433          1.1    jruoho  *
   1434          1.1    jruoho  * PARAMETERS:  Table               - A IVRS table
   1435          1.1    jruoho  *
   1436          1.1    jruoho  * RETURN:      None
   1437          1.1    jruoho  *
   1438          1.1    jruoho  * DESCRIPTION: Format the contents of a IVRS
   1439          1.1    jruoho  *
   1440          1.1    jruoho  ******************************************************************************/
   1441          1.1    jruoho 
   1442          1.1    jruoho static UINT8 EntrySizes[] = {4,8,16,32};
   1443          1.1    jruoho 
   1444          1.1    jruoho void
   1445          1.1    jruoho AcpiDmDumpIvrs (
   1446          1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   1447          1.1    jruoho {
   1448          1.1    jruoho     ACPI_STATUS             Status;
   1449          1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_IVRS);
   1450          1.1    jruoho     UINT32                  EntryOffset;
   1451          1.1    jruoho     UINT32                  EntryLength;
   1452          1.1    jruoho     UINT32                  EntryType;
   1453          1.1    jruoho     ACPI_IVRS_DE_HEADER     *DeviceEntry;
   1454          1.1    jruoho     ACPI_IVRS_HEADER        *SubTable;
   1455          1.1    jruoho     ACPI_DMTABLE_INFO       *InfoTable;
   1456          1.1    jruoho 
   1457          1.1    jruoho 
   1458          1.1    jruoho     /* Main table */
   1459          1.1    jruoho 
   1460          1.1    jruoho     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIvrs);
   1461          1.1    jruoho     if (ACPI_FAILURE (Status))
   1462          1.1    jruoho     {
   1463          1.1    jruoho         return;
   1464          1.1    jruoho     }
   1465          1.1    jruoho 
   1466      1.1.1.5  christos     /* Subtables */
   1467          1.1    jruoho 
   1468          1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset);
   1469          1.1    jruoho     while (Offset < Table->Length)
   1470          1.1    jruoho     {
   1471      1.1.1.5  christos         /* Common subtable header */
   1472          1.1    jruoho 
   1473          1.1    jruoho         AcpiOsPrintf ("\n");
   1474          1.1    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   1475          1.1    jruoho                     SubTable->Length, AcpiDmTableInfoIvrsHdr);
   1476          1.1    jruoho         if (ACPI_FAILURE (Status))
   1477          1.1    jruoho         {
   1478          1.1    jruoho             return;
   1479          1.1    jruoho         }
   1480          1.1    jruoho 
   1481          1.1    jruoho         switch (SubTable->Type)
   1482          1.1    jruoho         {
   1483          1.1    jruoho         case ACPI_IVRS_TYPE_HARDWARE:
   1484      1.1.1.4  christos 
   1485          1.1    jruoho             InfoTable = AcpiDmTableInfoIvrs0;
   1486          1.1    jruoho             break;
   1487      1.1.1.4  christos 
   1488          1.1    jruoho         case ACPI_IVRS_TYPE_MEMORY1:
   1489          1.1    jruoho         case ACPI_IVRS_TYPE_MEMORY2:
   1490          1.1    jruoho         case ACPI_IVRS_TYPE_MEMORY3:
   1491      1.1.1.4  christos 
   1492          1.1    jruoho             InfoTable = AcpiDmTableInfoIvrs1;
   1493          1.1    jruoho             break;
   1494      1.1.1.4  christos 
   1495          1.1    jruoho         default:
   1496      1.1.1.4  christos 
   1497      1.1.1.5  christos             AcpiOsPrintf ("\n**** Unknown IVRS subtable type 0x%X\n",
   1498          1.1    jruoho                 SubTable->Type);
   1499          1.1    jruoho 
   1500          1.1    jruoho             /* Attempt to continue */
   1501          1.1    jruoho 
   1502          1.1    jruoho             if (!SubTable->Length)
   1503          1.1    jruoho             {
   1504          1.1    jruoho                 AcpiOsPrintf ("Invalid zero length subtable\n");
   1505          1.1    jruoho                 return;
   1506          1.1    jruoho             }
   1507          1.1    jruoho             goto NextSubTable;
   1508          1.1    jruoho         }
   1509          1.1    jruoho 
   1510          1.1    jruoho         /* Dump the subtable */
   1511          1.1    jruoho 
   1512          1.1    jruoho         AcpiOsPrintf ("\n");
   1513          1.1    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   1514          1.1    jruoho                     SubTable->Length, InfoTable);
   1515          1.1    jruoho         if (ACPI_FAILURE (Status))
   1516          1.1    jruoho         {
   1517          1.1    jruoho             return;
   1518          1.1    jruoho         }
   1519          1.1    jruoho 
   1520          1.1    jruoho         /* The hardware subtable can contain multiple device entries */
   1521          1.1    jruoho 
   1522          1.1    jruoho         if (SubTable->Type == ACPI_IVRS_TYPE_HARDWARE)
   1523          1.1    jruoho         {
   1524          1.1    jruoho             EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE);
   1525          1.1    jruoho             DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, SubTable,
   1526          1.1    jruoho                             sizeof (ACPI_IVRS_HARDWARE));
   1527          1.1    jruoho 
   1528          1.1    jruoho             while (EntryOffset < (Offset + SubTable->Length))
   1529          1.1    jruoho             {
   1530          1.1    jruoho                 AcpiOsPrintf ("\n");
   1531          1.1    jruoho                 /*
   1532          1.1    jruoho                  * Upper 2 bits of Type encode the length of the device entry
   1533          1.1    jruoho                  *
   1534          1.1    jruoho                  * 00 = 4 byte
   1535          1.1    jruoho                  * 01 = 8 byte
   1536          1.1    jruoho                  * 10 = 16 byte - currently no entries defined
   1537          1.1    jruoho                  * 11 = 32 byte - currently no entries defined
   1538          1.1    jruoho                  */
   1539          1.1    jruoho                 EntryType = DeviceEntry->Type;
   1540          1.1    jruoho                 EntryLength = EntrySizes [EntryType >> 6];
   1541          1.1    jruoho 
   1542          1.1    jruoho                 switch (EntryType)
   1543          1.1    jruoho                 {
   1544          1.1    jruoho                 /* 4-byte device entries */
   1545          1.1    jruoho 
   1546          1.1    jruoho                 case ACPI_IVRS_TYPE_PAD4:
   1547          1.1    jruoho                 case ACPI_IVRS_TYPE_ALL:
   1548          1.1    jruoho                 case ACPI_IVRS_TYPE_SELECT:
   1549          1.1    jruoho                 case ACPI_IVRS_TYPE_START:
   1550          1.1    jruoho                 case ACPI_IVRS_TYPE_END:
   1551          1.1    jruoho 
   1552          1.1    jruoho                     InfoTable = AcpiDmTableInfoIvrs4;
   1553          1.1    jruoho                     break;
   1554          1.1    jruoho 
   1555          1.1    jruoho                 /* 8-byte entries, type A */
   1556          1.1    jruoho 
   1557          1.1    jruoho                 case ACPI_IVRS_TYPE_ALIAS_SELECT:
   1558          1.1    jruoho                 case ACPI_IVRS_TYPE_ALIAS_START:
   1559          1.1    jruoho 
   1560          1.1    jruoho                     InfoTable = AcpiDmTableInfoIvrs8a;
   1561          1.1    jruoho                     break;
   1562          1.1    jruoho 
   1563          1.1    jruoho                 /* 8-byte entries, type B */
   1564          1.1    jruoho 
   1565          1.1    jruoho                 case ACPI_IVRS_TYPE_PAD8:
   1566          1.1    jruoho                 case ACPI_IVRS_TYPE_EXT_SELECT:
   1567          1.1    jruoho                 case ACPI_IVRS_TYPE_EXT_START:
   1568          1.1    jruoho 
   1569          1.1    jruoho                     InfoTable = AcpiDmTableInfoIvrs8b;
   1570          1.1    jruoho                     break;
   1571          1.1    jruoho 
   1572          1.1    jruoho                 /* 8-byte entries, type C */
   1573          1.1    jruoho 
   1574          1.1    jruoho                 case ACPI_IVRS_TYPE_SPECIAL:
   1575          1.1    jruoho 
   1576          1.1    jruoho                     InfoTable = AcpiDmTableInfoIvrs8c;
   1577          1.1    jruoho                     break;
   1578          1.1    jruoho 
   1579          1.1    jruoho                 default:
   1580          1.1    jruoho                     InfoTable = AcpiDmTableInfoIvrs4;
   1581          1.1    jruoho                     AcpiOsPrintf (
   1582          1.1    jruoho                         "\n**** Unknown IVRS device entry type/length: "
   1583          1.1    jruoho                         "0x%.2X/0x%X at offset 0x%.4X: (header below)\n",
   1584          1.1    jruoho                         EntryType, EntryLength, EntryOffset);
   1585          1.1    jruoho                     break;
   1586          1.1    jruoho                 }
   1587          1.1    jruoho 
   1588          1.1    jruoho                 /* Dump the Device Entry */
   1589          1.1    jruoho 
   1590          1.1    jruoho                 Status = AcpiDmDumpTable (Table->Length, EntryOffset,
   1591          1.1    jruoho                             DeviceEntry, EntryLength, InfoTable);
   1592          1.1    jruoho 
   1593          1.1    jruoho                 EntryOffset += EntryLength;
   1594          1.1    jruoho                 DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, DeviceEntry,
   1595          1.1    jruoho                                 EntryLength);
   1596          1.1    jruoho             }
   1597          1.1    jruoho         }
   1598          1.1    jruoho 
   1599          1.1    jruoho NextSubTable:
   1600      1.1.1.5  christos         /* Point to next subtable */
   1601          1.1    jruoho 
   1602          1.1    jruoho         Offset += SubTable->Length;
   1603          1.1    jruoho         SubTable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, SubTable, SubTable->Length);
   1604          1.1    jruoho     }
   1605          1.1    jruoho }
   1606          1.1    jruoho 
   1607          1.1    jruoho 
   1608          1.1    jruoho /*******************************************************************************
   1609          1.1    jruoho  *
   1610      1.1.1.5  christos  * FUNCTION:    AcpiDmDumpLpit
   1611      1.1.1.5  christos  *
   1612      1.1.1.5  christos  * PARAMETERS:  Table               - A LPIT table
   1613      1.1.1.5  christos  *
   1614      1.1.1.5  christos  * RETURN:      None
   1615      1.1.1.5  christos  *
   1616      1.1.1.5  christos  * DESCRIPTION: Format the contents of a LPIT. This table type consists
   1617      1.1.1.5  christos  *              of an open-ended number of subtables. Note: There are no
   1618      1.1.1.5  christos  *              entries in the main table. An LPIT consists of the table
   1619      1.1.1.5  christos  *              header and then subtables only.
   1620      1.1.1.5  christos  *
   1621      1.1.1.5  christos  ******************************************************************************/
   1622      1.1.1.5  christos 
   1623      1.1.1.5  christos void
   1624      1.1.1.5  christos AcpiDmDumpLpit (
   1625      1.1.1.5  christos     ACPI_TABLE_HEADER       *Table)
   1626      1.1.1.5  christos {
   1627      1.1.1.5  christos     ACPI_STATUS             Status;
   1628      1.1.1.5  christos     ACPI_LPIT_HEADER        *SubTable;
   1629      1.1.1.5  christos     UINT32                  Length = Table->Length;
   1630      1.1.1.5  christos     UINT32                  Offset = sizeof (ACPI_TABLE_LPIT);
   1631      1.1.1.5  christos     ACPI_DMTABLE_INFO       *InfoTable;
   1632      1.1.1.5  christos     UINT32                  SubTableLength;
   1633      1.1.1.5  christos 
   1634      1.1.1.5  christos 
   1635      1.1.1.5  christos     /* Subtables */
   1636      1.1.1.5  christos 
   1637      1.1.1.5  christos     SubTable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, Table, Offset);
   1638      1.1.1.5  christos     while (Offset < Table->Length)
   1639      1.1.1.5  christos     {
   1640      1.1.1.5  christos         /* Common subtable header */
   1641      1.1.1.5  christos 
   1642      1.1.1.5  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   1643      1.1.1.5  christos                     sizeof (ACPI_LPIT_HEADER), AcpiDmTableInfoLpitHdr);
   1644      1.1.1.5  christos         if (ACPI_FAILURE (Status))
   1645      1.1.1.5  christos         {
   1646      1.1.1.5  christos             return;
   1647      1.1.1.5  christos         }
   1648      1.1.1.5  christos 
   1649      1.1.1.5  christos         switch (SubTable->Type)
   1650      1.1.1.5  christos         {
   1651      1.1.1.5  christos         case ACPI_LPIT_TYPE_NATIVE_CSTATE:
   1652      1.1.1.5  christos 
   1653      1.1.1.5  christos             InfoTable = AcpiDmTableInfoLpit0;
   1654      1.1.1.5  christos             SubTableLength = sizeof (ACPI_LPIT_NATIVE);
   1655      1.1.1.5  christos             break;
   1656      1.1.1.5  christos 
   1657      1.1.1.5  christos         case ACPI_LPIT_TYPE_SIMPLE_IO:
   1658      1.1.1.5  christos 
   1659      1.1.1.5  christos             InfoTable = AcpiDmTableInfoLpit1;
   1660      1.1.1.5  christos             SubTableLength = sizeof (ACPI_LPIT_IO);
   1661      1.1.1.5  christos             break;
   1662      1.1.1.5  christos 
   1663      1.1.1.5  christos         default:
   1664      1.1.1.5  christos 
   1665      1.1.1.5  christos             /* Cannot continue on unknown type - no length */
   1666      1.1.1.5  christos 
   1667      1.1.1.5  christos             AcpiOsPrintf ("\n**** Unknown LPIT subtable type 0x%X\n", SubTable->Type);
   1668      1.1.1.5  christos             return;
   1669      1.1.1.5  christos         }
   1670      1.1.1.5  christos 
   1671      1.1.1.5  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   1672      1.1.1.5  christos                     SubTableLength, InfoTable);
   1673      1.1.1.5  christos         if (ACPI_FAILURE (Status))
   1674      1.1.1.5  christos         {
   1675      1.1.1.5  christos             return;
   1676      1.1.1.5  christos         }
   1677      1.1.1.5  christos         AcpiOsPrintf ("\n");
   1678      1.1.1.5  christos 
   1679      1.1.1.5  christos         /* Point to next subtable */
   1680      1.1.1.5  christos 
   1681      1.1.1.5  christos         Offset += SubTableLength;
   1682      1.1.1.5  christos         SubTable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, SubTable, SubTableLength);
   1683      1.1.1.5  christos     }
   1684      1.1.1.5  christos }
   1685      1.1.1.5  christos 
   1686      1.1.1.5  christos 
   1687      1.1.1.5  christos /*******************************************************************************
   1688      1.1.1.5  christos  *
   1689          1.1    jruoho  * FUNCTION:    AcpiDmDumpMadt
   1690          1.1    jruoho  *
   1691          1.1    jruoho  * PARAMETERS:  Table               - A MADT table
   1692          1.1    jruoho  *
   1693          1.1    jruoho  * RETURN:      None
   1694          1.1    jruoho  *
   1695          1.1    jruoho  * DESCRIPTION: Format the contents of a MADT. This table type consists
   1696          1.1    jruoho  *              of an open-ended number of subtables.
   1697          1.1    jruoho  *
   1698          1.1    jruoho  ******************************************************************************/
   1699          1.1    jruoho 
   1700          1.1    jruoho void
   1701          1.1    jruoho AcpiDmDumpMadt (
   1702          1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   1703          1.1    jruoho {
   1704          1.1    jruoho     ACPI_STATUS             Status;
   1705          1.1    jruoho     ACPI_SUBTABLE_HEADER    *SubTable;
   1706          1.1    jruoho     UINT32                  Length = Table->Length;
   1707          1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_MADT);
   1708          1.1    jruoho     ACPI_DMTABLE_INFO       *InfoTable;
   1709          1.1    jruoho 
   1710          1.1    jruoho 
   1711          1.1    jruoho     /* Main table */
   1712          1.1    jruoho 
   1713          1.1    jruoho     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoMadt);
   1714          1.1    jruoho     if (ACPI_FAILURE (Status))
   1715          1.1    jruoho     {
   1716          1.1    jruoho         return;
   1717          1.1    jruoho     }
   1718          1.1    jruoho 
   1719      1.1.1.5  christos     /* Subtables */
   1720          1.1    jruoho 
   1721          1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
   1722          1.1    jruoho     while (Offset < Table->Length)
   1723          1.1    jruoho     {
   1724      1.1.1.5  christos         /* Common subtable header */
   1725          1.1    jruoho 
   1726          1.1    jruoho         AcpiOsPrintf ("\n");
   1727          1.1    jruoho         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   1728          1.1    jruoho                     SubTable->Length, AcpiDmTableInfoMadtHdr);
   1729          1.1    jruoho         if (ACPI_FAILURE (Status))
   1730          1.1    jruoho         {
   1731          1.1    jruoho             return;
   1732          1.1    jruoho         }
   1733          1.1    jruoho 
   1734          1.1    jruoho         switch (SubTable->Type)
   1735          1.1    jruoho         {
   1736          1.1    jruoho         case ACPI_MADT_TYPE_LOCAL_APIC:
   1737      1.1.1.4  christos 
   1738          1.1    jruoho             InfoTable = AcpiDmTableInfoMadt0;
   1739          1.1    jruoho             break;
   1740      1.1.1.4  christos 
   1741          1.1    jruoho         case ACPI_MADT_TYPE_IO_APIC:
   1742      1.1.1.4  christos 
   1743          1.1    jruoho             InfoTable = AcpiDmTableInfoMadt1;
   1744          1.1    jruoho             break;
   1745      1.1.1.4  christos 
   1746          1.1    jruoho         case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE:
   1747      1.1.1.4  christos 
   1748          1.1    jruoho             InfoTable = AcpiDmTableInfoMadt2;
   1749          1.1    jruoho             break;
   1750      1.1.1.4  christos 
   1751          1.1    jruoho         case ACPI_MADT_TYPE_NMI_SOURCE:
   1752      1.1.1.4  christos 
   1753          1.1    jruoho             InfoTable = AcpiDmTableInfoMadt3;
   1754          1.1    jruoho             break;
   1755      1.1.1.4  christos 
   1756          1.1    jruoho         case ACPI_MADT_TYPE_LOCAL_APIC_NMI:
   1757      1.1.1.4  christos 
   1758          1.1    jruoho             InfoTable = AcpiDmTableInfoMadt4;
   1759          1.1    jruoho             break;
   1760      1.1.1.4  christos 
   1761          1.1    jruoho         case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE:
   1762      1.1.1.4  christos 
   1763          1.1    jruoho             InfoTable = AcpiDmTableInfoMadt5;
   1764          1.1    jruoho             break;
   1765      1.1.1.4  christos 
   1766          1.1    jruoho         case ACPI_MADT_TYPE_IO_SAPIC:
   1767      1.1.1.4  christos 
   1768          1.1    jruoho             InfoTable = AcpiDmTableInfoMadt6;
   1769          1.1    jruoho             break;
   1770      1.1.1.4  christos 
   1771          1.1    jruoho         case ACPI_MADT_TYPE_LOCAL_SAPIC:
   1772      1.1.1.4  christos 
   1773          1.1    jruoho             InfoTable = AcpiDmTableInfoMadt7;
   1774          1.1    jruoho             break;
   1775      1.1.1.4  christos 
   1776          1.1    jruoho         case ACPI_MADT_TYPE_INTERRUPT_SOURCE:
   1777      1.1.1.4  christos 
   1778          1.1    jruoho             InfoTable = AcpiDmTableInfoMadt8;
   1779          1.1    jruoho             break;
   1780      1.1.1.4  christos 
   1781          1.1    jruoho         case ACPI_MADT_TYPE_LOCAL_X2APIC:
   1782      1.1.1.4  christos 
   1783          1.1    jruoho             InfoTable = AcpiDmTableInfoMadt9;
   1784          1.1    jruoho             break;
   1785      1.1.1.4  christos 
   1786          1.1    jruoho         case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI:
   1787      1.1.1.4  christos 
   1788          1.1    jruoho             InfoTable = AcpiDmTableInfoMadt10;
   1789          1.1    jruoho             break;
   1790      1.1.1.4  christos 
   1791      1.1.1.4  christos         case ACPI_MADT_TYPE_GENERIC_INTERRUPT:
   1792      1.1.1.4  christos 
   1793      1.1.1.4  christos             InfoTable = AcpiDmTableInfoMadt11;
   1794      1.1.1.4  christos             break;
   1795      1.1.1.4  christos 
   1796      1.1.1.4  christos         case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR:
   1797      1.1.1.4  christos 
   1798      1.1.1.4  christos             InfoTable = AcpiDmTableInfoMadt12;
   1799      1.1.1.4  christos             break;
   1800      1.1.1.4  christos 
   1801      1.1.1.5  christos         case ACPI_MADT_TYPE_GENERIC_MSI_FRAME:
   1802      1.1.1.5  christos 
   1803      1.1.1.5  christos             InfoTable = AcpiDmTableInfoMadt13;
   1804      1.1.1.5  christos             break;
   1805      1.1.1.5  christos 
   1806      1.1.1.5  christos         case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR:
   1807      1.1.1.5  christos 
   1808      1.1.1.5  christos             InfoTable = AcpiDmTableInfoMadt14;
   1809      1.1.1.5  christos             break;
   1810      1.1.1.5  christos 
   1811          1.1    jruoho         default:
   1812      1.1.1.4  christos 
   1813      1.1.1.5  christos             AcpiOsPrintf ("\n**** Unknown MADT subtable type 0x%X\n\n", SubTable->Type);
   1814          1.1    jruoho 
   1815          1.1    jruoho             /* Attempt to continue */
   1816          1.1    jruoho 
   1817          1.1    jruoho             if (!SubTable->Length)
   1818          1.1    jruoho             {
   1819          1.1    jruoho                 AcpiOsPrintf ("Invalid zero length subtable\n");
   1820          1.1    jruoho                 return;
   1821          1.1    jruoho             }
   1822          1.1    jruoho             goto NextSubTable;
   1823          1.1    jruoho         }
   1824          1.1    jruoho 
   1825          1.1    jruoho         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   1826          1.1    jruoho                     SubTable->Length, InfoTable);
   1827          1.1    jruoho         if (ACPI_FAILURE (Status))
   1828          1.1    jruoho         {
   1829          1.1    jruoho             return;
   1830          1.1    jruoho         }
   1831          1.1    jruoho 
   1832          1.1    jruoho NextSubTable:
   1833      1.1.1.5  christos         /* Point to next subtable */
   1834          1.1    jruoho 
   1835          1.1    jruoho         Offset += SubTable->Length;
   1836          1.1    jruoho         SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
   1837          1.1    jruoho     }
   1838          1.1    jruoho }
   1839          1.1    jruoho 
   1840          1.1    jruoho 
   1841          1.1    jruoho /*******************************************************************************
   1842          1.1    jruoho  *
   1843          1.1    jruoho  * FUNCTION:    AcpiDmDumpMcfg
   1844          1.1    jruoho  *
   1845          1.1    jruoho  * PARAMETERS:  Table               - A MCFG Table
   1846          1.1    jruoho  *
   1847          1.1    jruoho  * RETURN:      None
   1848          1.1    jruoho  *
   1849          1.1    jruoho  * DESCRIPTION: Format the contents of a MCFG table
   1850          1.1    jruoho  *
   1851          1.1    jruoho  ******************************************************************************/
   1852          1.1    jruoho 
   1853          1.1    jruoho void
   1854          1.1    jruoho AcpiDmDumpMcfg (
   1855          1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   1856          1.1    jruoho {
   1857          1.1    jruoho     ACPI_STATUS             Status;
   1858          1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_MCFG);
   1859          1.1    jruoho     ACPI_MCFG_ALLOCATION    *SubTable;
   1860          1.1    jruoho 
   1861          1.1    jruoho 
   1862          1.1    jruoho     /* Main table */
   1863          1.1    jruoho 
   1864          1.1    jruoho     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMcfg);
   1865          1.1    jruoho     if (ACPI_FAILURE (Status))
   1866          1.1    jruoho     {
   1867          1.1    jruoho         return;
   1868          1.1    jruoho     }
   1869          1.1    jruoho 
   1870      1.1.1.5  christos     /* Subtables */
   1871          1.1    jruoho 
   1872          1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset);
   1873          1.1    jruoho     while (Offset < Table->Length)
   1874          1.1    jruoho     {
   1875          1.1    jruoho         if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length)
   1876          1.1    jruoho         {
   1877          1.1    jruoho             AcpiOsPrintf ("Warning: there are %u invalid trailing bytes\n",
   1878          1.1    jruoho                 sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length));
   1879          1.1    jruoho             return;
   1880          1.1    jruoho         }
   1881          1.1    jruoho 
   1882          1.1    jruoho         AcpiOsPrintf ("\n");
   1883          1.1    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   1884          1.1    jruoho                     sizeof (ACPI_MCFG_ALLOCATION), AcpiDmTableInfoMcfg0);
   1885          1.1    jruoho         if (ACPI_FAILURE (Status))
   1886          1.1    jruoho         {
   1887          1.1    jruoho             return;
   1888          1.1    jruoho         }
   1889          1.1    jruoho 
   1890      1.1.1.5  christos         /* Point to next subtable (each subtable is of fixed length) */
   1891          1.1    jruoho 
   1892          1.1    jruoho         Offset += sizeof (ACPI_MCFG_ALLOCATION);
   1893          1.1    jruoho         SubTable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, SubTable,
   1894          1.1    jruoho                         sizeof (ACPI_MCFG_ALLOCATION));
   1895          1.1    jruoho     }
   1896          1.1    jruoho }
   1897          1.1    jruoho 
   1898          1.1    jruoho 
   1899          1.1    jruoho /*******************************************************************************
   1900          1.1    jruoho  *
   1901      1.1.1.4  christos  * FUNCTION:    AcpiDmDumpMpst
   1902      1.1.1.4  christos  *
   1903      1.1.1.4  christos  * PARAMETERS:  Table               - A MPST Table
   1904      1.1.1.4  christos  *
   1905      1.1.1.4  christos  * RETURN:      None
   1906      1.1.1.4  christos  *
   1907      1.1.1.4  christos  * DESCRIPTION: Format the contents of a MPST table
   1908      1.1.1.4  christos  *
   1909      1.1.1.4  christos  ******************************************************************************/
   1910      1.1.1.4  christos 
   1911      1.1.1.4  christos void
   1912      1.1.1.4  christos AcpiDmDumpMpst (
   1913      1.1.1.4  christos     ACPI_TABLE_HEADER       *Table)
   1914      1.1.1.4  christos {
   1915      1.1.1.4  christos     ACPI_STATUS             Status;
   1916      1.1.1.4  christos     UINT32                  Offset = sizeof (ACPI_TABLE_MPST);
   1917      1.1.1.4  christos     ACPI_MPST_POWER_NODE    *SubTable0;
   1918      1.1.1.4  christos     ACPI_MPST_POWER_STATE   *SubTable0A;
   1919      1.1.1.4  christos     ACPI_MPST_COMPONENT     *SubTable0B;
   1920      1.1.1.4  christos     ACPI_MPST_DATA_HDR      *SubTable1;
   1921      1.1.1.4  christos     ACPI_MPST_POWER_DATA    *SubTable2;
   1922      1.1.1.4  christos     UINT16                  SubtableCount;
   1923      1.1.1.4  christos     UINT32                  PowerStateCount;
   1924      1.1.1.4  christos     UINT32                  ComponentCount;
   1925      1.1.1.4  christos 
   1926      1.1.1.4  christos 
   1927      1.1.1.4  christos     /* Main table */
   1928      1.1.1.4  christos 
   1929      1.1.1.4  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMpst);
   1930      1.1.1.4  christos     if (ACPI_FAILURE (Status))
   1931      1.1.1.4  christos     {
   1932      1.1.1.4  christos         return;
   1933      1.1.1.4  christos     }
   1934      1.1.1.4  christos 
   1935      1.1.1.4  christos     /* Subtable: Memory Power Node(s) */
   1936      1.1.1.4  christos 
   1937      1.1.1.4  christos     SubtableCount = (ACPI_CAST_PTR (ACPI_TABLE_MPST, Table))->PowerNodeCount;
   1938      1.1.1.4  christos     SubTable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, Table, Offset);
   1939      1.1.1.4  christos 
   1940      1.1.1.4  christos     while ((Offset < Table->Length) && SubtableCount)
   1941      1.1.1.4  christos     {
   1942      1.1.1.4  christos         AcpiOsPrintf ("\n");
   1943      1.1.1.4  christos         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0,
   1944      1.1.1.4  christos                     sizeof (ACPI_MPST_POWER_NODE), AcpiDmTableInfoMpst0);
   1945      1.1.1.4  christos         if (ACPI_FAILURE (Status))
   1946      1.1.1.4  christos         {
   1947      1.1.1.4  christos             return;
   1948      1.1.1.4  christos         }
   1949      1.1.1.4  christos 
   1950      1.1.1.4  christos         /* Extract the sub-subtable counts */
   1951      1.1.1.4  christos 
   1952      1.1.1.4  christos         PowerStateCount = SubTable0->NumPowerStates;
   1953      1.1.1.4  christos         ComponentCount = SubTable0->NumPhysicalComponents;
   1954      1.1.1.4  christos         Offset += sizeof (ACPI_MPST_POWER_NODE);
   1955      1.1.1.4  christos 
   1956      1.1.1.4  christos         /* Sub-subtables - Memory Power State Structure(s) */
   1957      1.1.1.4  christos 
   1958      1.1.1.4  christos         SubTable0A = ACPI_ADD_PTR (ACPI_MPST_POWER_STATE, SubTable0,
   1959      1.1.1.4  christos             sizeof (ACPI_MPST_POWER_NODE));
   1960      1.1.1.4  christos 
   1961      1.1.1.4  christos         while (PowerStateCount)
   1962      1.1.1.4  christos         {
   1963      1.1.1.4  christos             AcpiOsPrintf ("\n");
   1964      1.1.1.4  christos             Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0A,
   1965      1.1.1.4  christos                         sizeof (ACPI_MPST_POWER_STATE), AcpiDmTableInfoMpst0A);
   1966      1.1.1.4  christos             if (ACPI_FAILURE (Status))
   1967      1.1.1.4  christos             {
   1968      1.1.1.4  christos                 return;
   1969      1.1.1.4  christos             }
   1970      1.1.1.4  christos 
   1971      1.1.1.4  christos             SubTable0A++;
   1972      1.1.1.4  christos             PowerStateCount--;
   1973      1.1.1.4  christos             Offset += sizeof (ACPI_MPST_POWER_STATE);
   1974      1.1.1.4  christos        }
   1975      1.1.1.4  christos 
   1976      1.1.1.4  christos         /* Sub-subtables - Physical Component ID Structure(s) */
   1977      1.1.1.4  christos 
   1978      1.1.1.4  christos         SubTable0B = ACPI_CAST_PTR (ACPI_MPST_COMPONENT, SubTable0A);
   1979      1.1.1.4  christos 
   1980      1.1.1.4  christos         if (ComponentCount)
   1981      1.1.1.4  christos         {
   1982      1.1.1.4  christos             AcpiOsPrintf ("\n");
   1983      1.1.1.4  christos         }
   1984      1.1.1.4  christos 
   1985      1.1.1.4  christos         while (ComponentCount)
   1986      1.1.1.4  christos         {
   1987      1.1.1.4  christos             Status = AcpiDmDumpTable (Table->Length, Offset, SubTable0B,
   1988      1.1.1.4  christos                         sizeof (ACPI_MPST_COMPONENT), AcpiDmTableInfoMpst0B);
   1989      1.1.1.4  christos             if (ACPI_FAILURE (Status))
   1990      1.1.1.4  christos             {
   1991      1.1.1.4  christos                 return;
   1992      1.1.1.4  christos             }
   1993      1.1.1.4  christos 
   1994      1.1.1.4  christos             SubTable0B++;
   1995      1.1.1.4  christos             ComponentCount--;
   1996      1.1.1.4  christos             Offset += sizeof (ACPI_MPST_COMPONENT);
   1997      1.1.1.4  christos         }
   1998      1.1.1.4  christos 
   1999      1.1.1.4  christos         /* Point to next Memory Power Node subtable */
   2000      1.1.1.4  christos 
   2001      1.1.1.4  christos         SubtableCount--;
   2002      1.1.1.4  christos         SubTable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, SubTable0,
   2003      1.1.1.4  christos             sizeof (ACPI_MPST_POWER_NODE) +
   2004      1.1.1.4  christos             (sizeof (ACPI_MPST_POWER_STATE) * SubTable0->NumPowerStates) +
   2005      1.1.1.4  christos             (sizeof (ACPI_MPST_COMPONENT) * SubTable0->NumPhysicalComponents));
   2006      1.1.1.4  christos     }
   2007      1.1.1.4  christos 
   2008      1.1.1.4  christos     /* Subtable: Count of Memory Power State Characteristic structures */
   2009      1.1.1.4  christos 
   2010      1.1.1.4  christos     AcpiOsPrintf ("\n");
   2011      1.1.1.4  christos     SubTable1 = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, SubTable0);
   2012      1.1.1.4  christos     Status = AcpiDmDumpTable (Table->Length, Offset, SubTable1,
   2013      1.1.1.4  christos                 sizeof (ACPI_MPST_DATA_HDR), AcpiDmTableInfoMpst1);
   2014      1.1.1.4  christos     if (ACPI_FAILURE (Status))
   2015      1.1.1.4  christos     {
   2016      1.1.1.4  christos         return;
   2017      1.1.1.4  christos     }
   2018      1.1.1.4  christos 
   2019      1.1.1.4  christos     SubtableCount = SubTable1->CharacteristicsCount;
   2020      1.1.1.4  christos     Offset += sizeof (ACPI_MPST_DATA_HDR);
   2021      1.1.1.4  christos 
   2022      1.1.1.4  christos     /* Subtable: Memory Power State Characteristics structure(s) */
   2023      1.1.1.4  christos 
   2024      1.1.1.4  christos     SubTable2 = ACPI_ADD_PTR (ACPI_MPST_POWER_DATA, SubTable1, sizeof (ACPI_MPST_DATA_HDR));
   2025      1.1.1.4  christos 
   2026      1.1.1.4  christos     while ((Offset < Table->Length) && SubtableCount)
   2027      1.1.1.4  christos     {
   2028      1.1.1.4  christos         AcpiOsPrintf ("\n");
   2029      1.1.1.4  christos         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable2,
   2030      1.1.1.4  christos                     sizeof (ACPI_MPST_POWER_DATA), AcpiDmTableInfoMpst2);
   2031      1.1.1.4  christos         if (ACPI_FAILURE (Status))
   2032      1.1.1.4  christos         {
   2033      1.1.1.4  christos             return;
   2034      1.1.1.4  christos         }
   2035      1.1.1.4  christos 
   2036      1.1.1.4  christos         SubTable2++;
   2037      1.1.1.4  christos         SubtableCount--;
   2038      1.1.1.4  christos         Offset += sizeof (ACPI_MPST_POWER_DATA);
   2039      1.1.1.4  christos     }
   2040      1.1.1.4  christos }
   2041      1.1.1.4  christos 
   2042      1.1.1.4  christos 
   2043      1.1.1.4  christos /*******************************************************************************
   2044      1.1.1.4  christos  *
   2045          1.1    jruoho  * FUNCTION:    AcpiDmDumpMsct
   2046          1.1    jruoho  *
   2047          1.1    jruoho  * PARAMETERS:  Table               - A MSCT table
   2048          1.1    jruoho  *
   2049          1.1    jruoho  * RETURN:      None
   2050          1.1    jruoho  *
   2051          1.1    jruoho  * DESCRIPTION: Format the contents of a MSCT
   2052          1.1    jruoho  *
   2053          1.1    jruoho  ******************************************************************************/
   2054          1.1    jruoho 
   2055          1.1    jruoho void
   2056          1.1    jruoho AcpiDmDumpMsct (
   2057          1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   2058          1.1    jruoho {
   2059          1.1    jruoho     ACPI_STATUS             Status;
   2060          1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_MSCT);
   2061          1.1    jruoho     ACPI_MSCT_PROXIMITY     *SubTable;
   2062          1.1    jruoho 
   2063          1.1    jruoho 
   2064          1.1    jruoho     /* Main table */
   2065          1.1    jruoho 
   2066          1.1    jruoho     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMsct);
   2067          1.1    jruoho     if (ACPI_FAILURE (Status))
   2068          1.1    jruoho     {
   2069          1.1    jruoho         return;
   2070          1.1    jruoho     }
   2071          1.1    jruoho 
   2072      1.1.1.5  christos     /* Subtables */
   2073          1.1    jruoho 
   2074          1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset);
   2075          1.1    jruoho     while (Offset < Table->Length)
   2076          1.1    jruoho     {
   2077      1.1.1.5  christos         /* Common subtable header */
   2078          1.1    jruoho 
   2079          1.1    jruoho         AcpiOsPrintf ("\n");
   2080          1.1    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   2081          1.1    jruoho                     sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0);
   2082          1.1    jruoho         if (ACPI_FAILURE (Status))
   2083          1.1    jruoho         {
   2084          1.1    jruoho             return;
   2085          1.1    jruoho         }
   2086          1.1    jruoho 
   2087      1.1.1.5  christos         /* Point to next subtable */
   2088          1.1    jruoho 
   2089          1.1    jruoho         Offset += sizeof (ACPI_MSCT_PROXIMITY);
   2090          1.1    jruoho         SubTable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, SubTable, sizeof (ACPI_MSCT_PROXIMITY));
   2091          1.1    jruoho     }
   2092          1.1    jruoho }
   2093          1.1    jruoho 
   2094          1.1    jruoho 
   2095          1.1    jruoho /*******************************************************************************
   2096          1.1    jruoho  *
   2097      1.1.1.4  christos  * FUNCTION:    AcpiDmDumpMtmr
   2098      1.1.1.3    jruoho  *
   2099      1.1.1.4  christos  * PARAMETERS:  Table               - A MTMR table
   2100      1.1.1.3    jruoho  *
   2101      1.1.1.3    jruoho  * RETURN:      None
   2102      1.1.1.3    jruoho  *
   2103      1.1.1.4  christos  * DESCRIPTION: Format the contents of a MTMR
   2104      1.1.1.3    jruoho  *
   2105      1.1.1.3    jruoho  ******************************************************************************/
   2106      1.1.1.3    jruoho 
   2107      1.1.1.3    jruoho void
   2108      1.1.1.4  christos AcpiDmDumpMtmr (
   2109      1.1.1.3    jruoho     ACPI_TABLE_HEADER       *Table)
   2110      1.1.1.3    jruoho {
   2111      1.1.1.3    jruoho     ACPI_STATUS             Status;
   2112      1.1.1.4  christos     UINT32                  Offset = sizeof (ACPI_TABLE_MTMR);
   2113      1.1.1.4  christos     ACPI_MTMR_ENTRY         *SubTable;
   2114      1.1.1.3    jruoho 
   2115      1.1.1.3    jruoho 
   2116      1.1.1.4  christos     /* Main table */
   2117      1.1.1.3    jruoho 
   2118      1.1.1.4  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMtmr);
   2119      1.1.1.4  christos     if (ACPI_FAILURE (Status))
   2120      1.1.1.4  christos     {
   2121      1.1.1.4  christos         return;
   2122      1.1.1.4  christos     }
   2123      1.1.1.4  christos 
   2124      1.1.1.5  christos     /* Subtables */
   2125      1.1.1.4  christos 
   2126      1.1.1.4  christos     SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, Table, Offset);
   2127      1.1.1.3    jruoho     while (Offset < Table->Length)
   2128      1.1.1.3    jruoho     {
   2129      1.1.1.5  christos         /* Common subtable header */
   2130      1.1.1.3    jruoho 
   2131      1.1.1.3    jruoho         AcpiOsPrintf ("\n");
   2132      1.1.1.3    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   2133      1.1.1.4  christos                     sizeof (ACPI_MTMR_ENTRY), AcpiDmTableInfoMtmr0);
   2134      1.1.1.3    jruoho         if (ACPI_FAILURE (Status))
   2135      1.1.1.3    jruoho         {
   2136      1.1.1.3    jruoho             return;
   2137      1.1.1.3    jruoho         }
   2138      1.1.1.3    jruoho 
   2139      1.1.1.5  christos         /* Point to next subtable */
   2140      1.1.1.4  christos 
   2141      1.1.1.4  christos         Offset += sizeof (ACPI_MTMR_ENTRY);
   2142      1.1.1.4  christos         SubTable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, SubTable, sizeof (ACPI_MTMR_ENTRY));
   2143      1.1.1.4  christos     }
   2144      1.1.1.4  christos }
   2145      1.1.1.4  christos 
   2146      1.1.1.4  christos 
   2147      1.1.1.4  christos /*******************************************************************************
   2148      1.1.1.4  christos  *
   2149      1.1.1.4  christos  * FUNCTION:    AcpiDmDumpPcct
   2150      1.1.1.4  christos  *
   2151      1.1.1.4  christos  * PARAMETERS:  Table               - A PCCT table
   2152      1.1.1.4  christos  *
   2153      1.1.1.4  christos  * RETURN:      None
   2154      1.1.1.4  christos  *
   2155      1.1.1.4  christos  * DESCRIPTION: Format the contents of a PCCT. This table type consists
   2156      1.1.1.4  christos  *              of an open-ended number of subtables.
   2157      1.1.1.4  christos  *
   2158      1.1.1.4  christos  ******************************************************************************/
   2159      1.1.1.4  christos 
   2160      1.1.1.4  christos void
   2161      1.1.1.4  christos AcpiDmDumpPcct (
   2162      1.1.1.4  christos     ACPI_TABLE_HEADER       *Table)
   2163      1.1.1.4  christos {
   2164      1.1.1.4  christos     ACPI_STATUS             Status;
   2165      1.1.1.4  christos     ACPI_PCCT_SUBSPACE      *SubTable;
   2166      1.1.1.5  christos     ACPI_DMTABLE_INFO       *InfoTable;
   2167      1.1.1.4  christos     UINT32                  Length = Table->Length;
   2168      1.1.1.4  christos     UINT32                  Offset = sizeof (ACPI_TABLE_PCCT);
   2169      1.1.1.4  christos 
   2170      1.1.1.4  christos 
   2171      1.1.1.4  christos     /* Main table */
   2172      1.1.1.4  christos 
   2173      1.1.1.4  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPcct);
   2174      1.1.1.4  christos     if (ACPI_FAILURE (Status))
   2175      1.1.1.4  christos     {
   2176      1.1.1.4  christos         return;
   2177      1.1.1.4  christos     }
   2178      1.1.1.4  christos 
   2179      1.1.1.4  christos     /* Subtables */
   2180      1.1.1.4  christos 
   2181      1.1.1.4  christos     SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Table, Offset);
   2182      1.1.1.4  christos     while (Offset < Table->Length)
   2183      1.1.1.4  christos     {
   2184      1.1.1.4  christos         /* Common subtable header */
   2185      1.1.1.4  christos 
   2186      1.1.1.4  christos         AcpiOsPrintf ("\n");
   2187      1.1.1.4  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   2188      1.1.1.4  christos                     SubTable->Header.Length, AcpiDmTableInfoPcctHdr);
   2189      1.1.1.4  christos         if (ACPI_FAILURE (Status))
   2190      1.1.1.4  christos         {
   2191      1.1.1.4  christos             return;
   2192      1.1.1.4  christos         }
   2193      1.1.1.4  christos 
   2194      1.1.1.5  christos         switch (SubTable->Header.Type)
   2195      1.1.1.4  christos         {
   2196      1.1.1.5  christos         case ACPI_PCCT_TYPE_GENERIC_SUBSPACE:
   2197      1.1.1.5  christos 
   2198      1.1.1.5  christos             InfoTable = AcpiDmTableInfoPcct0;
   2199      1.1.1.5  christos             break;
   2200      1.1.1.5  christos 
   2201      1.1.1.5  christos         case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE:
   2202      1.1.1.5  christos 
   2203      1.1.1.5  christos             InfoTable = AcpiDmTableInfoPcct1;
   2204      1.1.1.5  christos             break;
   2205      1.1.1.5  christos 
   2206      1.1.1.5  christos         default:
   2207      1.1.1.5  christos 
   2208      1.1.1.4  christos             AcpiOsPrintf (
   2209      1.1.1.4  christos                 "\n**** Unexpected or unknown PCCT subtable type 0x%X\n\n",
   2210      1.1.1.4  christos                 SubTable->Header.Type);
   2211      1.1.1.4  christos             return;
   2212      1.1.1.4  christos         }
   2213      1.1.1.4  christos 
   2214      1.1.1.4  christos         AcpiOsPrintf ("\n");
   2215      1.1.1.4  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   2216      1.1.1.5  christos                     SubTable->Header.Length, InfoTable);
   2217      1.1.1.4  christos         if (ACPI_FAILURE (Status))
   2218      1.1.1.4  christos         {
   2219      1.1.1.4  christos             return;
   2220      1.1.1.4  christos         }
   2221      1.1.1.4  christos 
   2222      1.1.1.4  christos         /* Point to next subtable */
   2223      1.1.1.4  christos 
   2224      1.1.1.4  christos         Offset += SubTable->Header.Length;
   2225      1.1.1.4  christos         SubTable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, SubTable,
   2226      1.1.1.4  christos                     SubTable->Header.Length);
   2227      1.1.1.4  christos     }
   2228      1.1.1.4  christos }
   2229      1.1.1.4  christos 
   2230      1.1.1.4  christos 
   2231      1.1.1.4  christos /*******************************************************************************
   2232      1.1.1.4  christos  *
   2233      1.1.1.4  christos  * FUNCTION:    AcpiDmDumpPmtt
   2234      1.1.1.4  christos  *
   2235      1.1.1.4  christos  * PARAMETERS:  Table               - A PMTT table
   2236      1.1.1.4  christos  *
   2237      1.1.1.4  christos  * RETURN:      None
   2238      1.1.1.4  christos  *
   2239      1.1.1.4  christos  * DESCRIPTION: Format the contents of a PMTT. This table type consists
   2240      1.1.1.4  christos  *              of an open-ended number of subtables.
   2241      1.1.1.4  christos  *
   2242      1.1.1.4  christos  ******************************************************************************/
   2243      1.1.1.4  christos 
   2244      1.1.1.4  christos void
   2245      1.1.1.4  christos AcpiDmDumpPmtt (
   2246      1.1.1.4  christos     ACPI_TABLE_HEADER       *Table)
   2247      1.1.1.4  christos {
   2248      1.1.1.4  christos     ACPI_STATUS             Status;
   2249      1.1.1.4  christos     ACPI_PMTT_HEADER        *SubTable;
   2250      1.1.1.4  christos     ACPI_PMTT_HEADER        *MemSubTable;
   2251      1.1.1.4  christos     ACPI_PMTT_HEADER        *DimmSubTable;
   2252      1.1.1.4  christos     ACPI_PMTT_DOMAIN        *DomainArray;
   2253      1.1.1.4  christos     UINT32                  Length = Table->Length;
   2254      1.1.1.4  christos     UINT32                  Offset = sizeof (ACPI_TABLE_PMTT);
   2255      1.1.1.4  christos     UINT32                  MemOffset;
   2256      1.1.1.4  christos     UINT32                  DimmOffset;
   2257      1.1.1.4  christos     UINT32                  DomainOffset;
   2258      1.1.1.4  christos     UINT32                  DomainCount;
   2259      1.1.1.4  christos 
   2260      1.1.1.4  christos 
   2261      1.1.1.4  christos     /* Main table */
   2262      1.1.1.4  christos 
   2263      1.1.1.4  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPmtt);
   2264      1.1.1.4  christos     if (ACPI_FAILURE (Status))
   2265      1.1.1.4  christos     {
   2266      1.1.1.4  christos         return;
   2267      1.1.1.4  christos     }
   2268      1.1.1.4  christos 
   2269      1.1.1.4  christos     /* Subtables */
   2270      1.1.1.4  christos 
   2271      1.1.1.4  christos     SubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Table, Offset);
   2272      1.1.1.4  christos     while (Offset < Table->Length)
   2273      1.1.1.4  christos     {
   2274      1.1.1.4  christos         /* Common subtable header */
   2275      1.1.1.4  christos 
   2276      1.1.1.4  christos         AcpiOsPrintf ("\n");
   2277      1.1.1.4  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   2278      1.1.1.4  christos                     SubTable->Length, AcpiDmTableInfoPmttHdr);
   2279      1.1.1.4  christos         if (ACPI_FAILURE (Status))
   2280      1.1.1.4  christos         {
   2281      1.1.1.4  christos             return;
   2282      1.1.1.4  christos         }
   2283      1.1.1.4  christos 
   2284      1.1.1.4  christos         /* Only Socket subtables are expected at this level */
   2285      1.1.1.4  christos 
   2286      1.1.1.4  christos         if (SubTable->Type != ACPI_PMTT_TYPE_SOCKET)
   2287      1.1.1.4  christos         {
   2288      1.1.1.4  christos             AcpiOsPrintf (
   2289      1.1.1.4  christos                 "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n",
   2290      1.1.1.4  christos                 SubTable->Type);
   2291      1.1.1.4  christos             return;
   2292      1.1.1.4  christos         }
   2293      1.1.1.4  christos 
   2294      1.1.1.4  christos         /* Dump the fixed-length portion of the subtable */
   2295      1.1.1.4  christos 
   2296      1.1.1.4  christos         Status = AcpiDmDumpTable (Length, Offset, SubTable,
   2297      1.1.1.4  christos                     SubTable->Length, AcpiDmTableInfoPmtt0);
   2298      1.1.1.4  christos         if (ACPI_FAILURE (Status))
   2299      1.1.1.4  christos         {
   2300      1.1.1.4  christos             return;
   2301      1.1.1.4  christos         }
   2302      1.1.1.4  christos 
   2303      1.1.1.4  christos         /* Walk the memory controller subtables */
   2304      1.1.1.4  christos 
   2305      1.1.1.4  christos         MemOffset = sizeof (ACPI_PMTT_SOCKET);
   2306      1.1.1.4  christos         MemSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, SubTable,
   2307      1.1.1.4  christos             sizeof (ACPI_PMTT_SOCKET));
   2308      1.1.1.4  christos 
   2309      1.1.1.4  christos         while (((Offset + MemOffset) < Table->Length) &&
   2310      1.1.1.4  christos             (MemOffset < SubTable->Length))
   2311      1.1.1.4  christos         {
   2312      1.1.1.4  christos             /* Common subtable header */
   2313      1.1.1.4  christos 
   2314      1.1.1.4  christos             AcpiOsPrintf ("\n");
   2315      1.1.1.4  christos             Status = AcpiDmDumpTable (Length,
   2316      1.1.1.4  christos                         Offset + MemOffset, MemSubTable,
   2317      1.1.1.4  christos                         MemSubTable->Length, AcpiDmTableInfoPmttHdr);
   2318      1.1.1.4  christos             if (ACPI_FAILURE (Status))
   2319      1.1.1.4  christos             {
   2320      1.1.1.4  christos                 return;
   2321      1.1.1.4  christos             }
   2322      1.1.1.4  christos 
   2323      1.1.1.4  christos             /* Only memory controller subtables are expected at this level */
   2324      1.1.1.4  christos 
   2325      1.1.1.4  christos             if (MemSubTable->Type != ACPI_PMTT_TYPE_CONTROLLER)
   2326      1.1.1.4  christos             {
   2327      1.1.1.4  christos                 AcpiOsPrintf (
   2328      1.1.1.4  christos                     "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n",
   2329      1.1.1.4  christos                     MemSubTable->Type);
   2330      1.1.1.4  christos                 return;
   2331      1.1.1.4  christos             }
   2332      1.1.1.4  christos 
   2333      1.1.1.4  christos             /* Dump the fixed-length portion of the controller subtable */
   2334      1.1.1.4  christos 
   2335      1.1.1.4  christos             Status = AcpiDmDumpTable (Length,
   2336      1.1.1.4  christos                         Offset + MemOffset, MemSubTable,
   2337      1.1.1.4  christos                         MemSubTable->Length, AcpiDmTableInfoPmtt1);
   2338      1.1.1.4  christos             if (ACPI_FAILURE (Status))
   2339      1.1.1.4  christos             {
   2340      1.1.1.4  christos                 return;
   2341      1.1.1.4  christos             }
   2342      1.1.1.4  christos 
   2343      1.1.1.4  christos             /* Walk the variable count of proximity domains */
   2344      1.1.1.4  christos 
   2345      1.1.1.4  christos             DomainCount = ((ACPI_PMTT_CONTROLLER *) MemSubTable)->DomainCount;
   2346      1.1.1.4  christos             DomainOffset = sizeof (ACPI_PMTT_CONTROLLER);
   2347      1.1.1.4  christos             DomainArray = ACPI_ADD_PTR (ACPI_PMTT_DOMAIN, MemSubTable,
   2348      1.1.1.4  christos                 sizeof (ACPI_PMTT_CONTROLLER));
   2349      1.1.1.4  christos 
   2350      1.1.1.4  christos             while (((Offset + MemOffset + DomainOffset) < Table->Length) &&
   2351      1.1.1.4  christos                 ((MemOffset + DomainOffset) < SubTable->Length) &&
   2352      1.1.1.4  christos                 DomainCount)
   2353      1.1.1.4  christos             {
   2354      1.1.1.4  christos                 Status = AcpiDmDumpTable (Length,
   2355      1.1.1.4  christos                             Offset + MemOffset + DomainOffset, DomainArray,
   2356      1.1.1.4  christos                             sizeof (ACPI_PMTT_DOMAIN), AcpiDmTableInfoPmtt1a);
   2357      1.1.1.4  christos                 if (ACPI_FAILURE (Status))
   2358      1.1.1.4  christos                 {
   2359      1.1.1.4  christos                     return;
   2360      1.1.1.4  christos                 }
   2361      1.1.1.4  christos 
   2362      1.1.1.4  christos                 DomainOffset += sizeof (ACPI_PMTT_DOMAIN);
   2363      1.1.1.4  christos                 DomainArray++;
   2364      1.1.1.4  christos                 DomainCount--;
   2365      1.1.1.4  christos             }
   2366      1.1.1.4  christos 
   2367      1.1.1.4  christos             if (DomainCount)
   2368      1.1.1.4  christos             {
   2369      1.1.1.4  christos                 AcpiOsPrintf (
   2370      1.1.1.5  christos                     "\n**** DomainCount exceeds subtable length\n\n");
   2371      1.1.1.4  christos             }
   2372      1.1.1.4  christos 
   2373      1.1.1.4  christos             /* Walk the physical component (DIMM) subtables */
   2374      1.1.1.4  christos 
   2375      1.1.1.4  christos             DimmOffset = DomainOffset;
   2376      1.1.1.4  christos             DimmSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, MemSubTable,
   2377      1.1.1.4  christos                 DomainOffset);
   2378      1.1.1.4  christos 
   2379      1.1.1.4  christos             while (((Offset + MemOffset + DimmOffset) < Table->Length) &&
   2380      1.1.1.4  christos                 (DimmOffset < MemSubTable->Length))
   2381      1.1.1.4  christos             {
   2382      1.1.1.4  christos                 /* Common subtable header */
   2383      1.1.1.4  christos 
   2384      1.1.1.4  christos                 AcpiOsPrintf ("\n");
   2385      1.1.1.4  christos                 Status = AcpiDmDumpTable (Length,
   2386      1.1.1.4  christos                             Offset + MemOffset + DimmOffset, DimmSubTable,
   2387      1.1.1.4  christos                             DimmSubTable->Length, AcpiDmTableInfoPmttHdr);
   2388      1.1.1.4  christos                 if (ACPI_FAILURE (Status))
   2389      1.1.1.4  christos                 {
   2390      1.1.1.4  christos                     return;
   2391      1.1.1.4  christos                 }
   2392      1.1.1.4  christos 
   2393      1.1.1.4  christos                 /* Only DIMM subtables are expected at this level */
   2394      1.1.1.4  christos 
   2395      1.1.1.4  christos                 if (DimmSubTable->Type != ACPI_PMTT_TYPE_DIMM)
   2396      1.1.1.4  christos                 {
   2397      1.1.1.4  christos                     AcpiOsPrintf (
   2398      1.1.1.4  christos                         "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n",
   2399      1.1.1.4  christos                         DimmSubTable->Type);
   2400      1.1.1.4  christos                     return;
   2401      1.1.1.4  christos                 }
   2402      1.1.1.4  christos 
   2403      1.1.1.4  christos                 /* Dump the fixed-length DIMM subtable */
   2404      1.1.1.4  christos 
   2405      1.1.1.4  christos                 Status = AcpiDmDumpTable (Length,
   2406      1.1.1.4  christos                             Offset + MemOffset + DimmOffset, DimmSubTable,
   2407      1.1.1.4  christos                             DimmSubTable->Length, AcpiDmTableInfoPmtt2);
   2408      1.1.1.4  christos                 if (ACPI_FAILURE (Status))
   2409      1.1.1.4  christos                 {
   2410      1.1.1.4  christos                     return;
   2411      1.1.1.4  christos                 }
   2412      1.1.1.4  christos 
   2413      1.1.1.4  christos                 /* Point to next DIMM subtable */
   2414      1.1.1.4  christos 
   2415      1.1.1.4  christos                 DimmOffset += DimmSubTable->Length;
   2416      1.1.1.4  christos                 DimmSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
   2417      1.1.1.4  christos                     DimmSubTable, DimmSubTable->Length);
   2418      1.1.1.4  christos             }
   2419      1.1.1.4  christos 
   2420      1.1.1.4  christos             /* Point to next Controller subtable */
   2421      1.1.1.4  christos 
   2422      1.1.1.4  christos             MemOffset += MemSubTable->Length;
   2423      1.1.1.4  christos             MemSubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
   2424      1.1.1.4  christos                 MemSubTable, MemSubTable->Length);
   2425      1.1.1.4  christos         }
   2426      1.1.1.4  christos 
   2427      1.1.1.4  christos         /* Point to next Socket subtable */
   2428      1.1.1.4  christos 
   2429      1.1.1.4  christos         Offset += SubTable->Length;
   2430      1.1.1.4  christos         SubTable = ACPI_ADD_PTR (ACPI_PMTT_HEADER,
   2431      1.1.1.4  christos             SubTable, SubTable->Length);
   2432      1.1.1.4  christos     }
   2433      1.1.1.4  christos }
   2434      1.1.1.4  christos 
   2435      1.1.1.4  christos 
   2436      1.1.1.4  christos /*******************************************************************************
   2437      1.1.1.4  christos  *
   2438      1.1.1.4  christos  * FUNCTION:    AcpiDmDumpS3pt
   2439      1.1.1.4  christos  *
   2440      1.1.1.4  christos  * PARAMETERS:  Table               - A S3PT table
   2441      1.1.1.4  christos  *
   2442      1.1.1.4  christos  * RETURN:      Length of the table
   2443      1.1.1.4  christos  *
   2444      1.1.1.4  christos  * DESCRIPTION: Format the contents of a S3PT
   2445      1.1.1.4  christos  *
   2446      1.1.1.4  christos  ******************************************************************************/
   2447      1.1.1.4  christos 
   2448      1.1.1.4  christos UINT32
   2449      1.1.1.4  christos AcpiDmDumpS3pt (
   2450      1.1.1.4  christos     ACPI_TABLE_HEADER       *Tables)
   2451      1.1.1.4  christos {
   2452      1.1.1.4  christos     ACPI_STATUS             Status;
   2453      1.1.1.4  christos     UINT32                  Offset = sizeof (ACPI_TABLE_S3PT);
   2454      1.1.1.4  christos     ACPI_S3PT_HEADER        *SubTable;
   2455      1.1.1.4  christos     ACPI_DMTABLE_INFO       *InfoTable;
   2456      1.1.1.4  christos     ACPI_TABLE_S3PT         *S3ptTable = ACPI_CAST_PTR (ACPI_TABLE_S3PT, Tables);
   2457      1.1.1.4  christos 
   2458      1.1.1.4  christos 
   2459      1.1.1.4  christos     /* Main table */
   2460      1.1.1.4  christos 
   2461      1.1.1.4  christos     Status = AcpiDmDumpTable (Offset, 0, S3ptTable, 0, AcpiDmTableInfoS3pt);
   2462      1.1.1.4  christos     if (ACPI_FAILURE (Status))
   2463      1.1.1.4  christos     {
   2464      1.1.1.4  christos         return 0;
   2465      1.1.1.4  christos     }
   2466      1.1.1.4  christos 
   2467      1.1.1.4  christos     SubTable = ACPI_ADD_PTR (ACPI_S3PT_HEADER, S3ptTable, Offset);
   2468      1.1.1.4  christos     while (Offset < S3ptTable->Length)
   2469      1.1.1.4  christos     {
   2470      1.1.1.5  christos         /* Common subtable header */
   2471      1.1.1.4  christos 
   2472      1.1.1.4  christos         AcpiOsPrintf ("\n");
   2473      1.1.1.4  christos         Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable,
   2474      1.1.1.4  christos                     SubTable->Length, AcpiDmTableInfoS3ptHdr);
   2475      1.1.1.4  christos         if (ACPI_FAILURE (Status))
   2476      1.1.1.4  christos         {
   2477      1.1.1.4  christos             return 0;
   2478      1.1.1.4  christos         }
   2479      1.1.1.4  christos 
   2480      1.1.1.4  christos         switch (SubTable->Type)
   2481      1.1.1.4  christos         {
   2482      1.1.1.4  christos         case ACPI_S3PT_TYPE_RESUME:
   2483      1.1.1.4  christos 
   2484      1.1.1.4  christos             InfoTable = AcpiDmTableInfoS3pt0;
   2485      1.1.1.4  christos             break;
   2486      1.1.1.4  christos 
   2487      1.1.1.4  christos         case ACPI_S3PT_TYPE_SUSPEND:
   2488      1.1.1.4  christos 
   2489      1.1.1.4  christos             InfoTable = AcpiDmTableInfoS3pt1;
   2490      1.1.1.4  christos             break;
   2491      1.1.1.4  christos 
   2492      1.1.1.4  christos         default:
   2493      1.1.1.4  christos 
   2494      1.1.1.5  christos             AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n", SubTable->Type);
   2495      1.1.1.4  christos 
   2496      1.1.1.4  christos             /* Attempt to continue */
   2497      1.1.1.4  christos 
   2498      1.1.1.4  christos             if (!SubTable->Length)
   2499      1.1.1.4  christos             {
   2500      1.1.1.4  christos                 AcpiOsPrintf ("Invalid zero length subtable\n");
   2501      1.1.1.4  christos                 return 0;
   2502      1.1.1.4  christos             }
   2503      1.1.1.4  christos             goto NextSubTable;
   2504      1.1.1.4  christos         }
   2505      1.1.1.4  christos 
   2506      1.1.1.4  christos         AcpiOsPrintf ("\n");
   2507      1.1.1.4  christos         Status = AcpiDmDumpTable (S3ptTable->Length, Offset, SubTable,
   2508      1.1.1.4  christos                     SubTable->Length, InfoTable);
   2509      1.1.1.4  christos         if (ACPI_FAILURE (Status))
   2510      1.1.1.4  christos         {
   2511      1.1.1.4  christos             return 0;
   2512      1.1.1.4  christos         }
   2513      1.1.1.4  christos 
   2514      1.1.1.4  christos NextSubTable:
   2515      1.1.1.5  christos         /* Point to next subtable */
   2516      1.1.1.4  christos 
   2517      1.1.1.4  christos         Offset += SubTable->Length;
   2518      1.1.1.4  christos         SubTable = ACPI_ADD_PTR (ACPI_S3PT_HEADER, SubTable, SubTable->Length);
   2519      1.1.1.4  christos     }
   2520      1.1.1.4  christos 
   2521      1.1.1.4  christos     return (S3ptTable->Length);
   2522      1.1.1.4  christos }
   2523      1.1.1.4  christos 
   2524      1.1.1.4  christos 
   2525      1.1.1.4  christos /*******************************************************************************
   2526      1.1.1.4  christos  *
   2527      1.1.1.4  christos  * FUNCTION:    AcpiDmDumpSlic
   2528      1.1.1.4  christos  *
   2529      1.1.1.4  christos  * PARAMETERS:  Table               - A SLIC table
   2530      1.1.1.4  christos  *
   2531      1.1.1.4  christos  * RETURN:      None
   2532      1.1.1.4  christos  *
   2533      1.1.1.4  christos  * DESCRIPTION: Format the contents of a SLIC
   2534      1.1.1.4  christos  *
   2535      1.1.1.4  christos  ******************************************************************************/
   2536      1.1.1.4  christos 
   2537      1.1.1.4  christos void
   2538      1.1.1.4  christos AcpiDmDumpSlic (
   2539      1.1.1.4  christos     ACPI_TABLE_HEADER       *Table)
   2540      1.1.1.4  christos {
   2541  1.1.1.5.2.1     skrll     (void)AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table,
   2542  1.1.1.5.2.1     skrll                 Table->Length - sizeof (*Table), AcpiDmTableInfoSlic);
   2543      1.1.1.3    jruoho }
   2544      1.1.1.3    jruoho 
   2545      1.1.1.3    jruoho 
   2546      1.1.1.3    jruoho /*******************************************************************************
   2547      1.1.1.3    jruoho  *
   2548          1.1    jruoho  * FUNCTION:    AcpiDmDumpSlit
   2549          1.1    jruoho  *
   2550          1.1    jruoho  * PARAMETERS:  Table               - An SLIT
   2551          1.1    jruoho  *
   2552          1.1    jruoho  * RETURN:      None
   2553          1.1    jruoho  *
   2554          1.1    jruoho  * DESCRIPTION: Format the contents of a SLIT
   2555          1.1    jruoho  *
   2556          1.1    jruoho  ******************************************************************************/
   2557          1.1    jruoho 
   2558          1.1    jruoho void
   2559          1.1    jruoho AcpiDmDumpSlit (
   2560          1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   2561          1.1    jruoho {
   2562          1.1    jruoho     ACPI_STATUS             Status;
   2563          1.1    jruoho     UINT32                  Offset;
   2564          1.1    jruoho     UINT8                   *Row;
   2565          1.1    jruoho     UINT32                  Localities;
   2566          1.1    jruoho     UINT32                  i;
   2567          1.1    jruoho     UINT32                  j;
   2568          1.1    jruoho 
   2569          1.1    jruoho 
   2570          1.1    jruoho     /* Main table */
   2571          1.1    jruoho 
   2572          1.1    jruoho     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSlit);
   2573          1.1    jruoho     if (ACPI_FAILURE (Status))
   2574          1.1    jruoho     {
   2575          1.1    jruoho         return;
   2576          1.1    jruoho     }
   2577          1.1    jruoho 
   2578          1.1    jruoho     /* Display the Locality NxN Matrix */
   2579          1.1    jruoho 
   2580          1.1    jruoho     Localities = (UINT32) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->LocalityCount;
   2581          1.1    jruoho     Offset = ACPI_OFFSET (ACPI_TABLE_SLIT, Entry[0]);
   2582          1.1    jruoho     Row = (UINT8 *) ACPI_CAST_PTR (ACPI_TABLE_SLIT, Table)->Entry;
   2583          1.1    jruoho 
   2584          1.1    jruoho     for (i = 0; i < Localities; i++)
   2585          1.1    jruoho     {
   2586          1.1    jruoho         /* Display one row of the matrix */
   2587          1.1    jruoho 
   2588          1.1    jruoho         AcpiDmLineHeader2 (Offset, Localities, "Locality", i);
   2589          1.1    jruoho         for  (j = 0; j < Localities; j++)
   2590          1.1    jruoho         {
   2591          1.1    jruoho             /* Check for beyond EOT */
   2592          1.1    jruoho 
   2593          1.1    jruoho             if (Offset >= Table->Length)
   2594          1.1    jruoho             {
   2595          1.1    jruoho                 AcpiOsPrintf ("\n**** Not enough room in table for all localities\n");
   2596          1.1    jruoho                 return;
   2597          1.1    jruoho             }
   2598          1.1    jruoho 
   2599      1.1.1.2    jruoho             AcpiOsPrintf ("%2.2X", Row[j]);
   2600          1.1    jruoho             Offset++;
   2601          1.1    jruoho 
   2602          1.1    jruoho             /* Display up to 16 bytes per output row */
   2603          1.1    jruoho 
   2604      1.1.1.2    jruoho             if ((j+1) < Localities)
   2605          1.1    jruoho             {
   2606      1.1.1.3    jruoho                 AcpiOsPrintf (" ");
   2607      1.1.1.2    jruoho 
   2608      1.1.1.2    jruoho                 if (j && (((j+1) % 16) == 0))
   2609      1.1.1.2    jruoho                 {
   2610      1.1.1.3    jruoho                     AcpiOsPrintf ("\\\n"); /* With line continuation char */
   2611      1.1.1.3    jruoho                     AcpiDmLineHeader (Offset, 0, NULL);
   2612      1.1.1.2    jruoho                 }
   2613          1.1    jruoho             }
   2614          1.1    jruoho         }
   2615          1.1    jruoho 
   2616          1.1    jruoho         /* Point to next row */
   2617          1.1    jruoho 
   2618          1.1    jruoho         AcpiOsPrintf ("\n");
   2619          1.1    jruoho         Row += Localities;
   2620          1.1    jruoho     }
   2621          1.1    jruoho }
   2622          1.1    jruoho 
   2623          1.1    jruoho 
   2624          1.1    jruoho /*******************************************************************************
   2625          1.1    jruoho  *
   2626          1.1    jruoho  * FUNCTION:    AcpiDmDumpSrat
   2627          1.1    jruoho  *
   2628          1.1    jruoho  * PARAMETERS:  Table               - A SRAT table
   2629          1.1    jruoho  *
   2630          1.1    jruoho  * RETURN:      None
   2631          1.1    jruoho  *
   2632          1.1    jruoho  * DESCRIPTION: Format the contents of a SRAT
   2633          1.1    jruoho  *
   2634          1.1    jruoho  ******************************************************************************/
   2635          1.1    jruoho 
   2636          1.1    jruoho void
   2637          1.1    jruoho AcpiDmDumpSrat (
   2638          1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   2639          1.1    jruoho {
   2640          1.1    jruoho     ACPI_STATUS             Status;
   2641          1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_SRAT);
   2642          1.1    jruoho     ACPI_SUBTABLE_HEADER    *SubTable;
   2643          1.1    jruoho     ACPI_DMTABLE_INFO       *InfoTable;
   2644          1.1    jruoho 
   2645          1.1    jruoho 
   2646          1.1    jruoho     /* Main table */
   2647          1.1    jruoho 
   2648          1.1    jruoho     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoSrat);
   2649          1.1    jruoho     if (ACPI_FAILURE (Status))
   2650          1.1    jruoho     {
   2651          1.1    jruoho         return;
   2652          1.1    jruoho     }
   2653          1.1    jruoho 
   2654      1.1.1.5  christos     /* Subtables */
   2655          1.1    jruoho 
   2656          1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset);
   2657          1.1    jruoho     while (Offset < Table->Length)
   2658          1.1    jruoho     {
   2659      1.1.1.5  christos         /* Common subtable header */
   2660          1.1    jruoho 
   2661          1.1    jruoho         AcpiOsPrintf ("\n");
   2662          1.1    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   2663          1.1    jruoho                     SubTable->Length, AcpiDmTableInfoSratHdr);
   2664          1.1    jruoho         if (ACPI_FAILURE (Status))
   2665          1.1    jruoho         {
   2666          1.1    jruoho             return;
   2667          1.1    jruoho         }
   2668          1.1    jruoho 
   2669          1.1    jruoho         switch (SubTable->Type)
   2670          1.1    jruoho         {
   2671          1.1    jruoho         case ACPI_SRAT_TYPE_CPU_AFFINITY:
   2672      1.1.1.4  christos 
   2673          1.1    jruoho             InfoTable = AcpiDmTableInfoSrat0;
   2674          1.1    jruoho             break;
   2675      1.1.1.4  christos 
   2676          1.1    jruoho         case ACPI_SRAT_TYPE_MEMORY_AFFINITY:
   2677      1.1.1.4  christos 
   2678          1.1    jruoho             InfoTable = AcpiDmTableInfoSrat1;
   2679          1.1    jruoho             break;
   2680      1.1.1.4  christos 
   2681          1.1    jruoho         case ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY:
   2682      1.1.1.4  christos 
   2683          1.1    jruoho             InfoTable = AcpiDmTableInfoSrat2;
   2684          1.1    jruoho             break;
   2685      1.1.1.4  christos 
   2686      1.1.1.5  christos         case ACPI_SRAT_TYPE_GICC_AFFINITY:
   2687      1.1.1.5  christos 
   2688      1.1.1.5  christos             InfoTable = AcpiDmTableInfoSrat3;
   2689      1.1.1.5  christos             break;
   2690      1.1.1.5  christos 
   2691          1.1    jruoho         default:
   2692      1.1.1.5  christos             AcpiOsPrintf ("\n**** Unknown SRAT subtable type 0x%X\n", SubTable->Type);
   2693          1.1    jruoho 
   2694          1.1    jruoho             /* Attempt to continue */
   2695          1.1    jruoho 
   2696          1.1    jruoho             if (!SubTable->Length)
   2697          1.1    jruoho             {
   2698          1.1    jruoho                 AcpiOsPrintf ("Invalid zero length subtable\n");
   2699          1.1    jruoho                 return;
   2700          1.1    jruoho             }
   2701          1.1    jruoho             goto NextSubTable;
   2702          1.1    jruoho         }
   2703          1.1    jruoho 
   2704          1.1    jruoho         AcpiOsPrintf ("\n");
   2705          1.1    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   2706          1.1    jruoho                     SubTable->Length, InfoTable);
   2707          1.1    jruoho         if (ACPI_FAILURE (Status))
   2708          1.1    jruoho         {
   2709          1.1    jruoho             return;
   2710          1.1    jruoho         }
   2711          1.1    jruoho 
   2712          1.1    jruoho NextSubTable:
   2713      1.1.1.5  christos         /* Point to next subtable */
   2714          1.1    jruoho 
   2715          1.1    jruoho         Offset += SubTable->Length;
   2716          1.1    jruoho         SubTable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, SubTable, SubTable->Length);
   2717          1.1    jruoho     }
   2718          1.1    jruoho }
   2719          1.1    jruoho 
   2720          1.1    jruoho 
   2721          1.1    jruoho /*******************************************************************************
   2722          1.1    jruoho  *
   2723      1.1.1.4  christos  * FUNCTION:    AcpiDmDumpVrtc
   2724      1.1.1.4  christos  *
   2725      1.1.1.4  christos  * PARAMETERS:  Table               - A VRTC table
   2726      1.1.1.4  christos  *
   2727      1.1.1.4  christos  * RETURN:      None
   2728      1.1.1.4  christos  *
   2729      1.1.1.4  christos  * DESCRIPTION: Format the contents of a VRTC
   2730      1.1.1.4  christos  *
   2731      1.1.1.4  christos  ******************************************************************************/
   2732      1.1.1.4  christos 
   2733      1.1.1.4  christos void
   2734      1.1.1.4  christos AcpiDmDumpVrtc (
   2735      1.1.1.4  christos     ACPI_TABLE_HEADER       *Table)
   2736      1.1.1.4  christos {
   2737      1.1.1.4  christos     ACPI_STATUS             Status;
   2738      1.1.1.4  christos     UINT32                  Offset = sizeof (ACPI_TABLE_VRTC);
   2739      1.1.1.4  christos     ACPI_VRTC_ENTRY         *SubTable;
   2740      1.1.1.4  christos 
   2741      1.1.1.4  christos 
   2742      1.1.1.4  christos     /* Main table */
   2743      1.1.1.4  christos 
   2744      1.1.1.4  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoVrtc);
   2745      1.1.1.4  christos     if (ACPI_FAILURE (Status))
   2746      1.1.1.4  christos     {
   2747      1.1.1.4  christos         return;
   2748      1.1.1.4  christos     }
   2749      1.1.1.4  christos 
   2750      1.1.1.5  christos     /* Subtables */
   2751      1.1.1.4  christos 
   2752      1.1.1.4  christos     SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, Table, Offset);
   2753      1.1.1.4  christos     while (Offset < Table->Length)
   2754      1.1.1.4  christos     {
   2755      1.1.1.5  christos         /* Common subtable header */
   2756      1.1.1.4  christos 
   2757      1.1.1.4  christos         AcpiOsPrintf ("\n");
   2758      1.1.1.4  christos         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   2759      1.1.1.4  christos                     sizeof (ACPI_VRTC_ENTRY), AcpiDmTableInfoVrtc0);
   2760      1.1.1.4  christos         if (ACPI_FAILURE (Status))
   2761      1.1.1.4  christos         {
   2762      1.1.1.4  christos             return;
   2763      1.1.1.4  christos         }
   2764      1.1.1.4  christos 
   2765      1.1.1.5  christos         /* Point to next subtable */
   2766      1.1.1.4  christos 
   2767      1.1.1.4  christos         Offset += sizeof (ACPI_VRTC_ENTRY);
   2768      1.1.1.4  christos         SubTable = ACPI_ADD_PTR (ACPI_VRTC_ENTRY, SubTable, sizeof (ACPI_VRTC_ENTRY));
   2769      1.1.1.4  christos     }
   2770      1.1.1.4  christos }
   2771      1.1.1.4  christos 
   2772      1.1.1.4  christos 
   2773      1.1.1.4  christos /*******************************************************************************
   2774      1.1.1.4  christos  *
   2775          1.1    jruoho  * FUNCTION:    AcpiDmDumpWdat
   2776          1.1    jruoho  *
   2777          1.1    jruoho  * PARAMETERS:  Table               - A WDAT table
   2778          1.1    jruoho  *
   2779          1.1    jruoho  * RETURN:      None
   2780          1.1    jruoho  *
   2781          1.1    jruoho  * DESCRIPTION: Format the contents of a WDAT
   2782          1.1    jruoho  *
   2783          1.1    jruoho  ******************************************************************************/
   2784          1.1    jruoho 
   2785          1.1    jruoho void
   2786          1.1    jruoho AcpiDmDumpWdat (
   2787          1.1    jruoho     ACPI_TABLE_HEADER       *Table)
   2788          1.1    jruoho {
   2789          1.1    jruoho     ACPI_STATUS             Status;
   2790          1.1    jruoho     UINT32                  Offset = sizeof (ACPI_TABLE_WDAT);
   2791          1.1    jruoho     ACPI_WDAT_ENTRY         *SubTable;
   2792          1.1    jruoho 
   2793          1.1    jruoho 
   2794          1.1    jruoho     /* Main table */
   2795          1.1    jruoho 
   2796          1.1    jruoho     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoWdat);
   2797          1.1    jruoho     if (ACPI_FAILURE (Status))
   2798          1.1    jruoho     {
   2799          1.1    jruoho         return;
   2800          1.1    jruoho     }
   2801          1.1    jruoho 
   2802      1.1.1.5  christos     /* Subtables */
   2803          1.1    jruoho 
   2804          1.1    jruoho     SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, Table, Offset);
   2805          1.1    jruoho     while (Offset < Table->Length)
   2806          1.1    jruoho     {
   2807      1.1.1.5  christos         /* Common subtable header */
   2808          1.1    jruoho 
   2809          1.1    jruoho         AcpiOsPrintf ("\n");
   2810          1.1    jruoho         Status = AcpiDmDumpTable (Table->Length, Offset, SubTable,
   2811          1.1    jruoho                     sizeof (ACPI_WDAT_ENTRY), AcpiDmTableInfoWdat0);
   2812          1.1    jruoho         if (ACPI_FAILURE (Status))
   2813          1.1    jruoho         {
   2814          1.1    jruoho             return;
   2815          1.1    jruoho         }
   2816          1.1    jruoho 
   2817      1.1.1.5  christos         /* Point to next subtable */
   2818          1.1    jruoho 
   2819          1.1    jruoho         Offset += sizeof (ACPI_WDAT_ENTRY);
   2820          1.1    jruoho         SubTable = ACPI_ADD_PTR (ACPI_WDAT_ENTRY, SubTable, sizeof (ACPI_WDAT_ENTRY));
   2821          1.1    jruoho     }
   2822          1.1    jruoho }
   2823