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