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