Home | History | Annotate | Line # | Download | only in common
dmtbdump1.c revision 1.1.1.6
      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.5  christos  * Copyright (C) 2000 - 2021, 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  christos 
     49      1.1  christos /* This module used for application-level code only */
     50      1.1  christos 
     51      1.1  christos #define _COMPONENT          ACPI_CA_DISASSEMBLER
     52      1.1  christos         ACPI_MODULE_NAME    ("dmtbdump1")
     53      1.1  christos 
     54      1.1  christos 
     55      1.1  christos /*******************************************************************************
     56      1.1  christos  *
     57  1.1.1.6  christos  * FUNCTION:    AcpiDmDumpAest
     58  1.1.1.6  christos  *
     59  1.1.1.6  christos  * PARAMETERS:  Table               - A AEST table
     60  1.1.1.6  christos  *
     61  1.1.1.6  christos  * RETURN:      None
     62  1.1.1.6  christos  *
     63  1.1.1.6  christos  * DESCRIPTION: Format the contents of a AEST table
     64  1.1.1.6  christos  *
     65  1.1.1.6  christos  * NOTE: Assumes the following table structure:
     66  1.1.1.6  christos  *      For all AEST Error Nodes:
     67  1.1.1.6  christos  *          1) An AEST Error Node, followed immediately by:
     68  1.1.1.6  christos  *          2) Any node-specific data
     69  1.1.1.6  christos  *          3) An Interface Structure (one)
     70  1.1.1.6  christos  *          4) A list (array) of Interrupt Structures
     71  1.1.1.6  christos  *
     72  1.1.1.6  christos  * AEST - ARM Error Source table. Conforms to:
     73  1.1.1.6  christos  * ACPI for the Armv8 RAS Extensions 1.1 Platform Design Document Sep 2020
     74  1.1.1.6  christos  *
     75  1.1.1.6  christos  ******************************************************************************/
     76  1.1.1.6  christos 
     77  1.1.1.6  christos void
     78  1.1.1.6  christos AcpiDmDumpAest (
     79  1.1.1.6  christos     ACPI_TABLE_HEADER       *Table)
     80  1.1.1.6  christos {
     81  1.1.1.6  christos     ACPI_STATUS             Status;
     82  1.1.1.6  christos     UINT32                  Offset = sizeof (ACPI_TABLE_HEADER);
     83  1.1.1.6  christos     ACPI_AEST_HEADER        *Subtable;
     84  1.1.1.6  christos     ACPI_AEST_HEADER        *NodeHeader;
     85  1.1.1.6  christos     ACPI_AEST_PROCESSOR     *ProcessorSubtable;
     86  1.1.1.6  christos     ACPI_DMTABLE_INFO       *InfoTable;
     87  1.1.1.6  christos     ACPI_SIZE               Length;
     88  1.1.1.6  christos     UINT8                   Type;
     89  1.1.1.6  christos 
     90  1.1.1.6  christos 
     91  1.1.1.6  christos     /* Very small, generic main table. AEST consists of mostly subtables */
     92  1.1.1.6  christos 
     93  1.1.1.6  christos     while (Offset < Table->Length)
     94  1.1.1.6  christos     {
     95  1.1.1.6  christos         NodeHeader = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset);
     96  1.1.1.6  christos 
     97  1.1.1.6  christos         /* Dump the common error node (subtable) header */
     98  1.1.1.6  christos 
     99  1.1.1.6  christos         Status = AcpiDmDumpTable (Table->Length, Offset, NodeHeader,
    100  1.1.1.6  christos             NodeHeader->Length, AcpiDmTableInfoAestHdr);
    101  1.1.1.6  christos         if (ACPI_FAILURE (Status))
    102  1.1.1.6  christos         {
    103  1.1.1.6  christos             return;
    104  1.1.1.6  christos         }
    105  1.1.1.6  christos 
    106  1.1.1.6  christos         Type = NodeHeader->Type;
    107  1.1.1.6  christos 
    108  1.1.1.6  christos         /* Setup the node-specific subtable based on the header Type field */
    109  1.1.1.6  christos 
    110  1.1.1.6  christos         switch (Type)
    111  1.1.1.6  christos         {
    112  1.1.1.6  christos         case ACPI_AEST_PROCESSOR_ERROR_NODE:
    113  1.1.1.6  christos             InfoTable = AcpiDmTableInfoAestProcError;
    114  1.1.1.6  christos             Length = sizeof (ACPI_AEST_PROCESSOR);
    115  1.1.1.6  christos             break;
    116  1.1.1.6  christos 
    117  1.1.1.6  christos         case ACPI_AEST_MEMORY_ERROR_NODE:
    118  1.1.1.6  christos             InfoTable = AcpiDmTableInfoAestMemError;
    119  1.1.1.6  christos             Length = sizeof (ACPI_AEST_MEMORY);
    120  1.1.1.6  christos             break;
    121  1.1.1.6  christos 
    122  1.1.1.6  christos         case ACPI_AEST_SMMU_ERROR_NODE:
    123  1.1.1.6  christos             InfoTable = AcpiDmTableInfoAestSmmuError;
    124  1.1.1.6  christos             Length = sizeof (ACPI_AEST_SMMU);
    125  1.1.1.6  christos             break;
    126  1.1.1.6  christos 
    127  1.1.1.6  christos         case ACPI_AEST_VENDOR_ERROR_NODE:
    128  1.1.1.6  christos             InfoTable = AcpiDmTableInfoAestVendorError;
    129  1.1.1.6  christos             Length = sizeof (ACPI_AEST_VENDOR);
    130  1.1.1.6  christos             break;
    131  1.1.1.6  christos 
    132  1.1.1.6  christos         case ACPI_AEST_GIC_ERROR_NODE:
    133  1.1.1.6  christos             InfoTable = AcpiDmTableInfoAestGicError;
    134  1.1.1.6  christos             Length = sizeof (ACPI_AEST_GIC);
    135  1.1.1.6  christos             break;
    136  1.1.1.6  christos 
    137  1.1.1.6  christos         /* Error case below */
    138  1.1.1.6  christos         default:
    139  1.1.1.6  christos 
    140  1.1.1.6  christos             AcpiOsPrintf ("\n**** Unknown AEST Error Subtable type 0x%X\n",
    141  1.1.1.6  christos                 Type);
    142  1.1.1.6  christos             return;
    143  1.1.1.6  christos         }
    144  1.1.1.6  christos 
    145  1.1.1.6  christos         /* Point past the common header (to the node-specific data) */
    146  1.1.1.6  christos 
    147  1.1.1.6  christos         Offset += sizeof (ACPI_AEST_HEADER);
    148  1.1.1.6  christos         Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset);
    149  1.1.1.6  christos         AcpiOsPrintf ("\n");
    150  1.1.1.6  christos 
    151  1.1.1.6  christos         /* Dump the node-specific subtable */
    152  1.1.1.6  christos 
    153  1.1.1.6  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, Length,
    154  1.1.1.6  christos             InfoTable);
    155  1.1.1.6  christos         if (ACPI_FAILURE (Status))
    156  1.1.1.6  christos         {
    157  1.1.1.6  christos             return;
    158  1.1.1.6  christos         }
    159  1.1.1.6  christos         AcpiOsPrintf ("\n");
    160  1.1.1.6  christos 
    161  1.1.1.6  christos         if (Type == ACPI_AEST_PROCESSOR_ERROR_NODE)
    162  1.1.1.6  christos         {
    163  1.1.1.6  christos             /*
    164  1.1.1.6  christos              * Special handling for PROCESSOR_ERROR_NODE subtables
    165  1.1.1.6  christos              * (to handle the Resource Substructure via the ResourceType
    166  1.1.1.6  christos              * field).
    167  1.1.1.6  christos              */
    168  1.1.1.6  christos 
    169  1.1.1.6  christos             /* Point past the node-specific data */
    170  1.1.1.6  christos 
    171  1.1.1.6  christos             Offset += Length;
    172  1.1.1.6  christos             ProcessorSubtable = ACPI_CAST_PTR (ACPI_AEST_PROCESSOR, Subtable);
    173  1.1.1.6  christos 
    174  1.1.1.6  christos             switch (ProcessorSubtable->ResourceType)
    175  1.1.1.6  christos             {
    176  1.1.1.6  christos             /* Setup the Resource Substructure subtable */
    177  1.1.1.6  christos 
    178  1.1.1.6  christos             case ACPI_AEST_CACHE_RESOURCE:
    179  1.1.1.6  christos                 InfoTable = AcpiDmTableInfoAestCacheRsrc;
    180  1.1.1.6  christos                 Length = sizeof (ACPI_AEST_PROCESSOR_CACHE);
    181  1.1.1.6  christos                 break;
    182  1.1.1.6  christos 
    183  1.1.1.6  christos             case ACPI_AEST_TLB_RESOURCE:
    184  1.1.1.6  christos                 InfoTable = AcpiDmTableInfoAestTlbRsrc;
    185  1.1.1.6  christos                 Length = sizeof (ACPI_AEST_PROCESSOR_TLB);
    186  1.1.1.6  christos                 break;
    187  1.1.1.6  christos 
    188  1.1.1.6  christos             case ACPI_AEST_GENERIC_RESOURCE:
    189  1.1.1.6  christos                 InfoTable = AcpiDmTableInfoAestGenRsrc;
    190  1.1.1.6  christos                 Length = sizeof (ACPI_AEST_PROCESSOR_GENERIC);
    191  1.1.1.6  christos                 AcpiOsPrintf ("Generic Resource Type (%X) is not supported at this time\n",
    192  1.1.1.6  christos                     ProcessorSubtable->ResourceType);
    193  1.1.1.6  christos                 break;
    194  1.1.1.6  christos 
    195  1.1.1.6  christos             /* Error case below */
    196  1.1.1.6  christos             default:
    197  1.1.1.6  christos                 AcpiOsPrintf ("\n**** Unknown AEST Processor Resource type 0x%X\n",
    198  1.1.1.6  christos                     ProcessorSubtable->ResourceType);
    199  1.1.1.6  christos                 return;
    200  1.1.1.6  christos             }
    201  1.1.1.6  christos 
    202  1.1.1.6  christos             ProcessorSubtable = ACPI_ADD_PTR (ACPI_AEST_PROCESSOR, Table,
    203  1.1.1.6  christos                 Offset);
    204  1.1.1.6  christos 
    205  1.1.1.6  christos             /* Dump the resource substructure subtable */
    206  1.1.1.6  christos 
    207  1.1.1.6  christos             Status = AcpiDmDumpTable (Table->Length, Offset, ProcessorSubtable,
    208  1.1.1.6  christos                 Length, InfoTable);
    209  1.1.1.6  christos             if (ACPI_FAILURE (Status))
    210  1.1.1.6  christos             {
    211  1.1.1.6  christos                 return;
    212  1.1.1.6  christos             }
    213  1.1.1.6  christos 
    214  1.1.1.6  christos             AcpiOsPrintf ("\n");
    215  1.1.1.6  christos         }
    216  1.1.1.6  christos 
    217  1.1.1.6  christos         /* Point past the resource substructure or the node-specific data */
    218  1.1.1.6  christos 
    219  1.1.1.6  christos         Offset += Length;
    220  1.1.1.6  christos 
    221  1.1.1.6  christos         /* Dump the interface structure, required to be present */
    222  1.1.1.6  christos 
    223  1.1.1.6  christos         Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset);
    224  1.1.1.6  christos         if (Subtable->Type >= ACPI_AEST_XFACE_RESERVED)
    225  1.1.1.6  christos         {
    226  1.1.1.6  christos             AcpiOsPrintf ("\n**** Unknown AEST Node Interface type 0x%X\n",
    227  1.1.1.6  christos                 Subtable->Type);
    228  1.1.1.6  christos             return;
    229  1.1.1.6  christos         }
    230  1.1.1.6  christos 
    231  1.1.1.6  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    232  1.1.1.6  christos             sizeof (ACPI_AEST_NODE_INTERFACE), AcpiDmTableInfoAestXface);
    233  1.1.1.6  christos         if (ACPI_FAILURE (Status))
    234  1.1.1.6  christos         {
    235  1.1.1.6  christos             return;
    236  1.1.1.6  christos         }
    237  1.1.1.6  christos 
    238  1.1.1.6  christos         /* Point past the interface structure */
    239  1.1.1.6  christos 
    240  1.1.1.6  christos         AcpiOsPrintf ("\n");
    241  1.1.1.6  christos         Offset += sizeof (ACPI_AEST_NODE_INTERFACE);
    242  1.1.1.6  christos 
    243  1.1.1.6  christos         /* Dump the entire interrupt structure array, if present */
    244  1.1.1.6  christos 
    245  1.1.1.6  christos         if (NodeHeader->NodeInterruptOffset)
    246  1.1.1.6  christos         {
    247  1.1.1.6  christos             Length = NodeHeader->NodeInterruptCount;
    248  1.1.1.6  christos             Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset);
    249  1.1.1.6  christos 
    250  1.1.1.6  christos             while (Length)
    251  1.1.1.6  christos             {
    252  1.1.1.6  christos                 /* Dump the interrupt structure */
    253  1.1.1.6  christos 
    254  1.1.1.6  christos                 Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    255  1.1.1.6  christos                     sizeof (ACPI_AEST_NODE_INTERRUPT),
    256  1.1.1.6  christos                     AcpiDmTableInfoAestXrupt);
    257  1.1.1.6  christos                 if (ACPI_FAILURE (Status))
    258  1.1.1.6  christos                 {
    259  1.1.1.6  christos                     return;
    260  1.1.1.6  christos                 }
    261  1.1.1.6  christos 
    262  1.1.1.6  christos                 /* Point to the next interrupt structure */
    263  1.1.1.6  christos 
    264  1.1.1.6  christos                 Offset += sizeof (ACPI_AEST_NODE_INTERRUPT);
    265  1.1.1.6  christos                 Subtable = ACPI_ADD_PTR (ACPI_AEST_HEADER, Table, Offset);
    266  1.1.1.6  christos                 Length--;
    267  1.1.1.6  christos                 AcpiOsPrintf ("\n");
    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.6  christos 
    273  1.1.1.6  christos 
    274  1.1.1.6  christos /*******************************************************************************
    275  1.1.1.6  christos  *
    276      1.1  christos  * FUNCTION:    AcpiDmDumpAsf
    277      1.1  christos  *
    278      1.1  christos  * PARAMETERS:  Table               - A ASF table
    279      1.1  christos  *
    280      1.1  christos  * RETURN:      None
    281      1.1  christos  *
    282      1.1  christos  * DESCRIPTION: Format the contents of a ASF table
    283      1.1  christos  *
    284      1.1  christos  ******************************************************************************/
    285      1.1  christos 
    286      1.1  christos void
    287      1.1  christos AcpiDmDumpAsf (
    288      1.1  christos     ACPI_TABLE_HEADER       *Table)
    289      1.1  christos {
    290      1.1  christos     ACPI_STATUS             Status;
    291      1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_HEADER);
    292      1.1  christos     ACPI_ASF_INFO           *Subtable;
    293      1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
    294      1.1  christos     ACPI_DMTABLE_INFO       *DataInfoTable = NULL;
    295      1.1  christos     UINT8                   *DataTable = NULL;
    296      1.1  christos     UINT32                  DataCount = 0;
    297      1.1  christos     UINT32                  DataLength = 0;
    298      1.1  christos     UINT32                  DataOffset = 0;
    299      1.1  christos     UINT32                  i;
    300      1.1  christos     UINT8                   Type;
    301      1.1  christos 
    302      1.1  christos 
    303      1.1  christos     /* No main table, only subtables */
    304      1.1  christos 
    305      1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Table, Offset);
    306      1.1  christos     while (Offset < Table->Length)
    307      1.1  christos     {
    308      1.1  christos         /* Common subtable header */
    309      1.1  christos 
    310      1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    311      1.1  christos             Subtable->Header.Length, AcpiDmTableInfoAsfHdr);
    312      1.1  christos         if (ACPI_FAILURE (Status))
    313      1.1  christos         {
    314      1.1  christos             return;
    315      1.1  christos         }
    316      1.1  christos 
    317      1.1  christos         /* The actual type is the lower 7 bits of Type */
    318      1.1  christos 
    319      1.1  christos         Type = (UINT8) (Subtable->Header.Type & 0x7F);
    320      1.1  christos 
    321      1.1  christos         switch (Type)
    322      1.1  christos         {
    323      1.1  christos         case ACPI_ASF_TYPE_INFO:
    324      1.1  christos 
    325      1.1  christos             InfoTable = AcpiDmTableInfoAsf0;
    326      1.1  christos             break;
    327      1.1  christos 
    328      1.1  christos         case ACPI_ASF_TYPE_ALERT:
    329      1.1  christos 
    330      1.1  christos             InfoTable = AcpiDmTableInfoAsf1;
    331      1.1  christos             DataInfoTable = AcpiDmTableInfoAsf1a;
    332      1.1  christos             DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ALERT));
    333      1.1  christos             DataCount = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->Alerts;
    334      1.1  christos             DataLength = ACPI_CAST_PTR (ACPI_ASF_ALERT, Subtable)->DataLength;
    335      1.1  christos             DataOffset = Offset + sizeof (ACPI_ASF_ALERT);
    336      1.1  christos             break;
    337      1.1  christos 
    338      1.1  christos         case ACPI_ASF_TYPE_CONTROL:
    339      1.1  christos 
    340      1.1  christos             InfoTable = AcpiDmTableInfoAsf2;
    341      1.1  christos             DataInfoTable = AcpiDmTableInfoAsf2a;
    342      1.1  christos             DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_REMOTE));
    343      1.1  christos             DataCount = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->Controls;
    344      1.1  christos             DataLength = ACPI_CAST_PTR (ACPI_ASF_REMOTE, Subtable)->DataLength;
    345      1.1  christos             DataOffset = Offset + sizeof (ACPI_ASF_REMOTE);
    346      1.1  christos             break;
    347      1.1  christos 
    348      1.1  christos         case ACPI_ASF_TYPE_BOOT:
    349      1.1  christos 
    350      1.1  christos             InfoTable = AcpiDmTableInfoAsf3;
    351      1.1  christos             break;
    352      1.1  christos 
    353      1.1  christos         case ACPI_ASF_TYPE_ADDRESS:
    354      1.1  christos 
    355      1.1  christos             InfoTable = AcpiDmTableInfoAsf4;
    356      1.1  christos             DataTable = ACPI_ADD_PTR (UINT8, Subtable, sizeof (ACPI_ASF_ADDRESS));
    357      1.1  christos             DataLength = ACPI_CAST_PTR (ACPI_ASF_ADDRESS, Subtable)->Devices;
    358      1.1  christos             DataOffset = Offset + sizeof (ACPI_ASF_ADDRESS);
    359      1.1  christos             break;
    360      1.1  christos 
    361      1.1  christos         default:
    362      1.1  christos 
    363      1.1  christos             AcpiOsPrintf ("\n**** Unknown ASF subtable type 0x%X\n",
    364      1.1  christos                 Subtable->Header.Type);
    365      1.1  christos             return;
    366      1.1  christos         }
    367      1.1  christos 
    368      1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, Subtable,
    369      1.1  christos             Subtable->Header.Length, InfoTable);
    370      1.1  christos         if (ACPI_FAILURE (Status))
    371      1.1  christos         {
    372      1.1  christos             return;
    373      1.1  christos         }
    374      1.1  christos 
    375      1.1  christos         /* Dump variable-length extra data */
    376      1.1  christos 
    377      1.1  christos         switch (Type)
    378      1.1  christos         {
    379      1.1  christos         case ACPI_ASF_TYPE_ALERT:
    380      1.1  christos         case ACPI_ASF_TYPE_CONTROL:
    381      1.1  christos 
    382      1.1  christos             for (i = 0; i < DataCount; i++)
    383      1.1  christos             {
    384      1.1  christos                 AcpiOsPrintf ("\n");
    385      1.1  christos                 Status = AcpiDmDumpTable (Table->Length, DataOffset,
    386      1.1  christos                     DataTable, DataLength, DataInfoTable);
    387      1.1  christos                 if (ACPI_FAILURE (Status))
    388      1.1  christos                 {
    389      1.1  christos                     return;
    390      1.1  christos                 }
    391      1.1  christos 
    392      1.1  christos                 DataTable = ACPI_ADD_PTR (UINT8, DataTable, DataLength);
    393      1.1  christos                 DataOffset += DataLength;
    394      1.1  christos             }
    395      1.1  christos             break;
    396      1.1  christos 
    397      1.1  christos         case ACPI_ASF_TYPE_ADDRESS:
    398      1.1  christos 
    399      1.1  christos             for (i = 0; i < DataLength; i++)
    400      1.1  christos             {
    401      1.1  christos                 if (!(i % 16))
    402      1.1  christos                 {
    403      1.1  christos                     AcpiDmLineHeader (DataOffset, 1, "Addresses");
    404      1.1  christos                 }
    405      1.1  christos 
    406      1.1  christos                 AcpiOsPrintf ("%2.2X ", *DataTable);
    407      1.1  christos                 DataTable++;
    408      1.1  christos                 DataOffset++;
    409      1.1  christos 
    410      1.1  christos                 if (DataOffset > Table->Length)
    411      1.1  christos                 {
    412      1.1  christos                     AcpiOsPrintf (
    413      1.1  christos                         "**** ACPI table terminates in the middle of a "
    414      1.1  christos                         "data structure! (ASF! table)\n");
    415      1.1  christos                     return;
    416      1.1  christos                 }
    417      1.1  christos             }
    418      1.1  christos 
    419      1.1  christos             AcpiOsPrintf ("\n");
    420      1.1  christos             break;
    421      1.1  christos 
    422      1.1  christos         default:
    423      1.1  christos 
    424      1.1  christos             break;
    425      1.1  christos         }
    426      1.1  christos 
    427      1.1  christos         AcpiOsPrintf ("\n");
    428      1.1  christos 
    429      1.1  christos         /* Point to next subtable */
    430      1.1  christos 
    431      1.1  christos         if (!Subtable->Header.Length)
    432      1.1  christos         {
    433      1.1  christos             AcpiOsPrintf ("Invalid zero subtable header length\n");
    434      1.1  christos             return;
    435      1.1  christos         }
    436      1.1  christos 
    437      1.1  christos         Offset += Subtable->Header.Length;
    438      1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_ASF_INFO, Subtable,
    439      1.1  christos             Subtable->Header.Length);
    440      1.1  christos     }
    441      1.1  christos }
    442      1.1  christos 
    443  1.1.1.5  christos /*******************************************************************************
    444  1.1.1.5  christos  *
    445  1.1.1.5  christos  * FUNCTION:    AcpiDmDumpCedt
    446  1.1.1.5  christos  *
    447  1.1.1.5  christos  * PARAMETERS:  Table               - A CEDT table
    448  1.1.1.5  christos  *
    449  1.1.1.5  christos  * RETURN:      None
    450  1.1.1.5  christos  *
    451  1.1.1.5  christos  * DESCRIPTION: Format the contents of a CEDT. This table type consists
    452  1.1.1.5  christos  *              of an open-ended number of subtables.
    453  1.1.1.5  christos  *
    454  1.1.1.5  christos  ******************************************************************************/
    455  1.1.1.5  christos 
    456  1.1.1.5  christos void
    457  1.1.1.5  christos AcpiDmDumpCedt (
    458  1.1.1.5  christos     ACPI_TABLE_HEADER       *Table)
    459  1.1.1.5  christos {
    460  1.1.1.5  christos     ACPI_STATUS             Status;
    461  1.1.1.5  christos     ACPI_CEDT_HEADER        *Subtable;
    462  1.1.1.5  christos     UINT32                  Length = Table->Length;
    463  1.1.1.5  christos     UINT32                  Offset = sizeof (ACPI_TABLE_CEDT);
    464  1.1.1.5  christos     ACPI_DMTABLE_INFO       *InfoTable;
    465  1.1.1.5  christos 
    466  1.1.1.5  christos 
    467  1.1.1.5  christos     /* There is no main table (other than the standard ACPI header) */
    468  1.1.1.5  christos 
    469  1.1.1.5  christos     Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Table, Offset);
    470  1.1.1.5  christos     while (Offset < Table->Length)
    471  1.1.1.5  christos     {
    472  1.1.1.5  christos         /* Common subtable header */
    473  1.1.1.5  christos 
    474  1.1.1.5  christos         AcpiOsPrintf ("\n");
    475  1.1.1.5  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
    476  1.1.1.5  christos             Subtable->Length, AcpiDmTableInfoCedtHdr);
    477  1.1.1.5  christos         if (ACPI_FAILURE (Status))
    478  1.1.1.5  christos         {
    479  1.1.1.5  christos             return;
    480  1.1.1.5  christos         }
    481  1.1.1.5  christos 
    482  1.1.1.5  christos         switch (Subtable->Type)
    483  1.1.1.5  christos         {
    484  1.1.1.5  christos         case ACPI_CEDT_TYPE_CHBS:
    485  1.1.1.5  christos 
    486  1.1.1.5  christos             InfoTable = AcpiDmTableInfoCedt0;
    487  1.1.1.5  christos             break;
    488  1.1.1.5  christos 
    489  1.1.1.5  christos         default:
    490  1.1.1.5  christos 
    491  1.1.1.5  christos             AcpiOsPrintf ("\n**** Unknown CEDT subtable type 0x%X\n\n",
    492  1.1.1.5  christos                 Subtable->Type);
    493  1.1.1.5  christos 
    494  1.1.1.5  christos             /* Attempt to continue */
    495  1.1.1.5  christos 
    496  1.1.1.5  christos             if (!Subtable->Length)
    497  1.1.1.5  christos             {
    498  1.1.1.5  christos                 AcpiOsPrintf ("Invalid zero length subtable\n");
    499  1.1.1.5  christos                 return;
    500  1.1.1.5  christos             }
    501  1.1.1.5  christos             goto NextSubtable;
    502  1.1.1.5  christos         }
    503  1.1.1.5  christos 
    504  1.1.1.5  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
    505  1.1.1.5  christos             Subtable->Length, InfoTable);
    506  1.1.1.5  christos         if (ACPI_FAILURE (Status))
    507  1.1.1.5  christos         {
    508  1.1.1.5  christos             return;
    509  1.1.1.5  christos         }
    510  1.1.1.5  christos 
    511  1.1.1.5  christos NextSubtable:
    512  1.1.1.5  christos         /* Point to next subtable */
    513  1.1.1.5  christos 
    514  1.1.1.5  christos         Offset += Subtable->Length;
    515  1.1.1.5  christos         Subtable = ACPI_ADD_PTR (ACPI_CEDT_HEADER, Subtable,
    516  1.1.1.5  christos             Subtable->Length);
    517  1.1.1.5  christos     }
    518  1.1.1.5  christos }
    519      1.1  christos 
    520      1.1  christos /*******************************************************************************
    521      1.1  christos  *
    522      1.1  christos  * FUNCTION:    AcpiDmDumpCpep
    523      1.1  christos  *
    524      1.1  christos  * PARAMETERS:  Table               - A CPEP table
    525      1.1  christos  *
    526      1.1  christos  * RETURN:      None
    527      1.1  christos  *
    528      1.1  christos  * DESCRIPTION: Format the contents of a CPEP. This table type consists
    529      1.1  christos  *              of an open-ended number of subtables.
    530      1.1  christos  *
    531      1.1  christos  ******************************************************************************/
    532      1.1  christos 
    533      1.1  christos void
    534      1.1  christos AcpiDmDumpCpep (
    535      1.1  christos     ACPI_TABLE_HEADER       *Table)
    536      1.1  christos {
    537      1.1  christos     ACPI_STATUS             Status;
    538      1.1  christos     ACPI_CPEP_POLLING       *Subtable;
    539      1.1  christos     UINT32                  Length = Table->Length;
    540      1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_CPEP);
    541      1.1  christos 
    542      1.1  christos 
    543      1.1  christos     /* Main table */
    544      1.1  christos 
    545      1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoCpep);
    546      1.1  christos     if (ACPI_FAILURE (Status))
    547      1.1  christos     {
    548      1.1  christos         return;
    549      1.1  christos     }
    550      1.1  christos 
    551      1.1  christos     /* Subtables */
    552      1.1  christos 
    553      1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Table, Offset);
    554      1.1  christos     while (Offset < Table->Length)
    555      1.1  christos     {
    556      1.1  christos         AcpiOsPrintf ("\n");
    557      1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
    558      1.1  christos             Subtable->Header.Length, AcpiDmTableInfoCpep0);
    559      1.1  christos         if (ACPI_FAILURE (Status))
    560      1.1  christos         {
    561      1.1  christos             return;
    562      1.1  christos         }
    563      1.1  christos 
    564      1.1  christos         /* Point to next subtable */
    565      1.1  christos 
    566      1.1  christos         Offset += Subtable->Header.Length;
    567      1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_CPEP_POLLING, Subtable,
    568      1.1  christos             Subtable->Header.Length);
    569      1.1  christos     }
    570      1.1  christos }
    571      1.1  christos 
    572      1.1  christos 
    573      1.1  christos /*******************************************************************************
    574      1.1  christos  *
    575      1.1  christos  * FUNCTION:    AcpiDmDumpCsrt
    576      1.1  christos  *
    577      1.1  christos  * PARAMETERS:  Table               - A CSRT table
    578      1.1  christos  *
    579      1.1  christos  * RETURN:      None
    580      1.1  christos  *
    581      1.1  christos  * DESCRIPTION: Format the contents of a CSRT. This table type consists
    582      1.1  christos  *              of an open-ended number of subtables.
    583      1.1  christos  *
    584      1.1  christos  ******************************************************************************/
    585      1.1  christos 
    586      1.1  christos void
    587      1.1  christos AcpiDmDumpCsrt (
    588      1.1  christos     ACPI_TABLE_HEADER       *Table)
    589      1.1  christos {
    590      1.1  christos     ACPI_STATUS             Status;
    591      1.1  christos     ACPI_CSRT_GROUP         *Subtable;
    592      1.1  christos     ACPI_CSRT_SHARED_INFO   *SharedInfoTable;
    593      1.1  christos     ACPI_CSRT_DESCRIPTOR    *SubSubtable;
    594      1.1  christos     UINT32                  Length = Table->Length;
    595      1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_CSRT);
    596      1.1  christos     UINT32                  SubOffset;
    597      1.1  christos     UINT32                  SubSubOffset;
    598      1.1  christos     UINT32                  InfoLength;
    599      1.1  christos 
    600      1.1  christos 
    601      1.1  christos     /* The main table only contains the ACPI header, thus already handled */
    602      1.1  christos 
    603      1.1  christos     /* Subtables (Resource Groups) */
    604      1.1  christos 
    605      1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Table, Offset);
    606      1.1  christos     while (Offset < Table->Length)
    607      1.1  christos     {
    608      1.1  christos         /* Resource group subtable */
    609      1.1  christos 
    610      1.1  christos         AcpiOsPrintf ("\n");
    611      1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
    612      1.1  christos             Subtable->Length, AcpiDmTableInfoCsrt0);
    613      1.1  christos         if (ACPI_FAILURE (Status))
    614      1.1  christos         {
    615      1.1  christos             return;
    616      1.1  christos         }
    617      1.1  christos 
    618      1.1  christos         /* Shared info subtable (One per resource group) */
    619      1.1  christos 
    620      1.1  christos         SubOffset = sizeof (ACPI_CSRT_GROUP);
    621      1.1  christos         SharedInfoTable = ACPI_ADD_PTR (ACPI_CSRT_SHARED_INFO, Table,
    622      1.1  christos             Offset + SubOffset);
    623      1.1  christos 
    624      1.1  christos         AcpiOsPrintf ("\n");
    625      1.1  christos         Status = AcpiDmDumpTable (Length, Offset + SubOffset, SharedInfoTable,
    626      1.1  christos             sizeof (ACPI_CSRT_SHARED_INFO), AcpiDmTableInfoCsrt1);
    627      1.1  christos         if (ACPI_FAILURE (Status))
    628      1.1  christos         {
    629      1.1  christos             return;
    630      1.1  christos         }
    631      1.1  christos 
    632      1.1  christos         SubOffset += Subtable->SharedInfoLength;
    633      1.1  christos 
    634      1.1  christos         /* Sub-Subtables (Resource Descriptors) */
    635      1.1  christos 
    636      1.1  christos         SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, Table,
    637      1.1  christos             Offset + SubOffset);
    638      1.1  christos 
    639      1.1  christos         while ((SubOffset < Subtable->Length) &&
    640      1.1  christos               ((Offset + SubOffset) < Table->Length))
    641      1.1  christos         {
    642      1.1  christos             AcpiOsPrintf ("\n");
    643      1.1  christos             Status = AcpiDmDumpTable (Length, Offset + SubOffset, SubSubtable,
    644      1.1  christos                 SubSubtable->Length, AcpiDmTableInfoCsrt2);
    645      1.1  christos             if (ACPI_FAILURE (Status))
    646      1.1  christos             {
    647      1.1  christos                 return;
    648      1.1  christos             }
    649      1.1  christos 
    650      1.1  christos             SubSubOffset = sizeof (ACPI_CSRT_DESCRIPTOR);
    651      1.1  christos 
    652      1.1  christos             /* Resource-specific info buffer */
    653      1.1  christos 
    654      1.1  christos             InfoLength = SubSubtable->Length - SubSubOffset;
    655      1.1  christos             if (InfoLength)
    656      1.1  christos             {
    657      1.1  christos                 Status = AcpiDmDumpTable (Length,
    658      1.1  christos                     Offset + SubOffset + SubSubOffset, Table,
    659      1.1  christos                     InfoLength, AcpiDmTableInfoCsrt2a);
    660      1.1  christos                 if (ACPI_FAILURE (Status))
    661      1.1  christos                 {
    662      1.1  christos                     return;
    663      1.1  christos                 }
    664      1.1  christos             }
    665      1.1  christos 
    666      1.1  christos             /* Point to next sub-subtable */
    667      1.1  christos 
    668      1.1  christos             SubOffset += SubSubtable->Length;
    669      1.1  christos             SubSubtable = ACPI_ADD_PTR (ACPI_CSRT_DESCRIPTOR, SubSubtable,
    670      1.1  christos                 SubSubtable->Length);
    671      1.1  christos         }
    672      1.1  christos 
    673      1.1  christos         /* Point to next subtable */
    674      1.1  christos 
    675      1.1  christos         Offset += Subtable->Length;
    676      1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_CSRT_GROUP, Subtable,
    677      1.1  christos             Subtable->Length);
    678      1.1  christos     }
    679      1.1  christos }
    680      1.1  christos 
    681      1.1  christos 
    682      1.1  christos /*******************************************************************************
    683      1.1  christos  *
    684      1.1  christos  * FUNCTION:    AcpiDmDumpDbg2
    685      1.1  christos  *
    686      1.1  christos  * PARAMETERS:  Table               - A DBG2 table
    687      1.1  christos  *
    688      1.1  christos  * RETURN:      None
    689      1.1  christos  *
    690      1.1  christos  * DESCRIPTION: Format the contents of a DBG2. This table type consists
    691      1.1  christos  *              of an open-ended number of subtables.
    692      1.1  christos  *
    693      1.1  christos  ******************************************************************************/
    694      1.1  christos 
    695      1.1  christos void
    696      1.1  christos AcpiDmDumpDbg2 (
    697      1.1  christos     ACPI_TABLE_HEADER       *Table)
    698      1.1  christos {
    699      1.1  christos     ACPI_STATUS             Status;
    700      1.1  christos     ACPI_DBG2_DEVICE        *Subtable;
    701      1.1  christos     UINT32                  Length = Table->Length;
    702      1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_DBG2);
    703      1.1  christos     UINT32                  i;
    704      1.1  christos     UINT32                  ArrayOffset;
    705      1.1  christos     UINT32                  AbsoluteOffset;
    706      1.1  christos     UINT8                   *Array;
    707      1.1  christos 
    708      1.1  christos 
    709      1.1  christos     /* Main table */
    710      1.1  christos 
    711      1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDbg2);
    712      1.1  christos     if (ACPI_FAILURE (Status))
    713      1.1  christos     {
    714      1.1  christos         return;
    715      1.1  christos     }
    716      1.1  christos 
    717      1.1  christos     /* Subtables */
    718      1.1  christos 
    719      1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Table, Offset);
    720      1.1  christos     while (Offset < Table->Length)
    721      1.1  christos     {
    722      1.1  christos         AcpiOsPrintf ("\n");
    723      1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
    724      1.1  christos             Subtable->Length, AcpiDmTableInfoDbg2Device);
    725      1.1  christos         if (ACPI_FAILURE (Status))
    726      1.1  christos         {
    727      1.1  christos             return;
    728      1.1  christos         }
    729      1.1  christos 
    730      1.1  christos         /* Dump the BaseAddress array */
    731      1.1  christos 
    732      1.1  christos         for (i = 0; i < Subtable->RegisterCount; i++)
    733      1.1  christos         {
    734      1.1  christos             ArrayOffset = Subtable->BaseAddressOffset +
    735      1.1  christos                 (sizeof (ACPI_GENERIC_ADDRESS) * i);
    736      1.1  christos             AbsoluteOffset = Offset + ArrayOffset;
    737      1.1  christos             Array = (UINT8 *) Subtable + ArrayOffset;
    738      1.1  christos 
    739      1.1  christos             Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
    740      1.1  christos                 Subtable->Length, AcpiDmTableInfoDbg2Addr);
    741      1.1  christos             if (ACPI_FAILURE (Status))
    742      1.1  christos             {
    743      1.1  christos                 return;
    744      1.1  christos             }
    745      1.1  christos         }
    746      1.1  christos 
    747      1.1  christos         /* Dump the AddressSize array */
    748      1.1  christos 
    749      1.1  christos         for (i = 0; i < Subtable->RegisterCount; i++)
    750      1.1  christos         {
    751      1.1  christos             ArrayOffset = Subtable->AddressSizeOffset +
    752      1.1  christos                 (sizeof (UINT32) * i);
    753      1.1  christos             AbsoluteOffset = Offset + ArrayOffset;
    754      1.1  christos             Array = (UINT8 *) Subtable + ArrayOffset;
    755      1.1  christos 
    756      1.1  christos             Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
    757      1.1  christos                 Subtable->Length, AcpiDmTableInfoDbg2Size);
    758      1.1  christos             if (ACPI_FAILURE (Status))
    759      1.1  christos             {
    760      1.1  christos                 return;
    761      1.1  christos             }
    762      1.1  christos         }
    763      1.1  christos 
    764      1.1  christos         /* Dump the Namestring (required) */
    765      1.1  christos 
    766      1.1  christos         AcpiOsPrintf ("\n");
    767      1.1  christos         ArrayOffset = Subtable->NamepathOffset;
    768      1.1  christos         AbsoluteOffset = Offset + ArrayOffset;
    769      1.1  christos         Array = (UINT8 *) Subtable + ArrayOffset;
    770      1.1  christos 
    771      1.1  christos         Status = AcpiDmDumpTable (Length, AbsoluteOffset, Array,
    772      1.1  christos             Subtable->Length, AcpiDmTableInfoDbg2Name);
    773      1.1  christos         if (ACPI_FAILURE (Status))
    774      1.1  christos         {
    775      1.1  christos             return;
    776      1.1  christos         }
    777      1.1  christos 
    778      1.1  christos         /* Dump the OemData (optional) */
    779      1.1  christos 
    780      1.1  christos         if (Subtable->OemDataOffset)
    781      1.1  christos         {
    782      1.1  christos             Status = AcpiDmDumpTable (Length, Offset + Subtable->OemDataOffset,
    783      1.1  christos                 Table, Subtable->OemDataLength,
    784      1.1  christos                 AcpiDmTableInfoDbg2OemData);
    785      1.1  christos             if (ACPI_FAILURE (Status))
    786      1.1  christos             {
    787      1.1  christos                 return;
    788      1.1  christos             }
    789      1.1  christos         }
    790      1.1  christos 
    791      1.1  christos         /* Point to next subtable */
    792      1.1  christos 
    793      1.1  christos         Offset += Subtable->Length;
    794      1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_DBG2_DEVICE, Subtable,
    795      1.1  christos             Subtable->Length);
    796      1.1  christos     }
    797      1.1  christos }
    798      1.1  christos 
    799      1.1  christos 
    800      1.1  christos /*******************************************************************************
    801      1.1  christos  *
    802      1.1  christos  * FUNCTION:    AcpiDmDumpDmar
    803      1.1  christos  *
    804      1.1  christos  * PARAMETERS:  Table               - A DMAR table
    805      1.1  christos  *
    806      1.1  christos  * RETURN:      None
    807      1.1  christos  *
    808      1.1  christos  * DESCRIPTION: Format the contents of a DMAR. This table type consists
    809      1.1  christos  *              of an open-ended number of subtables.
    810      1.1  christos  *
    811      1.1  christos  ******************************************************************************/
    812      1.1  christos 
    813      1.1  christos void
    814      1.1  christos AcpiDmDumpDmar (
    815      1.1  christos     ACPI_TABLE_HEADER       *Table)
    816      1.1  christos {
    817      1.1  christos     ACPI_STATUS             Status;
    818      1.1  christos     ACPI_DMAR_HEADER        *Subtable;
    819      1.1  christos     UINT32                  Length = Table->Length;
    820      1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_DMAR);
    821      1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
    822      1.1  christos     ACPI_DMAR_DEVICE_SCOPE  *ScopeTable;
    823      1.1  christos     UINT32                  ScopeOffset;
    824      1.1  christos     UINT8                   *PciPath;
    825      1.1  christos     UINT32                  PathOffset;
    826      1.1  christos 
    827      1.1  christos 
    828      1.1  christos     /* Main table */
    829      1.1  christos 
    830      1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoDmar);
    831      1.1  christos     if (ACPI_FAILURE (Status))
    832      1.1  christos     {
    833      1.1  christos         return;
    834      1.1  christos     }
    835      1.1  christos 
    836      1.1  christos     /* Subtables */
    837      1.1  christos 
    838      1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Table, Offset);
    839      1.1  christos     while (Offset < Table->Length)
    840      1.1  christos     {
    841      1.1  christos         /* Common subtable header */
    842      1.1  christos 
    843      1.1  christos         AcpiOsPrintf ("\n");
    844      1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
    845      1.1  christos             Subtable->Length, AcpiDmTableInfoDmarHdr);
    846      1.1  christos         if (ACPI_FAILURE (Status))
    847      1.1  christos         {
    848      1.1  christos             return;
    849      1.1  christos         }
    850      1.1  christos 
    851      1.1  christos         AcpiOsPrintf ("\n");
    852      1.1  christos 
    853      1.1  christos         switch (Subtable->Type)
    854      1.1  christos         {
    855      1.1  christos         case ACPI_DMAR_TYPE_HARDWARE_UNIT:
    856      1.1  christos 
    857      1.1  christos             InfoTable = AcpiDmTableInfoDmar0;
    858      1.1  christos             ScopeOffset = sizeof (ACPI_DMAR_HARDWARE_UNIT);
    859      1.1  christos             break;
    860      1.1  christos 
    861      1.1  christos         case ACPI_DMAR_TYPE_RESERVED_MEMORY:
    862      1.1  christos 
    863      1.1  christos             InfoTable = AcpiDmTableInfoDmar1;
    864      1.1  christos             ScopeOffset = sizeof (ACPI_DMAR_RESERVED_MEMORY);
    865      1.1  christos             break;
    866      1.1  christos 
    867      1.1  christos         case ACPI_DMAR_TYPE_ROOT_ATS:
    868      1.1  christos 
    869      1.1  christos             InfoTable = AcpiDmTableInfoDmar2;
    870      1.1  christos             ScopeOffset = sizeof (ACPI_DMAR_ATSR);
    871      1.1  christos             break;
    872      1.1  christos 
    873      1.1  christos         case ACPI_DMAR_TYPE_HARDWARE_AFFINITY:
    874      1.1  christos 
    875      1.1  christos             InfoTable = AcpiDmTableInfoDmar3;
    876      1.1  christos             ScopeOffset = sizeof (ACPI_DMAR_RHSA);
    877      1.1  christos             break;
    878      1.1  christos 
    879      1.1  christos         case ACPI_DMAR_TYPE_NAMESPACE:
    880      1.1  christos 
    881      1.1  christos             InfoTable = AcpiDmTableInfoDmar4;
    882      1.1  christos             ScopeOffset = sizeof (ACPI_DMAR_ANDD);
    883      1.1  christos             break;
    884      1.1  christos 
    885      1.1  christos         default:
    886      1.1  christos 
    887      1.1  christos             AcpiOsPrintf ("\n**** Unknown DMAR subtable type 0x%X\n\n",
    888      1.1  christos                 Subtable->Type);
    889      1.1  christos             return;
    890      1.1  christos         }
    891      1.1  christos 
    892      1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
    893      1.1  christos             Subtable->Length, InfoTable);
    894      1.1  christos         if (ACPI_FAILURE (Status))
    895      1.1  christos         {
    896      1.1  christos             return;
    897      1.1  christos         }
    898      1.1  christos 
    899      1.1  christos         /*
    900      1.1  christos          * Dump the optional device scope entries
    901      1.1  christos          */
    902      1.1  christos         if ((Subtable->Type == ACPI_DMAR_TYPE_HARDWARE_AFFINITY) ||
    903      1.1  christos             (Subtable->Type == ACPI_DMAR_TYPE_NAMESPACE))
    904      1.1  christos         {
    905      1.1  christos             /* These types do not support device scopes */
    906      1.1  christos 
    907      1.1  christos             goto NextSubtable;
    908      1.1  christos         }
    909      1.1  christos 
    910      1.1  christos         ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE, Subtable, ScopeOffset);
    911      1.1  christos         while (ScopeOffset < Subtable->Length)
    912      1.1  christos         {
    913      1.1  christos             AcpiOsPrintf ("\n");
    914      1.1  christos             Status = AcpiDmDumpTable (Length, Offset + ScopeOffset, ScopeTable,
    915      1.1  christos                 ScopeTable->Length, AcpiDmTableInfoDmarScope);
    916      1.1  christos             if (ACPI_FAILURE (Status))
    917      1.1  christos             {
    918      1.1  christos                 return;
    919      1.1  christos             }
    920      1.1  christos             AcpiOsPrintf ("\n");
    921      1.1  christos 
    922      1.1  christos             /* Dump the PCI Path entries for this device scope */
    923      1.1  christos 
    924      1.1  christos             PathOffset = sizeof (ACPI_DMAR_DEVICE_SCOPE); /* Path entries start at this offset */
    925      1.1  christos 
    926      1.1  christos             PciPath = ACPI_ADD_PTR (UINT8, ScopeTable,
    927      1.1  christos                 sizeof (ACPI_DMAR_DEVICE_SCOPE));
    928      1.1  christos 
    929      1.1  christos             while (PathOffset < ScopeTable->Length)
    930      1.1  christos             {
    931      1.1  christos                 AcpiDmLineHeader ((PathOffset + ScopeOffset + Offset), 2,
    932      1.1  christos                     "PCI Path");
    933      1.1  christos                 AcpiOsPrintf ("%2.2X,%2.2X\n", PciPath[0], PciPath[1]);
    934      1.1  christos 
    935      1.1  christos                 /* Point to next PCI Path entry */
    936      1.1  christos 
    937      1.1  christos                 PathOffset += 2;
    938      1.1  christos                 PciPath += 2;
    939      1.1  christos                 AcpiOsPrintf ("\n");
    940      1.1  christos             }
    941      1.1  christos 
    942      1.1  christos             /* Point to next device scope entry */
    943      1.1  christos 
    944      1.1  christos             ScopeOffset += ScopeTable->Length;
    945      1.1  christos             ScopeTable = ACPI_ADD_PTR (ACPI_DMAR_DEVICE_SCOPE,
    946      1.1  christos                 ScopeTable, ScopeTable->Length);
    947      1.1  christos         }
    948      1.1  christos 
    949      1.1  christos NextSubtable:
    950      1.1  christos         /* Point to next subtable */
    951      1.1  christos 
    952      1.1  christos         Offset += Subtable->Length;
    953      1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_DMAR_HEADER, Subtable,
    954      1.1  christos             Subtable->Length);
    955      1.1  christos     }
    956      1.1  christos }
    957      1.1  christos 
    958      1.1  christos 
    959      1.1  christos /*******************************************************************************
    960      1.1  christos  *
    961      1.1  christos  * FUNCTION:    AcpiDmDumpDrtm
    962      1.1  christos  *
    963      1.1  christos  * PARAMETERS:  Table               - A DRTM table
    964      1.1  christos  *
    965      1.1  christos  * RETURN:      None
    966      1.1  christos  *
    967      1.1  christos  * DESCRIPTION: Format the contents of a DRTM.
    968      1.1  christos  *
    969      1.1  christos  ******************************************************************************/
    970      1.1  christos 
    971      1.1  christos void
    972      1.1  christos AcpiDmDumpDrtm (
    973      1.1  christos     ACPI_TABLE_HEADER       *Table)
    974      1.1  christos {
    975      1.1  christos     ACPI_STATUS             Status;
    976      1.1  christos     UINT32                  Offset;
    977      1.1  christos     ACPI_DRTM_VTABLE_LIST   *DrtmVtl;
    978      1.1  christos     ACPI_DRTM_RESOURCE_LIST *DrtmRl;
    979      1.1  christos     ACPI_DRTM_DPS_ID        *DrtmDps;
    980      1.1  christos     UINT32                  Count;
    981      1.1  christos 
    982      1.1  christos 
    983      1.1  christos     /* Main table */
    984      1.1  christos 
    985      1.1  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0,
    986      1.1  christos         AcpiDmTableInfoDrtm);
    987      1.1  christos     if (ACPI_FAILURE (Status))
    988      1.1  christos     {
    989      1.1  christos         return;
    990      1.1  christos     }
    991      1.1  christos 
    992      1.1  christos     Offset = sizeof (ACPI_TABLE_DRTM);
    993      1.1  christos 
    994      1.1  christos     /* Sub-tables */
    995      1.1  christos 
    996      1.1  christos     /* Dump ValidatedTable length */
    997      1.1  christos 
    998      1.1  christos     DrtmVtl = ACPI_ADD_PTR (ACPI_DRTM_VTABLE_LIST, Table, Offset);
    999      1.1  christos     AcpiOsPrintf ("\n");
   1000      1.1  christos     Status = AcpiDmDumpTable (Table->Length, Offset,
   1001      1.1  christos         DrtmVtl, ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables),
   1002      1.1  christos         AcpiDmTableInfoDrtm0);
   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     Offset += ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST, ValidatedTables);
   1009      1.1  christos 
   1010      1.1  christos     /* Dump Validated table addresses */
   1011      1.1  christos 
   1012      1.1  christos     Count = 0;
   1013      1.1  christos     while ((Offset < Table->Length) &&
   1014      1.1  christos             (DrtmVtl->ValidatedTableCount > Count))
   1015      1.1  christos     {
   1016      1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset,
   1017      1.1  christos             ACPI_ADD_PTR (void, Table, Offset), sizeof (UINT64),
   1018      1.1  christos             AcpiDmTableInfoDrtm0a);
   1019      1.1  christos         if (ACPI_FAILURE (Status))
   1020      1.1  christos         {
   1021      1.1  christos             return;
   1022      1.1  christos         }
   1023      1.1  christos 
   1024      1.1  christos         Offset += sizeof (UINT64);
   1025      1.1  christos         Count++;
   1026      1.1  christos     }
   1027      1.1  christos 
   1028      1.1  christos     /* Dump ResourceList length */
   1029      1.1  christos 
   1030      1.1  christos     DrtmRl = ACPI_ADD_PTR (ACPI_DRTM_RESOURCE_LIST, Table, Offset);
   1031      1.1  christos     AcpiOsPrintf ("\n");
   1032      1.1  christos     Status = AcpiDmDumpTable (Table->Length, Offset,
   1033      1.1  christos         DrtmRl, ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources),
   1034      1.1  christos         AcpiDmTableInfoDrtm1);
   1035      1.1  christos     if (ACPI_FAILURE (Status))
   1036      1.1  christos     {
   1037      1.1  christos         return;
   1038      1.1  christos     }
   1039      1.1  christos 
   1040      1.1  christos     Offset += ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources);
   1041      1.1  christos 
   1042      1.1  christos     /* Dump the Resource List */
   1043      1.1  christos 
   1044      1.1  christos     Count = 0;
   1045      1.1  christos     while ((Offset < Table->Length) &&
   1046      1.1  christos            (DrtmRl->ResourceCount > Count))
   1047      1.1  christos     {
   1048      1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset,
   1049      1.1  christos             ACPI_ADD_PTR (void, Table, Offset),
   1050      1.1  christos             sizeof (ACPI_DRTM_RESOURCE), AcpiDmTableInfoDrtm1a);
   1051      1.1  christos         if (ACPI_FAILURE (Status))
   1052      1.1  christos         {
   1053      1.1  christos             return;
   1054      1.1  christos         }
   1055      1.1  christos 
   1056      1.1  christos         Offset += sizeof (ACPI_DRTM_RESOURCE);
   1057      1.1  christos         Count++;
   1058      1.1  christos     }
   1059      1.1  christos 
   1060      1.1  christos     /* Dump DPS */
   1061      1.1  christos 
   1062      1.1  christos     DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset);
   1063      1.1  christos     AcpiOsPrintf ("\n");
   1064      1.1  christos     (void) AcpiDmDumpTable (Table->Length, Offset,
   1065      1.1  christos         DrtmDps, sizeof (ACPI_DRTM_DPS_ID), AcpiDmTableInfoDrtm2);
   1066      1.1  christos }
   1067      1.1  christos 
   1068      1.1  christos 
   1069      1.1  christos /*******************************************************************************
   1070      1.1  christos  *
   1071      1.1  christos  * FUNCTION:    AcpiDmDumpEinj
   1072      1.1  christos  *
   1073      1.1  christos  * PARAMETERS:  Table               - A EINJ table
   1074      1.1  christos  *
   1075      1.1  christos  * RETURN:      None
   1076      1.1  christos  *
   1077      1.1  christos  * DESCRIPTION: Format the contents of a EINJ. This table type consists
   1078      1.1  christos  *              of an open-ended number of subtables.
   1079      1.1  christos  *
   1080      1.1  christos  ******************************************************************************/
   1081      1.1  christos 
   1082      1.1  christos void
   1083      1.1  christos AcpiDmDumpEinj (
   1084      1.1  christos     ACPI_TABLE_HEADER       *Table)
   1085      1.1  christos {
   1086      1.1  christos     ACPI_STATUS             Status;
   1087      1.1  christos     ACPI_WHEA_HEADER        *Subtable;
   1088      1.1  christos     UINT32                  Length = Table->Length;
   1089      1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_EINJ);
   1090      1.1  christos 
   1091      1.1  christos 
   1092      1.1  christos     /* Main table */
   1093      1.1  christos 
   1094      1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoEinj);
   1095      1.1  christos     if (ACPI_FAILURE (Status))
   1096      1.1  christos     {
   1097      1.1  christos         return;
   1098      1.1  christos     }
   1099      1.1  christos 
   1100      1.1  christos     /* Subtables */
   1101      1.1  christos 
   1102      1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
   1103      1.1  christos     while (Offset < Table->Length)
   1104      1.1  christos     {
   1105      1.1  christos         AcpiOsPrintf ("\n");
   1106      1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1107      1.1  christos             sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoEinj0);
   1108      1.1  christos         if (ACPI_FAILURE (Status))
   1109      1.1  christos         {
   1110      1.1  christos             return;
   1111      1.1  christos         }
   1112      1.1  christos 
   1113      1.1  christos         /* Point to next subtable (each subtable is of fixed length) */
   1114      1.1  christos 
   1115      1.1  christos         Offset += sizeof (ACPI_WHEA_HEADER);
   1116      1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable,
   1117      1.1  christos             sizeof (ACPI_WHEA_HEADER));
   1118      1.1  christos     }
   1119      1.1  christos }
   1120      1.1  christos 
   1121      1.1  christos 
   1122      1.1  christos /*******************************************************************************
   1123      1.1  christos  *
   1124      1.1  christos  * FUNCTION:    AcpiDmDumpErst
   1125      1.1  christos  *
   1126      1.1  christos  * PARAMETERS:  Table               - A ERST table
   1127      1.1  christos  *
   1128      1.1  christos  * RETURN:      None
   1129      1.1  christos  *
   1130      1.1  christos  * DESCRIPTION: Format the contents of a ERST. This table type consists
   1131      1.1  christos  *              of an open-ended number of subtables.
   1132      1.1  christos  *
   1133      1.1  christos  ******************************************************************************/
   1134      1.1  christos 
   1135      1.1  christos void
   1136      1.1  christos AcpiDmDumpErst (
   1137      1.1  christos     ACPI_TABLE_HEADER       *Table)
   1138      1.1  christos {
   1139      1.1  christos     ACPI_STATUS             Status;
   1140      1.1  christos     ACPI_WHEA_HEADER        *Subtable;
   1141      1.1  christos     UINT32                  Length = Table->Length;
   1142      1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_ERST);
   1143      1.1  christos 
   1144      1.1  christos 
   1145      1.1  christos     /* Main table */
   1146      1.1  christos 
   1147      1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoErst);
   1148      1.1  christos     if (ACPI_FAILURE (Status))
   1149      1.1  christos     {
   1150      1.1  christos         return;
   1151      1.1  christos     }
   1152      1.1  christos 
   1153      1.1  christos     /* Subtables */
   1154      1.1  christos 
   1155      1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Table, Offset);
   1156      1.1  christos     while (Offset < Table->Length)
   1157      1.1  christos     {
   1158      1.1  christos         AcpiOsPrintf ("\n");
   1159      1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1160      1.1  christos             sizeof (ACPI_WHEA_HEADER), AcpiDmTableInfoErst0);
   1161      1.1  christos         if (ACPI_FAILURE (Status))
   1162      1.1  christos         {
   1163      1.1  christos             return;
   1164      1.1  christos         }
   1165      1.1  christos 
   1166      1.1  christos         /* Point to next subtable (each subtable is of fixed length) */
   1167      1.1  christos 
   1168      1.1  christos         Offset += sizeof (ACPI_WHEA_HEADER);
   1169      1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_WHEA_HEADER, Subtable,
   1170      1.1  christos             sizeof (ACPI_WHEA_HEADER));
   1171      1.1  christos     }
   1172      1.1  christos }
   1173      1.1  christos 
   1174      1.1  christos 
   1175      1.1  christos /*******************************************************************************
   1176      1.1  christos  *
   1177      1.1  christos  * FUNCTION:    AcpiDmDumpFpdt
   1178      1.1  christos  *
   1179      1.1  christos  * PARAMETERS:  Table               - A FPDT table
   1180      1.1  christos  *
   1181      1.1  christos  * RETURN:      None
   1182      1.1  christos  *
   1183      1.1  christos  * DESCRIPTION: Format the contents of a FPDT. This table type consists
   1184      1.1  christos  *              of an open-ended number of subtables.
   1185      1.1  christos  *
   1186      1.1  christos  ******************************************************************************/
   1187      1.1  christos 
   1188      1.1  christos void
   1189      1.1  christos AcpiDmDumpFpdt (
   1190      1.1  christos     ACPI_TABLE_HEADER       *Table)
   1191      1.1  christos {
   1192      1.1  christos     ACPI_STATUS             Status;
   1193      1.1  christos     ACPI_FPDT_HEADER        *Subtable;
   1194      1.1  christos     UINT32                  Length = Table->Length;
   1195      1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_FPDT);
   1196      1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
   1197      1.1  christos 
   1198      1.1  christos 
   1199      1.1  christos     /* There is no main table (other than the standard ACPI header) */
   1200      1.1  christos 
   1201      1.1  christos     /* Subtables */
   1202      1.1  christos 
   1203      1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Table, Offset);
   1204      1.1  christos     while (Offset < Table->Length)
   1205      1.1  christos     {
   1206      1.1  christos         /* Common subtable header */
   1207      1.1  christos 
   1208      1.1  christos         AcpiOsPrintf ("\n");
   1209      1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1210      1.1  christos             Subtable->Length, AcpiDmTableInfoFpdtHdr);
   1211      1.1  christos         if (ACPI_FAILURE (Status))
   1212      1.1  christos         {
   1213      1.1  christos             return;
   1214      1.1  christos         }
   1215      1.1  christos 
   1216      1.1  christos         switch (Subtable->Type)
   1217      1.1  christos         {
   1218      1.1  christos         case ACPI_FPDT_TYPE_BOOT:
   1219      1.1  christos 
   1220      1.1  christos             InfoTable = AcpiDmTableInfoFpdt0;
   1221      1.1  christos             break;
   1222      1.1  christos 
   1223      1.1  christos         case ACPI_FPDT_TYPE_S3PERF:
   1224      1.1  christos 
   1225      1.1  christos             InfoTable = AcpiDmTableInfoFpdt1;
   1226      1.1  christos             break;
   1227      1.1  christos 
   1228      1.1  christos         default:
   1229      1.1  christos 
   1230      1.1  christos             AcpiOsPrintf ("\n**** Unknown FPDT subtable type 0x%X\n\n",
   1231      1.1  christos                 Subtable->Type);
   1232      1.1  christos 
   1233      1.1  christos             /* Attempt to continue */
   1234      1.1  christos 
   1235      1.1  christos             if (!Subtable->Length)
   1236      1.1  christos             {
   1237      1.1  christos                 AcpiOsPrintf ("Invalid zero length subtable\n");
   1238      1.1  christos                 return;
   1239      1.1  christos             }
   1240      1.1  christos             goto NextSubtable;
   1241      1.1  christos         }
   1242      1.1  christos 
   1243      1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1244      1.1  christos             Subtable->Length, InfoTable);
   1245      1.1  christos         if (ACPI_FAILURE (Status))
   1246      1.1  christos         {
   1247      1.1  christos             return;
   1248      1.1  christos         }
   1249      1.1  christos 
   1250      1.1  christos NextSubtable:
   1251      1.1  christos         /* Point to next subtable */
   1252      1.1  christos 
   1253      1.1  christos         Offset += Subtable->Length;
   1254      1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Subtable,
   1255      1.1  christos             Subtable->Length);
   1256      1.1  christos     }
   1257      1.1  christos }
   1258      1.1  christos 
   1259      1.1  christos 
   1260      1.1  christos /*******************************************************************************
   1261      1.1  christos  *
   1262      1.1  christos  * FUNCTION:    AcpiDmDumpGtdt
   1263      1.1  christos  *
   1264      1.1  christos  * PARAMETERS:  Table               - A GTDT table
   1265      1.1  christos  *
   1266      1.1  christos  * RETURN:      None
   1267      1.1  christos  *
   1268      1.1  christos  * DESCRIPTION: Format the contents of a GTDT. This table type consists
   1269      1.1  christos  *              of an open-ended number of subtables.
   1270      1.1  christos  *
   1271      1.1  christos  ******************************************************************************/
   1272      1.1  christos 
   1273      1.1  christos void
   1274      1.1  christos AcpiDmDumpGtdt (
   1275      1.1  christos     ACPI_TABLE_HEADER       *Table)
   1276      1.1  christos {
   1277      1.1  christos     ACPI_STATUS             Status;
   1278      1.1  christos     ACPI_GTDT_HEADER        *Subtable;
   1279      1.1  christos     UINT32                  Length = Table->Length;
   1280      1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_GTDT);
   1281      1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
   1282      1.1  christos     UINT32                  SubtableLength;
   1283      1.1  christos     UINT32                  GtCount;
   1284      1.1  christos     ACPI_GTDT_TIMER_ENTRY   *GtxTable;
   1285      1.1  christos 
   1286      1.1  christos 
   1287      1.1  christos     /* Main table */
   1288      1.1  christos 
   1289      1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoGtdt);
   1290      1.1  christos     if (ACPI_FAILURE (Status))
   1291      1.1  christos     {
   1292      1.1  christos         return;
   1293      1.1  christos     }
   1294      1.1  christos 
   1295  1.1.1.2  christos     /* Rev 3 fields */
   1296      1.1  christos 
   1297      1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
   1298  1.1.1.2  christos 
   1299  1.1.1.2  christos     if (Table->Revision > 2)
   1300  1.1.1.2  christos     {
   1301  1.1.1.2  christos         SubtableLength = sizeof (ACPI_GTDT_EL2);
   1302  1.1.1.2  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1303  1.1.1.2  christos             SubtableLength, AcpiDmTableInfoGtdtEl2);
   1304  1.1.1.2  christos         if (ACPI_FAILURE (Status))
   1305  1.1.1.2  christos         {
   1306  1.1.1.2  christos             return;
   1307  1.1.1.2  christos         }
   1308  1.1.1.2  christos         Offset += SubtableLength;
   1309  1.1.1.2  christos     }
   1310  1.1.1.2  christos 
   1311  1.1.1.2  christos     Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Table, Offset);
   1312  1.1.1.2  christos 
   1313  1.1.1.2  christos     /* Subtables */
   1314  1.1.1.2  christos 
   1315      1.1  christos     while (Offset < Table->Length)
   1316      1.1  christos     {
   1317      1.1  christos         /* Common subtable header */
   1318      1.1  christos 
   1319      1.1  christos         AcpiOsPrintf ("\n");
   1320      1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1321      1.1  christos             Subtable->Length, AcpiDmTableInfoGtdtHdr);
   1322      1.1  christos         if (ACPI_FAILURE (Status))
   1323      1.1  christos         {
   1324      1.1  christos             return;
   1325      1.1  christos         }
   1326      1.1  christos 
   1327      1.1  christos         GtCount = 0;
   1328      1.1  christos         switch (Subtable->Type)
   1329      1.1  christos         {
   1330      1.1  christos         case ACPI_GTDT_TYPE_TIMER_BLOCK:
   1331      1.1  christos 
   1332      1.1  christos             SubtableLength = sizeof (ACPI_GTDT_TIMER_BLOCK);
   1333      1.1  christos             GtCount = (ACPI_CAST_PTR (ACPI_GTDT_TIMER_BLOCK,
   1334      1.1  christos                 Subtable))->TimerCount;
   1335      1.1  christos 
   1336      1.1  christos             InfoTable = AcpiDmTableInfoGtdt0;
   1337      1.1  christos             break;
   1338      1.1  christos 
   1339      1.1  christos         case ACPI_GTDT_TYPE_WATCHDOG:
   1340      1.1  christos 
   1341      1.1  christos             SubtableLength = sizeof (ACPI_GTDT_WATCHDOG);
   1342      1.1  christos 
   1343      1.1  christos             InfoTable = AcpiDmTableInfoGtdt1;
   1344      1.1  christos             break;
   1345      1.1  christos 
   1346      1.1  christos         default:
   1347      1.1  christos 
   1348      1.1  christos             /* Cannot continue on unknown type - no length */
   1349      1.1  christos 
   1350      1.1  christos             AcpiOsPrintf ("\n**** Unknown GTDT subtable type 0x%X\n",
   1351      1.1  christos                 Subtable->Type);
   1352      1.1  christos             return;
   1353      1.1  christos         }
   1354      1.1  christos 
   1355      1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1356      1.1  christos             Subtable->Length, InfoTable);
   1357      1.1  christos         if (ACPI_FAILURE (Status))
   1358      1.1  christos         {
   1359      1.1  christos             return;
   1360      1.1  christos         }
   1361      1.1  christos 
   1362      1.1  christos         /* Point to end of current subtable (each subtable above is of fixed length) */
   1363      1.1  christos 
   1364      1.1  christos         Offset += SubtableLength;
   1365      1.1  christos 
   1366      1.1  christos         /* If there are any Gt Timer Blocks from above, dump them now */
   1367      1.1  christos 
   1368      1.1  christos         if (GtCount)
   1369      1.1  christos         {
   1370      1.1  christos             GtxTable = ACPI_ADD_PTR (
   1371      1.1  christos                 ACPI_GTDT_TIMER_ENTRY, Subtable, SubtableLength);
   1372      1.1  christos             SubtableLength += GtCount * sizeof (ACPI_GTDT_TIMER_ENTRY);
   1373      1.1  christos 
   1374      1.1  christos             while (GtCount)
   1375      1.1  christos             {
   1376      1.1  christos                 AcpiOsPrintf ("\n");
   1377      1.1  christos                 Status = AcpiDmDumpTable (Length, Offset, GtxTable,
   1378      1.1  christos                     sizeof (ACPI_GTDT_TIMER_ENTRY), AcpiDmTableInfoGtdt0a);
   1379      1.1  christos                 if (ACPI_FAILURE (Status))
   1380      1.1  christos                 {
   1381      1.1  christos                     return;
   1382      1.1  christos                 }
   1383      1.1  christos                 Offset += sizeof (ACPI_GTDT_TIMER_ENTRY);
   1384      1.1  christos                 GtxTable++;
   1385      1.1  christos                 GtCount--;
   1386      1.1  christos             }
   1387      1.1  christos         }
   1388      1.1  christos 
   1389      1.1  christos         /* Point to next subtable */
   1390      1.1  christos 
   1391      1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_GTDT_HEADER, Subtable, SubtableLength);
   1392      1.1  christos     }
   1393      1.1  christos }
   1394      1.1  christos 
   1395      1.1  christos 
   1396      1.1  christos /*******************************************************************************
   1397      1.1  christos  *
   1398      1.1  christos  * FUNCTION:    AcpiDmDumpHest
   1399      1.1  christos  *
   1400      1.1  christos  * PARAMETERS:  Table               - A HEST table
   1401      1.1  christos  *
   1402      1.1  christos  * RETURN:      None
   1403      1.1  christos  *
   1404      1.1  christos  * DESCRIPTION: Format the contents of a HEST. This table type consists
   1405      1.1  christos  *              of an open-ended number of subtables.
   1406      1.1  christos  *
   1407      1.1  christos  ******************************************************************************/
   1408      1.1  christos 
   1409      1.1  christos void
   1410      1.1  christos AcpiDmDumpHest (
   1411      1.1  christos     ACPI_TABLE_HEADER       *Table)
   1412      1.1  christos {
   1413      1.1  christos     ACPI_STATUS             Status;
   1414      1.1  christos     ACPI_HEST_HEADER        *Subtable;
   1415      1.1  christos     UINT32                  Length = Table->Length;
   1416      1.1  christos     UINT32                  Offset = sizeof (ACPI_TABLE_HEST);
   1417      1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
   1418      1.1  christos     UINT32                  SubtableLength;
   1419      1.1  christos     UINT32                  BankCount;
   1420      1.1  christos     ACPI_HEST_IA_ERROR_BANK *BankTable;
   1421      1.1  christos 
   1422      1.1  christos 
   1423      1.1  christos     /* Main table */
   1424      1.1  christos 
   1425      1.1  christos     Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoHest);
   1426      1.1  christos     if (ACPI_FAILURE (Status))
   1427      1.1  christos     {
   1428      1.1  christos         return;
   1429      1.1  christos     }
   1430      1.1  christos 
   1431      1.1  christos     /* Subtables */
   1432      1.1  christos 
   1433      1.1  christos     Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Table, Offset);
   1434      1.1  christos     while (Offset < Table->Length)
   1435      1.1  christos     {
   1436      1.1  christos         BankCount = 0;
   1437      1.1  christos         switch (Subtable->Type)
   1438      1.1  christos         {
   1439      1.1  christos         case ACPI_HEST_TYPE_IA32_CHECK:
   1440      1.1  christos 
   1441      1.1  christos             InfoTable = AcpiDmTableInfoHest0;
   1442      1.1  christos             SubtableLength = sizeof (ACPI_HEST_IA_MACHINE_CHECK);
   1443      1.1  christos             BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_MACHINE_CHECK,
   1444      1.1  christos                 Subtable))->NumHardwareBanks;
   1445      1.1  christos             break;
   1446      1.1  christos 
   1447      1.1  christos         case ACPI_HEST_TYPE_IA32_CORRECTED_CHECK:
   1448      1.1  christos 
   1449      1.1  christos             InfoTable = AcpiDmTableInfoHest1;
   1450      1.1  christos             SubtableLength = sizeof (ACPI_HEST_IA_CORRECTED);
   1451      1.1  christos             BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_CORRECTED,
   1452      1.1  christos                 Subtable))->NumHardwareBanks;
   1453      1.1  christos             break;
   1454      1.1  christos 
   1455      1.1  christos         case ACPI_HEST_TYPE_IA32_NMI:
   1456      1.1  christos 
   1457      1.1  christos             InfoTable = AcpiDmTableInfoHest2;
   1458      1.1  christos             SubtableLength = sizeof (ACPI_HEST_IA_NMI);
   1459      1.1  christos             break;
   1460      1.1  christos 
   1461      1.1  christos         case ACPI_HEST_TYPE_AER_ROOT_PORT:
   1462      1.1  christos 
   1463      1.1  christos             InfoTable = AcpiDmTableInfoHest6;
   1464      1.1  christos             SubtableLength = sizeof (ACPI_HEST_AER_ROOT);
   1465      1.1  christos             break;
   1466      1.1  christos 
   1467      1.1  christos         case ACPI_HEST_TYPE_AER_ENDPOINT:
   1468      1.1  christos 
   1469      1.1  christos             InfoTable = AcpiDmTableInfoHest7;
   1470      1.1  christos             SubtableLength = sizeof (ACPI_HEST_AER);
   1471      1.1  christos             break;
   1472      1.1  christos 
   1473      1.1  christos         case ACPI_HEST_TYPE_AER_BRIDGE:
   1474      1.1  christos 
   1475      1.1  christos             InfoTable = AcpiDmTableInfoHest8;
   1476      1.1  christos             SubtableLength = sizeof (ACPI_HEST_AER_BRIDGE);
   1477      1.1  christos             break;
   1478      1.1  christos 
   1479      1.1  christos         case ACPI_HEST_TYPE_GENERIC_ERROR:
   1480      1.1  christos 
   1481      1.1  christos             InfoTable = AcpiDmTableInfoHest9;
   1482      1.1  christos             SubtableLength = sizeof (ACPI_HEST_GENERIC);
   1483      1.1  christos             break;
   1484      1.1  christos 
   1485      1.1  christos         case ACPI_HEST_TYPE_GENERIC_ERROR_V2:
   1486      1.1  christos 
   1487      1.1  christos             InfoTable = AcpiDmTableInfoHest10;
   1488      1.1  christos             SubtableLength = sizeof (ACPI_HEST_GENERIC_V2);
   1489      1.1  christos             break;
   1490      1.1  christos 
   1491      1.1  christos         case ACPI_HEST_TYPE_IA32_DEFERRED_CHECK:
   1492      1.1  christos 
   1493      1.1  christos             InfoTable = AcpiDmTableInfoHest11;
   1494      1.1  christos             SubtableLength = sizeof (ACPI_HEST_IA_DEFERRED_CHECK);
   1495      1.1  christos             BankCount = (ACPI_CAST_PTR (ACPI_HEST_IA_DEFERRED_CHECK,
   1496      1.1  christos                 Subtable))->NumHardwareBanks;
   1497      1.1  christos             break;
   1498      1.1  christos 
   1499      1.1  christos         default:
   1500      1.1  christos 
   1501      1.1  christos             /* Cannot continue on unknown type - no length */
   1502      1.1  christos 
   1503      1.1  christos             AcpiOsPrintf ("\n**** Unknown HEST subtable type 0x%X\n",
   1504      1.1  christos                 Subtable->Type);
   1505      1.1  christos             return;
   1506      1.1  christos         }
   1507      1.1  christos 
   1508      1.1  christos         AcpiOsPrintf ("\n");
   1509      1.1  christos         Status = AcpiDmDumpTable (Length, Offset, Subtable,
   1510      1.1  christos             SubtableLength, InfoTable);
   1511      1.1  christos         if (ACPI_FAILURE (Status))
   1512      1.1  christos         {
   1513      1.1  christos             return;
   1514      1.1  christos         }
   1515      1.1  christos 
   1516      1.1  christos         /* Point to end of current subtable (each subtable above is of fixed length) */
   1517      1.1  christos 
   1518      1.1  christos         Offset += SubtableLength;
   1519      1.1  christos 
   1520      1.1  christos         /* If there are any (fixed-length) Error Banks from above, dump them now */
   1521      1.1  christos 
   1522      1.1  christos         if (BankCount)
   1523      1.1  christos         {
   1524      1.1  christos             BankTable = ACPI_ADD_PTR (ACPI_HEST_IA_ERROR_BANK, Subtable,
   1525      1.1  christos                 SubtableLength);
   1526      1.1  christos             SubtableLength += BankCount * sizeof (ACPI_HEST_IA_ERROR_BANK);
   1527      1.1  christos 
   1528      1.1  christos             while (BankCount)
   1529      1.1  christos             {
   1530      1.1  christos                 AcpiOsPrintf ("\n");
   1531      1.1  christos                 Status = AcpiDmDumpTable (Length, Offset, BankTable,
   1532      1.1  christos                     sizeof (ACPI_HEST_IA_ERROR_BANK), AcpiDmTableInfoHestBank);
   1533      1.1  christos                 if (ACPI_FAILURE (Status))
   1534      1.1  christos                 {
   1535      1.1  christos                     return;
   1536      1.1  christos                 }
   1537      1.1  christos 
   1538      1.1  christos                 Offset += sizeof (ACPI_HEST_IA_ERROR_BANK);
   1539      1.1  christos                 BankTable++;
   1540      1.1  christos                 BankCount--;
   1541      1.1  christos             }
   1542      1.1  christos         }
   1543      1.1  christos 
   1544      1.1  christos         /* Point to next subtable */
   1545      1.1  christos 
   1546      1.1  christos         Subtable = ACPI_ADD_PTR (ACPI_HEST_HEADER, Subtable, SubtableLength);
   1547      1.1  christos     }
   1548      1.1  christos }
   1549      1.1  christos 
   1550      1.1  christos 
   1551      1.1  christos /*******************************************************************************
   1552      1.1  christos  *
   1553      1.1  christos  * FUNCTION:    AcpiDmDumpHmat
   1554      1.1  christos  *
   1555      1.1  christos  * PARAMETERS:  Table               - A HMAT table
   1556      1.1  christos  *
   1557      1.1  christos  * RETURN:      None
   1558      1.1  christos  *
   1559      1.1  christos  * DESCRIPTION: Format the contents of a HMAT.
   1560      1.1  christos  *
   1561      1.1  christos  ******************************************************************************/
   1562      1.1  christos 
   1563      1.1  christos void
   1564      1.1  christos AcpiDmDumpHmat (
   1565      1.1  christos     ACPI_TABLE_HEADER       *Table)
   1566      1.1  christos {
   1567      1.1  christos     ACPI_STATUS             Status;
   1568      1.1  christos     ACPI_HMAT_STRUCTURE     *HmatStruct;
   1569      1.1  christos     ACPI_HMAT_LOCALITY      *HmatLocality;
   1570      1.1  christos     ACPI_HMAT_CACHE         *HmatCache;
   1571      1.1  christos     UINT32                  Offset;
   1572      1.1  christos     UINT32                  SubtableOffset;
   1573      1.1  christos     UINT32                  Length;
   1574      1.1  christos     ACPI_DMTABLE_INFO       *InfoTable;
   1575      1.1  christos     UINT32                  i, j;
   1576      1.1  christos 
   1577      1.1  christos 
   1578      1.1  christos     /* Main table */
   1579      1.1  christos 
   1580      1.1  christos     Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoHmat);
   1581      1.1  christos     if (ACPI_FAILURE (Status))
   1582      1.1  christos     {
   1583      1.1  christos         return;
   1584      1.1  christos     }
   1585      1.1  christos     Offset = sizeof (ACPI_TABLE_HMAT);
   1586      1.1  christos 
   1587      1.1  christos     while (Offset < Table->Length)
   1588      1.1  christos     {
   1589      1.1  christos         AcpiOsPrintf ("\n");
   1590      1.1  christos 
   1591      1.1  christos         /* Dump HMAT structure header */
   1592      1.1  christos 
   1593      1.1  christos         HmatStruct = ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, Table, Offset);
   1594      1.1  christos         if (HmatStruct->Length < sizeof (ACPI_HMAT_STRUCTURE))
   1595      1.1  christos         {
   1596      1.1  christos             AcpiOsPrintf ("Invalid HMAT structure length\n");
   1597      1.1  christos             return;
   1598      1.1  christos         }
   1599      1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct,
   1600      1.1  christos             HmatStruct->Length, AcpiDmTableInfoHmatHdr);
   1601      1.1  christos         if (ACPI_FAILURE (Status))
   1602      1.1  christos         {
   1603      1.1  christos             return;
   1604      1.1  christos         }
   1605      1.1  christos 
   1606      1.1  christos         switch (HmatStruct->Type)
   1607      1.1  christos         {
   1608      1.1  christos         case ACPI_HMAT_TYPE_ADDRESS_RANGE:
   1609      1.1  christos 
   1610      1.1  christos             InfoTable = AcpiDmTableInfoHmat0;
   1611  1.1.1.2  christos             Length = sizeof (ACPI_HMAT_PROXIMITY_DOMAIN);
   1612      1.1  christos             break;
   1613      1.1  christos 
   1614      1.1  christos         case ACPI_HMAT_TYPE_LOCALITY:
   1615      1.1  christos 
   1616      1.1  christos             InfoTable = AcpiDmTableInfoHmat1;
   1617      1.1  christos             Length = sizeof (ACPI_HMAT_LOCALITY);
   1618      1.1  christos             break;
   1619      1.1  christos 
   1620      1.1  christos         case ACPI_HMAT_TYPE_CACHE:
   1621      1.1  christos 
   1622      1.1  christos             InfoTable = AcpiDmTableInfoHmat2;
   1623      1.1  christos             Length = sizeof (ACPI_HMAT_CACHE);
   1624      1.1  christos             break;
   1625      1.1  christos 
   1626      1.1  christos         default:
   1627      1.1  christos 
   1628      1.1  christos             AcpiOsPrintf ("\n**** Unknown HMAT structure type 0x%X\n",
   1629      1.1  christos                 HmatStruct->Type);
   1630      1.1  christos 
   1631      1.1  christos             /* Attempt to continue */
   1632      1.1  christos 
   1633      1.1  christos             goto NextSubtable;
   1634      1.1  christos         }
   1635      1.1  christos 
   1636      1.1  christos         /* Dump HMAT structure body */
   1637      1.1  christos 
   1638      1.1  christos         if (HmatStruct->Length < Length)
   1639      1.1  christos         {
   1640      1.1  christos             AcpiOsPrintf ("Invalid HMAT structure length\n");
   1641      1.1  christos             return;
   1642      1.1  christos         }
   1643      1.1  christos         Status = AcpiDmDumpTable (Table->Length, Offset, HmatStruct,
   1644      1.1  christos             HmatStruct->Length, InfoTable);
   1645      1.1  christos         if (ACPI_FAILURE (Status))
   1646      1.1  christos         {
   1647      1.1  christos             return;
   1648      1.1  christos         }
   1649      1.1  christos 
   1650      1.1  christos         /* Dump HMAT structure additionals */
   1651      1.1  christos 
   1652      1.1  christos         switch (HmatStruct->Type)
   1653      1.1  christos         {
   1654      1.1  christos         case ACPI_HMAT_TYPE_LOCALITY:
   1655      1.1  christos 
   1656      1.1  christos             HmatLocality = ACPI_CAST_PTR (ACPI_HMAT_LOCALITY, HmatStruct);
   1657      1.1  christos             SubtableOffset = sizeof (ACPI_HMAT_LOCALITY);
   1658      1.1  christos 
   1659      1.1  christos             /* Dump initiator proximity domains */
   1660      1.1  christos 
   1661      1.1  christos             if ((UINT32)(HmatStruct->Length - SubtableOffset) <
   1662      1.1  christos                 (UINT32)(HmatLocality->NumberOfInitiatorPDs * 4))
   1663      1.1  christos             {
   1664      1.1  christos                 AcpiOsPrintf ("Invalid initiator proximity domain number\n");
   1665      1.1  christos                 return;
   1666      1.1  christos             }
   1667      1.1  christos             for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++)
   1668      1.1  christos             {
   1669      1.1  christos                 Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
   1670      1.1  christos                     ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
   1671      1.1  christos                     4, AcpiDmTableInfoHmat1a);
   1672  1.1.1.3  christos                 if (ACPI_FAILURE (Status))
   1673  1.1.1.3  christos                 {
   1674  1.1.1.3  christos                     return;
   1675  1.1.1.3  christos                 }
   1676  1.1.1.3  christos 
   1677      1.1  christos                 SubtableOffset += 4;
   1678      1.1  christos             }
   1679      1.1  christos 
   1680      1.1  christos             /* Dump target proximity domains */
   1681      1.1  christos 
   1682      1.1  christos             if ((UINT32)(HmatStruct->Length - SubtableOffset) <
   1683      1.1  christos                 (UINT32)(HmatLocality->NumberOfTargetPDs * 4))
   1684      1.1  christos             {
   1685      1.1  christos                 AcpiOsPrintf ("Invalid target proximity domain number\n");
   1686      1.1  christos                 return;
   1687      1.1  christos             }
   1688      1.1  christos             for (i = 0; i < HmatLocality->NumberOfTargetPDs; i++)
   1689      1.1  christos             {
   1690      1.1  christos                 Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
   1691      1.1  christos                     ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
   1692      1.1  christos                     4, AcpiDmTableInfoHmat1b);
   1693  1.1.1.3  christos                 if (ACPI_FAILURE (Status))
   1694  1.1.1.3  christos                 {
   1695  1.1.1.3  christos                     return;
   1696  1.1.1.3  christos                 }
   1697  1.1.1.3  christos 
   1698      1.1  christos                 SubtableOffset += 4;
   1699      1.1  christos             }
   1700      1.1  christos 
   1701      1.1  christos             /* Dump latency/bandwidth entris */
   1702      1.1  christos 
   1703      1.1  christos             if ((UINT32)(HmatStruct->Length - SubtableOffset) <
   1704      1.1  christos                 (UINT32)(HmatLocality->NumberOfInitiatorPDs *
   1705      1.1  christos                          HmatLocality->NumberOfTargetPDs * 2))
   1706      1.1  christos             {
   1707      1.1  christos                 AcpiOsPrintf ("Invalid latency/bandwidth entry number\n");
   1708      1.1  christos                 return;
   1709      1.1  christos             }
   1710      1.1  christos             for (i = 0; i < HmatLocality->NumberOfInitiatorPDs; i++)
   1711      1.1  christos             {
   1712      1.1  christos                 for (j = 0; j < HmatLocality->NumberOfTargetPDs; j++)
   1713      1.1  christos                 {
   1714      1.1  christos                     Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
   1715      1.1  christos                         ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
   1716      1.1  christos                         2, AcpiDmTableInfoHmat1c);
   1717  1.1.1.3  christos                     if (ACPI_FAILURE(Status))
   1718  1.1.1.3  christos                     {
   1719  1.1.1.3  christos                         return;
   1720  1.1.1.3  christos                     }
   1721  1.1.1.3  christos 
   1722      1.1  christos                     SubtableOffset += 2;
   1723      1.1  christos                 }
   1724      1.1  christos             }
   1725      1.1  christos             break;
   1726      1.1  christos 
   1727      1.1  christos         case ACPI_HMAT_TYPE_CACHE:
   1728      1.1  christos 
   1729      1.1  christos             HmatCache = ACPI_CAST_PTR (ACPI_HMAT_CACHE, HmatStruct);
   1730      1.1  christos             SubtableOffset = sizeof (ACPI_HMAT_CACHE);
   1731      1.1  christos 
   1732      1.1  christos             /* Dump SMBIOS handles */
   1733      1.1  christos 
   1734      1.1  christos             if ((UINT32)(HmatStruct->Length - SubtableOffset) <
   1735      1.1  christos                 (UINT32)(HmatCache->NumberOfSMBIOSHandles * 2))
   1736      1.1  christos             {
   1737      1.1  christos                 AcpiOsPrintf ("Invalid SMBIOS handle number\n");
   1738      1.1  christos                 return;
   1739      1.1  christos             }
   1740      1.1  christos             for (i = 0; i < HmatCache->NumberOfSMBIOSHandles; i++)
   1741      1.1  christos             {
   1742      1.1  christos                 Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset,
   1743      1.1  christos                     ACPI_ADD_PTR (ACPI_HMAT_STRUCTURE, HmatStruct, SubtableOffset),
   1744      1.1  christos                     2, AcpiDmTableInfoHmat2a);
   1745  1.1.1.3  christos                 if (ACPI_FAILURE (Status))
   1746  1.1.1.3  christos                 {
   1747  1.1.1.3  christos                     return;
   1748  1.1.1.3  christos                 }
   1749  1.1.1.3  christos 
   1750      1.1  christos                 SubtableOffset += 2;
   1751      1.1  christos             }
   1752      1.1  christos             break;
   1753      1.1  christos 
   1754      1.1  christos         default:
   1755      1.1  christos 
   1756      1.1  christos             break;
   1757      1.1  christos         }
   1758      1.1  christos 
   1759      1.1  christos NextSubtable:
   1760      1.1  christos         /* Point to next HMAT structure subtable */
   1761      1.1  christos 
   1762      1.1  christos         Offset += (HmatStruct->Length);
   1763      1.1  christos     }
   1764      1.1  christos }
   1765