Home | History | Annotate | Line # | Download | only in common
      1       1.1  christos /******************************************************************************
      2       1.1  christos  *
      3       1.1  christos  * Module Name: dmtbdump1 - Dump ACPI data tables that contain no AML code
      4       1.1  christos  *
      5       1.1  christos  *****************************************************************************/
      6       1.1  christos 
      7  1.1.1.12  christos /******************************************************************************
      8  1.1.1.12  christos  *
      9  1.1.1.12  christos  * 1. Copyright Notice
     10  1.1.1.12  christos  *
     11  1.1.1.13  christos  * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
     12       1.1  christos  * All rights reserved.
     13       1.1  christos  *
     14  1.1.1.12  christos  * 2. License
     15  1.1.1.12  christos  *
     16  1.1.1.12  christos  * 2.1. This is your license from Intel Corp. under its intellectual property
     17  1.1.1.12  christos  * rights. You may have additional license terms from the party that provided
     18  1.1.1.12  christos  * you this software, covering your right to use that party's intellectual
     19  1.1.1.12  christos  * property rights.
     20  1.1.1.12  christos  *
     21  1.1.1.12  christos  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
     22  1.1.1.12  christos  * copy of the source code appearing in this file ("Covered Code") an
     23  1.1.1.12  christos  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
     24  1.1.1.12  christos  * base code distributed originally by Intel ("Original Intel Code") to copy,
     25  1.1.1.12  christos  * make derivatives, distribute, use and display any portion of the Covered
     26  1.1.1.12  christos  * Code in any form, with the right to sublicense such rights; and
     27  1.1.1.12  christos  *
     28  1.1.1.12  christos  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
     29  1.1.1.12  christos  * license (with the right to sublicense), under only those claims of Intel
     30  1.1.1.12  christos  * patents that are infringed by the Original Intel Code, to make, use, sell,
     31  1.1.1.12  christos  * offer to sell, and import the Covered Code and derivative works thereof
     32  1.1.1.12  christos  * solely to the minimum extent necessary to exercise the above copyright
     33  1.1.1.12  christos  * license, and in no event shall the patent license extend to any additions
     34  1.1.1.12  christos  * to or modifications of the Original Intel Code. No other license or right
     35  1.1.1.12  christos  * is granted directly or by implication, estoppel or otherwise;
     36  1.1.1.12  christos  *
     37  1.1.1.12  christos  * The above copyright and patent license is granted only if the following
     38  1.1.1.12  christos  * conditions are met:
     39  1.1.1.12  christos  *
     40  1.1.1.12  christos  * 3. Conditions
     41  1.1.1.12  christos  *
     42  1.1.1.12  christos  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
     43  1.1.1.12  christos  * Redistribution of source code of any substantial portion of the Covered
     44  1.1.1.12  christos  * Code or modification with rights to further distribute source must include
     45  1.1.1.12  christos  * the above Copyright Notice, the above License, this list of Conditions,
     46  1.1.1.12  christos  * and the following Disclaimer and Export Compliance provision. In addition,
     47  1.1.1.12  christos  * Licensee must cause all Covered Code to which Licensee contributes to
     48  1.1.1.12  christos  * contain a file documenting the changes Licensee made to create that Covered
     49  1.1.1.12  christos  * Code and the date of any change. Licensee must include in that file the
     50  1.1.1.12  christos  * documentation of any changes made by any predecessor Licensee. Licensee
     51  1.1.1.12  christos  * must include a prominent statement that the modification is derived,
     52  1.1.1.12  christos  * directly or indirectly, from Original Intel Code.
     53  1.1.1.12  christos  *
     54  1.1.1.12  christos  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
     55  1.1.1.12  christos  * Redistribution of source code of any substantial portion of the Covered
     56  1.1.1.12  christos  * Code or modification without rights to further distribute source must
     57  1.1.1.12  christos  * include the following Disclaimer and Export Compliance provision in the
     58  1.1.1.12  christos  * documentation and/or other materials provided with distribution. In
     59  1.1.1.12  christos  * addition, Licensee may not authorize further sublicense of source of any
     60  1.1.1.12  christos  * portion of the Covered Code, and must include terms to the effect that the
     61  1.1.1.12  christos  * license from Licensee to its licensee is limited to the intellectual
     62  1.1.1.12  christos  * property embodied in the software Licensee provides to its licensee, and
     63  1.1.1.12  christos  * not to intellectual property embodied in modifications its licensee may
     64  1.1.1.12  christos  * make.
     65  1.1.1.12  christos  *
     66  1.1.1.12  christos  * 3.3. Redistribution of Executable. Redistribution in executable form of any
     67  1.1.1.12  christos  * substantial portion of the Covered Code or modification must reproduce the
     68  1.1.1.12  christos  * above Copyright Notice, and the following Disclaimer and Export Compliance
     69  1.1.1.12  christos  * provision in the documentation and/or other materials provided with the
     70  1.1.1.12  christos  * distribution.
     71  1.1.1.12  christos  *
     72  1.1.1.12  christos  * 3.4. Intel retains all right, title, and interest in and to the Original
     73  1.1.1.12  christos  * Intel Code.
     74  1.1.1.12  christos  *
     75  1.1.1.12  christos  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
     76  1.1.1.12  christos  * Intel shall be used in advertising or otherwise to promote the sale, use or
     77  1.1.1.12  christos  * other dealings in products derived from or relating to the Covered Code
     78  1.1.1.12  christos  * without prior written authorization from Intel.
     79  1.1.1.12  christos  *
     80  1.1.1.12  christos  * 4. Disclaimer and Export Compliance
     81  1.1.1.12  christos  *
     82  1.1.1.12  christos  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
     83  1.1.1.12  christos  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
     84  1.1.1.12  christos  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
     85  1.1.1.12  christos  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
     86  1.1.1.12  christos  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
     87  1.1.1.12  christos  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
     88  1.1.1.12  christos  * PARTICULAR PURPOSE.
     89  1.1.1.12  christos  *
     90  1.1.1.12  christos  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
     91  1.1.1.12  christos  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
     92  1.1.1.12  christos  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
     93  1.1.1.12  christos  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
     94  1.1.1.12  christos  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
     95  1.1.1.12  christos  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
     96  1.1.1.12  christos  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
     97  1.1.1.12  christos  * LIMITED REMEDY.
     98  1.1.1.12  christos  *
     99  1.1.1.12  christos  * 4.3. Licensee shall not export, either directly or indirectly, any of this
    100  1.1.1.12  christos  * software or system incorporating such software without first obtaining any
    101  1.1.1.12  christos  * required license or other approval from the U. S. Department of Commerce or
    102  1.1.1.12  christos  * any other agency or department of the United States Government. In the
    103  1.1.1.12  christos  * event Licensee exports any such software from the United States or
    104  1.1.1.12  christos  * re-exports any such software from a foreign destination, Licensee shall
    105  1.1.1.12  christos  * ensure that the distribution and export/re-export of the software is in
    106  1.1.1.12  christos  * compliance with all laws, regulations, orders, or other restrictions of the
    107  1.1.1.12  christos  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
    108  1.1.1.12  christos  * any of its subsidiaries will export/re-export any technical data, process,
    109  1.1.1.12  christos  * software, or service, directly or indirectly, to any country for which the
    110  1.1.1.12  christos  * United States government or any agency thereof requires an export license,
    111  1.1.1.12  christos  * other governmental approval, or letter of assurance, without first obtaining
    112  1.1.1.12  christos  * such license, approval or letter.
    113  1.1.1.12  christos  *
    114  1.1.1.12  christos  *****************************************************************************
    115  1.1.1.12  christos  *
    116  1.1.1.12  christos  * Alternatively, you may choose to be licensed under the terms of the
    117  1.1.1.12  christos  * following license:
    118  1.1.1.12  christos  *
    119       1.1  christos  * Redistribution and use in source and binary forms, with or without
    120       1.1  christos  * modification, are permitted provided that the following conditions
    121       1.1  christos  * are met:
    122       1.1  christos  * 1. Redistributions of source code must retain the above copyright
    123       1.1  christos  *    notice, this list of conditions, and the following disclaimer,
    124       1.1  christos  *    without modification.
    125       1.1  christos  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
    126       1.1  christos  *    substantially similar to the "NO WARRANTY" disclaimer below
    127       1.1  christos  *    ("Disclaimer") and any redistribution must be conditioned upon
    128       1.1  christos  *    including a substantially similar Disclaimer requirement for further
    129       1.1  christos  *    binary redistribution.
    130       1.1  christos  * 3. Neither the names of the above-listed copyright holders nor the names
    131       1.1  christos  *    of any contributors may be used to endorse or promote products derived
    132       1.1  christos  *    from this software without specific prior written permission.
    133       1.1  christos  *
    134       1.1  christos  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    135       1.1  christos  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    136   1.1.1.5  christos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    137       1.1  christos  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    138  1.1.1.12  christos  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    139  1.1.1.12  christos  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    140  1.1.1.12  christos  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    141  1.1.1.12  christos  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    142  1.1.1.12  christos  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    143  1.1.1.12  christos  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    144  1.1.1.12  christos  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    145  1.1.1.12  christos  *
    146  1.1.1.12  christos  * Alternatively, you may choose to be licensed under the terms of the
    147  1.1.1.12  christos  * GNU General Public License ("GPL") version 2 as published by the Free
    148  1.1.1.12  christos  * Software Foundation.
    149  1.1.1.12  christos  *
    150  1.1.1.12  christos  *****************************************************************************/
    151       1.1  christos 
    152       1.1  christos #include "acpi.h"
    153       1.1  christos #include "accommon.h"
    154       1.1  christos #include "acdisasm.h"
    155       1.1  christos #include "actables.h"
    156   1.1.1.9  christos #include "aslcompiler.h"
    157       1.1  christos 
    158       1.1  christos /* This module used for application-level code only */
    159       1.1  christos 
    160       1.1  christos #define _COMPONENT          ACPI_CA_DISASSEMBLER
    161       1.1  christos         ACPI_MODULE_NAME    ("dmtbdump1")
    162       1.1  christos 
    163       1.1  christos 
    164       1.1  christos /*******************************************************************************
    165       1.1  christos  *
    166   1.1.1.6  christos  * FUNCTION:    AcpiDmDumpAest
    167   1.1.1.6  christos  *
    168   1.1.1.6  christos  * PARAMETERS:  Table               - A AEST table
    169   1.1.1.6  christos  *
    170   1.1.1.6  christos  * RETURN:      None
    171   1.1.1.6  christos  *
    172   1.1.1.6  christos  * DESCRIPTION: Format the contents of a AEST table
    173   1.1.1.6  christos  *
    174   1.1.1.6  christos  * NOTE: Assumes the following table structure:
    175   1.1.1.6  christos  *      For all AEST Error Nodes:
    176   1.1.1.6  christos  *          1) An AEST Error Node, followed immediately by:
    177   1.1.1.6  christos  *          2) Any node-specific data
    178   1.1.1.6  christos  *          3) An Interface Structure (one)
    179   1.1.1.6  christos  *          4) A list (array) of Interrupt Structures
    180   1.1.1.6  christos  *
    181   1.1.1.6  christos  * AEST - ARM Error Source table. Conforms to:
    182   1.1.1.6  christos  * ACPI for the Armv8 RAS Extensions 1.1 Platform Design Document Sep 2020
    183   1.1.1.6  christos  *
    184   1.1.1.6  christos  ******************************************************************************/
    185   1.1.1.6  christos 
    186   1.1.1.6  christos void
    187   1.1.1.6  christos AcpiDmDumpAest (
    188   1.1.1.6  christos     ACPI_TABLE_HEADER       *Table)
    189   1.1.1.6  christos {
    190   1.1.1.6  christos     ACPI_STATUS             Status;
    191   1.1.1.6  christos     UINT32                  Offset = sizeof (ACPI_TABLE_HEADER);
    192   1.1.1.6  christos     ACPI_AEST_HEADER        *Subtable;
    193   1.1.1.6  christos     ACPI_AEST_HEADER        *NodeHeader;
    194   1.1.1.6  christos     ACPI_AEST_PROCESSOR     *ProcessorSubtable;
    195   1.1.1.6  christos     ACPI_DMTABLE_INFO       *InfoTable;
    196   1.1.1.6  christos     ACPI_SIZE               Length;
    197   1.1.1.6  christos     UINT8                   Type;
    198  1.1.1.11  christos     UINT8                   Revision = Table->Revision;
    199  1.1.1.11  christos     UINT32                  Count;
    200  1.1.1.11  christos     ACPI_AEST_NODE_INTERFACE_HEADER *InterfaceHeader;
    201   1.1.1.6  christos 
    202   1.1.1.6  christos 
    203   1.1.1.6  christos     /* Very small, generic main table. AEST consists of mostly subtables */
    204   1.1.1.6  christos 
    205   1.1.1.6  christos     while (Offset < Table->Length)
    206   1.1.1.6  christos     {
    207   1.1.1.6  christos         NodeHeader = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset);
    208   1.1.1.6  christos 
    209   1.1.1.6  christos         /* Dump the common error node (subtable) header */
    210   1.1.1.6  christos 
    211   1.1.1.6  christos         Status = AcpiDmDumpTable (Table->Length, Offset, NodeHeader,
    212   1.1.1.6  christos             NodeHeader->Length, AcpiDmTableInfoAestHdr);
    213   1.1.1.6  christos         if (ACPI_FAILURE (Status))
    214   1.1.1.6  christos         {
    215   1.1.1.6  christos             return;
    216   1.1.1.6  christos         }
    217   1.1.1.6  christos 
    218   1.1.1.6  christos         Type = NodeHeader->Type;
    219   1.1.1.6  christos 
    220   1.1.1.6  christos         /* Setup the node-specific subtable based on the header Type field */
    221   1.1.1.6  christos 
    222   1.1.1.6  christos         switch (Type)
    223   1.1.1.6  christos         {
    224   1.1.1.6  christos         case ACPI_AEST_PROCESSOR_ERROR_NODE:
    225   1.1.1.6  christos             InfoTable = AcpiDmTableInfoAestProcError;
    226   1.1.1.6  christos             Length = sizeof (ACPI_AEST_PROCESSOR);
    227   1.1.1.6  christos             break;
    228   1.1.1.6  christos 
    229   1.1.1.6  christos         case ACPI_AEST_MEMORY_ERROR_NODE:
    230   1.1.1.6  christos             InfoTable = AcpiDmTableInfoAestMemError;
    231   1.1.1.6  christos             Length = sizeof (ACPI_AEST_MEMORY);
    232   1.1.1.6  christos             break;
    233   1.1.1.6  christos 
    234   1.1.1.6  christos         case ACPI_AEST_SMMU_ERROR_NODE:
    235   1.1.1.6  christos             InfoTable = AcpiDmTableInfoAestSmmuError;
    236   1.1.1.6  christos             Length = sizeof (ACPI_AEST_SMMU);
    237   1.1.1.6  christos             break;
    238   1.1.1.6  christos 
    239   1.1.1.6  christos         case ACPI_AEST_VENDOR_ERROR_NODE:
    240  1.1.1.11  christos             switch (Revision)
    241  1.1.1.11  christos             {
    242  1.1.1.11  christos             case 1:
    243  1.1.1.11  christos                 InfoTable = AcpiDmTableInfoAestVendorError;
    244  1.1.1.11  christos                 Length = sizeof (ACPI_AEST_VENDOR);
    245  1.1.1.11  christos                 break;
    246  1.1.1.11  christos 
    247  1.1.1.11  christos             case 2:
    248  1.1.1.11  christos                 InfoTable = AcpiDmTableInfoAestVendorV2Error;
    249  1.1.1.11  christos                 Length = sizeof (ACPI_AEST_VENDOR_V2);
    250  1.1.1.11  christos                 break;
    251  1.1.1.11  christos 
    252  1.1.1.11  christos             default:
    253  1.1.1.11  christos                 AcpiOsPrintf ("\n**** Unknown AEST revision 0x%X\n", Revision);
    254  1.1.1.11  christos                 return;
    255  1.1.1.11  christos             }
    256   1.1.1.6  christos             break;
    257   1.1.1.6  christos 
    258   1.1.1.6  christos         case ACPI_AEST_GIC_ERROR_NODE:
    259   1.1.1.6  christos             InfoTable = AcpiDmTableInfoAestGicError;
    260   1.1.1.6  christos             Length = sizeof (ACPI_AEST_GIC);
    261   1.1.1.6  christos             break;
    262   1.1.1.6  christos 
    263  1.1.1.11  christos         case ACPI_AEST_PCIE_ERROR_NODE:
    264  1.1.1.11  christos             InfoTable = AcpiDmTableInfoAestPCIeError;
    265  1.1.1.11  christos             Length = sizeof (ACPI_AEST_PCIE);
    266  1.1.1.11  christos             break;
    267  1.1.1.11  christos 
    268  1.1.1.11  christos         case ACPI_AEST_PROXY_ERROR_NODE:
    269  1.1.1.11  christos             InfoTable = AcpiDmTableInfoAestProxyError;
    270  1.1.1.11  christos             Length = sizeof (ACPI_AEST_PROXY);
    271  1.1.1.11  christos             break;
    272  1.1.1.11  christos 
    273   1.1.1.6  christos         /* Error case below */
    274   1.1.1.6  christos         default:
    275   1.1.1.6  christos 
    276   1.1.1.6  christos             AcpiOsPrintf ("\n**** Unknown AEST Error Subtable type 0x%X\n",
    277   1.1.1.6  christos                 Type);
    278   1.1.1.6  christos             return;
    279   1.1.1.6  christos         }
    280   1.1.1.6  christos 
    281   1.1.1.6  christos         /* Point past the common header (to the node-specific data) */
    282   1.1.1.6  christos 
    283   1.1.1.6  christos         Offset += sizeof (ACPI_AEST_HEADER);
    284   1.1.1.6  christos         Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset);
    285   1.1.1.6  christos         AcpiOsPrintf ("\n");
    286   1.1.1.6  christos 
    287   1.1.1.6  christos         /* Dump the node-specific subtable */
    288   1.1.1.6  christos 
    289   1.1.1.6  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, Length,
    290   1.1.1.6  christos             InfoTable);
    291   1.1.1.6  christos         if (ACPI_FAILURE (Status))
    292   1.1.1.6  christos         {
    293   1.1.1.6  christos             return;
    294   1.1.1.6  christos         }
    295   1.1.1.6  christos         AcpiOsPrintf ("\n");
    296   1.1.1.6  christos 
    297   1.1.1.6  christos         if (Type == ACPI_AEST_PROCESSOR_ERROR_NODE)
    298   1.1.1.6  christos         {
    299   1.1.1.6  christos             /*
    300   1.1.1.6  christos              * Special handling for PROCESSOR_ERROR_NODE subtables
    301   1.1.1.6  christos              * (to handle the Resource Substructure via the ResourceType
    302   1.1.1.6  christos              * field).
    303   1.1.1.6  christos              */
    304   1.1.1.6  christos 
    305   1.1.1.6  christos             /* Point past the node-specific data */
    306   1.1.1.6  christos 
    307   1.1.1.6  christos             Offset += Length;
    308   1.1.1.6  christos             ProcessorSubtable = ACPI_CAST_PTR (ACPI_AEST_PROCESSOR, Subtable);
    309   1.1.1.6  christos 
    310   1.1.1.6  christos             switch (ProcessorSubtable->ResourceType)
    311   1.1.1.6  christos             {
    312   1.1.1.6  christos             /* Setup the Resource Substructure subtable */
    313   1.1.1.6  christos 
    314   1.1.1.6  christos             case ACPI_AEST_CACHE_RESOURCE:
    315   1.1.1.6  christos                 InfoTable = AcpiDmTableInfoAestCacheRsrc;
    316   1.1.1.6  christos                 Length = sizeof (ACPI_AEST_PROCESSOR_CACHE);
    317   1.1.1.6  christos                 break;
    318   1.1.1.6  christos 
    319   1.1.1.6  christos             case ACPI_AEST_TLB_RESOURCE:
    320   1.1.1.6  christos                 InfoTable = AcpiDmTableInfoAestTlbRsrc;
    321   1.1.1.6  christos                 Length = sizeof (ACPI_AEST_PROCESSOR_TLB);
    322   1.1.1.6  christos                 break;
    323   1.1.1.6  christos 
    324   1.1.1.6  christos             case ACPI_AEST_GENERIC_RESOURCE:
    325   1.1.1.6  christos                 InfoTable = AcpiDmTableInfoAestGenRsrc;
    326   1.1.1.6  christos                 Length = sizeof (ACPI_AEST_PROCESSOR_GENERIC);
    327   1.1.1.6  christos                 break;
    328   1.1.1.6  christos 
    329   1.1.1.6  christos             /* Error case below */
    330   1.1.1.6  christos             default:
    331   1.1.1.6  christos                 AcpiOsPrintf ("\n**** Unknown AEST Processor Resource type 0x%X\n",
    332   1.1.1.6  christos                     ProcessorSubtable->ResourceType);
    333   1.1.1.6  christos                 return;
    334   1.1.1.6  christos             }
    335   1.1.1.6  christos 
    336   1.1.1.6  christos             ProcessorSubtable = ACPI_ADD_PTR (ACPI_AEST_PROCESSOR, Table,
    337   1.1.1.6  christos                 Offset);
    338   1.1.1.6  christos 
    339   1.1.1.6  christos             /* Dump the resource substructure subtable */
    340   1.1.1.6  christos 
    341   1.1.1.6  christos             Status = AcpiDmDumpTable (Table->Length, Offset, ProcessorSubtable,
    342   1.1.1.6  christos                 Length, InfoTable);
    343   1.1.1.6  christos             if (ACPI_FAILURE (Status))
    344   1.1.1.6  christos             {
    345   1.1.1.6  christos                 return;
    346   1.1.1.6  christos             }
    347   1.1.1.6  christos 
    348   1.1.1.6  christos             AcpiOsPrintf ("\n");
    349   1.1.1.6  christos         }
    350   1.1.1.6  christos 
    351   1.1.1.6  christos         /* Point past the resource substructure or the node-specific data */
    352   1.1.1.6  christos 
    353   1.1.1.6  christos         Offset += Length;
    354   1.1.1.6  christos 
    355   1.1.1.6  christos         /* Dump the interface structure, required to be present */
    356   1.1.1.6  christos 
    357   1.1.1.6  christos         Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset);
    358   1.1.1.6  christos         if (Subtable->Type >= ACPI_AEST_XFACE_RESERVED)
    359   1.1.1.6  christos         {
    360   1.1.1.6  christos             AcpiOsPrintf ("\n**** Unknown AEST Node Interface type 0x%X\n",
    361   1.1.1.6  christos                 Subtable->Type);
    362   1.1.1.6  christos             return;
    363   1.1.1.6  christos         }
    364   1.1.1.6  christos 
    365  1.1.1.11  christos         if (Revision == 1)
    366  1.1.1.11  christos         {
    367  1.1.1.11  christos             InfoTable = AcpiDmTableInfoAestXface;
    368  1.1.1.11  christos             Length = sizeof (ACPI_AEST_NODE_INTERFACE);
    369  1.1.1.11  christos         }
    370  1.1.1.11  christos         else if (Revision == 2)
    371  1.1.1.11  christos         {
    372  1.1.1.11  christos             InfoTable = AcpiDmTableInfoAestXfaceHeader;
    373  1.1.1.11  christos             Length = sizeof (ACPI_AEST_NODE_INTERFACE_HEADER);
    374  1.1.1.11  christos 
    375  1.1.1.11  christos             Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, Length, InfoTable);
    376  1.1.1.11  christos             if (ACPI_FAILURE (Status))
    377  1.1.1.11  christos             {
    378  1.1.1.11  christos                 return;
    379  1.1.1.11  christos             }
    380  1.1.1.11  christos 
    381  1.1.1.11  christos             Offset += Length;
    382  1.1.1.11  christos 
    383  1.1.1.11  christos             InterfaceHeader = ACPI_CAST_PTR (ACPI_AEST_NODE_INTERFACE_HEADER, Subtable);
    384  1.1.1.11  christos             switch (InterfaceHeader->GroupFormat)
    385  1.1.1.11  christos 	        {
    386  1.1.1.11  christos             case ACPI_AEST_NODE_GROUP_FORMAT_4K:
    387  1.1.1.11  christos                 InfoTable = AcpiDmTableInfoAestXface4k;
    388  1.1.1.11  christos                 Length = sizeof (ACPI_AEST_NODE_INTERFACE_4K);
    389  1.1.1.11  christos                 break;
    390  1.1.1.11  christos 
    391  1.1.1.11  christos             case ACPI_AEST_NODE_GROUP_FORMAT_16K:
    392  1.1.1.11  christos                 InfoTable = AcpiDmTableInfoAestXface16k;
    393  1.1.1.11  christos                 Length = sizeof (ACPI_AEST_NODE_INTERFACE_16K);
    394  1.1.1.11  christos                 break;
    395  1.1.1.11  christos 
    396  1.1.1.11  christos             case ACPI_AEST_NODE_GROUP_FORMAT_64K:
    397  1.1.1.11  christos                 InfoTable = AcpiDmTableInfoAestXface64k;
    398  1.1.1.11  christos                 Length = sizeof (ACPI_AEST_NODE_INTERFACE_64K);
    399  1.1.1.11  christos                 break;
    400  1.1.1.11  christos 
    401  1.1.1.11  christos             default:
    402  1.1.1.11  christos                 AcpiOsPrintf ("\n**** Unknown AEST Interface Group Format 0x%X\n",
    403  1.1.1.11  christos                     InterfaceHeader->GroupFormat);
    404  1.1.1.11  christos                 return;
    405  1.1.1.11  christos             }
    406  1.1.1.11  christos 
    407  1.1.1.11  christos             Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset);
    408  1.1.1.11  christos         }
    409  1.1.1.11  christos         else
    410  1.1.1.11  christos         {
    411  1.1.1.11  christos             AcpiOsPrintf ("\n**** Unknown AEST revision 0x%X\n", Revision);
    412  1.1.1.11  christos             return;
    413  1.1.1.11  christos         }
    414  1.1.1.11  christos 
    415  1.1.1.11  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, Length, InfoTable);
    416   1.1.1.6  christos         if (ACPI_FAILURE (Status))
    417   1.1.1.6  christos         {
    418   1.1.1.6  christos             return;
    419   1.1.1.6  christos         }
    420   1.1.1.6  christos 
    421   1.1.1.6  christos         /* Point past the interface structure */
    422   1.1.1.6  christos 
    423   1.1.1.6  christos         AcpiOsPrintf ("\n");
    424  1.1.1.11  christos         Offset += Length;
    425   1.1.1.6  christos 
    426   1.1.1.6  christos         /* Dump the entire interrupt structure array, if present */
    427   1.1.1.6  christos 
    428   1.1.1.6  christos         if (NodeHeader->NodeInterruptOffset)
    429   1.1.1.6  christos         {
    430  1.1.1.11  christos             Count = NodeHeader->NodeInterruptCount;
    431   1.1.1.6  christos             Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset);
    432   1.1.1.6  christos 
    433  1.1.1.11  christos             while (Count)
    434   1.1.1.6  christos             {
    435   1.1.1.6  christos                 /* Dump the interrupt structure */
    436   1.1.1.6  christos 
    437  1.1.1.11  christos                 switch (Revision) {
    438  1.1.1.11  christos                 case 1:
    439  1.1.1.11  christos                     InfoTable = AcpiDmTableInfoAestXrupt;
    440  1.1.1.11  christos                     Length = sizeof (ACPI_AEST_NODE_INTERRUPT);
    441  1.1.1.11  christos                     break;
    442  1.1.1.11  christos 
    443  1.1.1.11  christos                 case 2:
    444  1.1.1.11  christos                     InfoTable = AcpiDmTableInfoAestXruptV2;
    445  1.1.1.11  christos                     Length = sizeof (ACPI_AEST_NODE_INTERRUPT_V2);
    446  1.1.1.11  christos                     break;
    447  1.1.1.11  christos                 default:
    448  1.1.1.11  christos                     AcpiOsPrintf ("\n**** Unknown AEST revision 0x%X\n",
    449  1.1.1.11  christos                         Revision);
    450  1.1.1.11  christos                     return;
    451  1.1.1.11  christos                 }
    452   1.1.1.6  christos                 Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    453  1.1.1.11  christos                     Length, InfoTable);
    454   1.1.1.6  christos                 if (ACPI_FAILURE (Status))
    455   1.1.1.6  christos                 {
    456   1.1.1.6  christos                     return;
    457   1.1.1.6  christos                 }
    458   1.1.1.6  christos 
    459   1.1.1.6  christos                 /* Point to the next interrupt structure */
    460   1.1.1.6  christos 
    461  1.1.1.11  christos                 Offset += Length;
    462   1.1.1.6  christos                 Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset);
    463  1.1.1.11  christos                 Count--;
    464   1.1.1.6  christos                 AcpiOsPrintf ("\n");
    465   1.1.1.6  christos             }
    466   1.1.1.6  christos         }
    467   1.1.1.6  christos     }
    468   1.1.1.6  christos }
    469   1.1.1.6  christos 
    470   1.1.1.8  christos /*******************************************************************************
    471   1.1.1.8  christos  *
    472   1.1.1.8  christos  * FUNCTION:    AcpiDmDumpApmt
    473   1.1.1.8  christos  *
    474   1.1.1.8  christos  * PARAMETERS:  Table               - A APMT table
    475   1.1.1.8  christos  *
    476   1.1.1.8  christos  * RETURN:      None
    477   1.1.1.8  christos  *
    478   1.1.1.8  christos  * DESCRIPTION: Format the contents of a APMT. This table type consists
    479   1.1.1.8  christos  *              of an open-ended number of subtables.
    480   1.1.1.8  christos  *
    481   1.1.1.8  christos  *
    482   1.1.1.8  christos  * APMT - ARM Performance Monitoring Unit table. Conforms to:
    483   1.1.1.8  christos  * ARM Performance Monitoring Unit Architecture 1.0 Platform Design Document
    484   1.1.1.8  christos  * ARM DEN0117 v1.0 November 25, 2021
    485   1.1.1.8  christos  *
    486   1.1.1.8  christos  ******************************************************************************/
    487   1.1.1.8  christos 
    488   1.1.1.8  christos void
    489   1.1.1.8  christos AcpiDmDumpApmt (
    490   1.1.1.8  christos     ACPI_TABLE_HEADER       *Table)
    491   1.1.1.8  christos {
    492   1.1.1.8  christos     ACPI_STATUS              Status;
    493   1.1.1.8  christos     ACPI_APMT_NODE           *Subtable;
    494   1.1.1.8  christos     UINT32                   Length = Table->Length;
    495   1.1.1.8  christos     UINT32                   Offset = sizeof (ACPI_TABLE_APMT);
    496   1.1.1.8  christos     UINT32                   NodeNum = 0;
    497   1.1.1.8  christos 
    498   1.1.1.8  christos     /* There is no main table (other than the standard ACPI header) */
    499   1.1.1.8  christos 
    500   1.1.1.8  christos     /* Subtables */
    501   1.1.1.8  christos 
    502   1.1.1.8  christos     Subtable = ACPI_ADD_PTR (ACPI_APMT_NODE, Table, Offset);
    503   1.1.1.8  christos     while (Offset < Table->Length)
    504   1.1.1.8  christos     {
    505   1.1.1.8  christos         AcpiOsPrintf ("\n");
    506   1.1.1.8  christos 
    507   1.1.1.8  christos         if (Subtable->Type >= ACPI_APMT_NODE_TYPE_COUNT)
    508   1.1.1.8  christos         {
    509   1.1.1.8  christos             AcpiOsPrintf ("\n**** Unknown APMT subtable type 0x%X\n",
    510   1.1.1.8  christos                 Subtable->Type);
    511   1.1.1.8  christos             return;
    512   1.1.1.8  christos         }
    513   1.1.1.8  christos 
    514   1.1.1.8  christos         AcpiOsPrintf ("/* APMT Node-%u */\n", NodeNum++);
    515   1.1.1.8  christos 
    516   1.1.1.8  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
    517   1.1.1.8  christos             Subtable->Length, AcpiDmTableInfoApmtNode);
    518   1.1.1.8  christos         if (ACPI_FAILURE (Status))
    519   1.1.1.8  christos         {
    520   1.1.1.8  christos             return;
    521   1.1.1.8  christos         }
    522   1.1.1.8  christos 
    523   1.1.1.8  christos         /* Point to next subtable */
    524   1.1.1.8  christos 
    525   1.1.1.8  christos         Offset += Subtable->Length;
    526   1.1.1.8  christos         Subtable = ACPI_ADD_PTR (ACPI_APMT_NODE, Subtable,
    527   1.1.1.8  christos             Subtable->Length);
    528   1.1.1.8  christos         AcpiOsPrintf ("\n");
    529   1.1.1.8  christos     }
    530   1.1.1.8  christos }
    531   1.1.1.8  christos 
    532   1.1.1.6  christos 
    533   1.1.1.6  christos /*******************************************************************************
    534   1.1.1.6  christos  *
    535       1.1  christos  * FUNCTION:    AcpiDmDumpAsf
    536       1.1  christos  *
    537       1.1  christos  * PARAMETERS:  Table               - A ASF table
    538       1.1  christos  *
    539       1.1  christos  * RETURN:      None
    540       1.1  christos  *
    541       1.1  christos  * DESCRIPTION: Format the contents of a ASF table
    542       1.1  christos  *
    543       1.1  christos  ******************************************************************************/
    544       1.1  christos 
    545       1.1  christos void
    546       1.1  christos AcpiDmDumpAsf (
    547       1.1  christos     ACPI_TABLE_HEADER       *Table)
    548       1.1  christos {
    549       1.1  christos     ACPI_STATUS             Status;
    550       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_HEADER);
    551       1.1  christos     ACPI_ASF_INFO           *Subtable;
    552       1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
    553       1.1  christos     ACPI_DMTABLE_INFO       *DataInfoTable = NULL;
    554       1.1  christos     UINT8                   *DataTable = NULL;
    555       1.1  christos     UINT32                  DataCount = 0;
    556       1.1  christos     UINT32                  DataLength = 0;
    557       1.1  christos     UINT32                  DataOffset = 0;
    558       1.1  christos     UINT32                  i;
    559       1.1  christos     UINT8                   Type;
    560       1.1  christos 
    561       1.1  christos 
    562       1.1  christos     /* No main table, only subtables */
    563       1.1  christos 
    564       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset);
    565       1.1  christos     while (Offset < Table->Length)
    566       1.1  christos     {
    567       1.1  christos         /* Common subtable header */
    568       1.1  christos 
    569       1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    570       1.1  christos             Subtable->Header.Length, AcpiDmTableInfoAsfHdr);
    571       1.1  christos         if (ACPI_FAILURE (Status))
    572       1.1  christos         {
    573       1.1  christos             return;
    574       1.1  christos         }
    575       1.1  christos 
    576       1.1  christos         /* The actual type is the lower 7 bits of Type */
    577       1.1  christos 
    578       1.1  christos         Type = (UINT8) (Subtable->Header.Type & 0x7F);
    579       1.1  christos 
    580       1.1  christos         switch (Type)
    581       1.1  christos         {
    582       1.1  christos         case ACPI_ASF_TYPE_INFO:
    583       1.1  christos 
    584       1.1  christos             InfoTable = AcpiDmTableInfoAsf0;
    585       1.1  christos             break;
    586       1.1  christos 
    587       1.1  christos         case ACPI_ASF_TYPE_ALERT:
    588       1.1  christos 
    589       1.1  christos             InfoTable = AcpiDmTableInfoAsf1;
    590       1.1  christos             DataInfoTable = AcpiDmTableInfoAsf1a;
    591       1.1  christos             DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ALERT));
    592       1.1  christos             DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->Alerts;
    593       1.1  christos             DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->DataLength;
    594       1.1  christos             DataOffset = Offset + sizeof (ACPI_ASF_ALERT);
    595       1.1  christos             break;
    596       1.1  christos 
    597       1.1  christos         case ACPI_ASF_TYPE_CONTROL:
    598       1.1  christos 
    599       1.1  christos             InfoTable = AcpiDmTableInfoAsf2;
    600       1.1  christos             DataInfoTable = AcpiDmTableInfoAsf2a;
    601       1.1  christos             DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_REMOTE));
    602       1.1  christos             DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->Controls;
    603       1.1  christos             DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->DataLength;
    604       1.1  christos             DataOffset = Offset + sizeof (ACPI_ASF_REMOTE);
    605       1.1  christos             break;
    606       1.1  christos 
    607       1.1  christos         case ACPI_ASF_TYPE_BOOT:
    608       1.1  christos 
    609       1.1  christos             InfoTable = AcpiDmTableInfoAsf3;
    610       1.1  christos             break;
    611       1.1  christos 
    612       1.1  christos         case ACPI_ASF_TYPE_ADDRESS:
    613       1.1  christos 
    614       1.1  christos             InfoTable = AcpiDmTableInfoAsf4;
    615       1.1  christos             DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ADDRESS));
    616       1.1  christos             DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, Subtable)->Devices;
    617       1.1  christos             DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS);
    618       1.1  christos             break;
    619       1.1  christos 
    620       1.1  christos         default:
    621       1.1  christos 
    622       1.1  christos             AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n",
    623       1.1  christos                 Subtable->Header.Type);
    624       1.1  christos             return;
    625       1.1  christos         }
    626       1.1  christos 
    627       1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    628       1.1  christos             Subtable->Header.Length, InfoTable);
    629       1.1  christos         if (ACPI_FAILURE (Status))
    630       1.1  christos         {
    631       1.1  christos             return;
    632       1.1  christos         }
    633       1.1  christos 
    634       1.1  christos         /* Dump variable-length extra data */
    635       1.1  christos 
    636       1.1  christos         switch (Type)
    637       1.1  christos         {
    638       1.1  christos         case ACPI_ASF_TYPE_ALERT:
    639       1.1  christos         case ACPI_ASF_TYPE_CONTROL:
    640       1.1  christos 
    641       1.1  christos             for (i = 0; i < DataCount; i++)
    642       1.1  christos             {
    643       1.1  christos                 AcpiOsPrintf ("\n");
    644       1.1  christos                 Status = AcpiDmDumpTable (Table->Length, DataOffset,
    645       1.1  christos                     DataTable, DataLength, DataInfoTable);
    646       1.1  christos                 if (ACPI_FAILURE (Status))
    647       1.1  christos                 {
    648       1.1  christos                     return;
    649       1.1  christos                 }
    650       1.1  christos 
    651       1.1  christos                 DataTable = ACPI_ADD_PTR (UINT8, DataTable, DataLength);
    652       1.1  christos                 DataOffset += DataLength;
    653       1.1  christos             }
    654       1.1  christos             break;
    655       1.1  christos 
    656       1.1  christos         case ACPI_ASF_TYPE_ADDRESS:
    657       1.1  christos 
    658       1.1  christos             for (i = 0; i < DataLength; i++)
    659       1.1  christos             {
    660       1.1  christos                 if (!(i % 16))
    661       1.1  christos                 {
    662       1.1  christos                     AcpiDmLineHeader (DataOffset, 1, "Addresses");
    663       1.1  christos                 }
    664       1.1  christos 
    665       1.1  christos                 AcpiOsPrintf ("%2.2X ", *DataTable);
    666       1.1  christos                 DataTable++;
    667       1.1  christos                 DataOffset++;
    668       1.1  christos 
    669       1.1  christos                 if (DataOffset > Table->Length)
    670       1.1  christos                 {
    671       1.1  christos                     AcpiOsPrintf (
    672       1.1  christos                         "**** ACPI table terminates in the middle of a "
    673       1.1  christos                         "data structure! (ASF! table)\n");
    674       1.1  christos                     return;
    675       1.1  christos                 }
    676       1.1  christos             }
    677       1.1  christos 
    678       1.1  christos             AcpiOsPrintf ("\n");
    679       1.1  christos             break;
    680       1.1  christos 
    681       1.1  christos         default:
    682       1.1  christos 
    683       1.1  christos             break;
    684       1.1  christos         }
    685       1.1  christos 
    686       1.1  christos         AcpiOsPrintf ("\n");
    687       1.1  christos 
    688       1.1  christos         /* Point to next subtable */
    689       1.1  christos 
    690       1.1  christos         if (!Subtable->Header.Length)
    691       1.1  christos         {
    692       1.1  christos             AcpiOsPrintf ("Invalid zero subtable header length\n");
    693       1.1  christos             return;
    694       1.1  christos         }
    695       1.1  christos 
    696       1.1  christos         Offset += Subtable->Header.Length;
    697       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Subtable,
    698       1.1  christos             Subtable->Header.Length);
    699       1.1  christos     }
    700       1.1  christos }
    701       1.1  christos 
    702  1.1.1.10  christos /*******************************************************************************
    703  1.1.1.10  christos  *
    704  1.1.1.10  christos  * FUNCTION:    AcpiDmDumpAspt
    705  1.1.1.10  christos  *
    706  1.1.1.10  christos  * PARAMETERS:  Table               - A ASPT table
    707  1.1.1.10  christos  *
    708  1.1.1.10  christos  * RETURN:      None
    709  1.1.1.10  christos  *
    710  1.1.1.10  christos  * DESCRIPTION: Format the contents of a ASPT table
    711  1.1.1.10  christos  *
    712  1.1.1.10  christos  ******************************************************************************/
    713  1.1.1.10  christos 
    714  1.1.1.10  christos void
    715  1.1.1.10  christos AcpiDmDumpAspt (
    716  1.1.1.10  christos     ACPI_TABLE_HEADER       *Table)
    717  1.1.1.10  christos {
    718  1.1.1.10  christos     ACPI_STATUS             Status;
    719  1.1.1.10  christos     UINT32                  Offset = sizeof (ACPI_TABLE_ASPT);
    720  1.1.1.10  christos     UINT32                  Length = Table->Length;
    721  1.1.1.10  christos     ACPI_ASPT_HEADER        *Subtable;
    722  1.1.1.10  christos     ACPI_DMTABLE_INFO       *InfoTable;
    723  1.1.1.10  christos     UINT16                   Type;
    724  1.1.1.10  christos 
    725  1.1.1.10  christos     /* Main table */
    726  1.1.1.10  christos     Status = AcpiDmDumpTable(Length, 0, Table, 0, AcpiDmTableInfoAspt);
    727  1.1.1.10  christos 
    728  1.1.1.10  christos     /* Subtables */
    729  1.1.1.10  christos 
    730  1.1.1.10  christos     Subtable = ACPI_ADD_PTR (ACPI_ASPT_HEADER, Table, Offset);
    731  1.1.1.10  christos     while (Offset < Table->Length)
    732  1.1.1.10  christos     {
    733  1.1.1.10  christos         AcpiOsPrintf ("\n");
    734  1.1.1.10  christos 
    735  1.1.1.10  christos         /* Common subtable header */
    736  1.1.1.10  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    737  1.1.1.10  christos             Subtable->Length, AcpiDmTableInfoAsptHdr);
    738  1.1.1.10  christos         if (ACPI_FAILURE (Status))
    739  1.1.1.10  christos         {
    740  1.1.1.10  christos             return;
    741  1.1.1.10  christos         }
    742  1.1.1.10  christos 
    743  1.1.1.10  christos         Type = Subtable->Type;
    744  1.1.1.10  christos 
    745  1.1.1.10  christos         switch (Type)
    746  1.1.1.10  christos         {
    747  1.1.1.10  christos         case ACPI_ASPT_TYPE_GLOBAL_REGS:
    748  1.1.1.10  christos 
    749  1.1.1.10  christos             InfoTable = AcpiDmTableInfoAspt0;
    750  1.1.1.10  christos             break;
    751  1.1.1.10  christos 
    752  1.1.1.10  christos         case ACPI_ASPT_TYPE_SEV_MBOX_REGS:
    753  1.1.1.10  christos 
    754  1.1.1.10  christos             InfoTable = AcpiDmTableInfoAspt1;
    755  1.1.1.10  christos             break;
    756  1.1.1.10  christos 
    757  1.1.1.10  christos         case ACPI_ASPT_TYPE_ACPI_MBOX_REGS:
    758  1.1.1.10  christos 
    759  1.1.1.10  christos             InfoTable = AcpiDmTableInfoAspt2;
    760  1.1.1.10  christos             break;
    761  1.1.1.10  christos 
    762  1.1.1.10  christos         default:
    763  1.1.1.10  christos 
    764  1.1.1.10  christos             AcpiOsPrintf ("\n**** Unknown ASPT subtable type 0x%X\n",
    765  1.1.1.10  christos                 Subtable->Type);
    766  1.1.1.10  christos             return;
    767  1.1.1.10  christos         }
    768  1.1.1.10  christos 
    769  1.1.1.10  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    770  1.1.1.10  christos             Subtable->Length, InfoTable);
    771  1.1.1.10  christos         if (ACPI_FAILURE (Status))
    772  1.1.1.10  christos         {
    773  1.1.1.10  christos             return;
    774  1.1.1.10  christos         }
    775  1.1.1.10  christos 
    776  1.1.1.10  christos         AcpiOsPrintf ("\n");
    777  1.1.1.10  christos 
    778  1.1.1.10  christos         /* Point to next subtable */
    779  1.1.1.10  christos         if (!Subtable->Length)
    780  1.1.1.10  christos         {
    781  1.1.1.10  christos             AcpiOsPrintf ("Invalid zero subtable header length\n");
    782  1.1.1.10  christos             return;
    783  1.1.1.10  christos         }
    784  1.1.1.10  christos 
    785  1.1.1.10  christos         Offset += Subtable->Length;
    786  1.1.1.10  christos         Subtable = ACPI_ADD_PTR (ACPI_ASPT_HEADER, Subtable,
    787  1.1.1.10  christos             Subtable->Length);
    788  1.1.1.10  christos     }
    789  1.1.1.10  christos }
    790  1.1.1.10  christos 
    791   1.1.1.9  christos 
    792   1.1.1.9  christos /*******************************************************************************
    793   1.1.1.9  christos  *
    794   1.1.1.9  christos  * FUNCTION:    AcpiDmDumpCdat
    795   1.1.1.9  christos  *
    796   1.1.1.9  christos  * PARAMETERS:  InTable             - A CDAT table
    797   1.1.1.9  christos  *
    798   1.1.1.9  christos  * RETURN:      None
    799   1.1.1.9  christos  *
    800   1.1.1.9  christos  * DESCRIPTION: Format the contents of a CDAT. This table type consists
    801   1.1.1.9  christos  *              of an open-ended number of subtables.
    802   1.1.1.9  christos  *
    803   1.1.1.9  christos  ******************************************************************************/
    804   1.1.1.9  christos 
    805   1.1.1.9  christos void
    806   1.1.1.9  christos AcpiDmDumpCdat (
    807   1.1.1.9  christos     ACPI_TABLE_HEADER       *InTable)
    808   1.1.1.9  christos {
    809   1.1.1.9  christos     ACPI_TABLE_CDAT         *Table = ACPI_CAST_PTR (ACPI_TABLE_CDAT, InTable);
    810   1.1.1.9  christos     ACPI_STATUS             Status;
    811   1.1.1.9  christos     ACPI_CDAT_HEADER        *Subtable;
    812   1.1.1.9  christos     ACPI_TABLE_CDAT         *CdatTable = ACPI_CAST_PTR (ACPI_TABLE_CDAT, Table);
    813   1.1.1.9  christos     ACPI_DMTABLE_INFO       *InfoTable;
    814   1.1.1.9  christos     UINT32                  Length = CdatTable->Length;
    815   1.1.1.9  christos     UINT32                  Offset = sizeof (ACPI_TABLE_CDAT);
    816   1.1.1.9  christos     UINT32                  SubtableLength;
    817   1.1.1.9  christos     UINT32                  SubtableType;
    818   1.1.1.9  christos     INT32                   EntriesLength;
    819   1.1.1.9  christos 
    820   1.1.1.9  christos 
    821   1.1.1.9  christos     /* Main table */
    822   1.1.1.9  christos 
    823   1.1.1.9  christos     Status = AcpiDmDumpTable (Offset, 0, CdatTable, 0,
    824   1.1.1.9  christos         AcpiDmTableInfoCdatTableHdr);
    825   1.1.1.9  christos     if (ACPI_FAILURE (Status))
    826   1.1.1.9  christos     {
    827   1.1.1.9  christos         return;
    828   1.1.1.9  christos     }
    829   1.1.1.9  christos 
    830   1.1.1.9  christos     Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, sizeof (ACPI_TABLE_CDAT));
    831   1.1.1.9  christos     while (Offset < Table->Length)
    832   1.1.1.9  christos     {
    833   1.1.1.9  christos         /* Dump the common subtable header */
    834   1.1.1.9  christos 
    835   1.1.1.9  christos         DbgPrint (ASL_DEBUG_OUTPUT, "0) HeaderOffset: %X\n", Offset);
    836   1.1.1.9  christos         AcpiOsPrintf ("\n");
    837   1.1.1.9  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
    838   1.1.1.9  christos             sizeof (ACPI_CDAT_HEADER), AcpiDmTableInfoCdatHeader);
    839   1.1.1.9  christos         if (ACPI_FAILURE (Status))
    840   1.1.1.9  christos         {
    841   1.1.1.9  christos             return;
    842   1.1.1.9  christos         }
    843   1.1.1.9  christos 
    844   1.1.1.9  christos         /* Point past the common subtable header, decode the subtable type */
    845   1.1.1.9  christos 
    846   1.1.1.9  christos         Offset += sizeof (ACPI_CDAT_HEADER);
    847   1.1.1.9  christos         SubtableType = Subtable->Type;
    848   1.1.1.9  christos 
    849   1.1.1.9  christos         switch (Subtable->Type)
    850   1.1.1.9  christos         {
    851   1.1.1.9  christos         case ACPI_CDAT_TYPE_DSMAS:
    852   1.1.1.9  christos             Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
    853   1.1.1.9  christos             SubtableLength = sizeof (ACPI_CDAT_DSMAS);
    854   1.1.1.9  christos 
    855   1.1.1.9  christos             InfoTable = AcpiDmTableInfoCdat0;
    856   1.1.1.9  christos             break;
    857   1.1.1.9  christos 
    858   1.1.1.9  christos         case ACPI_CDAT_TYPE_DSLBIS:
    859   1.1.1.9  christos             Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
    860   1.1.1.9  christos             SubtableLength = sizeof (ACPI_CDAT_DSLBIS);
    861   1.1.1.9  christos             DbgPrint (ASL_DEBUG_OUTPUT, "1) Offset: %X\n", Offset);
    862   1.1.1.9  christos 
    863   1.1.1.9  christos             InfoTable = AcpiDmTableInfoCdat1;
    864   1.1.1.9  christos             break;
    865   1.1.1.9  christos 
    866   1.1.1.9  christos         case ACPI_CDAT_TYPE_DSMSCIS:
    867   1.1.1.9  christos             Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
    868   1.1.1.9  christos             SubtableLength = sizeof (ACPI_CDAT_DSMSCIS);
    869   1.1.1.9  christos 
    870   1.1.1.9  christos             InfoTable = AcpiDmTableInfoCdat2;
    871   1.1.1.9  christos             break;
    872   1.1.1.9  christos 
    873   1.1.1.9  christos         case ACPI_CDAT_TYPE_DSIS:
    874   1.1.1.9  christos             DbgPrint (ASL_DEBUG_OUTPUT, "2) Offset: %X ", Offset);
    875   1.1.1.9  christos             SubtableLength = sizeof (ACPI_CDAT_DSIS);
    876   1.1.1.9  christos             DbgPrint (ASL_DEBUG_OUTPUT, "1) input pointer: %p\n", Table);
    877   1.1.1.9  christos             Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
    878   1.1.1.9  christos             DbgPrint (ASL_DEBUG_OUTPUT, "1) output pointers: %p, %p, Offset: %X\n",
    879   1.1.1.9  christos                 Table, Subtable, Offset);
    880   1.1.1.9  christos             DbgPrint (ASL_DEBUG_OUTPUT, "3) Offset: %X\n", Offset);
    881   1.1.1.9  christos 
    882   1.1.1.9  christos             InfoTable = AcpiDmTableInfoCdat3;
    883   1.1.1.9  christos             break;
    884   1.1.1.9  christos 
    885   1.1.1.9  christos         case ACPI_CDAT_TYPE_DSEMTS:
    886   1.1.1.9  christos             Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
    887   1.1.1.9  christos             SubtableLength = sizeof (ACPI_CDAT_DSEMTS);
    888   1.1.1.9  christos 
    889   1.1.1.9  christos             InfoTable = AcpiDmTableInfoCdat4;
    890   1.1.1.9  christos             break;
    891   1.1.1.9  christos 
    892   1.1.1.9  christos         case ACPI_CDAT_TYPE_SSLBIS:
    893   1.1.1.9  christos             SubtableLength = Subtable->Length;
    894   1.1.1.9  christos 
    895   1.1.1.9  christos             InfoTable = AcpiDmTableInfoCdat5;
    896   1.1.1.9  christos             Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
    897   1.1.1.9  christos             break;
    898   1.1.1.9  christos 
    899   1.1.1.9  christos         default:
    900   1.1.1.9  christos             fprintf (stderr, "ERROR: Unknown SubtableType: %X\n", Subtable->Type);
    901   1.1.1.9  christos             return;
    902   1.1.1.9  christos         }
    903   1.1.1.9  christos 
    904   1.1.1.9  christos         DbgPrint (ASL_DEBUG_OUTPUT, "SubtableType: %X, Length: %X Actual "
    905   1.1.1.9  christos             "Length: %X Offset: %X tableptr: %p\n", SubtableType,
    906   1.1.1.9  christos             Subtable->Length, SubtableLength, Offset, Table);
    907   1.1.1.9  christos 
    908   1.1.1.9  christos         /*
    909   1.1.1.9  christos          * Do the subtable-specific fields
    910   1.1.1.9  christos          */
    911   1.1.1.9  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable, Offset, InfoTable);
    912   1.1.1.9  christos         if (ACPI_FAILURE (Status))
    913   1.1.1.9  christos         {
    914   1.1.1.9  christos             return;
    915   1.1.1.9  christos         }
    916   1.1.1.9  christos 
    917   1.1.1.9  christos         DbgPrint (ASL_DEBUG_OUTPUT, "Subtable Type: %X, Offset: %X, SubtableLength: %X\n",
    918   1.1.1.9  christos             SubtableType, Offset, SubtableLength);
    919   1.1.1.9  christos 
    920   1.1.1.9  christos         /* Additional sub-subtables, dependent on the main subtable type */
    921   1.1.1.9  christos 
    922   1.1.1.9  christos         switch (SubtableType)
    923   1.1.1.9  christos         {
    924   1.1.1.9  christos         case ACPI_CDAT_TYPE_SSLBIS:
    925   1.1.1.9  christos             Offset += sizeof (ACPI_CDAT_SSLBIS);
    926   1.1.1.9  christos             Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table,
    927   1.1.1.9  christos                 Offset);
    928   1.1.1.9  christos 
    929   1.1.1.9  christos             DbgPrint (ASL_DEBUG_OUTPUT, "Case SSLBIS, Offset: %X, SubtableLength: %X "
    930   1.1.1.9  christos                 "Subtable->Length %X\n", Offset, SubtableLength, Subtable->Length);
    931   1.1.1.9  christos 
    932   1.1.1.9  christos             /* Generate the total length of all the SSLBE entries */
    933   1.1.1.9  christos 
    934   1.1.1.9  christos             EntriesLength = SubtableLength - sizeof (ACPI_CDAT_HEADER) -
    935   1.1.1.9  christos                 sizeof (ACPI_CDAT_SSLBIS);
    936   1.1.1.9  christos             DbgPrint (ASL_DEBUG_OUTPUT, "EntriesLength: %X, Offset: %X, Table->Length: %X\n",
    937   1.1.1.9  christos                 EntriesLength, Offset, Table->Length);
    938   1.1.1.9  christos 
    939   1.1.1.9  christos             /* Do each of the SSLBE Entries */
    940   1.1.1.9  christos 
    941   1.1.1.9  christos             while ((EntriesLength > 0) && (Offset < Table->Length))
    942   1.1.1.9  christos             {
    943   1.1.1.9  christos                 AcpiOsPrintf ("\n");
    944   1.1.1.9  christos 
    945   1.1.1.9  christos                 Status = AcpiDmDumpTable (Length, Offset, Subtable, Offset,
    946   1.1.1.9  christos                     AcpiDmTableInfoCdatEntries);
    947   1.1.1.9  christos                 if (ACPI_FAILURE (Status))
    948   1.1.1.9  christos                 {
    949   1.1.1.9  christos                     return;
    950   1.1.1.9  christos                 }
    951   1.1.1.9  christos 
    952   1.1.1.9  christos                 EntriesLength -= sizeof (ACPI_CDAT_SSLBE);
    953   1.1.1.9  christos                 Offset += sizeof (ACPI_CDAT_SSLBE);
    954   1.1.1.9  christos                 Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
    955   1.1.1.9  christos             }
    956   1.1.1.9  christos 
    957   1.1.1.9  christos             SubtableLength = 0;
    958   1.1.1.9  christos             break;
    959   1.1.1.9  christos 
    960   1.1.1.9  christos         default:
    961   1.1.1.9  christos             break;
    962   1.1.1.9  christos         }
    963   1.1.1.9  christos 
    964   1.1.1.9  christos         DbgPrint (ASL_DEBUG_OUTPUT, "Offset: %X, Subtable Length: %X\n",
    965   1.1.1.9  christos             Offset, SubtableLength);
    966   1.1.1.9  christos 
    967   1.1.1.9  christos         /* Point to next subtable */
    968   1.1.1.9  christos 
    969   1.1.1.9  christos         Offset += SubtableLength;
    970   1.1.1.9  christos         Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
    971   1.1.1.9  christos     }
    972   1.1.1.9  christos 
    973   1.1.1.9  christos     return;
    974   1.1.1.9  christos }
    975   1.1.1.9  christos 
    976   1.1.1.9  christos 
    977   1.1.1.5  christos /*******************************************************************************
    978   1.1.1.5  christos  *
    979   1.1.1.5  christos  * FUNCTION:    AcpiDmDumpCedt
    980   1.1.1.5  christos  *
    981   1.1.1.5  christos  * PARAMETERS:  Table               - A CEDT table
    982   1.1.1.5  christos  *
    983   1.1.1.5  christos  * RETURN:      None
    984   1.1.1.5  christos  *
    985   1.1.1.5  christos  * DESCRIPTION: Format the contents of a CEDT. This table type consists
    986   1.1.1.5  christos  *              of an open-ended number of subtables.
    987   1.1.1.5  christos  *
    988   1.1.1.5  christos  ******************************************************************************/
    989   1.1.1.5  christos 
    990   1.1.1.5  christos void
    991   1.1.1.5  christos AcpiDmDumpCedt (
    992   1.1.1.5  christos     ACPI_TABLE_HEADER       *Table)
    993   1.1.1.5  christos {
    994   1.1.1.5  christos     ACPI_STATUS             Status;
    995   1.1.1.5  christos     ACPI_CEDT_HEADER        *Subtable;
    996   1.1.1.5  christos     UINT32                  Length = Table->Length;
    997   1.1.1.5  christos     UINT32                  Offset = sizeof (ACPI_TABLE_CEDT);
    998   1.1.1.5  christos 
    999   1.1.1.5  christos 
   1000   1.1.1.5  christos     /* There is no main table (other than the standard ACPI header) */
   1001   1.1.1.5  christos 
   1002   1.1.1.5  christos     Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Table, Offset);
   1003   1.1.1.5  christos     while (Offset < Table->Length)
   1004   1.1.1.5  christos     {
   1005   1.1.1.5  christos         /* Common subtable header */
   1006   1.1.1.5  christos 
   1007   1.1.1.5  christos         AcpiOsPrintf ("\n");
   1008   1.1.1.5  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1009   1.1.1.5  christos             Subtable->Length, AcpiDmTableInfoCedtHdr);
   1010   1.1.1.5  christos         if (ACPI_FAILURE (Status))
   1011   1.1.1.5  christos         {
   1012   1.1.1.5  christos             return;
   1013   1.1.1.5  christos         }
   1014   1.1.1.5  christos 
   1015   1.1.1.5  christos         switch (Subtable->Type)
   1016   1.1.1.5  christos         {
   1017   1.1.1.5  christos         case ACPI_CEDT_TYPE_CHBS:
   1018   1.1.1.8  christos             Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1019   1.1.1.8  christos                 Subtable->Length, AcpiDmTableInfoCedt0);
   1020   1.1.1.9  christos             if (ACPI_FAILURE (Status))
   1021   1.1.1.9  christos             {
   1022   1.1.1.8  christos                 return;
   1023   1.1.1.8  christos             }
   1024   1.1.1.8  christos             break;
   1025   1.1.1.5  christos 
   1026   1.1.1.9  christos         case ACPI_CEDT_TYPE_CFMWS:
   1027   1.1.1.9  christos         {
   1028   1.1.1.8  christos             ACPI_CEDT_CFMWS *ptr = (ACPI_CEDT_CFMWS *) Subtable;
   1029  1.1.1.11  christos             unsigned int i, max;
   1030  1.1.1.11  christos 
   1031  1.1.1.11  christos             if (ptr->InterleaveWays < 8)
   1032  1.1.1.11  christos                 max = 1 << (ptr->InterleaveWays);
   1033  1.1.1.11  christos             else
   1034  1.1.1.11  christos                 max = 3 << (ptr->InterleaveWays - 8);
   1035   1.1.1.8  christos 
   1036  1.1.1.11  christos 	    /* print out table with first "Interleave target" */
   1037   1.1.1.8  christos 
   1038   1.1.1.8  christos             Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1039   1.1.1.8  christos                 Subtable->Length, AcpiDmTableInfoCedt1);
   1040   1.1.1.9  christos             if (ACPI_FAILURE (Status))
   1041   1.1.1.9  christos             {
   1042   1.1.1.8  christos                 return;
   1043   1.1.1.8  christos             }
   1044   1.1.1.8  christos 
   1045   1.1.1.8  christos             /* Now, print out any interleave targets beyond the first. */
   1046   1.1.1.8  christos 
   1047   1.1.1.9  christos             for (i = 1; i < max; i++)
   1048   1.1.1.9  christos             {
   1049   1.1.1.9  christos                 unsigned int loc_offset = Offset + (i * 4) + ACPI_OFFSET (ACPI_CEDT_CFMWS, InterleaveTargets);
   1050   1.1.1.8  christos                 unsigned int *trg = &(ptr->InterleaveTargets[i]);
   1051   1.1.1.9  christos 
   1052   1.1.1.8  christos                 Status = AcpiDmDumpTable (Length, loc_offset, trg,
   1053   1.1.1.8  christos                         Subtable->Length, AcpiDmTableInfoCedt1_te);
   1054   1.1.1.9  christos                 if (ACPI_FAILURE (Status))
   1055   1.1.1.9  christos                 {
   1056   1.1.1.8  christos                     return;
   1057   1.1.1.8  christos                 }
   1058   1.1.1.8  christos             }
   1059   1.1.1.5  christos             break;
   1060   1.1.1.8  christos         }
   1061   1.1.1.5  christos 
   1062  1.1.1.11  christos         case ACPI_CEDT_TYPE_CXIMS:
   1063  1.1.1.11  christos         {
   1064  1.1.1.11  christos             ACPI_CEDT_CXIMS *ptr = (ACPI_CEDT_CXIMS *) Subtable;
   1065  1.1.1.11  christos             unsigned int i, max = ptr->NrXormaps;
   1066  1.1.1.11  christos 
   1067  1.1.1.11  christos             /* print out table with first "XOR Map" */
   1068  1.1.1.11  christos 
   1069  1.1.1.11  christos             Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1070  1.1.1.11  christos                 Subtable->Length, AcpiDmTableInfoCedt2);
   1071  1.1.1.11  christos             if (ACPI_FAILURE (Status))
   1072  1.1.1.11  christos             {
   1073  1.1.1.11  christos                 return;
   1074  1.1.1.11  christos             }
   1075  1.1.1.11  christos 
   1076  1.1.1.11  christos             /* Now, print out any XOR Map beyond the first. */
   1077  1.1.1.11  christos 
   1078  1.1.1.11  christos             for (i = 1; i < max; i++)
   1079  1.1.1.11  christos             {
   1080  1.1.1.11  christos                 unsigned int loc_offset = Offset + (i * 1) + ACPI_OFFSET (ACPI_CEDT_CXIMS, XormapList);
   1081  1.1.1.11  christos                 UINT64 *trg = &(ptr->XormapList[i]);
   1082  1.1.1.11  christos 
   1083  1.1.1.11  christos                 Status = AcpiDmDumpTable (Length, loc_offset, trg,
   1084  1.1.1.11  christos                         Subtable->Length, AcpiDmTableInfoCedt2_te);
   1085  1.1.1.11  christos                 if (ACPI_FAILURE (Status))
   1086  1.1.1.11  christos                 {
   1087  1.1.1.11  christos                     return;
   1088  1.1.1.11  christos                 }
   1089  1.1.1.11  christos             }
   1090  1.1.1.11  christos             break;
   1091  1.1.1.11  christos         }
   1092  1.1.1.11  christos 
   1093   1.1.1.5  christos         default:
   1094   1.1.1.5  christos             AcpiOsPrintf ("\n**** Unknown CEDT subtable type 0x%X\n\n",
   1095   1.1.1.5  christos                 Subtable->Type);
   1096   1.1.1.5  christos 
   1097   1.1.1.5  christos             /* Attempt to continue */
   1098   1.1.1.5  christos             if (!Subtable->Length)
   1099   1.1.1.5  christos             {
   1100   1.1.1.5  christos                 AcpiOsPrintf ("Invalid zero length subtable\n");
   1101   1.1.1.5  christos                 return;
   1102   1.1.1.5  christos             }
   1103   1.1.1.5  christos         }
   1104   1.1.1.5  christos 
   1105   1.1.1.5  christos         /* Point to next subtable */
   1106   1.1.1.5  christos         Offset += Subtable->Length;
   1107   1.1.1.5  christos         Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Subtable,
   1108   1.1.1.5  christos             Subtable->Length);
   1109   1.1.1.5  christos     }
   1110   1.1.1.5  christos }
   1111       1.1  christos 
   1112       1.1  christos /*******************************************************************************
   1113       1.1  christos  *
   1114       1.1  christos  * FUNCTION:    AcpiDmDumpCpep
   1115       1.1  christos  *
   1116       1.1  christos  * PARAMETERS:  Table               - A CPEP table
   1117       1.1  christos  *
   1118       1.1  christos  * RETURN:      None
   1119       1.1  christos  *
   1120       1.1  christos  * DESCRIPTION: Format the contents of a CPEP. This table type consists
   1121       1.1  christos  *              of an open-ended number of subtables.
   1122       1.1  christos  *
   1123       1.1  christos  ******************************************************************************/
   1124       1.1  christos 
   1125       1.1  christos void
   1126       1.1  christos AcpiDmDumpCpep (
   1127       1.1  christos     ACPI_TABLE_HEADER       *Table)
   1128       1.1  christos {
   1129       1.1  christos     ACPI_STATUS             Status;
   1130       1.1  christos     ACPI_CPEP_POLLING       *Subtable;
   1131       1.1  christos     UINT32                  Length = Table->Length;
   1132       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_CPEP);
   1133       1.1  christos 
   1134       1.1  christos 
   1135       1.1  christos     /* Main table */
   1136       1.1  christos 
   1137       1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoCpep);
   1138       1.1  christos     if (ACPI_FAILURE (Status))
   1139       1.1  christos     {
   1140       1.1  christos         return;
   1141       1.1  christos     }
   1142       1.1  christos 
   1143       1.1  christos     /* Subtables */
   1144       1.1  christos 
   1145       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset);
   1146       1.1  christos     while (Offset < Table->Length)
   1147       1.1  christos     {
   1148       1.1  christos         AcpiOsPrintf ("\n");
   1149       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1150       1.1  christos             Subtable->Header.Length, AcpiDmTableInfoCpep0);
   1151       1.1  christos         if (ACPI_FAILURE (Status))
   1152       1.1  christos         {
   1153       1.1  christos             return;
   1154       1.1  christos         }
   1155       1.1  christos 
   1156       1.1  christos         /* Point to next subtable */
   1157       1.1  christos 
   1158       1.1  christos         Offset += Subtable->Header.Length;
   1159       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Subtable,
   1160       1.1  christos             Subtable->Header.Length);
   1161       1.1  christos     }
   1162       1.1  christos }
   1163       1.1  christos 
   1164       1.1  christos 
   1165       1.1  christos /*******************************************************************************
   1166       1.1  christos  *
   1167       1.1  christos  * FUNCTION:    AcpiDmDumpCsrt
   1168       1.1  christos  *
   1169       1.1  christos  * PARAMETERS:  Table               - A CSRT table
   1170       1.1  christos  *
   1171       1.1  christos  * RETURN:      None
   1172       1.1  christos  *
   1173       1.1  christos  * DESCRIPTION: Format the contents of a CSRT. This table type consists
   1174       1.1  christos  *              of an open-ended number of subtables.
   1175       1.1  christos  *
   1176       1.1  christos  ******************************************************************************/
   1177       1.1  christos 
   1178       1.1  christos void
   1179       1.1  christos AcpiDmDumpCsrt (
   1180       1.1  christos     ACPI_TABLE_HEADER       *Table)
   1181       1.1  christos {
   1182       1.1  christos     ACPI_STATUS             Status;
   1183       1.1  christos     ACPI_CSRT_GROUP         *Subtable;
   1184       1.1  christos     ACPI_CSRT_SHARED_INFO   *SharedInfoTable;
   1185       1.1  christos     ACPI_CSRT_DESCRIPTOR    *SubSubtable;
   1186       1.1  christos     UINT32                  Length = Table->Length;
   1187       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_CSRT);
   1188       1.1  christos     UINT32                  SubOffset;
   1189       1.1  christos     UINT32                  SubSubOffset;
   1190       1.1  christos     UINT32                  InfoLength;
   1191       1.1  christos 
   1192       1.1  christos 
   1193       1.1  christos     /* The main table only contains the ACPI header, thus already handled */
   1194       1.1  christos 
   1195       1.1  christos     /* Subtables (Resource Groups) */
   1196       1.1  christos 
   1197       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset);
   1198       1.1  christos     while (Offset < Table->Length)
   1199       1.1  christos     {
   1200       1.1  christos         /* Resource group subtable */
   1201       1.1  christos 
   1202       1.1  christos         AcpiOsPrintf ("\n");
   1203       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1204       1.1  christos             Subtable->Length, AcpiDmTableInfoCsrt0);
   1205       1.1  christos         if (ACPI_FAILURE (Status))
   1206       1.1  christos         {
   1207       1.1  christos             return;
   1208       1.1  christos         }
   1209       1.1  christos 
   1210       1.1  christos         /* Shared info subtable (One per resource group) */
   1211       1.1  christos 
   1212       1.1  christos         SubOffset = sizeof (ACPI_CSRT_GROUP);
   1213       1.1  christos         SharedInfoTable = ACPI_ADD_PTR (ACPI_CSRT_SHARED_INFO, Table,
   1214       1.1  christos             Offset + SubOffset);
   1215       1.1  christos 
   1216       1.1  christos         AcpiOsPrintf ("\n");
   1217       1.1  christos         Status = AcpiDmDumpTable (Length, Offset + SubOffset, SharedInfoTable,
   1218       1.1  christos             sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1);
   1219       1.1  christos         if (ACPI_FAILURE (Status))
   1220       1.1  christos         {
   1221       1.1  christos             return;
   1222       1.1  christos         }
   1223       1.1  christos 
   1224       1.1  christos         SubOffset += Subtable->SharedInfoLength;
   1225       1.1  christos 
   1226       1.1  christos         /* Sub-Subtables (Resource Descriptors) */
   1227       1.1  christos 
   1228       1.1  christos         SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table,
   1229       1.1  christos             Offset + SubOffset);
   1230       1.1  christos 
   1231       1.1  christos         while ((SubOffset < Subtable->Length) &&
   1232       1.1  christos               ((Offset + SubOffset) < Table->Length))
   1233       1.1  christos         {
   1234       1.1  christos             AcpiOsPrintf ("\n");
   1235       1.1  christos             Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubtable,
   1236       1.1  christos                 SubSubtable->Length, AcpiDmTableInfoCsrt2);
   1237       1.1  christos             if (ACPI_FAILURE (Status))
   1238       1.1  christos             {
   1239       1.1  christos                 return;
   1240       1.1  christos             }
   1241       1.1  christos 
   1242       1.1  christos             SubSubOffset = sizeof (ACPI_CSRT_DESCRIPTOR);
   1243       1.1  christos 
   1244       1.1  christos             /* Resource-specific info buffer */
   1245       1.1  christos 
   1246       1.1  christos             InfoLength = SubSubtable->Length - SubSubOffset;
   1247       1.1  christos             if (InfoLength)
   1248       1.1  christos             {
   1249       1.1  christos                 Status = AcpiDmDumpTable (Length,
   1250       1.1  christos                     Offset + SubOffset + SubSubOffset, Table,
   1251       1.1  christos                     InfoLength, AcpiDmTableInfoCsrt2a);
   1252       1.1  christos                 if (ACPI_FAILURE (Status))
   1253       1.1  christos                 {
   1254       1.1  christos                     return;
   1255       1.1  christos                 }
   1256       1.1  christos             }
   1257       1.1  christos 
   1258       1.1  christos             /* Point to next sub-subtable */
   1259       1.1  christos 
   1260       1.1  christos             SubOffset += SubSubtable->Length;
   1261       1.1  christos             SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubtable,
   1262       1.1  christos                 SubSubtable->Length);
   1263       1.1  christos         }
   1264       1.1  christos 
   1265       1.1  christos         /* Point to next subtable */
   1266       1.1  christos 
   1267       1.1  christos         Offset += Subtable->Length;
   1268       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Subtable,
   1269       1.1  christos             Subtable->Length);
   1270       1.1  christos     }
   1271       1.1  christos }
   1272       1.1  christos 
   1273       1.1  christos 
   1274       1.1  christos /*******************************************************************************
   1275       1.1  christos  *
   1276       1.1  christos  * FUNCTION:    AcpiDmDumpDbg2
   1277       1.1  christos  *
   1278       1.1  christos  * PARAMETERS:  Table               - A DBG2 table
   1279       1.1  christos  *
   1280       1.1  christos  * RETURN:      None
   1281       1.1  christos  *
   1282       1.1  christos  * DESCRIPTION: Format the contents of a DBG2. This table type consists
   1283       1.1  christos  *              of an open-ended number of subtables.
   1284       1.1  christos  *
   1285       1.1  christos  ******************************************************************************/
   1286       1.1  christos 
   1287       1.1  christos void
   1288       1.1  christos AcpiDmDumpDbg2 (
   1289       1.1  christos     ACPI_TABLE_HEADER       *Table)
   1290       1.1  christos {
   1291       1.1  christos     ACPI_STATUS             Status;
   1292       1.1  christos     ACPI_DBG2_DEVICE        *Subtable;
   1293       1.1  christos     UINT32                  Length = Table->Length;
   1294       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_DBG2);
   1295       1.1  christos     UINT32                  i;
   1296       1.1  christos     UINT32                  ArrayOffset;
   1297       1.1  christos     UINT32                  AbsoluteOffset;
   1298       1.1  christos     UINT8                   *Array;
   1299       1.1  christos 
   1300       1.1  christos 
   1301       1.1  christos     /* Main table */
   1302       1.1  christos 
   1303       1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDbg2);
   1304       1.1  christos     if (ACPI_FAILURE (Status))
   1305       1.1  christos     {
   1306       1.1  christos         return;
   1307       1.1  christos     }
   1308       1.1  christos 
   1309       1.1  christos     /* Subtables */
   1310       1.1  christos 
   1311       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
   1312       1.1  christos     while (Offset < Table->Length)
   1313       1.1  christos     {
   1314       1.1  christos         AcpiOsPrintf ("\n");
   1315       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1316       1.1  christos             Subtable->Length, AcpiDmTableInfoDbg2Device);
   1317       1.1  christos         if (ACPI_FAILURE (Status))
   1318       1.1  christos         {
   1319       1.1  christos             return;
   1320       1.1  christos         }
   1321       1.1  christos 
   1322       1.1  christos         /* Dump the BaseAddress array */
   1323       1.1  christos 
   1324       1.1  christos         for (i = 0; i < Subtable->RegisterCount; i++)
   1325       1.1  christos         {
   1326       1.1  christos             ArrayOffset = Subtable->BaseAddressOffset +
   1327       1.1  christos                 (sizeof (ACPI_GENERIC_ADDRESS) * i);
   1328       1.1  christos             AbsoluteOffset = Offset + ArrayOffset;
   1329       1.1  christos             Array = (UINT8 *) Subtable + ArrayOffset;
   1330       1.1  christos 
   1331       1.1  christos             Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
   1332       1.1  christos                 Subtable->Length, AcpiDmTableInfoDbg2Addr);
   1333       1.1  christos             if (ACPI_FAILURE (Status))
   1334       1.1  christos             {
   1335       1.1  christos                 return;
   1336       1.1  christos             }
   1337       1.1  christos         }
   1338       1.1  christos 
   1339       1.1  christos         /* Dump the AddressSize array */
   1340       1.1  christos 
   1341       1.1  christos         for (i = 0; i < Subtable->RegisterCount; i++)
   1342       1.1  christos         {
   1343       1.1  christos             ArrayOffset = Subtable->AddressSizeOffset +
   1344       1.1  christos                 (sizeof (UINT32) * i);
   1345       1.1  christos             AbsoluteOffset = Offset + ArrayOffset;
   1346       1.1  christos             Array = (UINT8 *) Subtable + ArrayOffset;
   1347       1.1  christos 
   1348       1.1  christos             Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
   1349       1.1  christos                 Subtable->Length, AcpiDmTableInfoDbg2Size);
   1350       1.1  christos             if (ACPI_FAILURE (Status))
   1351       1.1  christos             {
   1352       1.1  christos                 return;
   1353       1.1  christos             }
   1354       1.1  christos         }
   1355       1.1  christos 
   1356       1.1  christos         /* Dump the Namestring (required) */
   1357       1.1  christos 
   1358       1.1  christos         AcpiOsPrintf ("\n");
   1359       1.1  christos         ArrayOffset = Subtable->NamepathOffset;
   1360       1.1  christos         AbsoluteOffset = Offset + ArrayOffset;
   1361       1.1  christos         Array = (UINT8 *) Subtable + ArrayOffset;
   1362       1.1  christos 
   1363       1.1  christos         Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
   1364       1.1  christos             Subtable->Length, AcpiDmTableInfoDbg2Name);
   1365       1.1  christos         if (ACPI_FAILURE (Status))
   1366       1.1  christos         {
   1367       1.1  christos             return;
   1368       1.1  christos         }
   1369       1.1  christos 
   1370       1.1  christos         /* Dump the OemData (optional) */
   1371       1.1  christos 
   1372       1.1  christos         if (Subtable->OemDataOffset)
   1373       1.1  christos         {
   1374  1.1.1.11  christos             Status = AcpiDmDumpTable (Length, Subtable->OemDataOffset,
   1375  1.1.1.11  christos                 Subtable, Subtable->OemDataLength,
   1376       1.1  christos                 AcpiDmTableInfoDbg2OemData);
   1377       1.1  christos             if (ACPI_FAILURE (Status))
   1378       1.1  christos             {
   1379       1.1  christos                 return;
   1380       1.1  christos             }
   1381       1.1  christos         }
   1382       1.1  christos 
   1383       1.1  christos         /* Point to next subtable */
   1384       1.1  christos 
   1385       1.1  christos         Offset += Subtable->Length;
   1386       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Subtable,
   1387       1.1  christos             Subtable->Length);
   1388       1.1  christos     }
   1389       1.1  christos }
   1390       1.1  christos 
   1391       1.1  christos 
   1392       1.1  christos /*******************************************************************************
   1393       1.1  christos  *
   1394       1.1  christos  * FUNCTION:    AcpiDmDumpDmar
   1395       1.1  christos  *
   1396       1.1  christos  * PARAMETERS:  Table               - A DMAR table
   1397       1.1  christos  *
   1398       1.1  christos  * RETURN:      None
   1399       1.1  christos  *
   1400       1.1  christos  * DESCRIPTION: Format the contents of a DMAR. This table type consists
   1401       1.1  christos  *              of an open-ended number of subtables.
   1402       1.1  christos  *
   1403       1.1  christos  ******************************************************************************/
   1404       1.1  christos 
   1405       1.1  christos void
   1406       1.1  christos AcpiDmDumpDmar (
   1407       1.1  christos     ACPI_TABLE_HEADER       *Table)
   1408       1.1  christos {
   1409       1.1  christos     ACPI_STATUS             Status;
   1410       1.1  christos     ACPI_DMAR_HEADER        *Subtable;
   1411       1.1  christos     UINT32                  Length = Table->Length;
   1412       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_DMAR);
   1413       1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
   1414       1.1  christos     ACPI_DMAR_DEVICE_SCOPE  *ScopeTable;
   1415       1.1  christos     UINT32                  ScopeOffset;
   1416       1.1  christos     UINT8                   *PciPath;
   1417       1.1  christos     UINT32                  PathOffset;
   1418       1.1  christos 
   1419       1.1  christos 
   1420       1.1  christos     /* Main table */
   1421       1.1  christos 
   1422       1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDmar);
   1423       1.1  christos     if (ACPI_FAILURE (Status))
   1424       1.1  christos     {
   1425       1.1  christos         return;
   1426       1.1  christos     }
   1427       1.1  christos 
   1428       1.1  christos     /* Subtables */
   1429       1.1  christos 
   1430       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset);
   1431       1.1  christos     while (Offset < Table->Length)
   1432       1.1  christos     {
   1433       1.1  christos         /* Common subtable header */
   1434       1.1  christos 
   1435       1.1  christos         AcpiOsPrintf ("\n");
   1436       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1437       1.1  christos             Subtable->Length, AcpiDmTableInfoDmarHdr);
   1438       1.1  christos         if (ACPI_FAILURE (Status))
   1439       1.1  christos         {
   1440       1.1  christos             return;
   1441       1.1  christos         }
   1442       1.1  christos 
   1443       1.1  christos         AcpiOsPrintf ("\n");
   1444       1.1  christos 
   1445       1.1  christos         switch (Subtable->Type)
   1446       1.1  christos         {
   1447       1.1  christos         case ACPI_DMAR_TYPE_HARDWARE_UNIT:
   1448       1.1  christos 
   1449       1.1  christos             InfoTable = AcpiDmTableInfoDmar0;
   1450       1.1  christos             ScopeOffset = sizeof (ACPI_DMAR_HARDWARE_UNIT);
   1451       1.1  christos             break;
   1452       1.1  christos 
   1453       1.1  christos         case ACPI_DMAR_TYPE_RESERVED_MEMORY:
   1454       1.1  christos 
   1455       1.1  christos             InfoTable = AcpiDmTableInfoDmar1;
   1456       1.1  christos             ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY);
   1457       1.1  christos             break;
   1458       1.1  christos 
   1459       1.1  christos         case ACPI_DMAR_TYPE_ROOT_ATS:
   1460       1.1  christos 
   1461       1.1  christos             InfoTable = AcpiDmTableInfoDmar2;
   1462       1.1  christos             ScopeOffset = sizeof (ACPI_DMAR_ATSR);
   1463       1.1  christos             break;
   1464       1.1  christos 
   1465       1.1  christos         case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
   1466       1.1  christos 
   1467       1.1  christos             InfoTable = AcpiDmTableInfoDmar3;
   1468       1.1  christos             ScopeOffset = sizeof (ACPI_DMAR_RHSA);
   1469       1.1  christos             break;
   1470       1.1  christos 
   1471       1.1  christos         case ACPI_DMAR_TYPE_NAMESPACE:
   1472       1.1  christos 
   1473       1.1  christos             InfoTable = AcpiDmTableInfoDmar4;
   1474       1.1  christos             ScopeOffset = sizeof (ACPI_DMAR_ANDD);
   1475       1.1  christos             break;
   1476       1.1  christos 
   1477   1.1.1.8  christos         case ACPI_DMAR_TYPE_SATC:
   1478   1.1.1.8  christos 
   1479   1.1.1.8  christos             InfoTable = AcpiDmTableInfoDmar5;
   1480   1.1.1.8  christos             ScopeOffset = sizeof (ACPI_DMAR_SATC);
   1481   1.1.1.8  christos             break;
   1482   1.1.1.8  christos 
   1483  1.1.1.13  christos         case ACPI_DMAR_TYPE_SIDP:
   1484  1.1.1.13  christos 
   1485  1.1.1.13  christos             InfoTable = AcpiDmTableInfoDmar6;
   1486  1.1.1.13  christos             ScopeOffset = sizeof (ACPI_DMAR_SIDP);
   1487  1.1.1.13  christos             break;
   1488  1.1.1.13  christos 
   1489       1.1  christos         default:
   1490       1.1  christos 
   1491       1.1  christos             AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n",
   1492       1.1  christos                 Subtable->Type);
   1493       1.1  christos             return;
   1494       1.1  christos         }
   1495       1.1  christos 
   1496       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1497       1.1  christos             Subtable->Length, InfoTable);
   1498       1.1  christos         if (ACPI_FAILURE (Status))
   1499       1.1  christos         {
   1500       1.1  christos             return;
   1501       1.1  christos         }
   1502       1.1  christos 
   1503       1.1  christos         /*
   1504       1.1  christos          * Dump the optional device scope entries
   1505       1.1  christos          */
   1506       1.1  christos         if ((Subtable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
   1507       1.1  christos             (Subtable->Type == ACPI_DMAR_TYPE_NAMESPACE))
   1508       1.1  christos         {
   1509       1.1  christos             /* These types do not support device scopes */
   1510       1.1  christos 
   1511       1.1  christos             goto NextSubtable;
   1512       1.1  christos         }
   1513       1.1  christos 
   1514       1.1  christos         ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable, ScopeOffset);
   1515       1.1  christos         while (ScopeOffset < Subtable->Length)
   1516       1.1  christos         {
   1517       1.1  christos             AcpiOsPrintf ("\n");
   1518       1.1  christos             Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable,
   1519       1.1  christos                 ScopeTable->Length, AcpiDmTableInfoDmarScope);
   1520       1.1  christos             if (ACPI_FAILURE (Status))
   1521       1.1  christos             {
   1522       1.1  christos                 return;
   1523       1.1  christos             }
   1524       1.1  christos             AcpiOsPrintf ("\n");
   1525       1.1  christos 
   1526       1.1  christos             /* Dump the PCI Path entries for this device scope */
   1527       1.1  christos 
   1528       1.1  christos             PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */
   1529       1.1  christos 
   1530       1.1  christos             PciPath = ACPI_ADD_PTR (UINT8, ScopeTable,
   1531       1.1  christos                 sizeof (ACPI_DMAR_DEVICE_SCOPE));
   1532       1.1  christos 
   1533       1.1  christos             while (PathOffset < ScopeTable->Length)
   1534       1.1  christos             {
   1535       1.1  christos                 AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2,
   1536       1.1  christos                     "PCI Path");
   1537       1.1  christos                 AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath[0], PciPath[1]);
   1538       1.1  christos 
   1539       1.1  christos                 /* Point to next PCI Path entry */
   1540       1.1  christos 
   1541       1.1  christos                 PathOffset += 2;
   1542       1.1  christos                 PciPath += 2;
   1543       1.1  christos                 AcpiOsPrintf ("\n");
   1544       1.1  christos             }
   1545       1.1  christos 
   1546       1.1  christos             /* Point to next device scope entry */
   1547       1.1  christos 
   1548       1.1  christos             ScopeOffset += ScopeTable->Length;
   1549       1.1  christos             ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE,
   1550       1.1  christos                 ScopeTable, ScopeTable->Length);
   1551       1.1  christos         }
   1552       1.1  christos 
   1553       1.1  christos NextSubtable:
   1554       1.1  christos         /* Point to next subtable */
   1555       1.1  christos 
   1556       1.1  christos         Offset += Subtable->Length;
   1557       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Subtable,
   1558       1.1  christos             Subtable->Length);
   1559       1.1  christos     }
   1560       1.1  christos }
   1561       1.1  christos 
   1562       1.1  christos 
   1563       1.1  christos /*******************************************************************************
   1564       1.1  christos  *
   1565       1.1  christos  * FUNCTION:    AcpiDmDumpDrtm
   1566       1.1  christos  *
   1567       1.1  christos  * PARAMETERS:  Table               - A DRTM table
   1568       1.1  christos  *
   1569       1.1  christos  * RETURN:      None
   1570       1.1  christos  *
   1571       1.1  christos  * DESCRIPTION: Format the contents of a DRTM.
   1572       1.1  christos  *
   1573       1.1  christos  ******************************************************************************/
   1574       1.1  christos 
   1575       1.1  christos void
   1576       1.1  christos AcpiDmDumpDrtm (
   1577       1.1  christos     ACPI_TABLE_HEADER       *Table)
   1578       1.1  christos {
   1579       1.1  christos     ACPI_STATUS             Status;
   1580       1.1  christos     UINT32                  Offset;
   1581       1.1  christos     ACPI_DRTM_VTABLE_LIST   *DrtmVtl;
   1582       1.1  christos     ACPI_DRTM_RESOURCE_LIST *DrtmRl;
   1583       1.1  christos     ACPI_DRTM_DPS_ID        *DrtmDps;
   1584       1.1  christos     UINT32                  Count;
   1585       1.1  christos 
   1586       1.1  christos 
   1587       1.1  christos     /* Main table */
   1588       1.1  christos 
   1589       1.1  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
   1590       1.1  christos         AcpiDmTableInfoDrtm);
   1591       1.1  christos     if (ACPI_FAILURE (Status))
   1592       1.1  christos     {
   1593       1.1  christos         return;
   1594       1.1  christos     }
   1595       1.1  christos 
   1596       1.1  christos     Offset = sizeof (ACPI_TABLE_DRTM);
   1597       1.1  christos 
   1598       1.1  christos     /* Sub-tables */
   1599       1.1  christos 
   1600       1.1  christos     /* Dump ValidatedTable length */
   1601       1.1  christos 
   1602       1.1  christos     DrtmVtl = ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST, Table, Offset);
   1603       1.1  christos     AcpiOsPrintf ("\n");
   1604       1.1  christos     Status = AcpiDmDumpTable (Table->Length, Offset,
   1605       1.1  christos         DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables),
   1606       1.1  christos         AcpiDmTableInfoDrtm0);
   1607       1.1  christos     if (ACPI_FAILURE (Status))
   1608       1.1  christos     {
   1609       1.1  christos             return;
   1610       1.1  christos     }
   1611       1.1  christos 
   1612       1.1  christos     Offset += ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables);
   1613       1.1  christos 
   1614       1.1  christos     /* Dump Validated table addresses */
   1615       1.1  christos 
   1616       1.1  christos     Count = 0;
   1617       1.1  christos     while ((Offset < Table->Length) &&
   1618       1.1  christos             (DrtmVtl->ValidatedTableCount > Count))
   1619       1.1  christos     {
   1620       1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset,
   1621       1.1  christos             ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64),
   1622       1.1  christos             AcpiDmTableInfoDrtm0a);
   1623       1.1  christos         if (ACPI_FAILURE (Status))
   1624       1.1  christos         {
   1625       1.1  christos             return;
   1626       1.1  christos         }
   1627       1.1  christos 
   1628       1.1  christos         Offset += sizeof (UINT64);
   1629       1.1  christos         Count++;
   1630       1.1  christos     }
   1631       1.1  christos 
   1632       1.1  christos     /* Dump ResourceList length */
   1633       1.1  christos 
   1634       1.1  christos     DrtmRl = ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST, Table, Offset);
   1635       1.1  christos     AcpiOsPrintf ("\n");
   1636       1.1  christos     Status = AcpiDmDumpTable (Table->Length, Offset,
   1637       1.1  christos         DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources),
   1638       1.1  christos         AcpiDmTableInfoDrtm1);
   1639       1.1  christos     if (ACPI_FAILURE (Status))
   1640       1.1  christos     {
   1641       1.1  christos         return;
   1642       1.1  christos     }
   1643       1.1  christos 
   1644       1.1  christos     Offset += ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources);
   1645       1.1  christos 
   1646       1.1  christos     /* Dump the Resource List */
   1647       1.1  christos 
   1648       1.1  christos     Count = 0;
   1649       1.1  christos     while ((Offset < Table->Length) &&
   1650       1.1  christos            (DrtmRl->ResourceCount > Count))
   1651       1.1  christos     {
   1652       1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset,
   1653       1.1  christos             ACPI_ADD_PTR (void, Table, Offset),
   1654       1.1  christos             sizeof (ACPI_DRTM_RESOURCE), AcpiDmTableInfoDrtm1a);
   1655       1.1  christos         if (ACPI_FAILURE (Status))
   1656       1.1  christos         {
   1657       1.1  christos             return;
   1658       1.1  christos         }
   1659       1.1  christos 
   1660       1.1  christos         Offset += sizeof (ACPI_DRTM_RESOURCE);
   1661       1.1  christos         Count++;
   1662       1.1  christos     }
   1663       1.1  christos 
   1664       1.1  christos     /* Dump DPS */
   1665       1.1  christos 
   1666       1.1  christos     DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset);
   1667       1.1  christos     AcpiOsPrintf ("\n");
   1668       1.1  christos     (void) AcpiDmDumpTable (Table->Length, Offset,
   1669       1.1  christos         DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2);
   1670       1.1  christos }
   1671       1.1  christos 
   1672       1.1  christos 
   1673       1.1  christos /*******************************************************************************
   1674       1.1  christos  *
   1675       1.1  christos  * FUNCTION:    AcpiDmDumpEinj
   1676       1.1  christos  *
   1677       1.1  christos  * PARAMETERS:  Table               - A EINJ table
   1678       1.1  christos  *
   1679       1.1  christos  * RETURN:      None
   1680       1.1  christos  *
   1681       1.1  christos  * DESCRIPTION: Format the contents of a EINJ. This table type consists
   1682       1.1  christos  *              of an open-ended number of subtables.
   1683       1.1  christos  *
   1684       1.1  christos  ******************************************************************************/
   1685       1.1  christos 
   1686       1.1  christos void
   1687       1.1  christos AcpiDmDumpEinj (
   1688       1.1  christos     ACPI_TABLE_HEADER       *Table)
   1689       1.1  christos {
   1690       1.1  christos     ACPI_STATUS             Status;
   1691       1.1  christos     ACPI_WHEA_HEADER        *Subtable;
   1692       1.1  christos     UINT32                  Length = Table->Length;
   1693       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_EINJ);
   1694       1.1  christos 
   1695       1.1  christos 
   1696       1.1  christos     /* Main table */
   1697       1.1  christos 
   1698       1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoEinj);
   1699       1.1  christos     if (ACPI_FAILURE (Status))
   1700       1.1  christos     {
   1701       1.1  christos         return;
   1702       1.1  christos     }
   1703       1.1  christos 
   1704       1.1  christos     /* Subtables */
   1705       1.1  christos 
   1706       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
   1707       1.1  christos     while (Offset < Table->Length)
   1708       1.1  christos     {
   1709       1.1  christos         AcpiOsPrintf ("\n");
   1710       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1711       1.1  christos             sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
   1712       1.1  christos         if (ACPI_FAILURE (Status))
   1713       1.1  christos         {
   1714       1.1  christos             return;
   1715       1.1  christos         }
   1716       1.1  christos 
   1717       1.1  christos         /* Point to next subtable (each subtable is of fixed length) */
   1718       1.1  christos 
   1719       1.1  christos         Offset += sizeof (ACPI_WHEA_HEADER);
   1720       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable,
   1721       1.1  christos             sizeof (ACPI_WHEA_HEADER));
   1722       1.1  christos     }
   1723       1.1  christos }
   1724       1.1  christos 
   1725       1.1  christos 
   1726       1.1  christos /*******************************************************************************
   1727       1.1  christos  *
   1728  1.1.1.13  christos  * FUNCTION:    AcpiDmDumpErdt
   1729  1.1.1.13  christos  *
   1730  1.1.1.13  christos  * PARAMETERS:  Table               - A ERDT table
   1731  1.1.1.13  christos  *
   1732  1.1.1.13  christos  * RETURN:      None
   1733  1.1.1.13  christos  *
   1734  1.1.1.13  christos  * DESCRIPTION: Format the contents of a ERDT. This table type consists
   1735  1.1.1.13  christos  *              of an open-ended number of subtables.
   1736  1.1.1.13  christos  *
   1737  1.1.1.13  christos  ******************************************************************************/
   1738  1.1.1.13  christos 
   1739  1.1.1.13  christos void
   1740  1.1.1.13  christos AcpiDmDumpErdt (
   1741  1.1.1.13  christos     ACPI_TABLE_HEADER       *Table)
   1742  1.1.1.13  christos {
   1743  1.1.1.13  christos     ACPI_STATUS             Status;
   1744  1.1.1.13  christos     ACPI_SUBTBL_HDR_16      *Subtable, *Subsubtable;
   1745  1.1.1.13  christos     ACPI_ERDT_DACD_PATHS    *ScopeTable;
   1746  1.1.1.13  christos     UINT32                  Offset = sizeof (ACPI_TABLE_ERDT);
   1747  1.1.1.13  christos     UINT32                  Suboffset;
   1748  1.1.1.13  christos     UINT32                  ScopeOffset;
   1749  1.1.1.13  christos     UINT32                  SubsubtableLength = 0;
   1750  1.1.1.13  christos     ACPI_DMTABLE_INFO       *InfoTable, *TrailEntries, *DacdEntries;
   1751  1.1.1.13  christos     UINT32                  NumTrailers = 0;
   1752  1.1.1.13  christos 
   1753  1.1.1.13  christos     /* Main table */
   1754  1.1.1.13  christos 
   1755  1.1.1.13  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoErdt);
   1756  1.1.1.13  christos     if (ACPI_FAILURE (Status))
   1757  1.1.1.13  christos     {
   1758  1.1.1.13  christos         return;
   1759  1.1.1.13  christos     }
   1760  1.1.1.13  christos 
   1761  1.1.1.13  christos     /* Subtables */
   1762  1.1.1.13  christos     Subtable = ACPI_ADD_PTR (ACPI_SUBTBL_HDR_16, Table, Offset);
   1763  1.1.1.13  christos     while (Offset < Table->Length)
   1764  1.1.1.13  christos     {
   1765  1.1.1.13  christos 
   1766  1.1.1.13  christos         /* Dump common header */
   1767  1.1.1.13  christos 
   1768  1.1.1.13  christos         AcpiOsPrintf ("\n");
   1769  1.1.1.13  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
   1770  1.1.1.13  christos             Subtable->Length, AcpiDmTableInfoErdtHdr);
   1771  1.1.1.13  christos         if (ACPI_FAILURE (Status))
   1772  1.1.1.13  christos         {
   1773  1.1.1.13  christos             return;
   1774  1.1.1.13  christos         }
   1775  1.1.1.13  christos 
   1776  1.1.1.13  christos         AcpiOsPrintf ("\n");
   1777  1.1.1.13  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
   1778  1.1.1.13  christos             Subtable->Length, AcpiDmTableInfoErdtRmdd);
   1779  1.1.1.13  christos         if (ACPI_FAILURE (Status))
   1780  1.1.1.13  christos         {
   1781  1.1.1.13  christos             return;
   1782  1.1.1.13  christos         }
   1783  1.1.1.13  christos 
   1784  1.1.1.13  christos         /* Subtables of this RMDD table */
   1785  1.1.1.13  christos 
   1786  1.1.1.13  christos         Suboffset = Offset + sizeof(ACPI_ERDT_RMDD);
   1787  1.1.1.13  christos         Subsubtable = ACPI_ADD_PTR (ACPI_SUBTBL_HDR_16, Table, Suboffset);
   1788  1.1.1.13  christos         while (Suboffset < Offset + Subtable->Length)
   1789  1.1.1.13  christos         {
   1790  1.1.1.13  christos             AcpiOsPrintf ("\n");
   1791  1.1.1.13  christos 
   1792  1.1.1.13  christos             TrailEntries = NULL;
   1793  1.1.1.13  christos             DacdEntries = NULL;
   1794  1.1.1.13  christos             switch (Subsubtable->Type)
   1795  1.1.1.13  christos             {
   1796  1.1.1.13  christos             case ACPI_ERDT_TYPE_CACD:
   1797  1.1.1.13  christos                  InfoTable = AcpiDmTableInfoErdtCacd;
   1798  1.1.1.13  christos                  TrailEntries = AcpiDmTableInfoErdtCacdX2apic;
   1799  1.1.1.13  christos                  SubsubtableLength = sizeof(ACPI_ERDT_CACD);
   1800  1.1.1.13  christos                  break;
   1801  1.1.1.13  christos 
   1802  1.1.1.13  christos             case ACPI_ERDT_TYPE_DACD:
   1803  1.1.1.13  christos                  InfoTable = AcpiDmTableInfoErdtDacd;
   1804  1.1.1.13  christos                  DacdEntries = AcpiDmTableInfoErdtDacdScope;
   1805  1.1.1.13  christos                  SubsubtableLength = sizeof(ACPI_ERDT_DACD);
   1806  1.1.1.13  christos                  break;
   1807  1.1.1.13  christos 
   1808  1.1.1.13  christos             case ACPI_ERDT_TYPE_CMRC:
   1809  1.1.1.13  christos                  InfoTable = AcpiDmTableInfoErdtCmrc;
   1810  1.1.1.13  christos                  break;
   1811  1.1.1.13  christos 
   1812  1.1.1.13  christos             case ACPI_ERDT_TYPE_MMRC:
   1813  1.1.1.13  christos                  InfoTable = AcpiDmTableInfoErdtMmrc;
   1814  1.1.1.13  christos                  TrailEntries = AcpiDmTableInfoErdtMmrcCorrFactor;
   1815  1.1.1.13  christos                  SubsubtableLength = sizeof(ACPI_ERDT_MMRC);
   1816  1.1.1.13  christos                  break;
   1817  1.1.1.13  christos 
   1818  1.1.1.13  christos             case ACPI_ERDT_TYPE_MARC:
   1819  1.1.1.13  christos                  InfoTable = AcpiDmTableInfoErdtMarc;
   1820  1.1.1.13  christos                  break;
   1821  1.1.1.13  christos 
   1822  1.1.1.13  christos             case ACPI_ERDT_TYPE_CARC:
   1823  1.1.1.13  christos                  InfoTable = AcpiDmTableInfoErdtCarc;
   1824  1.1.1.13  christos                  break;
   1825  1.1.1.13  christos 
   1826  1.1.1.13  christos             case ACPI_ERDT_TYPE_CMRD:
   1827  1.1.1.13  christos                  InfoTable = AcpiDmTableInfoErdtCmrd;
   1828  1.1.1.13  christos                  break;
   1829  1.1.1.13  christos 
   1830  1.1.1.13  christos             case ACPI_ERDT_TYPE_IBRD:
   1831  1.1.1.13  christos                  InfoTable = AcpiDmTableInfoErdtIbrd;
   1832  1.1.1.13  christos                  TrailEntries = AcpiDmTableInfoErdtIbrdCorrFactor;
   1833  1.1.1.13  christos                  SubsubtableLength = sizeof(ACPI_ERDT_IBRD);
   1834  1.1.1.13  christos                  break;
   1835  1.1.1.13  christos 
   1836  1.1.1.13  christos             case ACPI_ERDT_TYPE_IBAD:
   1837  1.1.1.13  christos                  InfoTable = AcpiDmTableInfoErdtIbad;
   1838  1.1.1.13  christos                  break;
   1839  1.1.1.13  christos 
   1840  1.1.1.13  christos             case ACPI_ERDT_TYPE_CARD:
   1841  1.1.1.13  christos                  InfoTable = AcpiDmTableInfoErdtCard;
   1842  1.1.1.13  christos                  break;
   1843  1.1.1.13  christos 
   1844  1.1.1.13  christos             default:
   1845  1.1.1.13  christos                 AcpiOsPrintf ("\n**** Unknown RMDD subtable type 0x%X\n",
   1846  1.1.1.13  christos                     Subsubtable->Type);
   1847  1.1.1.13  christos 
   1848  1.1.1.13  christos                 /* Attempt to continue */
   1849  1.1.1.13  christos 
   1850  1.1.1.13  christos                 if (!Subsubtable->Length)
   1851  1.1.1.13  christos                 {
   1852  1.1.1.13  christos                     AcpiOsPrintf ("Invalid zero length subtable\n");
   1853  1.1.1.13  christos                     return;
   1854  1.1.1.13  christos                 }
   1855  1.1.1.13  christos                 goto NextSubsubtable;
   1856  1.1.1.13  christos             }
   1857  1.1.1.13  christos 
   1858  1.1.1.13  christos             /* Dump subtable header */
   1859  1.1.1.13  christos 
   1860  1.1.1.13  christos             Status = AcpiDmDumpTable (Table->Length, Suboffset, Subsubtable,
   1861  1.1.1.13  christos                 Subsubtable->Length, AcpiDmTableInfoErdtHdr);
   1862  1.1.1.13  christos             if (ACPI_FAILURE (Status))
   1863  1.1.1.13  christos             {
   1864  1.1.1.13  christos                 return;
   1865  1.1.1.13  christos             }
   1866  1.1.1.13  christos 
   1867  1.1.1.13  christos             /* Dump subtable body */
   1868  1.1.1.13  christos 
   1869  1.1.1.13  christos             Status = AcpiDmDumpTable (Table->Length, Suboffset, Subsubtable,
   1870  1.1.1.13  christos                 Subsubtable->Length, InfoTable);
   1871  1.1.1.13  christos             if (ACPI_FAILURE (Status))
   1872  1.1.1.13  christos             {
   1873  1.1.1.13  christos                 return;
   1874  1.1.1.13  christos             }
   1875  1.1.1.13  christos 
   1876  1.1.1.13  christos             /* CACD, MMRC, and IBRD subtables have simple flex array at end */
   1877  1.1.1.13  christos 
   1878  1.1.1.13  christos             if (TrailEntries)
   1879  1.1.1.13  christos             {
   1880  1.1.1.13  christos                 NumTrailers = 0;
   1881  1.1.1.13  christos                 while (NumTrailers < Subsubtable->Length - SubsubtableLength)
   1882  1.1.1.13  christos                 {
   1883  1.1.1.13  christos 
   1884  1.1.1.13  christos                     /* Dump one flex array element */
   1885  1.1.1.13  christos 
   1886  1.1.1.13  christos                     Status = AcpiDmDumpTable (Table->Length, Suboffset +
   1887  1.1.1.13  christos                         SubsubtableLength + NumTrailers,
   1888  1.1.1.13  christos                         ACPI_ADD_PTR (ACPI_SUBTBL_HDR_16, Subsubtable,
   1889  1.1.1.13  christos                             SubsubtableLength + NumTrailers),
   1890  1.1.1.13  christos                         sizeof(UINT32), TrailEntries);
   1891  1.1.1.13  christos                     if (ACPI_FAILURE (Status))
   1892  1.1.1.13  christos                     {
   1893  1.1.1.13  christos                         return;
   1894  1.1.1.13  christos                     }
   1895  1.1.1.13  christos                     NumTrailers += sizeof(UINT32);
   1896  1.1.1.13  christos                 }
   1897  1.1.1.13  christos             }
   1898  1.1.1.13  christos 
   1899  1.1.1.13  christos             /* DACD subtable has flex array of device agent structures */
   1900  1.1.1.13  christos 
   1901  1.1.1.13  christos             if (DacdEntries) {
   1902  1.1.1.13  christos                  ScopeOffset = Suboffset + SubsubtableLength;
   1903  1.1.1.13  christos                  ScopeTable = ACPI_ADD_PTR (ACPI_ERDT_DACD_PATHS,
   1904  1.1.1.13  christos                      Subsubtable, SubsubtableLength);
   1905  1.1.1.13  christos                  while (ScopeOffset < Suboffset + Subsubtable->Length)
   1906  1.1.1.13  christos                  {
   1907  1.1.1.13  christos                      /* Dump one device agent structure */
   1908  1.1.1.13  christos 
   1909  1.1.1.13  christos                      AcpiOsPrintf ("\n");
   1910  1.1.1.13  christos                      Status = AcpiDmDumpTable (Table->Length, ScopeOffset,
   1911  1.1.1.13  christos                          ScopeTable, ScopeTable->Header.Length, DacdEntries);
   1912  1.1.1.13  christos                      if (ACPI_FAILURE (Status))
   1913  1.1.1.13  christos                      {
   1914  1.1.1.13  christos                          return;
   1915  1.1.1.13  christos                      }
   1916  1.1.1.13  christos 
   1917  1.1.1.13  christos                      /* Flex array of UINT8 for device path */
   1918  1.1.1.13  christos 
   1919  1.1.1.13  christos                      NumTrailers = 0;
   1920  1.1.1.13  christos                      while (NumTrailers < ScopeTable->Header.Length - sizeof(ACPI_ERDT_DACD_PATHS))
   1921  1.1.1.13  christos                      {
   1922  1.1.1.13  christos                          /* Dump one UINT8 of the device path */
   1923  1.1.1.13  christos 
   1924  1.1.1.13  christos                          Status = AcpiDmDumpTable (Table->Length, ScopeOffset +
   1925  1.1.1.13  christos                              sizeof(ACPI_ERDT_DACD_PATHS) + NumTrailers,
   1926  1.1.1.13  christos                              ACPI_ADD_PTR (ACPI_SUBTBL_HDR_16, ScopeTable,
   1927  1.1.1.13  christos                                  sizeof(*ScopeTable) + NumTrailers),
   1928  1.1.1.13  christos                              sizeof(UINT32), AcpiDmTableInfoErdtDacdPath);
   1929  1.1.1.13  christos                          if (ACPI_FAILURE (Status))
   1930  1.1.1.13  christos                          {
   1931  1.1.1.13  christos                              return;
   1932  1.1.1.13  christos                          }
   1933  1.1.1.13  christos                          NumTrailers++;
   1934  1.1.1.13  christos                      }
   1935  1.1.1.13  christos 
   1936  1.1.1.13  christos                      ScopeOffset += ScopeTable->Header.Length;
   1937  1.1.1.13  christos                      ScopeTable = ACPI_ADD_PTR (ACPI_ERDT_DACD_PATHS,
   1938  1.1.1.13  christos                          ScopeTable, ScopeTable->Header.Length);
   1939  1.1.1.13  christos                  }
   1940  1.1.1.13  christos             }
   1941  1.1.1.13  christos NextSubsubtable:
   1942  1.1.1.13  christos             Suboffset += Subsubtable->Length;
   1943  1.1.1.13  christos             Subsubtable = ACPI_ADD_PTR (ACPI_SUBTBL_HDR_16, Table, Suboffset);
   1944  1.1.1.13  christos         }
   1945  1.1.1.13  christos 
   1946  1.1.1.13  christos         Offset += Subtable->Length;
   1947  1.1.1.13  christos         Subtable = ACPI_ADD_PTR (ACPI_SUBTBL_HDR_16, Subtable,
   1948  1.1.1.13  christos             Subtable->Length);
   1949  1.1.1.13  christos     }
   1950  1.1.1.13  christos }
   1951  1.1.1.13  christos 
   1952  1.1.1.13  christos 
   1953  1.1.1.13  christos /*******************************************************************************
   1954  1.1.1.13  christos  *
   1955       1.1  christos  * FUNCTION:    AcpiDmDumpErst
   1956       1.1  christos  *
   1957       1.1  christos  * PARAMETERS:  Table               - A ERST table
   1958       1.1  christos  *
   1959       1.1  christos  * RETURN:      None
   1960       1.1  christos  *
   1961       1.1  christos  * DESCRIPTION: Format the contents of a ERST. This table type consists
   1962       1.1  christos  *              of an open-ended number of subtables.
   1963       1.1  christos  *
   1964       1.1  christos  ******************************************************************************/
   1965       1.1  christos 
   1966       1.1  christos void
   1967       1.1  christos AcpiDmDumpErst (
   1968       1.1  christos     ACPI_TABLE_HEADER       *Table)
   1969       1.1  christos {
   1970       1.1  christos     ACPI_STATUS             Status;
   1971       1.1  christos     ACPI_WHEA_HEADER        *Subtable;
   1972       1.1  christos     UINT32                  Length = Table->Length;
   1973       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_ERST);
   1974       1.1  christos 
   1975       1.1  christos 
   1976       1.1  christos     /* Main table */
   1977       1.1  christos 
   1978       1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoErst);
   1979       1.1  christos     if (ACPI_FAILURE (Status))
   1980       1.1  christos     {
   1981       1.1  christos         return;
   1982       1.1  christos     }
   1983       1.1  christos 
   1984       1.1  christos     /* Subtables */
   1985       1.1  christos 
   1986       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
   1987       1.1  christos     while (Offset < Table->Length)
   1988       1.1  christos     {
   1989       1.1  christos         AcpiOsPrintf ("\n");
   1990       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1991       1.1  christos             sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0);
   1992       1.1  christos         if (ACPI_FAILURE (Status))
   1993       1.1  christos         {
   1994       1.1  christos             return;
   1995       1.1  christos         }
   1996       1.1  christos 
   1997       1.1  christos         /* Point to next subtable (each subtable is of fixed length) */
   1998       1.1  christos 
   1999       1.1  christos         Offset += sizeof (ACPI_WHEA_HEADER);
   2000       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable,
   2001       1.1  christos             sizeof (ACPI_WHEA_HEADER));
   2002       1.1  christos     }
   2003       1.1  christos }
   2004       1.1  christos 
   2005       1.1  christos 
   2006       1.1  christos /*******************************************************************************
   2007       1.1  christos  *
   2008       1.1  christos  * FUNCTION:    AcpiDmDumpFpdt
   2009       1.1  christos  *
   2010       1.1  christos  * PARAMETERS:  Table               - A FPDT table
   2011       1.1  christos  *
   2012       1.1  christos  * RETURN:      None
   2013       1.1  christos  *
   2014       1.1  christos  * DESCRIPTION: Format the contents of a FPDT. This table type consists
   2015       1.1  christos  *              of an open-ended number of subtables.
   2016       1.1  christos  *
   2017       1.1  christos  ******************************************************************************/
   2018       1.1  christos 
   2019       1.1  christos void
   2020       1.1  christos AcpiDmDumpFpdt (
   2021       1.1  christos     ACPI_TABLE_HEADER       *Table)
   2022       1.1  christos {
   2023       1.1  christos     ACPI_STATUS             Status;
   2024       1.1  christos     ACPI_FPDT_HEADER        *Subtable;
   2025       1.1  christos     UINT32                  Length = Table->Length;
   2026       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_FPDT);
   2027       1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
   2028       1.1  christos 
   2029       1.1  christos 
   2030       1.1  christos     /* There is no main table (other than the standard ACPI header) */
   2031       1.1  christos 
   2032       1.1  christos     /* Subtables */
   2033       1.1  christos 
   2034       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset);
   2035       1.1  christos     while (Offset < Table->Length)
   2036       1.1  christos     {
   2037       1.1  christos         /* Common subtable header */
   2038       1.1  christos 
   2039       1.1  christos         AcpiOsPrintf ("\n");
   2040       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   2041       1.1  christos             Subtable->Length, AcpiDmTableInfoFpdtHdr);
   2042       1.1  christos         if (ACPI_FAILURE (Status))
   2043       1.1  christos         {
   2044       1.1  christos             return;
   2045       1.1  christos         }
   2046       1.1  christos 
   2047       1.1  christos         switch (Subtable->Type)
   2048       1.1  christos         {
   2049       1.1  christos         case ACPI_FPDT_TYPE_BOOT:
   2050       1.1  christos 
   2051       1.1  christos             InfoTable = AcpiDmTableInfoFpdt0;
   2052       1.1  christos             break;
   2053       1.1  christos 
   2054       1.1  christos         case ACPI_FPDT_TYPE_S3PERF:
   2055       1.1  christos 
   2056       1.1  christos             InfoTable = AcpiDmTableInfoFpdt1;
   2057       1.1  christos             break;
   2058       1.1  christos 
   2059       1.1  christos         default:
   2060       1.1  christos 
   2061       1.1  christos             AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n",
   2062       1.1  christos                 Subtable->Type);
   2063       1.1  christos 
   2064       1.1  christos             /* Attempt to continue */
   2065       1.1  christos 
   2066       1.1  christos             if (!Subtable->Length)
   2067       1.1  christos             {
   2068       1.1  christos                 AcpiOsPrintf ("Invalid zero length subtable\n");
   2069       1.1  christos                 return;
   2070       1.1  christos             }
   2071       1.1  christos             goto NextSubtable;
   2072       1.1  christos         }
   2073       1.1  christos 
   2074       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   2075       1.1  christos             Subtable->Length, InfoTable);
   2076       1.1  christos         if (ACPI_FAILURE (Status))
   2077       1.1  christos         {
   2078       1.1  christos             return;
   2079       1.1  christos         }
   2080       1.1  christos 
   2081       1.1  christos NextSubtable:
   2082       1.1  christos         /* Point to next subtable */
   2083       1.1  christos 
   2084       1.1  christos         Offset += Subtable->Length;
   2085       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Subtable,
   2086       1.1  christos             Subtable->Length);
   2087       1.1  christos     }
   2088       1.1  christos }
   2089       1.1  christos 
   2090       1.1  christos 
   2091       1.1  christos /*******************************************************************************
   2092       1.1  christos  *
   2093       1.1  christos  * FUNCTION:    AcpiDmDumpGtdt
   2094       1.1  christos  *
   2095       1.1  christos  * PARAMETERS:  Table               - A GTDT table
   2096       1.1  christos  *
   2097       1.1  christos  * RETURN:      None
   2098       1.1  christos  *
   2099       1.1  christos  * DESCRIPTION: Format the contents of a GTDT. This table type consists
   2100       1.1  christos  *              of an open-ended number of subtables.
   2101       1.1  christos  *
   2102       1.1  christos  ******************************************************************************/
   2103       1.1  christos 
   2104       1.1  christos void
   2105       1.1  christos AcpiDmDumpGtdt (
   2106       1.1  christos     ACPI_TABLE_HEADER       *Table)
   2107       1.1  christos {
   2108       1.1  christos     ACPI_STATUS             Status;
   2109       1.1  christos     ACPI_GTDT_HEADER        *Subtable;
   2110       1.1  christos     UINT32                  Length = Table->Length;
   2111       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_GTDT);
   2112       1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
   2113       1.1  christos     UINT32                  SubtableLength;
   2114       1.1  christos     UINT32                  GtCount;
   2115       1.1  christos     ACPI_GTDT_TIMER_ENTRY   *GtxTable;
   2116       1.1  christos 
   2117       1.1  christos 
   2118       1.1  christos     /* Main table */
   2119       1.1  christos 
   2120       1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoGtdt);
   2121       1.1  christos     if (ACPI_FAILURE (Status))
   2122       1.1  christos     {
   2123       1.1  christos         return;
   2124       1.1  christos     }
   2125       1.1  christos 
   2126   1.1.1.2  christos     /* Rev 3 fields */
   2127       1.1  christos 
   2128       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
   2129   1.1.1.2  christos 
   2130   1.1.1.2  christos     if (Table->Revision > 2)
   2131   1.1.1.2  christos     {
   2132   1.1.1.2  christos         SubtableLength = sizeof (ACPI_GTDT_EL2);
   2133   1.1.1.2  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   2134   1.1.1.2  christos             SubtableLength, AcpiDmTableInfoGtdtEl2);
   2135   1.1.1.2  christos         if (ACPI_FAILURE (Status))
   2136   1.1.1.2  christos         {
   2137   1.1.1.2  christos             return;
   2138   1.1.1.2  christos         }
   2139   1.1.1.2  christos         Offset += SubtableLength;
   2140   1.1.1.2  christos     }
   2141   1.1.1.2  christos 
   2142   1.1.1.2  christos     Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
   2143   1.1.1.2  christos 
   2144   1.1.1.2  christos     /* Subtables */
   2145   1.1.1.2  christos 
   2146       1.1  christos     while (Offset < Table->Length)
   2147       1.1  christos     {
   2148       1.1  christos         /* Common subtable header */
   2149       1.1  christos 
   2150       1.1  christos         AcpiOsPrintf ("\n");
   2151       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   2152       1.1  christos             Subtable->Length, AcpiDmTableInfoGtdtHdr);
   2153       1.1  christos         if (ACPI_FAILURE (Status))
   2154       1.1  christos         {
   2155       1.1  christos             return;
   2156       1.1  christos         }
   2157       1.1  christos 
   2158       1.1  christos         GtCount = 0;
   2159       1.1  christos         switch (Subtable->Type)
   2160       1.1  christos         {
   2161       1.1  christos         case ACPI_GTDT_TYPE_TIMER_BLOCK:
   2162       1.1  christos 
   2163       1.1  christos             SubtableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
   2164       1.1  christos             GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
   2165       1.1  christos                 Subtable))->TimerCount;
   2166       1.1  christos 
   2167       1.1  christos             InfoTable = AcpiDmTableInfoGtdt0;
   2168       1.1  christos             break;
   2169       1.1  christos 
   2170       1.1  christos         case ACPI_GTDT_TYPE_WATCHDOG:
   2171       1.1  christos 
   2172       1.1  christos             SubtableLength = sizeof (ACPI_GTDT_WATCHDOG);
   2173       1.1  christos 
   2174       1.1  christos             InfoTable = AcpiDmTableInfoGtdt1;
   2175       1.1  christos             break;
   2176       1.1  christos 
   2177       1.1  christos         default:
   2178       1.1  christos 
   2179       1.1  christos             /* Cannot continue on unknown type - no length */
   2180       1.1  christos 
   2181       1.1  christos             AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n",
   2182       1.1  christos                 Subtable->Type);
   2183       1.1  christos             return;
   2184       1.1  christos         }
   2185       1.1  christos 
   2186       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   2187       1.1  christos             Subtable->Length, InfoTable);
   2188       1.1  christos         if (ACPI_FAILURE (Status))
   2189       1.1  christos         {
   2190       1.1  christos             return;
   2191       1.1  christos         }
   2192       1.1  christos 
   2193       1.1  christos         /* Point to end of current subtable (each subtable above is of fixed length) */
   2194       1.1  christos 
   2195       1.1  christos         Offset += SubtableLength;
   2196       1.1  christos 
   2197       1.1  christos         /* If there are any Gt Timer Blocks from above, dump them now */
   2198       1.1  christos 
   2199       1.1  christos         if (GtCount)
   2200       1.1  christos         {
   2201       1.1  christos             GtxTable = ACPI_ADD_PTR (
   2202       1.1  christos                 ACPI_GTDT_TIMER_ENTRY, Subtable, SubtableLength);
   2203       1.1  christos             SubtableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY);
   2204       1.1  christos 
   2205       1.1  christos             while (GtCount)
   2206       1.1  christos             {
   2207       1.1  christos                 AcpiOsPrintf ("\n");
   2208       1.1  christos                 Status = AcpiDmDumpTable (Length, Offset, GtxTable,
   2209       1.1  christos                     sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a);
   2210       1.1  christos                 if (ACPI_FAILURE (Status))
   2211       1.1  christos                 {
   2212       1.1  christos                     return;
   2213       1.1  christos                 }
   2214       1.1  christos                 Offset += sizeof (ACPI_GTDT_TIMER_ENTRY);
   2215       1.1  christos                 GtxTable++;
   2216       1.1  christos                 GtCount--;
   2217       1.1  christos             }
   2218       1.1  christos         }
   2219       1.1  christos 
   2220       1.1  christos         /* Point to next subtable */
   2221       1.1  christos 
   2222       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Subtable, SubtableLength);
   2223       1.1  christos     }
   2224       1.1  christos }
   2225       1.1  christos 
   2226       1.1  christos 
   2227       1.1  christos /*******************************************************************************
   2228       1.1  christos  *
   2229       1.1  christos  * FUNCTION:    AcpiDmDumpHest
   2230       1.1  christos  *
   2231       1.1  christos  * PARAMETERS:  Table               - A HEST table
   2232       1.1  christos  *
   2233       1.1  christos  * RETURN:      None
   2234       1.1  christos  *
   2235       1.1  christos  * DESCRIPTION: Format the contents of a HEST. This table type consists
   2236       1.1  christos  *              of an open-ended number of subtables.
   2237       1.1  christos  *
   2238       1.1  christos  ******************************************************************************/
   2239       1.1  christos 
   2240       1.1  christos void
   2241       1.1  christos AcpiDmDumpHest (
   2242       1.1  christos     ACPI_TABLE_HEADER       *Table)
   2243       1.1  christos {
   2244       1.1  christos     ACPI_STATUS             Status;
   2245       1.1  christos     ACPI_HEST_HEADER        *Subtable;
   2246       1.1  christos     UINT32                  Length = Table->Length;
   2247       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_HEST);
   2248       1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
   2249       1.1  christos     UINT32                  SubtableLength;
   2250       1.1  christos     UINT32                  BankCount;
   2251       1.1  christos     ACPI_HEST_IA_ERROR_BANK *BankTable;
   2252       1.1  christos 
   2253       1.1  christos 
   2254       1.1  christos     /* Main table */
   2255       1.1  christos 
   2256       1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHest);
   2257       1.1  christos     if (ACPI_FAILURE (Status))
   2258       1.1  christos     {
   2259       1.1  christos         return;
   2260       1.1  christos     }
   2261       1.1  christos 
   2262       1.1  christos     /* Subtables */
   2263       1.1  christos 
   2264       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
   2265       1.1  christos     while (Offset < Table->Length)
   2266       1.1  christos     {
   2267       1.1  christos         BankCount = 0;
   2268       1.1  christos         switch (Subtable->Type)
   2269       1.1  christos         {
   2270       1.1  christos         case ACPI_HEST_TYPE_IA32_CHECK:
   2271       1.1  christos 
   2272       1.1  christos             InfoTable = AcpiDmTableInfoHest0;
   2273       1.1  christos             SubtableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK);
   2274       1.1  christos             BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
   2275       1.1  christos                 Subtable))->NumHardwareBanks;
   2276       1.1  christos             break;
   2277       1.1  christos 
   2278       1.1  christos         case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
   2279       1.1  christos 
   2280       1.1  christos             InfoTable = AcpiDmTableInfoHest1;
   2281       1.1  christos             SubtableLength = sizeof (ACPI_HEST_IA_CORRECTED);
   2282       1.1  christos             BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
   2283       1.1  christos                 Subtable))->NumHardwareBanks;
   2284       1.1  christos             break;
   2285       1.1  christos 
   2286       1.1  christos         case ACPI_HEST_TYPE_IA32_NMI:
   2287       1.1  christos 
   2288       1.1  christos             InfoTable = AcpiDmTableInfoHest2;
   2289       1.1  christos             SubtableLength = sizeof (ACPI_HEST_IA_NMI);
   2290       1.1  christos             break;
   2291       1.1  christos 
   2292       1.1  christos         case ACPI_HEST_TYPE_AER_ROOT_PORT:
   2293       1.1  christos 
   2294       1.1  christos             InfoTable = AcpiDmTableInfoHest6;
   2295       1.1  christos             SubtableLength = sizeof (ACPI_HEST_AER_ROOT);
   2296       1.1  christos             break;
   2297       1.1  christos 
   2298       1.1  christos         case ACPI_HEST_TYPE_AER_ENDPOINT:
   2299       1.1  christos 
   2300       1.1  christos             InfoTable = AcpiDmTableInfoHest7;
   2301       1.1  christos             SubtableLength = sizeof (ACPI_HEST_AER);
   2302       1.1  christos             break;
   2303       1.1  christos 
   2304       1.1  christos         case ACPI_HEST_TYPE_AER_BRIDGE:
   2305       1.1  christos 
   2306       1.1  christos             InfoTable = AcpiDmTableInfoHest8;
   2307       1.1  christos             SubtableLength = sizeof (ACPI_HEST_AER_BRIDGE);
   2308       1.1  christos             break;
   2309       1.1  christos 
   2310       1.1  christos         case ACPI_HEST_TYPE_GENERIC_ERROR:
   2311       1.1  christos 
   2312       1.1  christos             InfoTable = AcpiDmTableInfoHest9;
   2313       1.1  christos             SubtableLength = sizeof (ACPI_HEST_GENERIC);
   2314       1.1  christos             break;
   2315       1.1  christos 
   2316       1.1  christos         case ACPI_HEST_TYPE_GENERIC_ERROR_V2:
   2317       1.1  christos 
   2318       1.1  christos             InfoTable = AcpiDmTableInfoHest10;
   2319       1.1  christos             SubtableLength = sizeof (ACPI_HEST_GENERIC_V2);
   2320       1.1  christos             break;
   2321       1.1  christos 
   2322       1.1  christos         case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK:
   2323       1.1  christos 
   2324       1.1  christos             InfoTable = AcpiDmTableInfoHest11;
   2325       1.1  christos             SubtableLength = sizeof (ACPI_HEST_IA_DEFERRED_CHECK);
   2326       1.1  christos             BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_DEFERRED_CHECK,
   2327       1.1  christos                 Subtable))->NumHardwareBanks;
   2328       1.1  christos             break;
   2329       1.1  christos 
   2330       1.1  christos         default:
   2331       1.1  christos 
   2332       1.1  christos             /* Cannot continue on unknown type - no length */
   2333       1.1  christos 
   2334       1.1  christos             AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n",
   2335       1.1  christos                 Subtable->Type);
   2336       1.1  christos             return;
   2337       1.1  christos         }
   2338       1.1  christos 
   2339       1.1  christos         AcpiOsPrintf ("\n");
   2340       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   2341       1.1  christos             SubtableLength, InfoTable);
   2342       1.1  christos         if (ACPI_FAILURE (Status))
   2343       1.1  christos         {
   2344       1.1  christos             return;
   2345       1.1  christos         }
   2346       1.1  christos 
   2347       1.1  christos         /* Point to end of current subtable (each subtable above is of fixed length) */
   2348       1.1  christos 
   2349       1.1  christos         Offset += SubtableLength;
   2350       1.1  christos 
   2351       1.1  christos         /* If there are any (fixed-length) Error Banks from above, dump them now */
   2352       1.1  christos 
   2353       1.1  christos         if (BankCount)
   2354       1.1  christos         {
   2355       1.1  christos             BankTable = ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK, Subtable,
   2356       1.1  christos                 SubtableLength);
   2357       1.1  christos             SubtableLength += BankCount * sizeof (ACPI_HEST_IA_ERROR_BANK);
   2358       1.1  christos 
   2359       1.1  christos             while (BankCount)
   2360       1.1  christos             {
   2361       1.1  christos                 AcpiOsPrintf ("\n");
   2362       1.1  christos                 Status = AcpiDmDumpTable (Length, Offset, BankTable,
   2363       1.1  christos                     sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank);
   2364       1.1  christos                 if (ACPI_FAILURE (Status))
   2365       1.1  christos                 {
   2366       1.1  christos                     return;
   2367       1.1  christos                 }
   2368       1.1  christos 
   2369       1.1  christos                 Offset += sizeof (ACPI_HEST_IA_ERROR_BANK);
   2370       1.1  christos                 BankTable++;
   2371       1.1  christos                 BankCount--;
   2372       1.1  christos             }
   2373       1.1  christos         }
   2374       1.1  christos 
   2375       1.1  christos         /* Point to next subtable */
   2376       1.1  christos 
   2377       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Subtable, SubtableLength);
   2378       1.1  christos     }
   2379       1.1  christos }
   2380       1.1  christos 
   2381       1.1  christos 
   2382       1.1  christos /*******************************************************************************
   2383       1.1  christos  *
   2384       1.1  christos  * FUNCTION:    AcpiDmDumpHmat
   2385       1.1  christos  *
   2386       1.1  christos  * PARAMETERS:  Table               - A HMAT table
   2387       1.1  christos  *
   2388       1.1  christos  * RETURN:      None
   2389       1.1  christos  *
   2390       1.1  christos  * DESCRIPTION: Format the contents of a HMAT.
   2391       1.1  christos  *
   2392       1.1  christos  ******************************************************************************/
   2393       1.1  christos 
   2394       1.1  christos void
   2395       1.1  christos AcpiDmDumpHmat (
   2396       1.1  christos     ACPI_TABLE_HEADER       *Table)
   2397       1.1  christos {
   2398       1.1  christos     ACPI_STATUS             Status;
   2399       1.1  christos     ACPI_HMAT_STRUCTURE     *HmatStruct;
   2400       1.1  christos     ACPI_HMAT_LOCALITY      *HmatLocality;
   2401       1.1  christos     ACPI_HMAT_CACHE         *HmatCache;
   2402       1.1  christos     UINT32                  Offset;
   2403       1.1  christos     UINT32                  SubtableOffset;
   2404       1.1  christos     UINT32                  Length;
   2405       1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
   2406       1.1  christos     UINT32                  i, j;
   2407       1.1  christos 
   2408       1.1  christos 
   2409       1.1  christos     /* Main table */
   2410       1.1  christos 
   2411       1.1  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoHmat);
   2412       1.1  christos     if (ACPI_FAILURE (Status))
   2413       1.1  christos     {
   2414       1.1  christos         return;
   2415       1.1  christos     }
   2416       1.1  christos     Offset = sizeof (ACPI_TABLE_HMAT);
   2417       1.1  christos 
   2418       1.1  christos     while (Offset < Table->Length)
   2419       1.1  christos     {
   2420       1.1  christos         AcpiOsPrintf ("\n");
   2421       1.1  christos 
   2422       1.1  christos         /* Dump HMAT structure header */
   2423       1.1  christos 
   2424       1.1  christos         HmatStruct = ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, Table, Offset);
   2425       1.1  christos         if (HmatStruct->Length < sizeof (ACPI_HMAT_STRUCTURE))
   2426       1.1  christos         {
   2427       1.1  christos             AcpiOsPrintf ("Invalid HMAT structure length\n");
   2428       1.1  christos             return;
   2429       1.1  christos         }
   2430       1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct,
   2431       1.1  christos             HmatStruct->Length, AcpiDmTableInfoHmatHdr);
   2432       1.1  christos         if (ACPI_FAILURE (Status))
   2433       1.1  christos         {
   2434       1.1  christos             return;
   2435       1.1  christos         }
   2436       1.1  christos 
   2437       1.1  christos         switch (HmatStruct->Type)
   2438       1.1  christos         {
   2439       1.1  christos         case ACPI_HMAT_TYPE_ADDRESS_RANGE:
   2440       1.1  christos 
   2441       1.1  christos             InfoTable = AcpiDmTableInfoHmat0;
   2442   1.1.1.2  christos             Length = sizeof (ACPI_HMAT_PROXIMITY_DOMAIN);
   2443       1.1  christos             break;
   2444       1.1  christos 
   2445       1.1  christos         case ACPI_HMAT_TYPE_LOCALITY:
   2446       1.1  christos 
   2447       1.1  christos             InfoTable = AcpiDmTableInfoHmat1;
   2448       1.1  christos             Length = sizeof (ACPI_HMAT_LOCALITY);
   2449       1.1  christos             break;
   2450       1.1  christos 
   2451       1.1  christos         case ACPI_HMAT_TYPE_CACHE:
   2452       1.1  christos 
   2453       1.1  christos             InfoTable = AcpiDmTableInfoHmat2;
   2454       1.1  christos             Length = sizeof (ACPI_HMAT_CACHE);
   2455       1.1  christos             break;
   2456       1.1  christos 
   2457       1.1  christos         default:
   2458       1.1  christos 
   2459       1.1  christos             AcpiOsPrintf ("\n**** Unknown HMAT structure type 0x%X\n",
   2460       1.1  christos                 HmatStruct->Type);
   2461       1.1  christos 
   2462       1.1  christos             /* Attempt to continue */
   2463       1.1  christos 
   2464       1.1  christos             goto NextSubtable;
   2465       1.1  christos         }
   2466       1.1  christos 
   2467       1.1  christos         /* Dump HMAT structure body */
   2468       1.1  christos 
   2469       1.1  christos         if (HmatStruct->Length < Length)
   2470       1.1  christos         {
   2471       1.1  christos             AcpiOsPrintf ("Invalid HMAT structure length\n");
   2472       1.1  christos             return;
   2473       1.1  christos         }
   2474       1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct,
   2475       1.1  christos             HmatStruct->Length, InfoTable);
   2476       1.1  christos         if (ACPI_FAILURE (Status))
   2477       1.1  christos         {
   2478       1.1  christos             return;
   2479       1.1  christos         }
   2480       1.1  christos 
   2481  1.1.1.10  christos         /* Dump HMAT structure additional */
   2482       1.1  christos 
   2483       1.1  christos         switch (HmatStruct->Type)
   2484       1.1  christos         {
   2485       1.1  christos         case ACPI_HMAT_TYPE_LOCALITY:
   2486       1.1  christos 
   2487       1.1  christos             HmatLocality = ACPI_CAST_PTR (ACPI_HMAT_LOCALITY, HmatStruct);
   2488       1.1  christos             SubtableOffset = sizeof (ACPI_HMAT_LOCALITY);
   2489       1.1  christos 
   2490       1.1  christos             /* Dump initiator proximity domains */
   2491       1.1  christos 
   2492       1.1  christos             if ((UINT32)(HmatStruct->Length - SubtableOffset) <
   2493       1.1  christos                 (UINT32)(HmatLocality->NumberOfInitiatorPDs * 4))
   2494       1.1  christos             {
   2495       1.1  christos                 AcpiOsPrintf ("Invalid initiator proximity domain number\n");
   2496       1.1  christos                 return;
   2497       1.1  christos             }
   2498       1.1  christos             for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++)
   2499       1.1  christos             {
   2500       1.1  christos                 Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
   2501       1.1  christos                     ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
   2502       1.1  christos                     4, AcpiDmTableInfoHmat1a);
   2503   1.1.1.3  christos                 if (ACPI_FAILURE (Status))
   2504   1.1.1.3  christos                 {
   2505   1.1.1.3  christos                     return;
   2506   1.1.1.3  christos                 }
   2507   1.1.1.3  christos 
   2508       1.1  christos                 SubtableOffset += 4;
   2509       1.1  christos             }
   2510       1.1  christos 
   2511       1.1  christos             /* Dump target proximity domains */
   2512       1.1  christos 
   2513       1.1  christos             if ((UINT32)(HmatStruct->Length - SubtableOffset) <
   2514       1.1  christos                 (UINT32)(HmatLocality->NumberOfTargetPDs * 4))
   2515       1.1  christos             {
   2516       1.1  christos                 AcpiOsPrintf ("Invalid target proximity domain number\n");
   2517       1.1  christos                 return;
   2518       1.1  christos             }
   2519       1.1  christos             for (i = 0; i < HmatLocality->NumberOfTargetPDs; i++)
   2520       1.1  christos             {
   2521       1.1  christos                 Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
   2522       1.1  christos                     ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
   2523       1.1  christos                     4, AcpiDmTableInfoHmat1b);
   2524   1.1.1.3  christos                 if (ACPI_FAILURE (Status))
   2525   1.1.1.3  christos                 {
   2526   1.1.1.3  christos                     return;
   2527   1.1.1.3  christos                 }
   2528   1.1.1.3  christos 
   2529       1.1  christos                 SubtableOffset += 4;
   2530       1.1  christos             }
   2531       1.1  christos 
   2532       1.1  christos             /* Dump latency/bandwidth entris */
   2533       1.1  christos 
   2534       1.1  christos             if ((UINT32)(HmatStruct->Length - SubtableOffset) <
   2535       1.1  christos                 (UINT32)(HmatLocality->NumberOfInitiatorPDs *
   2536       1.1  christos                          HmatLocality->NumberOfTargetPDs * 2))
   2537       1.1  christos             {
   2538       1.1  christos                 AcpiOsPrintf ("Invalid latency/bandwidth entry number\n");
   2539       1.1  christos                 return;
   2540       1.1  christos             }
   2541       1.1  christos             for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++)
   2542       1.1  christos             {
   2543       1.1  christos                 for (j = 0; j < HmatLocality->NumberOfTargetPDs; j++)
   2544       1.1  christos                 {
   2545       1.1  christos                     Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
   2546       1.1  christos                         ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
   2547       1.1  christos                         2, AcpiDmTableInfoHmat1c);
   2548   1.1.1.3  christos                     if (ACPI_FAILURE(Status))
   2549   1.1.1.3  christos                     {
   2550   1.1.1.3  christos                         return;
   2551   1.1.1.3  christos                     }
   2552   1.1.1.3  christos 
   2553       1.1  christos                     SubtableOffset += 2;
   2554       1.1  christos                 }
   2555       1.1  christos             }
   2556       1.1  christos             break;
   2557       1.1  christos 
   2558       1.1  christos         case ACPI_HMAT_TYPE_CACHE:
   2559       1.1  christos 
   2560       1.1  christos             HmatCache = ACPI_CAST_PTR (ACPI_HMAT_CACHE, HmatStruct);
   2561       1.1  christos             SubtableOffset = sizeof (ACPI_HMAT_CACHE);
   2562       1.1  christos 
   2563       1.1  christos             /* Dump SMBIOS handles */
   2564       1.1  christos 
   2565       1.1  christos             if ((UINT32)(HmatStruct->Length - SubtableOffset) <
   2566       1.1  christos                 (UINT32)(HmatCache->NumberOfSMBIOSHandles * 2))
   2567       1.1  christos             {
   2568       1.1  christos                 AcpiOsPrintf ("Invalid SMBIOS handle number\n");
   2569       1.1  christos                 return;
   2570       1.1  christos             }
   2571       1.1  christos             for (i = 0; i < HmatCache->NumberOfSMBIOSHandles; i++)
   2572       1.1  christos             {
   2573       1.1  christos                 Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
   2574       1.1  christos                     ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
   2575       1.1  christos                     2, AcpiDmTableInfoHmat2a);
   2576   1.1.1.3  christos                 if (ACPI_FAILURE (Status))
   2577   1.1.1.3  christos                 {
   2578   1.1.1.3  christos                     return;
   2579   1.1.1.3  christos                 }
   2580   1.1.1.3  christos 
   2581       1.1  christos                 SubtableOffset += 2;
   2582       1.1  christos             }
   2583       1.1  christos             break;
   2584       1.1  christos 
   2585       1.1  christos         default:
   2586       1.1  christos 
   2587       1.1  christos             break;
   2588       1.1  christos         }
   2589       1.1  christos 
   2590       1.1  christos NextSubtable:
   2591       1.1  christos         /* Point to next HMAT structure subtable */
   2592       1.1  christos 
   2593       1.1  christos         Offset += (HmatStruct->Length);
   2594       1.1  christos     }
   2595       1.1  christos }
   2596