Home | History | Annotate | Line # | Download | only in common
dmtbdump1.c revision 1.1.1.10
      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  christos /*
      8  1.1.1.10  christos  * Copyright (C) 2000 - 2023, Intel Corp.
      9       1.1  christos  * All rights reserved.
     10       1.1  christos  *
     11       1.1  christos  * Redistribution and use in source and binary forms, with or without
     12       1.1  christos  * modification, are permitted provided that the following conditions
     13       1.1  christos  * are met:
     14       1.1  christos  * 1. Redistributions of source code must retain the above copyright
     15       1.1  christos  *    notice, this list of conditions, and the following disclaimer,
     16       1.1  christos  *    without modification.
     17       1.1  christos  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     18       1.1  christos  *    substantially similar to the "NO WARRANTY" disclaimer below
     19       1.1  christos  *    ("Disclaimer") and any redistribution must be conditioned upon
     20       1.1  christos  *    including a substantially similar Disclaimer requirement for further
     21       1.1  christos  *    binary redistribution.
     22       1.1  christos  * 3. Neither the names of the above-listed copyright holders nor the names
     23       1.1  christos  *    of any contributors may be used to endorse or promote products derived
     24       1.1  christos  *    from this software without specific prior written permission.
     25       1.1  christos  *
     26       1.1  christos  * Alternatively, this software may be distributed under the terms of the
     27       1.1  christos  * GNU General Public License ("GPL") version 2 as published by the Free
     28       1.1  christos  * Software Foundation.
     29       1.1  christos  *
     30       1.1  christos  * NO WARRANTY
     31       1.1  christos  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     32       1.1  christos  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     33   1.1.1.5  christos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     34       1.1  christos  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     35       1.1  christos  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     36       1.1  christos  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     37       1.1  christos  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     38       1.1  christos  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     39       1.1  christos  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     40       1.1  christos  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     41       1.1  christos  * POSSIBILITY OF SUCH DAMAGES.
     42       1.1  christos  */
     43       1.1  christos 
     44       1.1  christos #include "acpi.h"
     45       1.1  christos #include "accommon.h"
     46       1.1  christos #include "acdisasm.h"
     47       1.1  christos #include "actables.h"
     48   1.1.1.9  christos #include "aslcompiler.h"
     49       1.1  christos 
     50       1.1  christos /* This module used for application-level code only */
     51       1.1  christos 
     52       1.1  christos #define _COMPONENT          ACPI_CA_DISASSEMBLER
     53       1.1  christos         ACPI_MODULE_NAME    ("dmtbdump1")
     54       1.1  christos 
     55       1.1  christos 
     56       1.1  christos /*******************************************************************************
     57       1.1  christos  *
     58   1.1.1.6  christos  * FUNCTION:    AcpiDmDumpAest
     59   1.1.1.6  christos  *
     60   1.1.1.6  christos  * PARAMETERS:  Table               - A AEST table
     61   1.1.1.6  christos  *
     62   1.1.1.6  christos  * RETURN:      None
     63   1.1.1.6  christos  *
     64   1.1.1.6  christos  * DESCRIPTION: Format the contents of a AEST table
     65   1.1.1.6  christos  *
     66   1.1.1.6  christos  * NOTE: Assumes the following table structure:
     67   1.1.1.6  christos  *      For all AEST Error Nodes:
     68   1.1.1.6  christos  *          1) An AEST Error Node, followed immediately by:
     69   1.1.1.6  christos  *          2) Any node-specific data
     70   1.1.1.6  christos  *          3) An Interface Structure (one)
     71   1.1.1.6  christos  *          4) A list (array) of Interrupt Structures
     72   1.1.1.6  christos  *
     73   1.1.1.6  christos  * AEST - ARM Error Source table. Conforms to:
     74   1.1.1.6  christos  * ACPI for the Armv8 RAS Extensions 1.1 Platform Design Document Sep 2020
     75   1.1.1.6  christos  *
     76   1.1.1.6  christos  ******************************************************************************/
     77   1.1.1.6  christos 
     78   1.1.1.6  christos void
     79   1.1.1.6  christos AcpiDmDumpAest (
     80   1.1.1.6  christos     ACPI_TABLE_HEADER       *Table)
     81   1.1.1.6  christos {
     82   1.1.1.6  christos     ACPI_STATUS             Status;
     83   1.1.1.6  christos     UINT32                  Offset = sizeof (ACPI_TABLE_HEADER);
     84   1.1.1.6  christos     ACPI_AEST_HEADER        *Subtable;
     85   1.1.1.6  christos     ACPI_AEST_HEADER        *NodeHeader;
     86   1.1.1.6  christos     ACPI_AEST_PROCESSOR     *ProcessorSubtable;
     87   1.1.1.6  christos     ACPI_DMTABLE_INFO       *InfoTable;
     88   1.1.1.6  christos     ACPI_SIZE               Length;
     89   1.1.1.6  christos     UINT8                   Type;
     90   1.1.1.6  christos 
     91   1.1.1.6  christos 
     92   1.1.1.6  christos     /* Very small, generic main table. AEST consists of mostly subtables */
     93   1.1.1.6  christos 
     94   1.1.1.6  christos     while (Offset < Table->Length)
     95   1.1.1.6  christos     {
     96   1.1.1.6  christos         NodeHeader = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset);
     97   1.1.1.6  christos 
     98   1.1.1.6  christos         /* Dump the common error node (subtable) header */
     99   1.1.1.6  christos 
    100   1.1.1.6  christos         Status = AcpiDmDumpTable (Table->Length, Offset, NodeHeader,
    101   1.1.1.6  christos             NodeHeader->Length, AcpiDmTableInfoAestHdr);
    102   1.1.1.6  christos         if (ACPI_FAILURE (Status))
    103   1.1.1.6  christos         {
    104   1.1.1.6  christos             return;
    105   1.1.1.6  christos         }
    106   1.1.1.6  christos 
    107   1.1.1.6  christos         Type = NodeHeader->Type;
    108   1.1.1.6  christos 
    109   1.1.1.6  christos         /* Setup the node-specific subtable based on the header Type field */
    110   1.1.1.6  christos 
    111   1.1.1.6  christos         switch (Type)
    112   1.1.1.6  christos         {
    113   1.1.1.6  christos         case ACPI_AEST_PROCESSOR_ERROR_NODE:
    114   1.1.1.6  christos             InfoTable = AcpiDmTableInfoAestProcError;
    115   1.1.1.6  christos             Length = sizeof (ACPI_AEST_PROCESSOR);
    116   1.1.1.6  christos             break;
    117   1.1.1.6  christos 
    118   1.1.1.6  christos         case ACPI_AEST_MEMORY_ERROR_NODE:
    119   1.1.1.6  christos             InfoTable = AcpiDmTableInfoAestMemError;
    120   1.1.1.6  christos             Length = sizeof (ACPI_AEST_MEMORY);
    121   1.1.1.6  christos             break;
    122   1.1.1.6  christos 
    123   1.1.1.6  christos         case ACPI_AEST_SMMU_ERROR_NODE:
    124   1.1.1.6  christos             InfoTable = AcpiDmTableInfoAestSmmuError;
    125   1.1.1.6  christos             Length = sizeof (ACPI_AEST_SMMU);
    126   1.1.1.6  christos             break;
    127   1.1.1.6  christos 
    128   1.1.1.6  christos         case ACPI_AEST_VENDOR_ERROR_NODE:
    129   1.1.1.6  christos             InfoTable = AcpiDmTableInfoAestVendorError;
    130   1.1.1.6  christos             Length = sizeof (ACPI_AEST_VENDOR);
    131   1.1.1.6  christos             break;
    132   1.1.1.6  christos 
    133   1.1.1.6  christos         case ACPI_AEST_GIC_ERROR_NODE:
    134   1.1.1.6  christos             InfoTable = AcpiDmTableInfoAestGicError;
    135   1.1.1.6  christos             Length = sizeof (ACPI_AEST_GIC);
    136   1.1.1.6  christos             break;
    137   1.1.1.6  christos 
    138   1.1.1.6  christos         /* Error case below */
    139   1.1.1.6  christos         default:
    140   1.1.1.6  christos 
    141   1.1.1.6  christos             AcpiOsPrintf ("\n**** Unknown AEST Error Subtable type 0x%X\n",
    142   1.1.1.6  christos                 Type);
    143   1.1.1.6  christos             return;
    144   1.1.1.6  christos         }
    145   1.1.1.6  christos 
    146   1.1.1.6  christos         /* Point past the common header (to the node-specific data) */
    147   1.1.1.6  christos 
    148   1.1.1.6  christos         Offset += sizeof (ACPI_AEST_HEADER);
    149   1.1.1.6  christos         Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset);
    150   1.1.1.6  christos         AcpiOsPrintf ("\n");
    151   1.1.1.6  christos 
    152   1.1.1.6  christos         /* Dump the node-specific subtable */
    153   1.1.1.6  christos 
    154   1.1.1.6  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, Length,
    155   1.1.1.6  christos             InfoTable);
    156   1.1.1.6  christos         if (ACPI_FAILURE (Status))
    157   1.1.1.6  christos         {
    158   1.1.1.6  christos             return;
    159   1.1.1.6  christos         }
    160   1.1.1.6  christos         AcpiOsPrintf ("\n");
    161   1.1.1.6  christos 
    162   1.1.1.6  christos         if (Type == ACPI_AEST_PROCESSOR_ERROR_NODE)
    163   1.1.1.6  christos         {
    164   1.1.1.6  christos             /*
    165   1.1.1.6  christos              * Special handling for PROCESSOR_ERROR_NODE subtables
    166   1.1.1.6  christos              * (to handle the Resource Substructure via the ResourceType
    167   1.1.1.6  christos              * field).
    168   1.1.1.6  christos              */
    169   1.1.1.6  christos 
    170   1.1.1.6  christos             /* Point past the node-specific data */
    171   1.1.1.6  christos 
    172   1.1.1.6  christos             Offset += Length;
    173   1.1.1.6  christos             ProcessorSubtable = ACPI_CAST_PTR (ACPI_AEST_PROCESSOR, Subtable);
    174   1.1.1.6  christos 
    175   1.1.1.6  christos             switch (ProcessorSubtable->ResourceType)
    176   1.1.1.6  christos             {
    177   1.1.1.6  christos             /* Setup the Resource Substructure subtable */
    178   1.1.1.6  christos 
    179   1.1.1.6  christos             case ACPI_AEST_CACHE_RESOURCE:
    180   1.1.1.6  christos                 InfoTable = AcpiDmTableInfoAestCacheRsrc;
    181   1.1.1.6  christos                 Length = sizeof (ACPI_AEST_PROCESSOR_CACHE);
    182   1.1.1.6  christos                 break;
    183   1.1.1.6  christos 
    184   1.1.1.6  christos             case ACPI_AEST_TLB_RESOURCE:
    185   1.1.1.6  christos                 InfoTable = AcpiDmTableInfoAestTlbRsrc;
    186   1.1.1.6  christos                 Length = sizeof (ACPI_AEST_PROCESSOR_TLB);
    187   1.1.1.6  christos                 break;
    188   1.1.1.6  christos 
    189   1.1.1.6  christos             case ACPI_AEST_GENERIC_RESOURCE:
    190   1.1.1.6  christos                 InfoTable = AcpiDmTableInfoAestGenRsrc;
    191   1.1.1.6  christos                 Length = sizeof (ACPI_AEST_PROCESSOR_GENERIC);
    192   1.1.1.6  christos                 break;
    193   1.1.1.6  christos 
    194   1.1.1.6  christos             /* Error case below */
    195   1.1.1.6  christos             default:
    196   1.1.1.6  christos                 AcpiOsPrintf ("\n**** Unknown AEST Processor Resource type 0x%X\n",
    197   1.1.1.6  christos                     ProcessorSubtable->ResourceType);
    198   1.1.1.6  christos                 return;
    199   1.1.1.6  christos             }
    200   1.1.1.6  christos 
    201   1.1.1.6  christos             ProcessorSubtable = ACPI_ADD_PTR (ACPI_AEST_PROCESSOR, Table,
    202   1.1.1.6  christos                 Offset);
    203   1.1.1.6  christos 
    204   1.1.1.6  christos             /* Dump the resource substructure subtable */
    205   1.1.1.6  christos 
    206   1.1.1.6  christos             Status = AcpiDmDumpTable (Table->Length, Offset, ProcessorSubtable,
    207   1.1.1.6  christos                 Length, InfoTable);
    208   1.1.1.6  christos             if (ACPI_FAILURE (Status))
    209   1.1.1.6  christos             {
    210   1.1.1.6  christos                 return;
    211   1.1.1.6  christos             }
    212   1.1.1.6  christos 
    213   1.1.1.6  christos             AcpiOsPrintf ("\n");
    214   1.1.1.6  christos         }
    215   1.1.1.6  christos 
    216   1.1.1.6  christos         /* Point past the resource substructure or the node-specific data */
    217   1.1.1.6  christos 
    218   1.1.1.6  christos         Offset += Length;
    219   1.1.1.6  christos 
    220   1.1.1.6  christos         /* Dump the interface structure, required to be present */
    221   1.1.1.6  christos 
    222   1.1.1.6  christos         Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset);
    223   1.1.1.6  christos         if (Subtable->Type >= ACPI_AEST_XFACE_RESERVED)
    224   1.1.1.6  christos         {
    225   1.1.1.6  christos             AcpiOsPrintf ("\n**** Unknown AEST Node Interface type 0x%X\n",
    226   1.1.1.6  christos                 Subtable->Type);
    227   1.1.1.6  christos             return;
    228   1.1.1.6  christos         }
    229   1.1.1.6  christos 
    230   1.1.1.6  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    231   1.1.1.6  christos             sizeof (ACPI_AEST_NODE_INTERFACE), AcpiDmTableInfoAestXface);
    232   1.1.1.6  christos         if (ACPI_FAILURE (Status))
    233   1.1.1.6  christos         {
    234   1.1.1.6  christos             return;
    235   1.1.1.6  christos         }
    236   1.1.1.6  christos 
    237   1.1.1.6  christos         /* Point past the interface structure */
    238   1.1.1.6  christos 
    239   1.1.1.6  christos         AcpiOsPrintf ("\n");
    240   1.1.1.6  christos         Offset += sizeof (ACPI_AEST_NODE_INTERFACE);
    241   1.1.1.6  christos 
    242   1.1.1.6  christos         /* Dump the entire interrupt structure array, if present */
    243   1.1.1.6  christos 
    244   1.1.1.6  christos         if (NodeHeader->NodeInterruptOffset)
    245   1.1.1.6  christos         {
    246   1.1.1.6  christos             Length = NodeHeader->NodeInterruptCount;
    247   1.1.1.6  christos             Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset);
    248   1.1.1.6  christos 
    249   1.1.1.6  christos             while (Length)
    250   1.1.1.6  christos             {
    251   1.1.1.6  christos                 /* Dump the interrupt structure */
    252   1.1.1.6  christos 
    253   1.1.1.6  christos                 Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    254   1.1.1.6  christos                     sizeof (ACPI_AEST_NODE_INTERRUPT),
    255   1.1.1.6  christos                     AcpiDmTableInfoAestXrupt);
    256   1.1.1.6  christos                 if (ACPI_FAILURE (Status))
    257   1.1.1.6  christos                 {
    258   1.1.1.6  christos                     return;
    259   1.1.1.6  christos                 }
    260   1.1.1.6  christos 
    261   1.1.1.6  christos                 /* Point to the next interrupt structure */
    262   1.1.1.6  christos 
    263   1.1.1.6  christos                 Offset += sizeof (ACPI_AEST_NODE_INTERRUPT);
    264   1.1.1.6  christos                 Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset);
    265   1.1.1.6  christos                 Length--;
    266   1.1.1.6  christos                 AcpiOsPrintf ("\n");
    267   1.1.1.6  christos             }
    268   1.1.1.6  christos         }
    269   1.1.1.6  christos     }
    270   1.1.1.6  christos }
    271   1.1.1.6  christos 
    272   1.1.1.8  christos /*******************************************************************************
    273   1.1.1.8  christos  *
    274   1.1.1.8  christos  * FUNCTION:    AcpiDmDumpApmt
    275   1.1.1.8  christos  *
    276   1.1.1.8  christos  * PARAMETERS:  Table               - A APMT table
    277   1.1.1.8  christos  *
    278   1.1.1.8  christos  * RETURN:      None
    279   1.1.1.8  christos  *
    280   1.1.1.8  christos  * DESCRIPTION: Format the contents of a APMT. This table type consists
    281   1.1.1.8  christos  *              of an open-ended number of subtables.
    282   1.1.1.8  christos  *
    283   1.1.1.8  christos  *
    284   1.1.1.8  christos  * APMT - ARM Performance Monitoring Unit table. Conforms to:
    285   1.1.1.8  christos  * ARM Performance Monitoring Unit Architecture 1.0 Platform Design Document
    286   1.1.1.8  christos  * ARM DEN0117 v1.0 November 25, 2021
    287   1.1.1.8  christos  *
    288   1.1.1.8  christos  ******************************************************************************/
    289   1.1.1.8  christos 
    290   1.1.1.8  christos void
    291   1.1.1.8  christos AcpiDmDumpApmt (
    292   1.1.1.8  christos     ACPI_TABLE_HEADER       *Table)
    293   1.1.1.8  christos {
    294   1.1.1.8  christos     ACPI_STATUS              Status;
    295   1.1.1.8  christos     ACPI_APMT_NODE           *Subtable;
    296   1.1.1.8  christos     UINT32                   Length = Table->Length;
    297   1.1.1.8  christos     UINT32                   Offset = sizeof (ACPI_TABLE_APMT);
    298   1.1.1.8  christos     UINT32                   NodeNum = 0;
    299   1.1.1.8  christos 
    300   1.1.1.8  christos     /* There is no main table (other than the standard ACPI header) */
    301   1.1.1.8  christos 
    302   1.1.1.8  christos     /* Subtables */
    303   1.1.1.8  christos 
    304   1.1.1.8  christos     Subtable = ACPI_ADD_PTR (ACPI_APMT_NODE, Table, Offset);
    305   1.1.1.8  christos     while (Offset < Table->Length)
    306   1.1.1.8  christos     {
    307   1.1.1.8  christos         AcpiOsPrintf ("\n");
    308   1.1.1.8  christos 
    309   1.1.1.8  christos         if (Subtable->Type >= ACPI_APMT_NODE_TYPE_COUNT)
    310   1.1.1.8  christos         {
    311   1.1.1.8  christos             AcpiOsPrintf ("\n**** Unknown APMT subtable type 0x%X\n",
    312   1.1.1.8  christos                 Subtable->Type);
    313   1.1.1.8  christos             return;
    314   1.1.1.8  christos         }
    315   1.1.1.8  christos 
    316   1.1.1.8  christos         AcpiOsPrintf ("/* APMT Node-%u */\n", NodeNum++);
    317   1.1.1.8  christos 
    318   1.1.1.8  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
    319   1.1.1.8  christos             Subtable->Length, AcpiDmTableInfoApmtNode);
    320   1.1.1.8  christos         if (ACPI_FAILURE (Status))
    321   1.1.1.8  christos         {
    322   1.1.1.8  christos             return;
    323   1.1.1.8  christos         }
    324   1.1.1.8  christos 
    325   1.1.1.8  christos         /* Point to next subtable */
    326   1.1.1.8  christos 
    327   1.1.1.8  christos         Offset += Subtable->Length;
    328   1.1.1.8  christos         Subtable = ACPI_ADD_PTR (ACPI_APMT_NODE, Subtable,
    329   1.1.1.8  christos             Subtable->Length);
    330   1.1.1.8  christos         AcpiOsPrintf ("\n");
    331   1.1.1.8  christos     }
    332   1.1.1.8  christos }
    333   1.1.1.8  christos 
    334   1.1.1.6  christos 
    335   1.1.1.6  christos /*******************************************************************************
    336   1.1.1.6  christos  *
    337       1.1  christos  * FUNCTION:    AcpiDmDumpAsf
    338       1.1  christos  *
    339       1.1  christos  * PARAMETERS:  Table               - A ASF table
    340       1.1  christos  *
    341       1.1  christos  * RETURN:      None
    342       1.1  christos  *
    343       1.1  christos  * DESCRIPTION: Format the contents of a ASF table
    344       1.1  christos  *
    345       1.1  christos  ******************************************************************************/
    346       1.1  christos 
    347       1.1  christos void
    348       1.1  christos AcpiDmDumpAsf (
    349       1.1  christos     ACPI_TABLE_HEADER       *Table)
    350       1.1  christos {
    351       1.1  christos     ACPI_STATUS             Status;
    352       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_HEADER);
    353       1.1  christos     ACPI_ASF_INFO           *Subtable;
    354       1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
    355       1.1  christos     ACPI_DMTABLE_INFO       *DataInfoTable = NULL;
    356       1.1  christos     UINT8                   *DataTable = NULL;
    357       1.1  christos     UINT32                  DataCount = 0;
    358       1.1  christos     UINT32                  DataLength = 0;
    359       1.1  christos     UINT32                  DataOffset = 0;
    360       1.1  christos     UINT32                  i;
    361       1.1  christos     UINT8                   Type;
    362       1.1  christos 
    363       1.1  christos 
    364       1.1  christos     /* No main table, only subtables */
    365       1.1  christos 
    366       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset);
    367       1.1  christos     while (Offset < Table->Length)
    368       1.1  christos     {
    369       1.1  christos         /* Common subtable header */
    370       1.1  christos 
    371       1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    372       1.1  christos             Subtable->Header.Length, AcpiDmTableInfoAsfHdr);
    373       1.1  christos         if (ACPI_FAILURE (Status))
    374       1.1  christos         {
    375       1.1  christos             return;
    376       1.1  christos         }
    377       1.1  christos 
    378       1.1  christos         /* The actual type is the lower 7 bits of Type */
    379       1.1  christos 
    380       1.1  christos         Type = (UINT8) (Subtable->Header.Type & 0x7F);
    381       1.1  christos 
    382       1.1  christos         switch (Type)
    383       1.1  christos         {
    384       1.1  christos         case ACPI_ASF_TYPE_INFO:
    385       1.1  christos 
    386       1.1  christos             InfoTable = AcpiDmTableInfoAsf0;
    387       1.1  christos             break;
    388       1.1  christos 
    389       1.1  christos         case ACPI_ASF_TYPE_ALERT:
    390       1.1  christos 
    391       1.1  christos             InfoTable = AcpiDmTableInfoAsf1;
    392       1.1  christos             DataInfoTable = AcpiDmTableInfoAsf1a;
    393       1.1  christos             DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ALERT));
    394       1.1  christos             DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->Alerts;
    395       1.1  christos             DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->DataLength;
    396       1.1  christos             DataOffset = Offset + sizeof (ACPI_ASF_ALERT);
    397       1.1  christos             break;
    398       1.1  christos 
    399       1.1  christos         case ACPI_ASF_TYPE_CONTROL:
    400       1.1  christos 
    401       1.1  christos             InfoTable = AcpiDmTableInfoAsf2;
    402       1.1  christos             DataInfoTable = AcpiDmTableInfoAsf2a;
    403       1.1  christos             DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_REMOTE));
    404       1.1  christos             DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->Controls;
    405       1.1  christos             DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->DataLength;
    406       1.1  christos             DataOffset = Offset + sizeof (ACPI_ASF_REMOTE);
    407       1.1  christos             break;
    408       1.1  christos 
    409       1.1  christos         case ACPI_ASF_TYPE_BOOT:
    410       1.1  christos 
    411       1.1  christos             InfoTable = AcpiDmTableInfoAsf3;
    412       1.1  christos             break;
    413       1.1  christos 
    414       1.1  christos         case ACPI_ASF_TYPE_ADDRESS:
    415       1.1  christos 
    416       1.1  christos             InfoTable = AcpiDmTableInfoAsf4;
    417       1.1  christos             DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ADDRESS));
    418       1.1  christos             DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, Subtable)->Devices;
    419       1.1  christos             DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS);
    420       1.1  christos             break;
    421       1.1  christos 
    422       1.1  christos         default:
    423       1.1  christos 
    424       1.1  christos             AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n",
    425       1.1  christos                 Subtable->Header.Type);
    426       1.1  christos             return;
    427       1.1  christos         }
    428       1.1  christos 
    429       1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    430       1.1  christos             Subtable->Header.Length, InfoTable);
    431       1.1  christos         if (ACPI_FAILURE (Status))
    432       1.1  christos         {
    433       1.1  christos             return;
    434       1.1  christos         }
    435       1.1  christos 
    436       1.1  christos         /* Dump variable-length extra data */
    437       1.1  christos 
    438       1.1  christos         switch (Type)
    439       1.1  christos         {
    440       1.1  christos         case ACPI_ASF_TYPE_ALERT:
    441       1.1  christos         case ACPI_ASF_TYPE_CONTROL:
    442       1.1  christos 
    443       1.1  christos             for (i = 0; i < DataCount; i++)
    444       1.1  christos             {
    445       1.1  christos                 AcpiOsPrintf ("\n");
    446       1.1  christos                 Status = AcpiDmDumpTable (Table->Length, DataOffset,
    447       1.1  christos                     DataTable, DataLength, DataInfoTable);
    448       1.1  christos                 if (ACPI_FAILURE (Status))
    449       1.1  christos                 {
    450       1.1  christos                     return;
    451       1.1  christos                 }
    452       1.1  christos 
    453       1.1  christos                 DataTable = ACPI_ADD_PTR (UINT8, DataTable, DataLength);
    454       1.1  christos                 DataOffset += DataLength;
    455       1.1  christos             }
    456       1.1  christos             break;
    457       1.1  christos 
    458       1.1  christos         case ACPI_ASF_TYPE_ADDRESS:
    459       1.1  christos 
    460       1.1  christos             for (i = 0; i < DataLength; i++)
    461       1.1  christos             {
    462       1.1  christos                 if (!(i % 16))
    463       1.1  christos                 {
    464       1.1  christos                     AcpiDmLineHeader (DataOffset, 1, "Addresses");
    465       1.1  christos                 }
    466       1.1  christos 
    467       1.1  christos                 AcpiOsPrintf ("%2.2X ", *DataTable);
    468       1.1  christos                 DataTable++;
    469       1.1  christos                 DataOffset++;
    470       1.1  christos 
    471       1.1  christos                 if (DataOffset > Table->Length)
    472       1.1  christos                 {
    473       1.1  christos                     AcpiOsPrintf (
    474       1.1  christos                         "**** ACPI table terminates in the middle of a "
    475       1.1  christos                         "data structure! (ASF! table)\n");
    476       1.1  christos                     return;
    477       1.1  christos                 }
    478       1.1  christos             }
    479       1.1  christos 
    480       1.1  christos             AcpiOsPrintf ("\n");
    481       1.1  christos             break;
    482       1.1  christos 
    483       1.1  christos         default:
    484       1.1  christos 
    485       1.1  christos             break;
    486       1.1  christos         }
    487       1.1  christos 
    488       1.1  christos         AcpiOsPrintf ("\n");
    489       1.1  christos 
    490       1.1  christos         /* Point to next subtable */
    491       1.1  christos 
    492       1.1  christos         if (!Subtable->Header.Length)
    493       1.1  christos         {
    494       1.1  christos             AcpiOsPrintf ("Invalid zero subtable header length\n");
    495       1.1  christos             return;
    496       1.1  christos         }
    497       1.1  christos 
    498       1.1  christos         Offset += Subtable->Header.Length;
    499       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Subtable,
    500       1.1  christos             Subtable->Header.Length);
    501       1.1  christos     }
    502       1.1  christos }
    503       1.1  christos 
    504  1.1.1.10  christos /*******************************************************************************
    505  1.1.1.10  christos  *
    506  1.1.1.10  christos  * FUNCTION:    AcpiDmDumpAspt
    507  1.1.1.10  christos  *
    508  1.1.1.10  christos  * PARAMETERS:  Table               - A ASPT table
    509  1.1.1.10  christos  *
    510  1.1.1.10  christos  * RETURN:      None
    511  1.1.1.10  christos  *
    512  1.1.1.10  christos  * DESCRIPTION: Format the contents of a ASPT table
    513  1.1.1.10  christos  *
    514  1.1.1.10  christos  ******************************************************************************/
    515  1.1.1.10  christos 
    516  1.1.1.10  christos void
    517  1.1.1.10  christos AcpiDmDumpAspt (
    518  1.1.1.10  christos     ACPI_TABLE_HEADER       *Table)
    519  1.1.1.10  christos {
    520  1.1.1.10  christos     ACPI_STATUS             Status;
    521  1.1.1.10  christos     UINT32                  Offset = sizeof (ACPI_TABLE_ASPT);
    522  1.1.1.10  christos     UINT32                  Length = Table->Length;
    523  1.1.1.10  christos     ACPI_ASPT_HEADER        *Subtable;
    524  1.1.1.10  christos     ACPI_DMTABLE_INFO       *InfoTable;
    525  1.1.1.10  christos     UINT16                   Type;
    526  1.1.1.10  christos 
    527  1.1.1.10  christos     /* Main table */
    528  1.1.1.10  christos     Status = AcpiDmDumpTable(Length, 0, Table, 0, AcpiDmTableInfoAspt);
    529  1.1.1.10  christos 
    530  1.1.1.10  christos     /* Subtables */
    531  1.1.1.10  christos 
    532  1.1.1.10  christos     Subtable = ACPI_ADD_PTR (ACPI_ASPT_HEADER, Table, Offset);
    533  1.1.1.10  christos     while (Offset < Table->Length)
    534  1.1.1.10  christos     {
    535  1.1.1.10  christos         AcpiOsPrintf ("\n");
    536  1.1.1.10  christos 
    537  1.1.1.10  christos         /* Common subtable header */
    538  1.1.1.10  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    539  1.1.1.10  christos             Subtable->Length, AcpiDmTableInfoAsptHdr);
    540  1.1.1.10  christos         if (ACPI_FAILURE (Status))
    541  1.1.1.10  christos         {
    542  1.1.1.10  christos             return;
    543  1.1.1.10  christos         }
    544  1.1.1.10  christos 
    545  1.1.1.10  christos         Type = Subtable->Type;
    546  1.1.1.10  christos 
    547  1.1.1.10  christos         switch (Type)
    548  1.1.1.10  christos         {
    549  1.1.1.10  christos         case ACPI_ASPT_TYPE_GLOBAL_REGS:
    550  1.1.1.10  christos 
    551  1.1.1.10  christos             InfoTable = AcpiDmTableInfoAspt0;
    552  1.1.1.10  christos             break;
    553  1.1.1.10  christos 
    554  1.1.1.10  christos         case ACPI_ASPT_TYPE_SEV_MBOX_REGS:
    555  1.1.1.10  christos 
    556  1.1.1.10  christos             InfoTable = AcpiDmTableInfoAspt1;
    557  1.1.1.10  christos             break;
    558  1.1.1.10  christos 
    559  1.1.1.10  christos         case ACPI_ASPT_TYPE_ACPI_MBOX_REGS:
    560  1.1.1.10  christos 
    561  1.1.1.10  christos             InfoTable = AcpiDmTableInfoAspt2;
    562  1.1.1.10  christos             break;
    563  1.1.1.10  christos 
    564  1.1.1.10  christos         default:
    565  1.1.1.10  christos 
    566  1.1.1.10  christos             AcpiOsPrintf ("\n**** Unknown ASPT subtable type 0x%X\n",
    567  1.1.1.10  christos                 Subtable->Type);
    568  1.1.1.10  christos             return;
    569  1.1.1.10  christos         }
    570  1.1.1.10  christos 
    571  1.1.1.10  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    572  1.1.1.10  christos             Subtable->Length, InfoTable);
    573  1.1.1.10  christos         if (ACPI_FAILURE (Status))
    574  1.1.1.10  christos         {
    575  1.1.1.10  christos             return;
    576  1.1.1.10  christos         }
    577  1.1.1.10  christos 
    578  1.1.1.10  christos         AcpiOsPrintf ("\n");
    579  1.1.1.10  christos 
    580  1.1.1.10  christos         /* Point to next subtable */
    581  1.1.1.10  christos         if (!Subtable->Length)
    582  1.1.1.10  christos         {
    583  1.1.1.10  christos             AcpiOsPrintf ("Invalid zero subtable header length\n");
    584  1.1.1.10  christos             return;
    585  1.1.1.10  christos         }
    586  1.1.1.10  christos 
    587  1.1.1.10  christos         Offset += Subtable->Length;
    588  1.1.1.10  christos         Subtable = ACPI_ADD_PTR (ACPI_ASPT_HEADER, Subtable,
    589  1.1.1.10  christos             Subtable->Length);
    590  1.1.1.10  christos     }
    591  1.1.1.10  christos }
    592  1.1.1.10  christos 
    593   1.1.1.9  christos 
    594   1.1.1.9  christos /*******************************************************************************
    595   1.1.1.9  christos  *
    596   1.1.1.9  christos  * FUNCTION:    AcpiDmDumpCdat
    597   1.1.1.9  christos  *
    598   1.1.1.9  christos  * PARAMETERS:  InTable             - A CDAT table
    599   1.1.1.9  christos  *
    600   1.1.1.9  christos  * RETURN:      None
    601   1.1.1.9  christos  *
    602   1.1.1.9  christos  * DESCRIPTION: Format the contents of a CDAT. This table type consists
    603   1.1.1.9  christos  *              of an open-ended number of subtables.
    604   1.1.1.9  christos  *
    605   1.1.1.9  christos  ******************************************************************************/
    606   1.1.1.9  christos 
    607   1.1.1.9  christos void
    608   1.1.1.9  christos AcpiDmDumpCdat (
    609   1.1.1.9  christos     ACPI_TABLE_HEADER       *InTable)
    610   1.1.1.9  christos {
    611   1.1.1.9  christos     ACPI_TABLE_CDAT         *Table = ACPI_CAST_PTR (ACPI_TABLE_CDAT, InTable);
    612   1.1.1.9  christos     ACPI_STATUS             Status;
    613   1.1.1.9  christos     ACPI_CDAT_HEADER        *Subtable;
    614   1.1.1.9  christos     ACPI_TABLE_CDAT         *CdatTable = ACPI_CAST_PTR (ACPI_TABLE_CDAT, Table);
    615   1.1.1.9  christos     ACPI_DMTABLE_INFO       *InfoTable;
    616   1.1.1.9  christos     UINT32                  Length = CdatTable->Length;
    617   1.1.1.9  christos     UINT32                  Offset = sizeof (ACPI_TABLE_CDAT);
    618   1.1.1.9  christos     UINT32                  SubtableLength;
    619   1.1.1.9  christos     UINT32                  SubtableType;
    620   1.1.1.9  christos     INT32                   EntriesLength;
    621   1.1.1.9  christos 
    622   1.1.1.9  christos 
    623   1.1.1.9  christos     /* Main table */
    624   1.1.1.9  christos 
    625   1.1.1.9  christos     Status = AcpiDmDumpTable (Offset, 0, CdatTable, 0,
    626   1.1.1.9  christos         AcpiDmTableInfoCdatTableHdr);
    627   1.1.1.9  christos     if (ACPI_FAILURE (Status))
    628   1.1.1.9  christos     {
    629   1.1.1.9  christos         return;
    630   1.1.1.9  christos     }
    631   1.1.1.9  christos 
    632   1.1.1.9  christos     Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, sizeof (ACPI_TABLE_CDAT));
    633   1.1.1.9  christos     while (Offset < Table->Length)
    634   1.1.1.9  christos     {
    635   1.1.1.9  christos         /* Dump the common subtable header */
    636   1.1.1.9  christos 
    637   1.1.1.9  christos         DbgPrint (ASL_DEBUG_OUTPUT, "0) HeaderOffset: %X\n", Offset);
    638   1.1.1.9  christos         AcpiOsPrintf ("\n");
    639   1.1.1.9  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
    640   1.1.1.9  christos             sizeof (ACPI_CDAT_HEADER), AcpiDmTableInfoCdatHeader);
    641   1.1.1.9  christos         if (ACPI_FAILURE (Status))
    642   1.1.1.9  christos         {
    643   1.1.1.9  christos             return;
    644   1.1.1.9  christos         }
    645   1.1.1.9  christos 
    646   1.1.1.9  christos         /* Point past the common subtable header, decode the subtable type */
    647   1.1.1.9  christos 
    648   1.1.1.9  christos         Offset += sizeof (ACPI_CDAT_HEADER);
    649   1.1.1.9  christos         SubtableType = Subtable->Type;
    650   1.1.1.9  christos 
    651   1.1.1.9  christos         switch (Subtable->Type)
    652   1.1.1.9  christos         {
    653   1.1.1.9  christos         case ACPI_CDAT_TYPE_DSMAS:
    654   1.1.1.9  christos             Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
    655   1.1.1.9  christos             SubtableLength = sizeof (ACPI_CDAT_DSMAS);
    656   1.1.1.9  christos 
    657   1.1.1.9  christos             InfoTable = AcpiDmTableInfoCdat0;
    658   1.1.1.9  christos             break;
    659   1.1.1.9  christos 
    660   1.1.1.9  christos         case ACPI_CDAT_TYPE_DSLBIS:
    661   1.1.1.9  christos             Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
    662   1.1.1.9  christos             SubtableLength = sizeof (ACPI_CDAT_DSLBIS);
    663   1.1.1.9  christos             DbgPrint (ASL_DEBUG_OUTPUT, "1) Offset: %X\n", Offset);
    664   1.1.1.9  christos 
    665   1.1.1.9  christos             InfoTable = AcpiDmTableInfoCdat1;
    666   1.1.1.9  christos             break;
    667   1.1.1.9  christos 
    668   1.1.1.9  christos         case ACPI_CDAT_TYPE_DSMSCIS:
    669   1.1.1.9  christos             Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
    670   1.1.1.9  christos             SubtableLength = sizeof (ACPI_CDAT_DSMSCIS);
    671   1.1.1.9  christos 
    672   1.1.1.9  christos             InfoTable = AcpiDmTableInfoCdat2;
    673   1.1.1.9  christos             break;
    674   1.1.1.9  christos 
    675   1.1.1.9  christos         case ACPI_CDAT_TYPE_DSIS:
    676   1.1.1.9  christos             DbgPrint (ASL_DEBUG_OUTPUT, "2) Offset: %X ", Offset);
    677   1.1.1.9  christos             SubtableLength = sizeof (ACPI_CDAT_DSIS);
    678   1.1.1.9  christos             DbgPrint (ASL_DEBUG_OUTPUT, "1) input pointer: %p\n", Table);
    679   1.1.1.9  christos             Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
    680   1.1.1.9  christos             DbgPrint (ASL_DEBUG_OUTPUT, "1) output pointers: %p, %p, Offset: %X\n",
    681   1.1.1.9  christos                 Table, Subtable, Offset);
    682   1.1.1.9  christos             DbgPrint (ASL_DEBUG_OUTPUT, "3) Offset: %X\n", Offset);
    683   1.1.1.9  christos 
    684   1.1.1.9  christos             InfoTable = AcpiDmTableInfoCdat3;
    685   1.1.1.9  christos             break;
    686   1.1.1.9  christos 
    687   1.1.1.9  christos         case ACPI_CDAT_TYPE_DSEMTS:
    688   1.1.1.9  christos             Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
    689   1.1.1.9  christos             SubtableLength = sizeof (ACPI_CDAT_DSEMTS);
    690   1.1.1.9  christos 
    691   1.1.1.9  christos             InfoTable = AcpiDmTableInfoCdat4;
    692   1.1.1.9  christos             break;
    693   1.1.1.9  christos 
    694   1.1.1.9  christos         case ACPI_CDAT_TYPE_SSLBIS:
    695   1.1.1.9  christos             SubtableLength = Subtable->Length;
    696   1.1.1.9  christos 
    697   1.1.1.9  christos             InfoTable = AcpiDmTableInfoCdat5;
    698   1.1.1.9  christos             Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
    699   1.1.1.9  christos             break;
    700   1.1.1.9  christos 
    701   1.1.1.9  christos         default:
    702   1.1.1.9  christos             fprintf (stderr, "ERROR: Unknown SubtableType: %X\n", Subtable->Type);
    703   1.1.1.9  christos             return;
    704   1.1.1.9  christos         }
    705   1.1.1.9  christos 
    706   1.1.1.9  christos         DbgPrint (ASL_DEBUG_OUTPUT, "SubtableType: %X, Length: %X Actual "
    707   1.1.1.9  christos             "Length: %X Offset: %X tableptr: %p\n", SubtableType,
    708   1.1.1.9  christos             Subtable->Length, SubtableLength, Offset, Table);
    709   1.1.1.9  christos 
    710   1.1.1.9  christos         /*
    711   1.1.1.9  christos          * Do the subtable-specific fields
    712   1.1.1.9  christos          */
    713   1.1.1.9  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable, Offset, InfoTable);
    714   1.1.1.9  christos         if (ACPI_FAILURE (Status))
    715   1.1.1.9  christos         {
    716   1.1.1.9  christos             return;
    717   1.1.1.9  christos         }
    718   1.1.1.9  christos 
    719   1.1.1.9  christos         DbgPrint (ASL_DEBUG_OUTPUT, "Subtable Type: %X, Offset: %X, SubtableLength: %X\n",
    720   1.1.1.9  christos             SubtableType, Offset, SubtableLength);
    721   1.1.1.9  christos 
    722   1.1.1.9  christos         /* Additional sub-subtables, dependent on the main subtable type */
    723   1.1.1.9  christos 
    724   1.1.1.9  christos         switch (SubtableType)
    725   1.1.1.9  christos         {
    726   1.1.1.9  christos         case ACPI_CDAT_TYPE_SSLBIS:
    727   1.1.1.9  christos             Offset += sizeof (ACPI_CDAT_SSLBIS);
    728   1.1.1.9  christos             Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table,
    729   1.1.1.9  christos                 Offset);
    730   1.1.1.9  christos 
    731   1.1.1.9  christos             DbgPrint (ASL_DEBUG_OUTPUT, "Case SSLBIS, Offset: %X, SubtableLength: %X "
    732   1.1.1.9  christos                 "Subtable->Length %X\n", Offset, SubtableLength, Subtable->Length);
    733   1.1.1.9  christos 
    734   1.1.1.9  christos             /* Generate the total length of all the SSLBE entries */
    735   1.1.1.9  christos 
    736   1.1.1.9  christos             EntriesLength = SubtableLength - sizeof (ACPI_CDAT_HEADER) -
    737   1.1.1.9  christos                 sizeof (ACPI_CDAT_SSLBIS);
    738   1.1.1.9  christos             DbgPrint (ASL_DEBUG_OUTPUT, "EntriesLength: %X, Offset: %X, Table->Length: %X\n",
    739   1.1.1.9  christos                 EntriesLength, Offset, Table->Length);
    740   1.1.1.9  christos 
    741   1.1.1.9  christos             /* Do each of the SSLBE Entries */
    742   1.1.1.9  christos 
    743   1.1.1.9  christos             while ((EntriesLength > 0) && (Offset < Table->Length))
    744   1.1.1.9  christos             {
    745   1.1.1.9  christos                 AcpiOsPrintf ("\n");
    746   1.1.1.9  christos 
    747   1.1.1.9  christos                 Status = AcpiDmDumpTable (Length, Offset, Subtable, Offset,
    748   1.1.1.9  christos                     AcpiDmTableInfoCdatEntries);
    749   1.1.1.9  christos                 if (ACPI_FAILURE (Status))
    750   1.1.1.9  christos                 {
    751   1.1.1.9  christos                     return;
    752   1.1.1.9  christos                 }
    753   1.1.1.9  christos 
    754   1.1.1.9  christos                 EntriesLength -= sizeof (ACPI_CDAT_SSLBE);
    755   1.1.1.9  christos                 Offset += sizeof (ACPI_CDAT_SSLBE);
    756   1.1.1.9  christos                 Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
    757   1.1.1.9  christos             }
    758   1.1.1.9  christos 
    759   1.1.1.9  christos             SubtableLength = 0;
    760   1.1.1.9  christos             break;
    761   1.1.1.9  christos 
    762   1.1.1.9  christos         default:
    763   1.1.1.9  christos             break;
    764   1.1.1.9  christos         }
    765   1.1.1.9  christos 
    766   1.1.1.9  christos         DbgPrint (ASL_DEBUG_OUTPUT, "Offset: %X, Subtable Length: %X\n",
    767   1.1.1.9  christos             Offset, SubtableLength);
    768   1.1.1.9  christos 
    769   1.1.1.9  christos         /* Point to next subtable */
    770   1.1.1.9  christos 
    771   1.1.1.9  christos         Offset += SubtableLength;
    772   1.1.1.9  christos         Subtable = ACPI_ADD_PTR (ACPI_CDAT_HEADER, Table, Offset);
    773   1.1.1.9  christos     }
    774   1.1.1.9  christos 
    775   1.1.1.9  christos     return;
    776   1.1.1.9  christos }
    777   1.1.1.9  christos 
    778   1.1.1.9  christos 
    779   1.1.1.5  christos /*******************************************************************************
    780   1.1.1.5  christos  *
    781   1.1.1.5  christos  * FUNCTION:    AcpiDmDumpCedt
    782   1.1.1.5  christos  *
    783   1.1.1.5  christos  * PARAMETERS:  Table               - A CEDT table
    784   1.1.1.5  christos  *
    785   1.1.1.5  christos  * RETURN:      None
    786   1.1.1.5  christos  *
    787   1.1.1.5  christos  * DESCRIPTION: Format the contents of a CEDT. This table type consists
    788   1.1.1.5  christos  *              of an open-ended number of subtables.
    789   1.1.1.5  christos  *
    790   1.1.1.5  christos  ******************************************************************************/
    791   1.1.1.5  christos 
    792   1.1.1.5  christos void
    793   1.1.1.5  christos AcpiDmDumpCedt (
    794   1.1.1.5  christos     ACPI_TABLE_HEADER       *Table)
    795   1.1.1.5  christos {
    796   1.1.1.5  christos     ACPI_STATUS             Status;
    797   1.1.1.5  christos     ACPI_CEDT_HEADER        *Subtable;
    798   1.1.1.5  christos     UINT32                  Length = Table->Length;
    799   1.1.1.5  christos     UINT32                  Offset = sizeof (ACPI_TABLE_CEDT);
    800   1.1.1.5  christos 
    801   1.1.1.5  christos 
    802   1.1.1.5  christos     /* There is no main table (other than the standard ACPI header) */
    803   1.1.1.5  christos 
    804   1.1.1.5  christos     Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Table, Offset);
    805   1.1.1.5  christos     while (Offset < Table->Length)
    806   1.1.1.5  christos     {
    807   1.1.1.5  christos         /* Common subtable header */
    808   1.1.1.5  christos 
    809   1.1.1.5  christos         AcpiOsPrintf ("\n");
    810   1.1.1.5  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
    811   1.1.1.5  christos             Subtable->Length, AcpiDmTableInfoCedtHdr);
    812   1.1.1.5  christos         if (ACPI_FAILURE (Status))
    813   1.1.1.5  christos         {
    814   1.1.1.5  christos             return;
    815   1.1.1.5  christos         }
    816   1.1.1.5  christos 
    817   1.1.1.5  christos         switch (Subtable->Type)
    818   1.1.1.5  christos         {
    819   1.1.1.5  christos         case ACPI_CEDT_TYPE_CHBS:
    820   1.1.1.8  christos             Status = AcpiDmDumpTable (Length, Offset, Subtable,
    821   1.1.1.8  christos                 Subtable->Length, AcpiDmTableInfoCedt0);
    822   1.1.1.9  christos             if (ACPI_FAILURE (Status))
    823   1.1.1.9  christos             {
    824   1.1.1.8  christos                 return;
    825   1.1.1.8  christos             }
    826   1.1.1.8  christos             break;
    827   1.1.1.5  christos 
    828   1.1.1.9  christos         case ACPI_CEDT_TYPE_CFMWS:
    829   1.1.1.9  christos         {
    830   1.1.1.8  christos             ACPI_CEDT_CFMWS *ptr = (ACPI_CEDT_CFMWS *) Subtable;
    831   1.1.1.8  christos             unsigned int i, max = 0x01 << (ptr->InterleaveWays);
    832   1.1.1.8  christos 
    833   1.1.1.8  christos             /* print out table with first "Interleave target" */
    834   1.1.1.8  christos 
    835   1.1.1.8  christos             Status = AcpiDmDumpTable (Length, Offset, Subtable,
    836   1.1.1.8  christos                 Subtable->Length, AcpiDmTableInfoCedt1);
    837   1.1.1.9  christos             if (ACPI_FAILURE (Status))
    838   1.1.1.9  christos             {
    839   1.1.1.8  christos                 return;
    840   1.1.1.8  christos             }
    841   1.1.1.8  christos 
    842   1.1.1.8  christos             /* Now, print out any interleave targets beyond the first. */
    843   1.1.1.8  christos 
    844   1.1.1.9  christos             for (i = 1; i < max; i++)
    845   1.1.1.9  christos             {
    846   1.1.1.9  christos                 unsigned int loc_offset = Offset + (i * 4) + ACPI_OFFSET (ACPI_CEDT_CFMWS, InterleaveTargets);
    847   1.1.1.8  christos                 unsigned int *trg = &(ptr->InterleaveTargets[i]);
    848   1.1.1.9  christos 
    849   1.1.1.8  christos                 Status = AcpiDmDumpTable (Length, loc_offset, trg,
    850   1.1.1.8  christos                         Subtable->Length, AcpiDmTableInfoCedt1_te);
    851   1.1.1.9  christos                 if (ACPI_FAILURE (Status))
    852   1.1.1.9  christos                 {
    853   1.1.1.8  christos                     return;
    854   1.1.1.8  christos                 }
    855   1.1.1.8  christos             }
    856   1.1.1.5  christos             break;
    857   1.1.1.8  christos         }
    858   1.1.1.5  christos 
    859   1.1.1.5  christos         default:
    860   1.1.1.5  christos             AcpiOsPrintf ("\n**** Unknown CEDT subtable type 0x%X\n\n",
    861   1.1.1.5  christos                 Subtable->Type);
    862   1.1.1.5  christos 
    863   1.1.1.5  christos             /* Attempt to continue */
    864   1.1.1.5  christos             if (!Subtable->Length)
    865   1.1.1.5  christos             {
    866   1.1.1.5  christos                 AcpiOsPrintf ("Invalid zero length subtable\n");
    867   1.1.1.5  christos                 return;
    868   1.1.1.5  christos             }
    869   1.1.1.5  christos         }
    870   1.1.1.5  christos 
    871   1.1.1.5  christos         /* Point to next subtable */
    872   1.1.1.5  christos         Offset += Subtable->Length;
    873   1.1.1.5  christos         Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Subtable,
    874   1.1.1.5  christos             Subtable->Length);
    875   1.1.1.5  christos     }
    876   1.1.1.5  christos }
    877       1.1  christos 
    878       1.1  christos /*******************************************************************************
    879       1.1  christos  *
    880       1.1  christos  * FUNCTION:    AcpiDmDumpCpep
    881       1.1  christos  *
    882       1.1  christos  * PARAMETERS:  Table               - A CPEP table
    883       1.1  christos  *
    884       1.1  christos  * RETURN:      None
    885       1.1  christos  *
    886       1.1  christos  * DESCRIPTION: Format the contents of a CPEP. This table type consists
    887       1.1  christos  *              of an open-ended number of subtables.
    888       1.1  christos  *
    889       1.1  christos  ******************************************************************************/
    890       1.1  christos 
    891       1.1  christos void
    892       1.1  christos AcpiDmDumpCpep (
    893       1.1  christos     ACPI_TABLE_HEADER       *Table)
    894       1.1  christos {
    895       1.1  christos     ACPI_STATUS             Status;
    896       1.1  christos     ACPI_CPEP_POLLING       *Subtable;
    897       1.1  christos     UINT32                  Length = Table->Length;
    898       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_CPEP);
    899       1.1  christos 
    900       1.1  christos 
    901       1.1  christos     /* Main table */
    902       1.1  christos 
    903       1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoCpep);
    904       1.1  christos     if (ACPI_FAILURE (Status))
    905       1.1  christos     {
    906       1.1  christos         return;
    907       1.1  christos     }
    908       1.1  christos 
    909       1.1  christos     /* Subtables */
    910       1.1  christos 
    911       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset);
    912       1.1  christos     while (Offset < Table->Length)
    913       1.1  christos     {
    914       1.1  christos         AcpiOsPrintf ("\n");
    915       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
    916       1.1  christos             Subtable->Header.Length, AcpiDmTableInfoCpep0);
    917       1.1  christos         if (ACPI_FAILURE (Status))
    918       1.1  christos         {
    919       1.1  christos             return;
    920       1.1  christos         }
    921       1.1  christos 
    922       1.1  christos         /* Point to next subtable */
    923       1.1  christos 
    924       1.1  christos         Offset += Subtable->Header.Length;
    925       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Subtable,
    926       1.1  christos             Subtable->Header.Length);
    927       1.1  christos     }
    928       1.1  christos }
    929       1.1  christos 
    930       1.1  christos 
    931       1.1  christos /*******************************************************************************
    932       1.1  christos  *
    933       1.1  christos  * FUNCTION:    AcpiDmDumpCsrt
    934       1.1  christos  *
    935       1.1  christos  * PARAMETERS:  Table               - A CSRT table
    936       1.1  christos  *
    937       1.1  christos  * RETURN:      None
    938       1.1  christos  *
    939       1.1  christos  * DESCRIPTION: Format the contents of a CSRT. This table type consists
    940       1.1  christos  *              of an open-ended number of subtables.
    941       1.1  christos  *
    942       1.1  christos  ******************************************************************************/
    943       1.1  christos 
    944       1.1  christos void
    945       1.1  christos AcpiDmDumpCsrt (
    946       1.1  christos     ACPI_TABLE_HEADER       *Table)
    947       1.1  christos {
    948       1.1  christos     ACPI_STATUS             Status;
    949       1.1  christos     ACPI_CSRT_GROUP         *Subtable;
    950       1.1  christos     ACPI_CSRT_SHARED_INFO   *SharedInfoTable;
    951       1.1  christos     ACPI_CSRT_DESCRIPTOR    *SubSubtable;
    952       1.1  christos     UINT32                  Length = Table->Length;
    953       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_CSRT);
    954       1.1  christos     UINT32                  SubOffset;
    955       1.1  christos     UINT32                  SubSubOffset;
    956       1.1  christos     UINT32                  InfoLength;
    957       1.1  christos 
    958       1.1  christos 
    959       1.1  christos     /* The main table only contains the ACPI header, thus already handled */
    960       1.1  christos 
    961       1.1  christos     /* Subtables (Resource Groups) */
    962       1.1  christos 
    963       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset);
    964       1.1  christos     while (Offset < Table->Length)
    965       1.1  christos     {
    966       1.1  christos         /* Resource group subtable */
    967       1.1  christos 
    968       1.1  christos         AcpiOsPrintf ("\n");
    969       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
    970       1.1  christos             Subtable->Length, AcpiDmTableInfoCsrt0);
    971       1.1  christos         if (ACPI_FAILURE (Status))
    972       1.1  christos         {
    973       1.1  christos             return;
    974       1.1  christos         }
    975       1.1  christos 
    976       1.1  christos         /* Shared info subtable (One per resource group) */
    977       1.1  christos 
    978       1.1  christos         SubOffset = sizeof (ACPI_CSRT_GROUP);
    979       1.1  christos         SharedInfoTable = ACPI_ADD_PTR (ACPI_CSRT_SHARED_INFO, Table,
    980       1.1  christos             Offset + SubOffset);
    981       1.1  christos 
    982       1.1  christos         AcpiOsPrintf ("\n");
    983       1.1  christos         Status = AcpiDmDumpTable (Length, Offset + SubOffset, SharedInfoTable,
    984       1.1  christos             sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1);
    985       1.1  christos         if (ACPI_FAILURE (Status))
    986       1.1  christos         {
    987       1.1  christos             return;
    988       1.1  christos         }
    989       1.1  christos 
    990       1.1  christos         SubOffset += Subtable->SharedInfoLength;
    991       1.1  christos 
    992       1.1  christos         /* Sub-Subtables (Resource Descriptors) */
    993       1.1  christos 
    994       1.1  christos         SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table,
    995       1.1  christos             Offset + SubOffset);
    996       1.1  christos 
    997       1.1  christos         while ((SubOffset < Subtable->Length) &&
    998       1.1  christos               ((Offset + SubOffset) < Table->Length))
    999       1.1  christos         {
   1000       1.1  christos             AcpiOsPrintf ("\n");
   1001       1.1  christos             Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubtable,
   1002       1.1  christos                 SubSubtable->Length, AcpiDmTableInfoCsrt2);
   1003       1.1  christos             if (ACPI_FAILURE (Status))
   1004       1.1  christos             {
   1005       1.1  christos                 return;
   1006       1.1  christos             }
   1007       1.1  christos 
   1008       1.1  christos             SubSubOffset = sizeof (ACPI_CSRT_DESCRIPTOR);
   1009       1.1  christos 
   1010       1.1  christos             /* Resource-specific info buffer */
   1011       1.1  christos 
   1012       1.1  christos             InfoLength = SubSubtable->Length - SubSubOffset;
   1013       1.1  christos             if (InfoLength)
   1014       1.1  christos             {
   1015       1.1  christos                 Status = AcpiDmDumpTable (Length,
   1016       1.1  christos                     Offset + SubOffset + SubSubOffset, Table,
   1017       1.1  christos                     InfoLength, AcpiDmTableInfoCsrt2a);
   1018       1.1  christos                 if (ACPI_FAILURE (Status))
   1019       1.1  christos                 {
   1020       1.1  christos                     return;
   1021       1.1  christos                 }
   1022       1.1  christos             }
   1023       1.1  christos 
   1024       1.1  christos             /* Point to next sub-subtable */
   1025       1.1  christos 
   1026       1.1  christos             SubOffset += SubSubtable->Length;
   1027       1.1  christos             SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubtable,
   1028       1.1  christos                 SubSubtable->Length);
   1029       1.1  christos         }
   1030       1.1  christos 
   1031       1.1  christos         /* Point to next subtable */
   1032       1.1  christos 
   1033       1.1  christos         Offset += Subtable->Length;
   1034       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Subtable,
   1035       1.1  christos             Subtable->Length);
   1036       1.1  christos     }
   1037       1.1  christos }
   1038       1.1  christos 
   1039       1.1  christos 
   1040       1.1  christos /*******************************************************************************
   1041       1.1  christos  *
   1042       1.1  christos  * FUNCTION:    AcpiDmDumpDbg2
   1043       1.1  christos  *
   1044       1.1  christos  * PARAMETERS:  Table               - A DBG2 table
   1045       1.1  christos  *
   1046       1.1  christos  * RETURN:      None
   1047       1.1  christos  *
   1048       1.1  christos  * DESCRIPTION: Format the contents of a DBG2. This table type consists
   1049       1.1  christos  *              of an open-ended number of subtables.
   1050       1.1  christos  *
   1051       1.1  christos  ******************************************************************************/
   1052       1.1  christos 
   1053       1.1  christos void
   1054       1.1  christos AcpiDmDumpDbg2 (
   1055       1.1  christos     ACPI_TABLE_HEADER       *Table)
   1056       1.1  christos {
   1057       1.1  christos     ACPI_STATUS             Status;
   1058       1.1  christos     ACPI_DBG2_DEVICE        *Subtable;
   1059       1.1  christos     UINT32                  Length = Table->Length;
   1060       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_DBG2);
   1061       1.1  christos     UINT32                  i;
   1062       1.1  christos     UINT32                  ArrayOffset;
   1063       1.1  christos     UINT32                  AbsoluteOffset;
   1064       1.1  christos     UINT8                   *Array;
   1065       1.1  christos 
   1066       1.1  christos 
   1067       1.1  christos     /* Main table */
   1068       1.1  christos 
   1069       1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDbg2);
   1070       1.1  christos     if (ACPI_FAILURE (Status))
   1071       1.1  christos     {
   1072       1.1  christos         return;
   1073       1.1  christos     }
   1074       1.1  christos 
   1075       1.1  christos     /* Subtables */
   1076       1.1  christos 
   1077       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
   1078       1.1  christos     while (Offset < Table->Length)
   1079       1.1  christos     {
   1080       1.1  christos         AcpiOsPrintf ("\n");
   1081       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1082       1.1  christos             Subtable->Length, AcpiDmTableInfoDbg2Device);
   1083       1.1  christos         if (ACPI_FAILURE (Status))
   1084       1.1  christos         {
   1085       1.1  christos             return;
   1086       1.1  christos         }
   1087       1.1  christos 
   1088       1.1  christos         /* Dump the BaseAddress array */
   1089       1.1  christos 
   1090       1.1  christos         for (i = 0; i < Subtable->RegisterCount; i++)
   1091       1.1  christos         {
   1092       1.1  christos             ArrayOffset = Subtable->BaseAddressOffset +
   1093       1.1  christos                 (sizeof (ACPI_GENERIC_ADDRESS) * i);
   1094       1.1  christos             AbsoluteOffset = Offset + ArrayOffset;
   1095       1.1  christos             Array = (UINT8 *) Subtable + ArrayOffset;
   1096       1.1  christos 
   1097       1.1  christos             Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
   1098       1.1  christos                 Subtable->Length, AcpiDmTableInfoDbg2Addr);
   1099       1.1  christos             if (ACPI_FAILURE (Status))
   1100       1.1  christos             {
   1101       1.1  christos                 return;
   1102       1.1  christos             }
   1103       1.1  christos         }
   1104       1.1  christos 
   1105       1.1  christos         /* Dump the AddressSize array */
   1106       1.1  christos 
   1107       1.1  christos         for (i = 0; i < Subtable->RegisterCount; i++)
   1108       1.1  christos         {
   1109       1.1  christos             ArrayOffset = Subtable->AddressSizeOffset +
   1110       1.1  christos                 (sizeof (UINT32) * i);
   1111       1.1  christos             AbsoluteOffset = Offset + ArrayOffset;
   1112       1.1  christos             Array = (UINT8 *) Subtable + ArrayOffset;
   1113       1.1  christos 
   1114       1.1  christos             Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
   1115       1.1  christos                 Subtable->Length, AcpiDmTableInfoDbg2Size);
   1116       1.1  christos             if (ACPI_FAILURE (Status))
   1117       1.1  christos             {
   1118       1.1  christos                 return;
   1119       1.1  christos             }
   1120       1.1  christos         }
   1121       1.1  christos 
   1122       1.1  christos         /* Dump the Namestring (required) */
   1123       1.1  christos 
   1124       1.1  christos         AcpiOsPrintf ("\n");
   1125       1.1  christos         ArrayOffset = Subtable->NamepathOffset;
   1126       1.1  christos         AbsoluteOffset = Offset + ArrayOffset;
   1127       1.1  christos         Array = (UINT8 *) Subtable + ArrayOffset;
   1128       1.1  christos 
   1129       1.1  christos         Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
   1130       1.1  christos             Subtable->Length, AcpiDmTableInfoDbg2Name);
   1131       1.1  christos         if (ACPI_FAILURE (Status))
   1132       1.1  christos         {
   1133       1.1  christos             return;
   1134       1.1  christos         }
   1135       1.1  christos 
   1136       1.1  christos         /* Dump the OemData (optional) */
   1137       1.1  christos 
   1138       1.1  christos         if (Subtable->OemDataOffset)
   1139       1.1  christos         {
   1140       1.1  christos             Status = AcpiDmDumpTable (Length, Offset + Subtable->OemDataOffset,
   1141       1.1  christos                 Table, Subtable->OemDataLength,
   1142       1.1  christos                 AcpiDmTableInfoDbg2OemData);
   1143       1.1  christos             if (ACPI_FAILURE (Status))
   1144       1.1  christos             {
   1145       1.1  christos                 return;
   1146       1.1  christos             }
   1147       1.1  christos         }
   1148       1.1  christos 
   1149       1.1  christos         /* Point to next subtable */
   1150       1.1  christos 
   1151       1.1  christos         Offset += Subtable->Length;
   1152       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Subtable,
   1153       1.1  christos             Subtable->Length);
   1154       1.1  christos     }
   1155       1.1  christos }
   1156       1.1  christos 
   1157       1.1  christos 
   1158       1.1  christos /*******************************************************************************
   1159       1.1  christos  *
   1160       1.1  christos  * FUNCTION:    AcpiDmDumpDmar
   1161       1.1  christos  *
   1162       1.1  christos  * PARAMETERS:  Table               - A DMAR table
   1163       1.1  christos  *
   1164       1.1  christos  * RETURN:      None
   1165       1.1  christos  *
   1166       1.1  christos  * DESCRIPTION: Format the contents of a DMAR. This table type consists
   1167       1.1  christos  *              of an open-ended number of subtables.
   1168       1.1  christos  *
   1169       1.1  christos  ******************************************************************************/
   1170       1.1  christos 
   1171       1.1  christos void
   1172       1.1  christos AcpiDmDumpDmar (
   1173       1.1  christos     ACPI_TABLE_HEADER       *Table)
   1174       1.1  christos {
   1175       1.1  christos     ACPI_STATUS             Status;
   1176       1.1  christos     ACPI_DMAR_HEADER        *Subtable;
   1177       1.1  christos     UINT32                  Length = Table->Length;
   1178       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_DMAR);
   1179       1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
   1180       1.1  christos     ACPI_DMAR_DEVICE_SCOPE  *ScopeTable;
   1181       1.1  christos     UINT32                  ScopeOffset;
   1182       1.1  christos     UINT8                   *PciPath;
   1183       1.1  christos     UINT32                  PathOffset;
   1184       1.1  christos 
   1185       1.1  christos 
   1186       1.1  christos     /* Main table */
   1187       1.1  christos 
   1188       1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDmar);
   1189       1.1  christos     if (ACPI_FAILURE (Status))
   1190       1.1  christos     {
   1191       1.1  christos         return;
   1192       1.1  christos     }
   1193       1.1  christos 
   1194       1.1  christos     /* Subtables */
   1195       1.1  christos 
   1196       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset);
   1197       1.1  christos     while (Offset < Table->Length)
   1198       1.1  christos     {
   1199       1.1  christos         /* Common subtable header */
   1200       1.1  christos 
   1201       1.1  christos         AcpiOsPrintf ("\n");
   1202       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1203       1.1  christos             Subtable->Length, AcpiDmTableInfoDmarHdr);
   1204       1.1  christos         if (ACPI_FAILURE (Status))
   1205       1.1  christos         {
   1206       1.1  christos             return;
   1207       1.1  christos         }
   1208       1.1  christos 
   1209       1.1  christos         AcpiOsPrintf ("\n");
   1210       1.1  christos 
   1211       1.1  christos         switch (Subtable->Type)
   1212       1.1  christos         {
   1213       1.1  christos         case ACPI_DMAR_TYPE_HARDWARE_UNIT:
   1214       1.1  christos 
   1215       1.1  christos             InfoTable = AcpiDmTableInfoDmar0;
   1216       1.1  christos             ScopeOffset = sizeof (ACPI_DMAR_HARDWARE_UNIT);
   1217       1.1  christos             break;
   1218       1.1  christos 
   1219       1.1  christos         case ACPI_DMAR_TYPE_RESERVED_MEMORY:
   1220       1.1  christos 
   1221       1.1  christos             InfoTable = AcpiDmTableInfoDmar1;
   1222       1.1  christos             ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY);
   1223       1.1  christos             break;
   1224       1.1  christos 
   1225       1.1  christos         case ACPI_DMAR_TYPE_ROOT_ATS:
   1226       1.1  christos 
   1227       1.1  christos             InfoTable = AcpiDmTableInfoDmar2;
   1228       1.1  christos             ScopeOffset = sizeof (ACPI_DMAR_ATSR);
   1229       1.1  christos             break;
   1230       1.1  christos 
   1231       1.1  christos         case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
   1232       1.1  christos 
   1233       1.1  christos             InfoTable = AcpiDmTableInfoDmar3;
   1234       1.1  christos             ScopeOffset = sizeof (ACPI_DMAR_RHSA);
   1235       1.1  christos             break;
   1236       1.1  christos 
   1237       1.1  christos         case ACPI_DMAR_TYPE_NAMESPACE:
   1238       1.1  christos 
   1239       1.1  christos             InfoTable = AcpiDmTableInfoDmar4;
   1240       1.1  christos             ScopeOffset = sizeof (ACPI_DMAR_ANDD);
   1241       1.1  christos             break;
   1242       1.1  christos 
   1243   1.1.1.8  christos         case ACPI_DMAR_TYPE_SATC:
   1244   1.1.1.8  christos 
   1245   1.1.1.8  christos             InfoTable = AcpiDmTableInfoDmar5;
   1246   1.1.1.8  christos             ScopeOffset = sizeof (ACPI_DMAR_SATC);
   1247   1.1.1.8  christos             break;
   1248   1.1.1.8  christos 
   1249       1.1  christos         default:
   1250       1.1  christos 
   1251       1.1  christos             AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n",
   1252       1.1  christos                 Subtable->Type);
   1253       1.1  christos             return;
   1254       1.1  christos         }
   1255       1.1  christos 
   1256       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1257       1.1  christos             Subtable->Length, InfoTable);
   1258       1.1  christos         if (ACPI_FAILURE (Status))
   1259       1.1  christos         {
   1260       1.1  christos             return;
   1261       1.1  christos         }
   1262       1.1  christos 
   1263       1.1  christos         /*
   1264       1.1  christos          * Dump the optional device scope entries
   1265       1.1  christos          */
   1266       1.1  christos         if ((Subtable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
   1267       1.1  christos             (Subtable->Type == ACPI_DMAR_TYPE_NAMESPACE))
   1268       1.1  christos         {
   1269       1.1  christos             /* These types do not support device scopes */
   1270       1.1  christos 
   1271       1.1  christos             goto NextSubtable;
   1272       1.1  christos         }
   1273       1.1  christos 
   1274       1.1  christos         ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable, ScopeOffset);
   1275       1.1  christos         while (ScopeOffset < Subtable->Length)
   1276       1.1  christos         {
   1277       1.1  christos             AcpiOsPrintf ("\n");
   1278       1.1  christos             Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable,
   1279       1.1  christos                 ScopeTable->Length, AcpiDmTableInfoDmarScope);
   1280       1.1  christos             if (ACPI_FAILURE (Status))
   1281       1.1  christos             {
   1282       1.1  christos                 return;
   1283       1.1  christos             }
   1284       1.1  christos             AcpiOsPrintf ("\n");
   1285       1.1  christos 
   1286       1.1  christos             /* Dump the PCI Path entries for this device scope */
   1287       1.1  christos 
   1288       1.1  christos             PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */
   1289       1.1  christos 
   1290       1.1  christos             PciPath = ACPI_ADD_PTR (UINT8, ScopeTable,
   1291       1.1  christos                 sizeof (ACPI_DMAR_DEVICE_SCOPE));
   1292       1.1  christos 
   1293       1.1  christos             while (PathOffset < ScopeTable->Length)
   1294       1.1  christos             {
   1295       1.1  christos                 AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2,
   1296       1.1  christos                     "PCI Path");
   1297       1.1  christos                 AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath[0], PciPath[1]);
   1298       1.1  christos 
   1299       1.1  christos                 /* Point to next PCI Path entry */
   1300       1.1  christos 
   1301       1.1  christos                 PathOffset += 2;
   1302       1.1  christos                 PciPath += 2;
   1303       1.1  christos                 AcpiOsPrintf ("\n");
   1304       1.1  christos             }
   1305       1.1  christos 
   1306       1.1  christos             /* Point to next device scope entry */
   1307       1.1  christos 
   1308       1.1  christos             ScopeOffset += ScopeTable->Length;
   1309       1.1  christos             ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE,
   1310       1.1  christos                 ScopeTable, ScopeTable->Length);
   1311       1.1  christos         }
   1312       1.1  christos 
   1313       1.1  christos NextSubtable:
   1314       1.1  christos         /* Point to next subtable */
   1315       1.1  christos 
   1316       1.1  christos         Offset += Subtable->Length;
   1317       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Subtable,
   1318       1.1  christos             Subtable->Length);
   1319       1.1  christos     }
   1320       1.1  christos }
   1321       1.1  christos 
   1322       1.1  christos 
   1323       1.1  christos /*******************************************************************************
   1324       1.1  christos  *
   1325       1.1  christos  * FUNCTION:    AcpiDmDumpDrtm
   1326       1.1  christos  *
   1327       1.1  christos  * PARAMETERS:  Table               - A DRTM table
   1328       1.1  christos  *
   1329       1.1  christos  * RETURN:      None
   1330       1.1  christos  *
   1331       1.1  christos  * DESCRIPTION: Format the contents of a DRTM.
   1332       1.1  christos  *
   1333       1.1  christos  ******************************************************************************/
   1334       1.1  christos 
   1335       1.1  christos void
   1336       1.1  christos AcpiDmDumpDrtm (
   1337       1.1  christos     ACPI_TABLE_HEADER       *Table)
   1338       1.1  christos {
   1339       1.1  christos     ACPI_STATUS             Status;
   1340       1.1  christos     UINT32                  Offset;
   1341       1.1  christos     ACPI_DRTM_VTABLE_LIST   *DrtmVtl;
   1342       1.1  christos     ACPI_DRTM_RESOURCE_LIST *DrtmRl;
   1343       1.1  christos     ACPI_DRTM_DPS_ID        *DrtmDps;
   1344       1.1  christos     UINT32                  Count;
   1345       1.1  christos 
   1346       1.1  christos 
   1347       1.1  christos     /* Main table */
   1348       1.1  christos 
   1349       1.1  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
   1350       1.1  christos         AcpiDmTableInfoDrtm);
   1351       1.1  christos     if (ACPI_FAILURE (Status))
   1352       1.1  christos     {
   1353       1.1  christos         return;
   1354       1.1  christos     }
   1355       1.1  christos 
   1356       1.1  christos     Offset = sizeof (ACPI_TABLE_DRTM);
   1357       1.1  christos 
   1358       1.1  christos     /* Sub-tables */
   1359       1.1  christos 
   1360       1.1  christos     /* Dump ValidatedTable length */
   1361       1.1  christos 
   1362       1.1  christos     DrtmVtl = ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST, Table, Offset);
   1363       1.1  christos     AcpiOsPrintf ("\n");
   1364       1.1  christos     Status = AcpiDmDumpTable (Table->Length, Offset,
   1365       1.1  christos         DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables),
   1366       1.1  christos         AcpiDmTableInfoDrtm0);
   1367       1.1  christos     if (ACPI_FAILURE (Status))
   1368       1.1  christos     {
   1369       1.1  christos             return;
   1370       1.1  christos     }
   1371       1.1  christos 
   1372       1.1  christos     Offset += ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables);
   1373       1.1  christos 
   1374       1.1  christos     /* Dump Validated table addresses */
   1375       1.1  christos 
   1376       1.1  christos     Count = 0;
   1377       1.1  christos     while ((Offset < Table->Length) &&
   1378       1.1  christos             (DrtmVtl->ValidatedTableCount > Count))
   1379       1.1  christos     {
   1380       1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset,
   1381       1.1  christos             ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64),
   1382       1.1  christos             AcpiDmTableInfoDrtm0a);
   1383       1.1  christos         if (ACPI_FAILURE (Status))
   1384       1.1  christos         {
   1385       1.1  christos             return;
   1386       1.1  christos         }
   1387       1.1  christos 
   1388       1.1  christos         Offset += sizeof (UINT64);
   1389       1.1  christos         Count++;
   1390       1.1  christos     }
   1391       1.1  christos 
   1392       1.1  christos     /* Dump ResourceList length */
   1393       1.1  christos 
   1394       1.1  christos     DrtmRl = ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST, Table, Offset);
   1395       1.1  christos     AcpiOsPrintf ("\n");
   1396       1.1  christos     Status = AcpiDmDumpTable (Table->Length, Offset,
   1397       1.1  christos         DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources),
   1398       1.1  christos         AcpiDmTableInfoDrtm1);
   1399       1.1  christos     if (ACPI_FAILURE (Status))
   1400       1.1  christos     {
   1401       1.1  christos         return;
   1402       1.1  christos     }
   1403       1.1  christos 
   1404       1.1  christos     Offset += ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources);
   1405       1.1  christos 
   1406       1.1  christos     /* Dump the Resource List */
   1407       1.1  christos 
   1408       1.1  christos     Count = 0;
   1409       1.1  christos     while ((Offset < Table->Length) &&
   1410       1.1  christos            (DrtmRl->ResourceCount > Count))
   1411       1.1  christos     {
   1412       1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset,
   1413       1.1  christos             ACPI_ADD_PTR (void, Table, Offset),
   1414       1.1  christos             sizeof (ACPI_DRTM_RESOURCE), AcpiDmTableInfoDrtm1a);
   1415       1.1  christos         if (ACPI_FAILURE (Status))
   1416       1.1  christos         {
   1417       1.1  christos             return;
   1418       1.1  christos         }
   1419       1.1  christos 
   1420       1.1  christos         Offset += sizeof (ACPI_DRTM_RESOURCE);
   1421       1.1  christos         Count++;
   1422       1.1  christos     }
   1423       1.1  christos 
   1424       1.1  christos     /* Dump DPS */
   1425       1.1  christos 
   1426       1.1  christos     DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset);
   1427       1.1  christos     AcpiOsPrintf ("\n");
   1428       1.1  christos     (void) AcpiDmDumpTable (Table->Length, Offset,
   1429       1.1  christos         DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2);
   1430       1.1  christos }
   1431       1.1  christos 
   1432       1.1  christos 
   1433       1.1  christos /*******************************************************************************
   1434       1.1  christos  *
   1435       1.1  christos  * FUNCTION:    AcpiDmDumpEinj
   1436       1.1  christos  *
   1437       1.1  christos  * PARAMETERS:  Table               - A EINJ table
   1438       1.1  christos  *
   1439       1.1  christos  * RETURN:      None
   1440       1.1  christos  *
   1441       1.1  christos  * DESCRIPTION: Format the contents of a EINJ. This table type consists
   1442       1.1  christos  *              of an open-ended number of subtables.
   1443       1.1  christos  *
   1444       1.1  christos  ******************************************************************************/
   1445       1.1  christos 
   1446       1.1  christos void
   1447       1.1  christos AcpiDmDumpEinj (
   1448       1.1  christos     ACPI_TABLE_HEADER       *Table)
   1449       1.1  christos {
   1450       1.1  christos     ACPI_STATUS             Status;
   1451       1.1  christos     ACPI_WHEA_HEADER        *Subtable;
   1452       1.1  christos     UINT32                  Length = Table->Length;
   1453       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_EINJ);
   1454       1.1  christos 
   1455       1.1  christos 
   1456       1.1  christos     /* Main table */
   1457       1.1  christos 
   1458       1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoEinj);
   1459       1.1  christos     if (ACPI_FAILURE (Status))
   1460       1.1  christos     {
   1461       1.1  christos         return;
   1462       1.1  christos     }
   1463       1.1  christos 
   1464       1.1  christos     /* Subtables */
   1465       1.1  christos 
   1466       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
   1467       1.1  christos     while (Offset < Table->Length)
   1468       1.1  christos     {
   1469       1.1  christos         AcpiOsPrintf ("\n");
   1470       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1471       1.1  christos             sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
   1472       1.1  christos         if (ACPI_FAILURE (Status))
   1473       1.1  christos         {
   1474       1.1  christos             return;
   1475       1.1  christos         }
   1476       1.1  christos 
   1477       1.1  christos         /* Point to next subtable (each subtable is of fixed length) */
   1478       1.1  christos 
   1479       1.1  christos         Offset += sizeof (ACPI_WHEA_HEADER);
   1480       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable,
   1481       1.1  christos             sizeof (ACPI_WHEA_HEADER));
   1482       1.1  christos     }
   1483       1.1  christos }
   1484       1.1  christos 
   1485       1.1  christos 
   1486       1.1  christos /*******************************************************************************
   1487       1.1  christos  *
   1488       1.1  christos  * FUNCTION:    AcpiDmDumpErst
   1489       1.1  christos  *
   1490       1.1  christos  * PARAMETERS:  Table               - A ERST table
   1491       1.1  christos  *
   1492       1.1  christos  * RETURN:      None
   1493       1.1  christos  *
   1494       1.1  christos  * DESCRIPTION: Format the contents of a ERST. This table type consists
   1495       1.1  christos  *              of an open-ended number of subtables.
   1496       1.1  christos  *
   1497       1.1  christos  ******************************************************************************/
   1498       1.1  christos 
   1499       1.1  christos void
   1500       1.1  christos AcpiDmDumpErst (
   1501       1.1  christos     ACPI_TABLE_HEADER       *Table)
   1502       1.1  christos {
   1503       1.1  christos     ACPI_STATUS             Status;
   1504       1.1  christos     ACPI_WHEA_HEADER        *Subtable;
   1505       1.1  christos     UINT32                  Length = Table->Length;
   1506       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_ERST);
   1507       1.1  christos 
   1508       1.1  christos 
   1509       1.1  christos     /* Main table */
   1510       1.1  christos 
   1511       1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoErst);
   1512       1.1  christos     if (ACPI_FAILURE (Status))
   1513       1.1  christos     {
   1514       1.1  christos         return;
   1515       1.1  christos     }
   1516       1.1  christos 
   1517       1.1  christos     /* Subtables */
   1518       1.1  christos 
   1519       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
   1520       1.1  christos     while (Offset < Table->Length)
   1521       1.1  christos     {
   1522       1.1  christos         AcpiOsPrintf ("\n");
   1523       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1524       1.1  christos             sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0);
   1525       1.1  christos         if (ACPI_FAILURE (Status))
   1526       1.1  christos         {
   1527       1.1  christos             return;
   1528       1.1  christos         }
   1529       1.1  christos 
   1530       1.1  christos         /* Point to next subtable (each subtable is of fixed length) */
   1531       1.1  christos 
   1532       1.1  christos         Offset += sizeof (ACPI_WHEA_HEADER);
   1533       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable,
   1534       1.1  christos             sizeof (ACPI_WHEA_HEADER));
   1535       1.1  christos     }
   1536       1.1  christos }
   1537       1.1  christos 
   1538       1.1  christos 
   1539       1.1  christos /*******************************************************************************
   1540       1.1  christos  *
   1541       1.1  christos  * FUNCTION:    AcpiDmDumpFpdt
   1542       1.1  christos  *
   1543       1.1  christos  * PARAMETERS:  Table               - A FPDT table
   1544       1.1  christos  *
   1545       1.1  christos  * RETURN:      None
   1546       1.1  christos  *
   1547       1.1  christos  * DESCRIPTION: Format the contents of a FPDT. This table type consists
   1548       1.1  christos  *              of an open-ended number of subtables.
   1549       1.1  christos  *
   1550       1.1  christos  ******************************************************************************/
   1551       1.1  christos 
   1552       1.1  christos void
   1553       1.1  christos AcpiDmDumpFpdt (
   1554       1.1  christos     ACPI_TABLE_HEADER       *Table)
   1555       1.1  christos {
   1556       1.1  christos     ACPI_STATUS             Status;
   1557       1.1  christos     ACPI_FPDT_HEADER        *Subtable;
   1558       1.1  christos     UINT32                  Length = Table->Length;
   1559       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_FPDT);
   1560       1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
   1561       1.1  christos 
   1562       1.1  christos 
   1563       1.1  christos     /* There is no main table (other than the standard ACPI header) */
   1564       1.1  christos 
   1565       1.1  christos     /* Subtables */
   1566       1.1  christos 
   1567       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset);
   1568       1.1  christos     while (Offset < Table->Length)
   1569       1.1  christos     {
   1570       1.1  christos         /* Common subtable header */
   1571       1.1  christos 
   1572       1.1  christos         AcpiOsPrintf ("\n");
   1573       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1574       1.1  christos             Subtable->Length, AcpiDmTableInfoFpdtHdr);
   1575       1.1  christos         if (ACPI_FAILURE (Status))
   1576       1.1  christos         {
   1577       1.1  christos             return;
   1578       1.1  christos         }
   1579       1.1  christos 
   1580       1.1  christos         switch (Subtable->Type)
   1581       1.1  christos         {
   1582       1.1  christos         case ACPI_FPDT_TYPE_BOOT:
   1583       1.1  christos 
   1584       1.1  christos             InfoTable = AcpiDmTableInfoFpdt0;
   1585       1.1  christos             break;
   1586       1.1  christos 
   1587       1.1  christos         case ACPI_FPDT_TYPE_S3PERF:
   1588       1.1  christos 
   1589       1.1  christos             InfoTable = AcpiDmTableInfoFpdt1;
   1590       1.1  christos             break;
   1591       1.1  christos 
   1592       1.1  christos         default:
   1593       1.1  christos 
   1594       1.1  christos             AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n",
   1595       1.1  christos                 Subtable->Type);
   1596       1.1  christos 
   1597       1.1  christos             /* Attempt to continue */
   1598       1.1  christos 
   1599       1.1  christos             if (!Subtable->Length)
   1600       1.1  christos             {
   1601       1.1  christos                 AcpiOsPrintf ("Invalid zero length subtable\n");
   1602       1.1  christos                 return;
   1603       1.1  christos             }
   1604       1.1  christos             goto NextSubtable;
   1605       1.1  christos         }
   1606       1.1  christos 
   1607       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1608       1.1  christos             Subtable->Length, InfoTable);
   1609       1.1  christos         if (ACPI_FAILURE (Status))
   1610       1.1  christos         {
   1611       1.1  christos             return;
   1612       1.1  christos         }
   1613       1.1  christos 
   1614       1.1  christos NextSubtable:
   1615       1.1  christos         /* Point to next subtable */
   1616       1.1  christos 
   1617       1.1  christos         Offset += Subtable->Length;
   1618       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Subtable,
   1619       1.1  christos             Subtable->Length);
   1620       1.1  christos     }
   1621       1.1  christos }
   1622       1.1  christos 
   1623       1.1  christos 
   1624       1.1  christos /*******************************************************************************
   1625       1.1  christos  *
   1626       1.1  christos  * FUNCTION:    AcpiDmDumpGtdt
   1627       1.1  christos  *
   1628       1.1  christos  * PARAMETERS:  Table               - A GTDT table
   1629       1.1  christos  *
   1630       1.1  christos  * RETURN:      None
   1631       1.1  christos  *
   1632       1.1  christos  * DESCRIPTION: Format the contents of a GTDT. This table type consists
   1633       1.1  christos  *              of an open-ended number of subtables.
   1634       1.1  christos  *
   1635       1.1  christos  ******************************************************************************/
   1636       1.1  christos 
   1637       1.1  christos void
   1638       1.1  christos AcpiDmDumpGtdt (
   1639       1.1  christos     ACPI_TABLE_HEADER       *Table)
   1640       1.1  christos {
   1641       1.1  christos     ACPI_STATUS             Status;
   1642       1.1  christos     ACPI_GTDT_HEADER        *Subtable;
   1643       1.1  christos     UINT32                  Length = Table->Length;
   1644       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_GTDT);
   1645       1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
   1646       1.1  christos     UINT32                  SubtableLength;
   1647       1.1  christos     UINT32                  GtCount;
   1648       1.1  christos     ACPI_GTDT_TIMER_ENTRY   *GtxTable;
   1649       1.1  christos 
   1650       1.1  christos 
   1651       1.1  christos     /* Main table */
   1652       1.1  christos 
   1653       1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoGtdt);
   1654       1.1  christos     if (ACPI_FAILURE (Status))
   1655       1.1  christos     {
   1656       1.1  christos         return;
   1657       1.1  christos     }
   1658       1.1  christos 
   1659   1.1.1.2  christos     /* Rev 3 fields */
   1660       1.1  christos 
   1661       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
   1662   1.1.1.2  christos 
   1663   1.1.1.2  christos     if (Table->Revision > 2)
   1664   1.1.1.2  christos     {
   1665   1.1.1.2  christos         SubtableLength = sizeof (ACPI_GTDT_EL2);
   1666   1.1.1.2  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1667   1.1.1.2  christos             SubtableLength, AcpiDmTableInfoGtdtEl2);
   1668   1.1.1.2  christos         if (ACPI_FAILURE (Status))
   1669   1.1.1.2  christos         {
   1670   1.1.1.2  christos             return;
   1671   1.1.1.2  christos         }
   1672   1.1.1.2  christos         Offset += SubtableLength;
   1673   1.1.1.2  christos     }
   1674   1.1.1.2  christos 
   1675   1.1.1.2  christos     Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
   1676   1.1.1.2  christos 
   1677   1.1.1.2  christos     /* Subtables */
   1678   1.1.1.2  christos 
   1679       1.1  christos     while (Offset < Table->Length)
   1680       1.1  christos     {
   1681       1.1  christos         /* Common subtable header */
   1682       1.1  christos 
   1683       1.1  christos         AcpiOsPrintf ("\n");
   1684       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1685       1.1  christos             Subtable->Length, AcpiDmTableInfoGtdtHdr);
   1686       1.1  christos         if (ACPI_FAILURE (Status))
   1687       1.1  christos         {
   1688       1.1  christos             return;
   1689       1.1  christos         }
   1690       1.1  christos 
   1691       1.1  christos         GtCount = 0;
   1692       1.1  christos         switch (Subtable->Type)
   1693       1.1  christos         {
   1694       1.1  christos         case ACPI_GTDT_TYPE_TIMER_BLOCK:
   1695       1.1  christos 
   1696       1.1  christos             SubtableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
   1697       1.1  christos             GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
   1698       1.1  christos                 Subtable))->TimerCount;
   1699       1.1  christos 
   1700       1.1  christos             InfoTable = AcpiDmTableInfoGtdt0;
   1701       1.1  christos             break;
   1702       1.1  christos 
   1703       1.1  christos         case ACPI_GTDT_TYPE_WATCHDOG:
   1704       1.1  christos 
   1705       1.1  christos             SubtableLength = sizeof (ACPI_GTDT_WATCHDOG);
   1706       1.1  christos 
   1707       1.1  christos             InfoTable = AcpiDmTableInfoGtdt1;
   1708       1.1  christos             break;
   1709       1.1  christos 
   1710       1.1  christos         default:
   1711       1.1  christos 
   1712       1.1  christos             /* Cannot continue on unknown type - no length */
   1713       1.1  christos 
   1714       1.1  christos             AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n",
   1715       1.1  christos                 Subtable->Type);
   1716       1.1  christos             return;
   1717       1.1  christos         }
   1718       1.1  christos 
   1719       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1720       1.1  christos             Subtable->Length, InfoTable);
   1721       1.1  christos         if (ACPI_FAILURE (Status))
   1722       1.1  christos         {
   1723       1.1  christos             return;
   1724       1.1  christos         }
   1725       1.1  christos 
   1726       1.1  christos         /* Point to end of current subtable (each subtable above is of fixed length) */
   1727       1.1  christos 
   1728       1.1  christos         Offset += SubtableLength;
   1729       1.1  christos 
   1730       1.1  christos         /* If there are any Gt Timer Blocks from above, dump them now */
   1731       1.1  christos 
   1732       1.1  christos         if (GtCount)
   1733       1.1  christos         {
   1734       1.1  christos             GtxTable = ACPI_ADD_PTR (
   1735       1.1  christos                 ACPI_GTDT_TIMER_ENTRY, Subtable, SubtableLength);
   1736       1.1  christos             SubtableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY);
   1737       1.1  christos 
   1738       1.1  christos             while (GtCount)
   1739       1.1  christos             {
   1740       1.1  christos                 AcpiOsPrintf ("\n");
   1741       1.1  christos                 Status = AcpiDmDumpTable (Length, Offset, GtxTable,
   1742       1.1  christos                     sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a);
   1743       1.1  christos                 if (ACPI_FAILURE (Status))
   1744       1.1  christos                 {
   1745       1.1  christos                     return;
   1746       1.1  christos                 }
   1747       1.1  christos                 Offset += sizeof (ACPI_GTDT_TIMER_ENTRY);
   1748       1.1  christos                 GtxTable++;
   1749       1.1  christos                 GtCount--;
   1750       1.1  christos             }
   1751       1.1  christos         }
   1752       1.1  christos 
   1753       1.1  christos         /* Point to next subtable */
   1754       1.1  christos 
   1755       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Subtable, SubtableLength);
   1756       1.1  christos     }
   1757       1.1  christos }
   1758       1.1  christos 
   1759       1.1  christos 
   1760       1.1  christos /*******************************************************************************
   1761       1.1  christos  *
   1762       1.1  christos  * FUNCTION:    AcpiDmDumpHest
   1763       1.1  christos  *
   1764       1.1  christos  * PARAMETERS:  Table               - A HEST table
   1765       1.1  christos  *
   1766       1.1  christos  * RETURN:      None
   1767       1.1  christos  *
   1768       1.1  christos  * DESCRIPTION: Format the contents of a HEST. This table type consists
   1769       1.1  christos  *              of an open-ended number of subtables.
   1770       1.1  christos  *
   1771       1.1  christos  ******************************************************************************/
   1772       1.1  christos 
   1773       1.1  christos void
   1774       1.1  christos AcpiDmDumpHest (
   1775       1.1  christos     ACPI_TABLE_HEADER       *Table)
   1776       1.1  christos {
   1777       1.1  christos     ACPI_STATUS             Status;
   1778       1.1  christos     ACPI_HEST_HEADER        *Subtable;
   1779       1.1  christos     UINT32                  Length = Table->Length;
   1780       1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_HEST);
   1781       1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
   1782       1.1  christos     UINT32                  SubtableLength;
   1783       1.1  christos     UINT32                  BankCount;
   1784       1.1  christos     ACPI_HEST_IA_ERROR_BANK *BankTable;
   1785       1.1  christos 
   1786       1.1  christos 
   1787       1.1  christos     /* Main table */
   1788       1.1  christos 
   1789       1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHest);
   1790       1.1  christos     if (ACPI_FAILURE (Status))
   1791       1.1  christos     {
   1792       1.1  christos         return;
   1793       1.1  christos     }
   1794       1.1  christos 
   1795       1.1  christos     /* Subtables */
   1796       1.1  christos 
   1797       1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
   1798       1.1  christos     while (Offset < Table->Length)
   1799       1.1  christos     {
   1800       1.1  christos         BankCount = 0;
   1801       1.1  christos         switch (Subtable->Type)
   1802       1.1  christos         {
   1803       1.1  christos         case ACPI_HEST_TYPE_IA32_CHECK:
   1804       1.1  christos 
   1805       1.1  christos             InfoTable = AcpiDmTableInfoHest0;
   1806       1.1  christos             SubtableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK);
   1807       1.1  christos             BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
   1808       1.1  christos                 Subtable))->NumHardwareBanks;
   1809       1.1  christos             break;
   1810       1.1  christos 
   1811       1.1  christos         case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
   1812       1.1  christos 
   1813       1.1  christos             InfoTable = AcpiDmTableInfoHest1;
   1814       1.1  christos             SubtableLength = sizeof (ACPI_HEST_IA_CORRECTED);
   1815       1.1  christos             BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
   1816       1.1  christos                 Subtable))->NumHardwareBanks;
   1817       1.1  christos             break;
   1818       1.1  christos 
   1819       1.1  christos         case ACPI_HEST_TYPE_IA32_NMI:
   1820       1.1  christos 
   1821       1.1  christos             InfoTable = AcpiDmTableInfoHest2;
   1822       1.1  christos             SubtableLength = sizeof (ACPI_HEST_IA_NMI);
   1823       1.1  christos             break;
   1824       1.1  christos 
   1825       1.1  christos         case ACPI_HEST_TYPE_AER_ROOT_PORT:
   1826       1.1  christos 
   1827       1.1  christos             InfoTable = AcpiDmTableInfoHest6;
   1828       1.1  christos             SubtableLength = sizeof (ACPI_HEST_AER_ROOT);
   1829       1.1  christos             break;
   1830       1.1  christos 
   1831       1.1  christos         case ACPI_HEST_TYPE_AER_ENDPOINT:
   1832       1.1  christos 
   1833       1.1  christos             InfoTable = AcpiDmTableInfoHest7;
   1834       1.1  christos             SubtableLength = sizeof (ACPI_HEST_AER);
   1835       1.1  christos             break;
   1836       1.1  christos 
   1837       1.1  christos         case ACPI_HEST_TYPE_AER_BRIDGE:
   1838       1.1  christos 
   1839       1.1  christos             InfoTable = AcpiDmTableInfoHest8;
   1840       1.1  christos             SubtableLength = sizeof (ACPI_HEST_AER_BRIDGE);
   1841       1.1  christos             break;
   1842       1.1  christos 
   1843       1.1  christos         case ACPI_HEST_TYPE_GENERIC_ERROR:
   1844       1.1  christos 
   1845       1.1  christos             InfoTable = AcpiDmTableInfoHest9;
   1846       1.1  christos             SubtableLength = sizeof (ACPI_HEST_GENERIC);
   1847       1.1  christos             break;
   1848       1.1  christos 
   1849       1.1  christos         case ACPI_HEST_TYPE_GENERIC_ERROR_V2:
   1850       1.1  christos 
   1851       1.1  christos             InfoTable = AcpiDmTableInfoHest10;
   1852       1.1  christos             SubtableLength = sizeof (ACPI_HEST_GENERIC_V2);
   1853       1.1  christos             break;
   1854       1.1  christos 
   1855       1.1  christos         case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK:
   1856       1.1  christos 
   1857       1.1  christos             InfoTable = AcpiDmTableInfoHest11;
   1858       1.1  christos             SubtableLength = sizeof (ACPI_HEST_IA_DEFERRED_CHECK);
   1859       1.1  christos             BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_DEFERRED_CHECK,
   1860       1.1  christos                 Subtable))->NumHardwareBanks;
   1861       1.1  christos             break;
   1862       1.1  christos 
   1863       1.1  christos         default:
   1864       1.1  christos 
   1865       1.1  christos             /* Cannot continue on unknown type - no length */
   1866       1.1  christos 
   1867       1.1  christos             AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n",
   1868       1.1  christos                 Subtable->Type);
   1869       1.1  christos             return;
   1870       1.1  christos         }
   1871       1.1  christos 
   1872       1.1  christos         AcpiOsPrintf ("\n");
   1873       1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1874       1.1  christos             SubtableLength, InfoTable);
   1875       1.1  christos         if (ACPI_FAILURE (Status))
   1876       1.1  christos         {
   1877       1.1  christos             return;
   1878       1.1  christos         }
   1879       1.1  christos 
   1880       1.1  christos         /* Point to end of current subtable (each subtable above is of fixed length) */
   1881       1.1  christos 
   1882       1.1  christos         Offset += SubtableLength;
   1883       1.1  christos 
   1884       1.1  christos         /* If there are any (fixed-length) Error Banks from above, dump them now */
   1885       1.1  christos 
   1886       1.1  christos         if (BankCount)
   1887       1.1  christos         {
   1888       1.1  christos             BankTable = ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK, Subtable,
   1889       1.1  christos                 SubtableLength);
   1890       1.1  christos             SubtableLength += BankCount * sizeof (ACPI_HEST_IA_ERROR_BANK);
   1891       1.1  christos 
   1892       1.1  christos             while (BankCount)
   1893       1.1  christos             {
   1894       1.1  christos                 AcpiOsPrintf ("\n");
   1895       1.1  christos                 Status = AcpiDmDumpTable (Length, Offset, BankTable,
   1896       1.1  christos                     sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank);
   1897       1.1  christos                 if (ACPI_FAILURE (Status))
   1898       1.1  christos                 {
   1899       1.1  christos                     return;
   1900       1.1  christos                 }
   1901       1.1  christos 
   1902       1.1  christos                 Offset += sizeof (ACPI_HEST_IA_ERROR_BANK);
   1903       1.1  christos                 BankTable++;
   1904       1.1  christos                 BankCount--;
   1905       1.1  christos             }
   1906       1.1  christos         }
   1907       1.1  christos 
   1908       1.1  christos         /* Point to next subtable */
   1909       1.1  christos 
   1910       1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Subtable, SubtableLength);
   1911       1.1  christos     }
   1912       1.1  christos }
   1913       1.1  christos 
   1914       1.1  christos 
   1915       1.1  christos /*******************************************************************************
   1916       1.1  christos  *
   1917       1.1  christos  * FUNCTION:    AcpiDmDumpHmat
   1918       1.1  christos  *
   1919       1.1  christos  * PARAMETERS:  Table               - A HMAT table
   1920       1.1  christos  *
   1921       1.1  christos  * RETURN:      None
   1922       1.1  christos  *
   1923       1.1  christos  * DESCRIPTION: Format the contents of a HMAT.
   1924       1.1  christos  *
   1925       1.1  christos  ******************************************************************************/
   1926       1.1  christos 
   1927       1.1  christos void
   1928       1.1  christos AcpiDmDumpHmat (
   1929       1.1  christos     ACPI_TABLE_HEADER       *Table)
   1930       1.1  christos {
   1931       1.1  christos     ACPI_STATUS             Status;
   1932       1.1  christos     ACPI_HMAT_STRUCTURE     *HmatStruct;
   1933       1.1  christos     ACPI_HMAT_LOCALITY      *HmatLocality;
   1934       1.1  christos     ACPI_HMAT_CACHE         *HmatCache;
   1935       1.1  christos     UINT32                  Offset;
   1936       1.1  christos     UINT32                  SubtableOffset;
   1937       1.1  christos     UINT32                  Length;
   1938       1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
   1939       1.1  christos     UINT32                  i, j;
   1940       1.1  christos 
   1941       1.1  christos 
   1942       1.1  christos     /* Main table */
   1943       1.1  christos 
   1944       1.1  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoHmat);
   1945       1.1  christos     if (ACPI_FAILURE (Status))
   1946       1.1  christos     {
   1947       1.1  christos         return;
   1948       1.1  christos     }
   1949       1.1  christos     Offset = sizeof (ACPI_TABLE_HMAT);
   1950       1.1  christos 
   1951       1.1  christos     while (Offset < Table->Length)
   1952       1.1  christos     {
   1953       1.1  christos         AcpiOsPrintf ("\n");
   1954       1.1  christos 
   1955       1.1  christos         /* Dump HMAT structure header */
   1956       1.1  christos 
   1957       1.1  christos         HmatStruct = ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, Table, Offset);
   1958       1.1  christos         if (HmatStruct->Length < sizeof (ACPI_HMAT_STRUCTURE))
   1959       1.1  christos         {
   1960       1.1  christos             AcpiOsPrintf ("Invalid HMAT structure length\n");
   1961       1.1  christos             return;
   1962       1.1  christos         }
   1963       1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct,
   1964       1.1  christos             HmatStruct->Length, AcpiDmTableInfoHmatHdr);
   1965       1.1  christos         if (ACPI_FAILURE (Status))
   1966       1.1  christos         {
   1967       1.1  christos             return;
   1968       1.1  christos         }
   1969       1.1  christos 
   1970       1.1  christos         switch (HmatStruct->Type)
   1971       1.1  christos         {
   1972       1.1  christos         case ACPI_HMAT_TYPE_ADDRESS_RANGE:
   1973       1.1  christos 
   1974       1.1  christos             InfoTable = AcpiDmTableInfoHmat0;
   1975   1.1.1.2  christos             Length = sizeof (ACPI_HMAT_PROXIMITY_DOMAIN);
   1976       1.1  christos             break;
   1977       1.1  christos 
   1978       1.1  christos         case ACPI_HMAT_TYPE_LOCALITY:
   1979       1.1  christos 
   1980       1.1  christos             InfoTable = AcpiDmTableInfoHmat1;
   1981       1.1  christos             Length = sizeof (ACPI_HMAT_LOCALITY);
   1982       1.1  christos             break;
   1983       1.1  christos 
   1984       1.1  christos         case ACPI_HMAT_TYPE_CACHE:
   1985       1.1  christos 
   1986       1.1  christos             InfoTable = AcpiDmTableInfoHmat2;
   1987       1.1  christos             Length = sizeof (ACPI_HMAT_CACHE);
   1988       1.1  christos             break;
   1989       1.1  christos 
   1990       1.1  christos         default:
   1991       1.1  christos 
   1992       1.1  christos             AcpiOsPrintf ("\n**** Unknown HMAT structure type 0x%X\n",
   1993       1.1  christos                 HmatStruct->Type);
   1994       1.1  christos 
   1995       1.1  christos             /* Attempt to continue */
   1996       1.1  christos 
   1997       1.1  christos             goto NextSubtable;
   1998       1.1  christos         }
   1999       1.1  christos 
   2000       1.1  christos         /* Dump HMAT structure body */
   2001       1.1  christos 
   2002       1.1  christos         if (HmatStruct->Length < Length)
   2003       1.1  christos         {
   2004       1.1  christos             AcpiOsPrintf ("Invalid HMAT structure length\n");
   2005       1.1  christos             return;
   2006       1.1  christos         }
   2007       1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct,
   2008       1.1  christos             HmatStruct->Length, InfoTable);
   2009       1.1  christos         if (ACPI_FAILURE (Status))
   2010       1.1  christos         {
   2011       1.1  christos             return;
   2012       1.1  christos         }
   2013       1.1  christos 
   2014  1.1.1.10  christos         /* Dump HMAT structure additional */
   2015       1.1  christos 
   2016       1.1  christos         switch (HmatStruct->Type)
   2017       1.1  christos         {
   2018       1.1  christos         case ACPI_HMAT_TYPE_LOCALITY:
   2019       1.1  christos 
   2020       1.1  christos             HmatLocality = ACPI_CAST_PTR (ACPI_HMAT_LOCALITY, HmatStruct);
   2021       1.1  christos             SubtableOffset = sizeof (ACPI_HMAT_LOCALITY);
   2022       1.1  christos 
   2023       1.1  christos             /* Dump initiator proximity domains */
   2024       1.1  christos 
   2025       1.1  christos             if ((UINT32)(HmatStruct->Length - SubtableOffset) <
   2026       1.1  christos                 (UINT32)(HmatLocality->NumberOfInitiatorPDs * 4))
   2027       1.1  christos             {
   2028       1.1  christos                 AcpiOsPrintf ("Invalid initiator proximity domain number\n");
   2029       1.1  christos                 return;
   2030       1.1  christos             }
   2031       1.1  christos             for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++)
   2032       1.1  christos             {
   2033       1.1  christos                 Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
   2034       1.1  christos                     ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
   2035       1.1  christos                     4, AcpiDmTableInfoHmat1a);
   2036   1.1.1.3  christos                 if (ACPI_FAILURE (Status))
   2037   1.1.1.3  christos                 {
   2038   1.1.1.3  christos                     return;
   2039   1.1.1.3  christos                 }
   2040   1.1.1.3  christos 
   2041       1.1  christos                 SubtableOffset += 4;
   2042       1.1  christos             }
   2043       1.1  christos 
   2044       1.1  christos             /* Dump target proximity domains */
   2045       1.1  christos 
   2046       1.1  christos             if ((UINT32)(HmatStruct->Length - SubtableOffset) <
   2047       1.1  christos                 (UINT32)(HmatLocality->NumberOfTargetPDs * 4))
   2048       1.1  christos             {
   2049       1.1  christos                 AcpiOsPrintf ("Invalid target proximity domain number\n");
   2050       1.1  christos                 return;
   2051       1.1  christos             }
   2052       1.1  christos             for (i = 0; i < HmatLocality->NumberOfTargetPDs; i++)
   2053       1.1  christos             {
   2054       1.1  christos                 Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
   2055       1.1  christos                     ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
   2056       1.1  christos                     4, AcpiDmTableInfoHmat1b);
   2057   1.1.1.3  christos                 if (ACPI_FAILURE (Status))
   2058   1.1.1.3  christos                 {
   2059   1.1.1.3  christos                     return;
   2060   1.1.1.3  christos                 }
   2061   1.1.1.3  christos 
   2062       1.1  christos                 SubtableOffset += 4;
   2063       1.1  christos             }
   2064       1.1  christos 
   2065       1.1  christos             /* Dump latency/bandwidth entris */
   2066       1.1  christos 
   2067       1.1  christos             if ((UINT32)(HmatStruct->Length - SubtableOffset) <
   2068       1.1  christos                 (UINT32)(HmatLocality->NumberOfInitiatorPDs *
   2069       1.1  christos                          HmatLocality->NumberOfTargetPDs * 2))
   2070       1.1  christos             {
   2071       1.1  christos                 AcpiOsPrintf ("Invalid latency/bandwidth entry number\n");
   2072       1.1  christos                 return;
   2073       1.1  christos             }
   2074       1.1  christos             for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++)
   2075       1.1  christos             {
   2076       1.1  christos                 for (j = 0; j < HmatLocality->NumberOfTargetPDs; j++)
   2077       1.1  christos                 {
   2078       1.1  christos                     Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
   2079       1.1  christos                         ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
   2080       1.1  christos                         2, AcpiDmTableInfoHmat1c);
   2081   1.1.1.3  christos                     if (ACPI_FAILURE(Status))
   2082   1.1.1.3  christos                     {
   2083   1.1.1.3  christos                         return;
   2084   1.1.1.3  christos                     }
   2085   1.1.1.3  christos 
   2086       1.1  christos                     SubtableOffset += 2;
   2087       1.1  christos                 }
   2088       1.1  christos             }
   2089       1.1  christos             break;
   2090       1.1  christos 
   2091       1.1  christos         case ACPI_HMAT_TYPE_CACHE:
   2092       1.1  christos 
   2093       1.1  christos             HmatCache = ACPI_CAST_PTR (ACPI_HMAT_CACHE, HmatStruct);
   2094       1.1  christos             SubtableOffset = sizeof (ACPI_HMAT_CACHE);
   2095       1.1  christos 
   2096       1.1  christos             /* Dump SMBIOS handles */
   2097       1.1  christos 
   2098       1.1  christos             if ((UINT32)(HmatStruct->Length - SubtableOffset) <
   2099       1.1  christos                 (UINT32)(HmatCache->NumberOfSMBIOSHandles * 2))
   2100       1.1  christos             {
   2101       1.1  christos                 AcpiOsPrintf ("Invalid SMBIOS handle number\n");
   2102       1.1  christos                 return;
   2103       1.1  christos             }
   2104       1.1  christos             for (i = 0; i < HmatCache->NumberOfSMBIOSHandles; i++)
   2105       1.1  christos             {
   2106       1.1  christos                 Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
   2107       1.1  christos                     ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
   2108       1.1  christos                     2, AcpiDmTableInfoHmat2a);
   2109   1.1.1.3  christos                 if (ACPI_FAILURE (Status))
   2110   1.1.1.3  christos                 {
   2111   1.1.1.3  christos                     return;
   2112   1.1.1.3  christos                 }
   2113   1.1.1.3  christos 
   2114       1.1  christos                 SubtableOffset += 2;
   2115       1.1  christos             }
   2116       1.1  christos             break;
   2117       1.1  christos 
   2118       1.1  christos         default:
   2119       1.1  christos 
   2120       1.1  christos             break;
   2121       1.1  christos         }
   2122       1.1  christos 
   2123       1.1  christos NextSubtable:
   2124       1.1  christos         /* Point to next HMAT structure subtable */
   2125       1.1  christos 
   2126       1.1  christos         Offset += (HmatStruct->Length);
   2127       1.1  christos     }
   2128       1.1  christos }
   2129