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