1*ff879b07SJung-uk Kim /****************************************************************************** 2*ff879b07SJung-uk Kim * 3*ff879b07SJung-uk Kim * Module Name: dmtbdump2 - Dump ACPI data tables that contain no AML code 4*ff879b07SJung-uk Kim * 5*ff879b07SJung-uk Kim *****************************************************************************/ 6*ff879b07SJung-uk Kim 7*ff879b07SJung-uk Kim /****************************************************************************** 8*ff879b07SJung-uk Kim * 9*ff879b07SJung-uk Kim * 1. Copyright Notice 10*ff879b07SJung-uk Kim * 11*ff879b07SJung-uk Kim * Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp. 12*ff879b07SJung-uk Kim * All rights reserved. 13*ff879b07SJung-uk Kim * 14*ff879b07SJung-uk Kim * 2. License 15*ff879b07SJung-uk Kim * 16*ff879b07SJung-uk Kim * 2.1. This is your license from Intel Corp. under its intellectual property 17*ff879b07SJung-uk Kim * rights. You may have additional license terms from the party that provided 18*ff879b07SJung-uk Kim * you this software, covering your right to use that party's intellectual 19*ff879b07SJung-uk Kim * property rights. 20*ff879b07SJung-uk Kim * 21*ff879b07SJung-uk Kim * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 22*ff879b07SJung-uk Kim * copy of the source code appearing in this file ("Covered Code") an 23*ff879b07SJung-uk Kim * irrevocable, perpetual, worldwide license under Intel's copyrights in the 24*ff879b07SJung-uk Kim * base code distributed originally by Intel ("Original Intel Code") to copy, 25*ff879b07SJung-uk Kim * make derivatives, distribute, use and display any portion of the Covered 26*ff879b07SJung-uk Kim * Code in any form, with the right to sublicense such rights; and 27*ff879b07SJung-uk Kim * 28*ff879b07SJung-uk Kim * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 29*ff879b07SJung-uk Kim * license (with the right to sublicense), under only those claims of Intel 30*ff879b07SJung-uk Kim * patents that are infringed by the Original Intel Code, to make, use, sell, 31*ff879b07SJung-uk Kim * offer to sell, and import the Covered Code and derivative works thereof 32*ff879b07SJung-uk Kim * solely to the minimum extent necessary to exercise the above copyright 33*ff879b07SJung-uk Kim * license, and in no event shall the patent license extend to any additions 34*ff879b07SJung-uk Kim * to or modifications of the Original Intel Code. No other license or right 35*ff879b07SJung-uk Kim * is granted directly or by implication, estoppel or otherwise; 36*ff879b07SJung-uk Kim * 37*ff879b07SJung-uk Kim * The above copyright and patent license is granted only if the following 38*ff879b07SJung-uk Kim * conditions are met: 39*ff879b07SJung-uk Kim * 40*ff879b07SJung-uk Kim * 3. Conditions 41*ff879b07SJung-uk Kim * 42*ff879b07SJung-uk Kim * 3.1. Redistribution of Source with Rights to Further Distribute Source. 43*ff879b07SJung-uk Kim * Redistribution of source code of any substantial portion of the Covered 44*ff879b07SJung-uk Kim * Code or modification with rights to further distribute source must include 45*ff879b07SJung-uk Kim * the above Copyright Notice, the above License, this list of Conditions, 46*ff879b07SJung-uk Kim * and the following Disclaimer and Export Compliance provision. In addition, 47*ff879b07SJung-uk Kim * Licensee must cause all Covered Code to which Licensee contributes to 48*ff879b07SJung-uk Kim * contain a file documenting the changes Licensee made to create that Covered 49*ff879b07SJung-uk Kim * Code and the date of any change. Licensee must include in that file the 50*ff879b07SJung-uk Kim * documentation of any changes made by any predecessor Licensee. Licensee 51*ff879b07SJung-uk Kim * must include a prominent statement that the modification is derived, 52*ff879b07SJung-uk Kim * directly or indirectly, from Original Intel Code. 53*ff879b07SJung-uk Kim * 54*ff879b07SJung-uk Kim * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 55*ff879b07SJung-uk Kim * Redistribution of source code of any substantial portion of the Covered 56*ff879b07SJung-uk Kim * Code or modification without rights to further distribute source must 57*ff879b07SJung-uk Kim * include the following Disclaimer and Export Compliance provision in the 58*ff879b07SJung-uk Kim * documentation and/or other materials provided with distribution. In 59*ff879b07SJung-uk Kim * addition, Licensee may not authorize further sublicense of source of any 60*ff879b07SJung-uk Kim * portion of the Covered Code, and must include terms to the effect that the 61*ff879b07SJung-uk Kim * license from Licensee to its licensee is limited to the intellectual 62*ff879b07SJung-uk Kim * property embodied in the software Licensee provides to its licensee, and 63*ff879b07SJung-uk Kim * not to intellectual property embodied in modifications its licensee may 64*ff879b07SJung-uk Kim * make. 65*ff879b07SJung-uk Kim * 66*ff879b07SJung-uk Kim * 3.3. Redistribution of Executable. Redistribution in executable form of any 67*ff879b07SJung-uk Kim * substantial portion of the Covered Code or modification must reproduce the 68*ff879b07SJung-uk Kim * above Copyright Notice, and the following Disclaimer and Export Compliance 69*ff879b07SJung-uk Kim * provision in the documentation and/or other materials provided with the 70*ff879b07SJung-uk Kim * distribution. 71*ff879b07SJung-uk Kim * 72*ff879b07SJung-uk Kim * 3.4. Intel retains all right, title, and interest in and to the Original 73*ff879b07SJung-uk Kim * Intel Code. 74*ff879b07SJung-uk Kim * 75*ff879b07SJung-uk Kim * 3.5. Neither the name Intel nor any other trademark owned or controlled by 76*ff879b07SJung-uk Kim * Intel shall be used in advertising or otherwise to promote the sale, use or 77*ff879b07SJung-uk Kim * other dealings in products derived from or relating to the Covered Code 78*ff879b07SJung-uk Kim * without prior written authorization from Intel. 79*ff879b07SJung-uk Kim * 80*ff879b07SJung-uk Kim * 4. Disclaimer and Export Compliance 81*ff879b07SJung-uk Kim * 82*ff879b07SJung-uk Kim * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 83*ff879b07SJung-uk Kim * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 84*ff879b07SJung-uk Kim * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 85*ff879b07SJung-uk Kim * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 86*ff879b07SJung-uk Kim * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 87*ff879b07SJung-uk Kim * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 88*ff879b07SJung-uk Kim * PARTICULAR PURPOSE. 89*ff879b07SJung-uk Kim * 90*ff879b07SJung-uk Kim * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 91*ff879b07SJung-uk Kim * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 92*ff879b07SJung-uk Kim * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 93*ff879b07SJung-uk Kim * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 94*ff879b07SJung-uk Kim * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 95*ff879b07SJung-uk Kim * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 96*ff879b07SJung-uk Kim * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 97*ff879b07SJung-uk Kim * LIMITED REMEDY. 98*ff879b07SJung-uk Kim * 99*ff879b07SJung-uk Kim * 4.3. Licensee shall not export, either directly or indirectly, any of this 100*ff879b07SJung-uk Kim * software or system incorporating such software without first obtaining any 101*ff879b07SJung-uk Kim * required license or other approval from the U. S. Department of Commerce or 102*ff879b07SJung-uk Kim * any other agency or department of the United States Government. In the 103*ff879b07SJung-uk Kim * event Licensee exports any such software from the United States or 104*ff879b07SJung-uk Kim * re-exports any such software from a foreign destination, Licensee shall 105*ff879b07SJung-uk Kim * ensure that the distribution and export/re-export of the software is in 106*ff879b07SJung-uk Kim * compliance with all laws, regulations, orders, or other restrictions of the 107*ff879b07SJung-uk Kim * U.S. Export Administration Regulations. Licensee agrees that neither it nor 108*ff879b07SJung-uk Kim * any of its subsidiaries will export/re-export any technical data, process, 109*ff879b07SJung-uk Kim * software, or service, directly or indirectly, to any country for which the 110*ff879b07SJung-uk Kim * United States government or any agency thereof requires an export license, 111*ff879b07SJung-uk Kim * other governmental approval, or letter of assurance, without first obtaining 112*ff879b07SJung-uk Kim * such license, approval or letter. 113*ff879b07SJung-uk Kim * 114*ff879b07SJung-uk Kim ***************************************************************************** 115*ff879b07SJung-uk Kim * 116*ff879b07SJung-uk Kim * Alternatively, you may choose to be licensed under the terms of the 117*ff879b07SJung-uk Kim * following license: 118*ff879b07SJung-uk Kim * 119*ff879b07SJung-uk Kim * Redistribution and use in source and binary forms, with or without 120*ff879b07SJung-uk Kim * modification, are permitted provided that the following conditions 121*ff879b07SJung-uk Kim * are met: 122*ff879b07SJung-uk Kim * 1. Redistributions of source code must retain the above copyright 123*ff879b07SJung-uk Kim * notice, this list of conditions, and the following disclaimer, 124*ff879b07SJung-uk Kim * without modification. 125*ff879b07SJung-uk Kim * 2. Redistributions in binary form must reproduce at minimum a disclaimer 126*ff879b07SJung-uk Kim * substantially similar to the "NO WARRANTY" disclaimer below 127*ff879b07SJung-uk Kim * ("Disclaimer") and any redistribution must be conditioned upon 128*ff879b07SJung-uk Kim * including a substantially similar Disclaimer requirement for further 129*ff879b07SJung-uk Kim * binary redistribution. 130*ff879b07SJung-uk Kim * 3. Neither the names of the above-listed copyright holders nor the names 131*ff879b07SJung-uk Kim * of any contributors may be used to endorse or promote products derived 132*ff879b07SJung-uk Kim * from this software without specific prior written permission. 133*ff879b07SJung-uk Kim * 134*ff879b07SJung-uk Kim * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 135*ff879b07SJung-uk Kim * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 136*ff879b07SJung-uk Kim * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 137*ff879b07SJung-uk Kim * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 138*ff879b07SJung-uk Kim * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 139*ff879b07SJung-uk Kim * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 140*ff879b07SJung-uk Kim * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 141*ff879b07SJung-uk Kim * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 142*ff879b07SJung-uk Kim * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 143*ff879b07SJung-uk Kim * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 144*ff879b07SJung-uk Kim * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 145*ff879b07SJung-uk Kim * 146*ff879b07SJung-uk Kim * Alternatively, you may choose to be licensed under the terms of the 147*ff879b07SJung-uk Kim * GNU General Public License ("GPL") version 2 as published by the Free 148*ff879b07SJung-uk Kim * Software Foundation. 149*ff879b07SJung-uk Kim * 150*ff879b07SJung-uk Kim *****************************************************************************/ 151*ff879b07SJung-uk Kim 152*ff879b07SJung-uk Kim #include <contrib/dev/acpica/include/acpi.h> 153*ff879b07SJung-uk Kim #include <contrib/dev/acpica/include/accommon.h> 154*ff879b07SJung-uk Kim #include <contrib/dev/acpica/include/acdisasm.h> 155*ff879b07SJung-uk Kim #include <contrib/dev/acpica/include/actables.h> 156*ff879b07SJung-uk Kim 157*ff879b07SJung-uk Kim /* This module used for application-level code only */ 158*ff879b07SJung-uk Kim 159*ff879b07SJung-uk Kim #define _COMPONENT ACPI_CA_DISASSEMBLER 160*ff879b07SJung-uk Kim ACPI_MODULE_NAME ("dmtbdump2") 161*ff879b07SJung-uk Kim 162*ff879b07SJung-uk Kim 163*ff879b07SJung-uk Kim /******************************************************************************* 164*ff879b07SJung-uk Kim * 165*ff879b07SJung-uk Kim * FUNCTION: AcpiDmDumpIort 166*ff879b07SJung-uk Kim * 167*ff879b07SJung-uk Kim * PARAMETERS: Table - A IORT table 168*ff879b07SJung-uk Kim * 169*ff879b07SJung-uk Kim * RETURN: None 170*ff879b07SJung-uk Kim * 171*ff879b07SJung-uk Kim * DESCRIPTION: Format the contents of a IORT 172*ff879b07SJung-uk Kim * 173*ff879b07SJung-uk Kim ******************************************************************************/ 174*ff879b07SJung-uk Kim 175*ff879b07SJung-uk Kim void 176*ff879b07SJung-uk Kim AcpiDmDumpIort ( 177*ff879b07SJung-uk Kim ACPI_TABLE_HEADER *Table) 178*ff879b07SJung-uk Kim { 179*ff879b07SJung-uk Kim ACPI_STATUS Status; 180*ff879b07SJung-uk Kim ACPI_TABLE_IORT *Iort; 181*ff879b07SJung-uk Kim ACPI_IORT_NODE *IortNode; 182*ff879b07SJung-uk Kim ACPI_IORT_ITS_GROUP *IortItsGroup = NULL; 183*ff879b07SJung-uk Kim ACPI_IORT_SMMU *IortSmmu = NULL; 184*ff879b07SJung-uk Kim UINT32 Offset; 185*ff879b07SJung-uk Kim UINT32 NodeOffset; 186*ff879b07SJung-uk Kim UINT32 Length; 187*ff879b07SJung-uk Kim ACPI_DMTABLE_INFO *InfoTable; 188*ff879b07SJung-uk Kim char *String; 189*ff879b07SJung-uk Kim UINT32 i; 190*ff879b07SJung-uk Kim 191*ff879b07SJung-uk Kim 192*ff879b07SJung-uk Kim /* Main table */ 193*ff879b07SJung-uk Kim 194*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIort); 195*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 196*ff879b07SJung-uk Kim { 197*ff879b07SJung-uk Kim return; 198*ff879b07SJung-uk Kim } 199*ff879b07SJung-uk Kim 200*ff879b07SJung-uk Kim Iort = ACPI_CAST_PTR (ACPI_TABLE_IORT, Table); 201*ff879b07SJung-uk Kim Offset = sizeof (ACPI_TABLE_IORT); 202*ff879b07SJung-uk Kim 203*ff879b07SJung-uk Kim /* Dump the OptionalPadding (optional) */ 204*ff879b07SJung-uk Kim 205*ff879b07SJung-uk Kim if (Iort->NodeOffset > Offset) 206*ff879b07SJung-uk Kim { 207*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset, Table, 208*ff879b07SJung-uk Kim Iort->NodeOffset - Offset, AcpiDmTableInfoIortPad); 209*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 210*ff879b07SJung-uk Kim { 211*ff879b07SJung-uk Kim return; 212*ff879b07SJung-uk Kim } 213*ff879b07SJung-uk Kim } 214*ff879b07SJung-uk Kim 215*ff879b07SJung-uk Kim Offset = Iort->NodeOffset; 216*ff879b07SJung-uk Kim while (Offset < Table->Length) 217*ff879b07SJung-uk Kim { 218*ff879b07SJung-uk Kim /* Common subtable header */ 219*ff879b07SJung-uk Kim 220*ff879b07SJung-uk Kim IortNode = ACPI_ADD_PTR (ACPI_IORT_NODE, Table, Offset); 221*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 222*ff879b07SJung-uk Kim Length = ACPI_OFFSET (ACPI_IORT_NODE, NodeData); 223*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset, 224*ff879b07SJung-uk Kim IortNode, Length, AcpiDmTableInfoIortHdr); 225*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 226*ff879b07SJung-uk Kim { 227*ff879b07SJung-uk Kim return; 228*ff879b07SJung-uk Kim } 229*ff879b07SJung-uk Kim 230*ff879b07SJung-uk Kim NodeOffset = Length; 231*ff879b07SJung-uk Kim 232*ff879b07SJung-uk Kim switch (IortNode->Type) 233*ff879b07SJung-uk Kim { 234*ff879b07SJung-uk Kim case ACPI_IORT_NODE_ITS_GROUP: 235*ff879b07SJung-uk Kim 236*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoIort0; 237*ff879b07SJung-uk Kim Length = ACPI_OFFSET (ACPI_IORT_ITS_GROUP, Identifiers); 238*ff879b07SJung-uk Kim IortItsGroup = ACPI_ADD_PTR (ACPI_IORT_ITS_GROUP, IortNode, NodeOffset); 239*ff879b07SJung-uk Kim break; 240*ff879b07SJung-uk Kim 241*ff879b07SJung-uk Kim case ACPI_IORT_NODE_NAMED_COMPONENT: 242*ff879b07SJung-uk Kim 243*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoIort1; 244*ff879b07SJung-uk Kim Length = ACPI_OFFSET (ACPI_IORT_NAMED_COMPONENT, DeviceName); 245*ff879b07SJung-uk Kim String = ACPI_ADD_PTR (char, IortNode, NodeOffset + Length); 246*ff879b07SJung-uk Kim Length += strlen (String) + 1; 247*ff879b07SJung-uk Kim break; 248*ff879b07SJung-uk Kim 249*ff879b07SJung-uk Kim case ACPI_IORT_NODE_PCI_ROOT_COMPLEX: 250*ff879b07SJung-uk Kim 251*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoIort2; 252*ff879b07SJung-uk Kim Length = IortNode->Length - NodeOffset; 253*ff879b07SJung-uk Kim break; 254*ff879b07SJung-uk Kim 255*ff879b07SJung-uk Kim case ACPI_IORT_NODE_SMMU: 256*ff879b07SJung-uk Kim 257*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoIort3; 258*ff879b07SJung-uk Kim Length = ACPI_OFFSET (ACPI_IORT_SMMU, Interrupts); 259*ff879b07SJung-uk Kim IortSmmu = ACPI_ADD_PTR (ACPI_IORT_SMMU, IortNode, NodeOffset); 260*ff879b07SJung-uk Kim break; 261*ff879b07SJung-uk Kim 262*ff879b07SJung-uk Kim case ACPI_IORT_NODE_SMMU_V3: 263*ff879b07SJung-uk Kim 264*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoIort4; 265*ff879b07SJung-uk Kim Length = IortNode->Length - NodeOffset; 266*ff879b07SJung-uk Kim break; 267*ff879b07SJung-uk Kim 268*ff879b07SJung-uk Kim default: 269*ff879b07SJung-uk Kim 270*ff879b07SJung-uk Kim AcpiOsPrintf ("\n**** Unknown IORT node type 0x%X\n", 271*ff879b07SJung-uk Kim IortNode->Type); 272*ff879b07SJung-uk Kim 273*ff879b07SJung-uk Kim /* Attempt to continue */ 274*ff879b07SJung-uk Kim 275*ff879b07SJung-uk Kim if (!IortNode->Length) 276*ff879b07SJung-uk Kim { 277*ff879b07SJung-uk Kim AcpiOsPrintf ("Invalid zero length IORT node\n"); 278*ff879b07SJung-uk Kim return; 279*ff879b07SJung-uk Kim } 280*ff879b07SJung-uk Kim goto NextSubtable; 281*ff879b07SJung-uk Kim } 282*ff879b07SJung-uk Kim 283*ff879b07SJung-uk Kim /* Dump the node subtable header */ 284*ff879b07SJung-uk Kim 285*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 286*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, 287*ff879b07SJung-uk Kim ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), 288*ff879b07SJung-uk Kim Length, InfoTable); 289*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 290*ff879b07SJung-uk Kim { 291*ff879b07SJung-uk Kim return; 292*ff879b07SJung-uk Kim } 293*ff879b07SJung-uk Kim 294*ff879b07SJung-uk Kim NodeOffset += Length; 295*ff879b07SJung-uk Kim 296*ff879b07SJung-uk Kim /* Dump the node specific data */ 297*ff879b07SJung-uk Kim 298*ff879b07SJung-uk Kim switch (IortNode->Type) 299*ff879b07SJung-uk Kim { 300*ff879b07SJung-uk Kim case ACPI_IORT_NODE_ITS_GROUP: 301*ff879b07SJung-uk Kim 302*ff879b07SJung-uk Kim /* Validate IortItsGroup to avoid compiler warnings */ 303*ff879b07SJung-uk Kim 304*ff879b07SJung-uk Kim if (IortItsGroup) 305*ff879b07SJung-uk Kim { 306*ff879b07SJung-uk Kim for (i = 0; i < IortItsGroup->ItsCount; i++) 307*ff879b07SJung-uk Kim { 308*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, 309*ff879b07SJung-uk Kim ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), 310*ff879b07SJung-uk Kim 4, AcpiDmTableInfoIort0a); 311*ff879b07SJung-uk Kim NodeOffset += 4; 312*ff879b07SJung-uk Kim } 313*ff879b07SJung-uk Kim } 314*ff879b07SJung-uk Kim break; 315*ff879b07SJung-uk Kim 316*ff879b07SJung-uk Kim case ACPI_IORT_NODE_NAMED_COMPONENT: 317*ff879b07SJung-uk Kim 318*ff879b07SJung-uk Kim /* Dump the Padding (optional) */ 319*ff879b07SJung-uk Kim 320*ff879b07SJung-uk Kim if (IortNode->Length > NodeOffset) 321*ff879b07SJung-uk Kim { 322*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, 323*ff879b07SJung-uk Kim Table, IortNode->Length - NodeOffset, 324*ff879b07SJung-uk Kim AcpiDmTableInfoIort1a); 325*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 326*ff879b07SJung-uk Kim { 327*ff879b07SJung-uk Kim return; 328*ff879b07SJung-uk Kim } 329*ff879b07SJung-uk Kim } 330*ff879b07SJung-uk Kim break; 331*ff879b07SJung-uk Kim 332*ff879b07SJung-uk Kim case ACPI_IORT_NODE_SMMU: 333*ff879b07SJung-uk Kim 334*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 335*ff879b07SJung-uk Kim 336*ff879b07SJung-uk Kim /* Validate IortSmmu to avoid compiler warnings */ 337*ff879b07SJung-uk Kim 338*ff879b07SJung-uk Kim if (IortSmmu) 339*ff879b07SJung-uk Kim { 340*ff879b07SJung-uk Kim Length = 2 * sizeof (UINT64); 341*ff879b07SJung-uk Kim NodeOffset = IortSmmu->GlobalInterruptOffset; 342*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, 343*ff879b07SJung-uk Kim ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), 344*ff879b07SJung-uk Kim Length, AcpiDmTableInfoIort3a); 345*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 346*ff879b07SJung-uk Kim { 347*ff879b07SJung-uk Kim return; 348*ff879b07SJung-uk Kim } 349*ff879b07SJung-uk Kim 350*ff879b07SJung-uk Kim NodeOffset = IortSmmu->ContextInterruptOffset; 351*ff879b07SJung-uk Kim for (i = 0; i < IortSmmu->ContextInterruptCount; i++) 352*ff879b07SJung-uk Kim { 353*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, 354*ff879b07SJung-uk Kim ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), 355*ff879b07SJung-uk Kim 8, AcpiDmTableInfoIort3b); 356*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 357*ff879b07SJung-uk Kim { 358*ff879b07SJung-uk Kim return; 359*ff879b07SJung-uk Kim } 360*ff879b07SJung-uk Kim 361*ff879b07SJung-uk Kim NodeOffset += 8; 362*ff879b07SJung-uk Kim } 363*ff879b07SJung-uk Kim 364*ff879b07SJung-uk Kim NodeOffset = IortSmmu->PmuInterruptOffset; 365*ff879b07SJung-uk Kim for (i = 0; i < IortSmmu->PmuInterruptCount; i++) 366*ff879b07SJung-uk Kim { 367*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, 368*ff879b07SJung-uk Kim ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), 369*ff879b07SJung-uk Kim 8, AcpiDmTableInfoIort3c); 370*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 371*ff879b07SJung-uk Kim { 372*ff879b07SJung-uk Kim return; 373*ff879b07SJung-uk Kim } 374*ff879b07SJung-uk Kim 375*ff879b07SJung-uk Kim NodeOffset += 8; 376*ff879b07SJung-uk Kim } 377*ff879b07SJung-uk Kim } 378*ff879b07SJung-uk Kim break; 379*ff879b07SJung-uk Kim 380*ff879b07SJung-uk Kim default: 381*ff879b07SJung-uk Kim 382*ff879b07SJung-uk Kim break; 383*ff879b07SJung-uk Kim } 384*ff879b07SJung-uk Kim 385*ff879b07SJung-uk Kim /* Dump the ID mappings */ 386*ff879b07SJung-uk Kim 387*ff879b07SJung-uk Kim NodeOffset = IortNode->MappingOffset; 388*ff879b07SJung-uk Kim for (i = 0; i < IortNode->MappingCount; i++) 389*ff879b07SJung-uk Kim { 390*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 391*ff879b07SJung-uk Kim Length = sizeof (ACPI_IORT_ID_MAPPING); 392*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset, 393*ff879b07SJung-uk Kim ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset), 394*ff879b07SJung-uk Kim Length, AcpiDmTableInfoIortMap); 395*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 396*ff879b07SJung-uk Kim { 397*ff879b07SJung-uk Kim return; 398*ff879b07SJung-uk Kim } 399*ff879b07SJung-uk Kim 400*ff879b07SJung-uk Kim NodeOffset += Length; 401*ff879b07SJung-uk Kim } 402*ff879b07SJung-uk Kim 403*ff879b07SJung-uk Kim NextSubtable: 404*ff879b07SJung-uk Kim /* Point to next node subtable */ 405*ff879b07SJung-uk Kim 406*ff879b07SJung-uk Kim Offset += IortNode->Length; 407*ff879b07SJung-uk Kim IortNode = ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, IortNode->Length); 408*ff879b07SJung-uk Kim } 409*ff879b07SJung-uk Kim } 410*ff879b07SJung-uk Kim 411*ff879b07SJung-uk Kim 412*ff879b07SJung-uk Kim /******************************************************************************* 413*ff879b07SJung-uk Kim * 414*ff879b07SJung-uk Kim * FUNCTION: AcpiDmDumpIvrs 415*ff879b07SJung-uk Kim * 416*ff879b07SJung-uk Kim * PARAMETERS: Table - A IVRS table 417*ff879b07SJung-uk Kim * 418*ff879b07SJung-uk Kim * RETURN: None 419*ff879b07SJung-uk Kim * 420*ff879b07SJung-uk Kim * DESCRIPTION: Format the contents of a IVRS 421*ff879b07SJung-uk Kim * 422*ff879b07SJung-uk Kim ******************************************************************************/ 423*ff879b07SJung-uk Kim 424*ff879b07SJung-uk Kim static UINT8 EntrySizes[] = {4,8,16,32}; 425*ff879b07SJung-uk Kim 426*ff879b07SJung-uk Kim void 427*ff879b07SJung-uk Kim AcpiDmDumpIvrs ( 428*ff879b07SJung-uk Kim ACPI_TABLE_HEADER *Table) 429*ff879b07SJung-uk Kim { 430*ff879b07SJung-uk Kim ACPI_STATUS Status; 431*ff879b07SJung-uk Kim UINT32 Offset = sizeof (ACPI_TABLE_IVRS); 432*ff879b07SJung-uk Kim UINT32 EntryOffset; 433*ff879b07SJung-uk Kim UINT32 EntryLength; 434*ff879b07SJung-uk Kim UINT32 EntryType; 435*ff879b07SJung-uk Kim ACPI_IVRS_DE_HEADER *DeviceEntry; 436*ff879b07SJung-uk Kim ACPI_IVRS_HEADER *Subtable; 437*ff879b07SJung-uk Kim ACPI_DMTABLE_INFO *InfoTable; 438*ff879b07SJung-uk Kim 439*ff879b07SJung-uk Kim 440*ff879b07SJung-uk Kim /* Main table */ 441*ff879b07SJung-uk Kim 442*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoIvrs); 443*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 444*ff879b07SJung-uk Kim { 445*ff879b07SJung-uk Kim return; 446*ff879b07SJung-uk Kim } 447*ff879b07SJung-uk Kim 448*ff879b07SJung-uk Kim /* Subtables */ 449*ff879b07SJung-uk Kim 450*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Table, Offset); 451*ff879b07SJung-uk Kim while (Offset < Table->Length) 452*ff879b07SJung-uk Kim { 453*ff879b07SJung-uk Kim /* Common subtable header */ 454*ff879b07SJung-uk Kim 455*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 456*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, 457*ff879b07SJung-uk Kim Subtable->Length, AcpiDmTableInfoIvrsHdr); 458*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 459*ff879b07SJung-uk Kim { 460*ff879b07SJung-uk Kim return; 461*ff879b07SJung-uk Kim } 462*ff879b07SJung-uk Kim 463*ff879b07SJung-uk Kim switch (Subtable->Type) 464*ff879b07SJung-uk Kim { 465*ff879b07SJung-uk Kim case ACPI_IVRS_TYPE_HARDWARE: 466*ff879b07SJung-uk Kim 467*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoIvrs0; 468*ff879b07SJung-uk Kim break; 469*ff879b07SJung-uk Kim 470*ff879b07SJung-uk Kim case ACPI_IVRS_TYPE_MEMORY1: 471*ff879b07SJung-uk Kim case ACPI_IVRS_TYPE_MEMORY2: 472*ff879b07SJung-uk Kim case ACPI_IVRS_TYPE_MEMORY3: 473*ff879b07SJung-uk Kim 474*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoIvrs1; 475*ff879b07SJung-uk Kim break; 476*ff879b07SJung-uk Kim 477*ff879b07SJung-uk Kim default: 478*ff879b07SJung-uk Kim 479*ff879b07SJung-uk Kim AcpiOsPrintf ("\n**** Unknown IVRS subtable type 0x%X\n", 480*ff879b07SJung-uk Kim Subtable->Type); 481*ff879b07SJung-uk Kim 482*ff879b07SJung-uk Kim /* Attempt to continue */ 483*ff879b07SJung-uk Kim 484*ff879b07SJung-uk Kim if (!Subtable->Length) 485*ff879b07SJung-uk Kim { 486*ff879b07SJung-uk Kim AcpiOsPrintf ("Invalid zero length subtable\n"); 487*ff879b07SJung-uk Kim return; 488*ff879b07SJung-uk Kim } 489*ff879b07SJung-uk Kim goto NextSubtable; 490*ff879b07SJung-uk Kim } 491*ff879b07SJung-uk Kim 492*ff879b07SJung-uk Kim /* Dump the subtable */ 493*ff879b07SJung-uk Kim 494*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 495*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, 496*ff879b07SJung-uk Kim Subtable->Length, InfoTable); 497*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 498*ff879b07SJung-uk Kim { 499*ff879b07SJung-uk Kim return; 500*ff879b07SJung-uk Kim } 501*ff879b07SJung-uk Kim 502*ff879b07SJung-uk Kim /* The hardware subtable can contain multiple device entries */ 503*ff879b07SJung-uk Kim 504*ff879b07SJung-uk Kim if (Subtable->Type == ACPI_IVRS_TYPE_HARDWARE) 505*ff879b07SJung-uk Kim { 506*ff879b07SJung-uk Kim EntryOffset = Offset + sizeof (ACPI_IVRS_HARDWARE); 507*ff879b07SJung-uk Kim DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, Subtable, 508*ff879b07SJung-uk Kim sizeof (ACPI_IVRS_HARDWARE)); 509*ff879b07SJung-uk Kim 510*ff879b07SJung-uk Kim while (EntryOffset < (Offset + Subtable->Length)) 511*ff879b07SJung-uk Kim { 512*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 513*ff879b07SJung-uk Kim /* 514*ff879b07SJung-uk Kim * Upper 2 bits of Type encode the length of the device entry 515*ff879b07SJung-uk Kim * 516*ff879b07SJung-uk Kim * 00 = 4 byte 517*ff879b07SJung-uk Kim * 01 = 8 byte 518*ff879b07SJung-uk Kim * 10 = 16 byte - currently no entries defined 519*ff879b07SJung-uk Kim * 11 = 32 byte - currently no entries defined 520*ff879b07SJung-uk Kim */ 521*ff879b07SJung-uk Kim EntryType = DeviceEntry->Type; 522*ff879b07SJung-uk Kim EntryLength = EntrySizes [EntryType >> 6]; 523*ff879b07SJung-uk Kim 524*ff879b07SJung-uk Kim switch (EntryType) 525*ff879b07SJung-uk Kim { 526*ff879b07SJung-uk Kim /* 4-byte device entries */ 527*ff879b07SJung-uk Kim 528*ff879b07SJung-uk Kim case ACPI_IVRS_TYPE_PAD4: 529*ff879b07SJung-uk Kim case ACPI_IVRS_TYPE_ALL: 530*ff879b07SJung-uk Kim case ACPI_IVRS_TYPE_SELECT: 531*ff879b07SJung-uk Kim case ACPI_IVRS_TYPE_START: 532*ff879b07SJung-uk Kim case ACPI_IVRS_TYPE_END: 533*ff879b07SJung-uk Kim 534*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoIvrs4; 535*ff879b07SJung-uk Kim break; 536*ff879b07SJung-uk Kim 537*ff879b07SJung-uk Kim /* 8-byte entries, type A */ 538*ff879b07SJung-uk Kim 539*ff879b07SJung-uk Kim case ACPI_IVRS_TYPE_ALIAS_SELECT: 540*ff879b07SJung-uk Kim case ACPI_IVRS_TYPE_ALIAS_START: 541*ff879b07SJung-uk Kim 542*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoIvrs8a; 543*ff879b07SJung-uk Kim break; 544*ff879b07SJung-uk Kim 545*ff879b07SJung-uk Kim /* 8-byte entries, type B */ 546*ff879b07SJung-uk Kim 547*ff879b07SJung-uk Kim case ACPI_IVRS_TYPE_PAD8: 548*ff879b07SJung-uk Kim case ACPI_IVRS_TYPE_EXT_SELECT: 549*ff879b07SJung-uk Kim case ACPI_IVRS_TYPE_EXT_START: 550*ff879b07SJung-uk Kim 551*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoIvrs8b; 552*ff879b07SJung-uk Kim break; 553*ff879b07SJung-uk Kim 554*ff879b07SJung-uk Kim /* 8-byte entries, type C */ 555*ff879b07SJung-uk Kim 556*ff879b07SJung-uk Kim case ACPI_IVRS_TYPE_SPECIAL: 557*ff879b07SJung-uk Kim 558*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoIvrs8c; 559*ff879b07SJung-uk Kim break; 560*ff879b07SJung-uk Kim 561*ff879b07SJung-uk Kim default: 562*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoIvrs4; 563*ff879b07SJung-uk Kim AcpiOsPrintf ( 564*ff879b07SJung-uk Kim "\n**** Unknown IVRS device entry type/length: " 565*ff879b07SJung-uk Kim "0x%.2X/0x%X at offset 0x%.4X: (header below)\n", 566*ff879b07SJung-uk Kim EntryType, EntryLength, EntryOffset); 567*ff879b07SJung-uk Kim break; 568*ff879b07SJung-uk Kim } 569*ff879b07SJung-uk Kim 570*ff879b07SJung-uk Kim /* Dump the Device Entry */ 571*ff879b07SJung-uk Kim 572*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, EntryOffset, 573*ff879b07SJung-uk Kim DeviceEntry, EntryLength, InfoTable); 574*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 575*ff879b07SJung-uk Kim { 576*ff879b07SJung-uk Kim return; 577*ff879b07SJung-uk Kim } 578*ff879b07SJung-uk Kim 579*ff879b07SJung-uk Kim EntryOffset += EntryLength; 580*ff879b07SJung-uk Kim DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, DeviceEntry, 581*ff879b07SJung-uk Kim EntryLength); 582*ff879b07SJung-uk Kim } 583*ff879b07SJung-uk Kim } 584*ff879b07SJung-uk Kim 585*ff879b07SJung-uk Kim NextSubtable: 586*ff879b07SJung-uk Kim /* Point to next subtable */ 587*ff879b07SJung-uk Kim 588*ff879b07SJung-uk Kim Offset += Subtable->Length; 589*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_IVRS_HEADER, Subtable, Subtable->Length); 590*ff879b07SJung-uk Kim } 591*ff879b07SJung-uk Kim } 592*ff879b07SJung-uk Kim 593*ff879b07SJung-uk Kim 594*ff879b07SJung-uk Kim /******************************************************************************* 595*ff879b07SJung-uk Kim * 596*ff879b07SJung-uk Kim * FUNCTION: AcpiDmDumpLpit 597*ff879b07SJung-uk Kim * 598*ff879b07SJung-uk Kim * PARAMETERS: Table - A LPIT table 599*ff879b07SJung-uk Kim * 600*ff879b07SJung-uk Kim * RETURN: None 601*ff879b07SJung-uk Kim * 602*ff879b07SJung-uk Kim * DESCRIPTION: Format the contents of a LPIT. This table type consists 603*ff879b07SJung-uk Kim * of an open-ended number of subtables. Note: There are no 604*ff879b07SJung-uk Kim * entries in the main table. An LPIT consists of the table 605*ff879b07SJung-uk Kim * header and then subtables only. 606*ff879b07SJung-uk Kim * 607*ff879b07SJung-uk Kim ******************************************************************************/ 608*ff879b07SJung-uk Kim 609*ff879b07SJung-uk Kim void 610*ff879b07SJung-uk Kim AcpiDmDumpLpit ( 611*ff879b07SJung-uk Kim ACPI_TABLE_HEADER *Table) 612*ff879b07SJung-uk Kim { 613*ff879b07SJung-uk Kim ACPI_STATUS Status; 614*ff879b07SJung-uk Kim ACPI_LPIT_HEADER *Subtable; 615*ff879b07SJung-uk Kim UINT32 Length = Table->Length; 616*ff879b07SJung-uk Kim UINT32 Offset = sizeof (ACPI_TABLE_LPIT); 617*ff879b07SJung-uk Kim ACPI_DMTABLE_INFO *InfoTable; 618*ff879b07SJung-uk Kim UINT32 SubtableLength; 619*ff879b07SJung-uk Kim 620*ff879b07SJung-uk Kim 621*ff879b07SJung-uk Kim /* Subtables */ 622*ff879b07SJung-uk Kim 623*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, Table, Offset); 624*ff879b07SJung-uk Kim while (Offset < Table->Length) 625*ff879b07SJung-uk Kim { 626*ff879b07SJung-uk Kim /* Common subtable header */ 627*ff879b07SJung-uk Kim 628*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, Offset, Subtable, 629*ff879b07SJung-uk Kim sizeof (ACPI_LPIT_HEADER), AcpiDmTableInfoLpitHdr); 630*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 631*ff879b07SJung-uk Kim { 632*ff879b07SJung-uk Kim return; 633*ff879b07SJung-uk Kim } 634*ff879b07SJung-uk Kim 635*ff879b07SJung-uk Kim switch (Subtable->Type) 636*ff879b07SJung-uk Kim { 637*ff879b07SJung-uk Kim case ACPI_LPIT_TYPE_NATIVE_CSTATE: 638*ff879b07SJung-uk Kim 639*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoLpit0; 640*ff879b07SJung-uk Kim SubtableLength = sizeof (ACPI_LPIT_NATIVE); 641*ff879b07SJung-uk Kim break; 642*ff879b07SJung-uk Kim 643*ff879b07SJung-uk Kim default: 644*ff879b07SJung-uk Kim 645*ff879b07SJung-uk Kim /* Cannot continue on unknown type - no length */ 646*ff879b07SJung-uk Kim 647*ff879b07SJung-uk Kim AcpiOsPrintf ("\n**** Unknown LPIT subtable type 0x%X\n", 648*ff879b07SJung-uk Kim Subtable->Type); 649*ff879b07SJung-uk Kim return; 650*ff879b07SJung-uk Kim } 651*ff879b07SJung-uk Kim 652*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, Offset, Subtable, 653*ff879b07SJung-uk Kim SubtableLength, InfoTable); 654*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 655*ff879b07SJung-uk Kim { 656*ff879b07SJung-uk Kim return; 657*ff879b07SJung-uk Kim } 658*ff879b07SJung-uk Kim 659*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 660*ff879b07SJung-uk Kim 661*ff879b07SJung-uk Kim /* Point to next subtable */ 662*ff879b07SJung-uk Kim 663*ff879b07SJung-uk Kim Offset += SubtableLength; 664*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_LPIT_HEADER, Subtable, SubtableLength); 665*ff879b07SJung-uk Kim } 666*ff879b07SJung-uk Kim } 667*ff879b07SJung-uk Kim 668*ff879b07SJung-uk Kim 669*ff879b07SJung-uk Kim /******************************************************************************* 670*ff879b07SJung-uk Kim * 671*ff879b07SJung-uk Kim * FUNCTION: AcpiDmDumpMadt 672*ff879b07SJung-uk Kim * 673*ff879b07SJung-uk Kim * PARAMETERS: Table - A MADT table 674*ff879b07SJung-uk Kim * 675*ff879b07SJung-uk Kim * RETURN: None 676*ff879b07SJung-uk Kim * 677*ff879b07SJung-uk Kim * DESCRIPTION: Format the contents of a MADT. This table type consists 678*ff879b07SJung-uk Kim * of an open-ended number of subtables. 679*ff879b07SJung-uk Kim * 680*ff879b07SJung-uk Kim ******************************************************************************/ 681*ff879b07SJung-uk Kim 682*ff879b07SJung-uk Kim void 683*ff879b07SJung-uk Kim AcpiDmDumpMadt ( 684*ff879b07SJung-uk Kim ACPI_TABLE_HEADER *Table) 685*ff879b07SJung-uk Kim { 686*ff879b07SJung-uk Kim ACPI_STATUS Status; 687*ff879b07SJung-uk Kim ACPI_SUBTABLE_HEADER *Subtable; 688*ff879b07SJung-uk Kim UINT32 Length = Table->Length; 689*ff879b07SJung-uk Kim UINT32 Offset = sizeof (ACPI_TABLE_MADT); 690*ff879b07SJung-uk Kim ACPI_DMTABLE_INFO *InfoTable; 691*ff879b07SJung-uk Kim 692*ff879b07SJung-uk Kim 693*ff879b07SJung-uk Kim /* Main table */ 694*ff879b07SJung-uk Kim 695*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoMadt); 696*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 697*ff879b07SJung-uk Kim { 698*ff879b07SJung-uk Kim return; 699*ff879b07SJung-uk Kim } 700*ff879b07SJung-uk Kim 701*ff879b07SJung-uk Kim /* Subtables */ 702*ff879b07SJung-uk Kim 703*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset); 704*ff879b07SJung-uk Kim while (Offset < Table->Length) 705*ff879b07SJung-uk Kim { 706*ff879b07SJung-uk Kim /* Common subtable header */ 707*ff879b07SJung-uk Kim 708*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 709*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, Offset, Subtable, 710*ff879b07SJung-uk Kim Subtable->Length, AcpiDmTableInfoMadtHdr); 711*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 712*ff879b07SJung-uk Kim { 713*ff879b07SJung-uk Kim return; 714*ff879b07SJung-uk Kim } 715*ff879b07SJung-uk Kim 716*ff879b07SJung-uk Kim switch (Subtable->Type) 717*ff879b07SJung-uk Kim { 718*ff879b07SJung-uk Kim case ACPI_MADT_TYPE_LOCAL_APIC: 719*ff879b07SJung-uk Kim 720*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoMadt0; 721*ff879b07SJung-uk Kim break; 722*ff879b07SJung-uk Kim 723*ff879b07SJung-uk Kim case ACPI_MADT_TYPE_IO_APIC: 724*ff879b07SJung-uk Kim 725*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoMadt1; 726*ff879b07SJung-uk Kim break; 727*ff879b07SJung-uk Kim 728*ff879b07SJung-uk Kim case ACPI_MADT_TYPE_INTERRUPT_OVERRIDE: 729*ff879b07SJung-uk Kim 730*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoMadt2; 731*ff879b07SJung-uk Kim break; 732*ff879b07SJung-uk Kim 733*ff879b07SJung-uk Kim case ACPI_MADT_TYPE_NMI_SOURCE: 734*ff879b07SJung-uk Kim 735*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoMadt3; 736*ff879b07SJung-uk Kim break; 737*ff879b07SJung-uk Kim 738*ff879b07SJung-uk Kim case ACPI_MADT_TYPE_LOCAL_APIC_NMI: 739*ff879b07SJung-uk Kim 740*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoMadt4; 741*ff879b07SJung-uk Kim break; 742*ff879b07SJung-uk Kim 743*ff879b07SJung-uk Kim case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE: 744*ff879b07SJung-uk Kim 745*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoMadt5; 746*ff879b07SJung-uk Kim break; 747*ff879b07SJung-uk Kim 748*ff879b07SJung-uk Kim case ACPI_MADT_TYPE_IO_SAPIC: 749*ff879b07SJung-uk Kim 750*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoMadt6; 751*ff879b07SJung-uk Kim break; 752*ff879b07SJung-uk Kim 753*ff879b07SJung-uk Kim case ACPI_MADT_TYPE_LOCAL_SAPIC: 754*ff879b07SJung-uk Kim 755*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoMadt7; 756*ff879b07SJung-uk Kim break; 757*ff879b07SJung-uk Kim 758*ff879b07SJung-uk Kim case ACPI_MADT_TYPE_INTERRUPT_SOURCE: 759*ff879b07SJung-uk Kim 760*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoMadt8; 761*ff879b07SJung-uk Kim break; 762*ff879b07SJung-uk Kim 763*ff879b07SJung-uk Kim case ACPI_MADT_TYPE_LOCAL_X2APIC: 764*ff879b07SJung-uk Kim 765*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoMadt9; 766*ff879b07SJung-uk Kim break; 767*ff879b07SJung-uk Kim 768*ff879b07SJung-uk Kim case ACPI_MADT_TYPE_LOCAL_X2APIC_NMI: 769*ff879b07SJung-uk Kim 770*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoMadt10; 771*ff879b07SJung-uk Kim break; 772*ff879b07SJung-uk Kim 773*ff879b07SJung-uk Kim case ACPI_MADT_TYPE_GENERIC_INTERRUPT: 774*ff879b07SJung-uk Kim 775*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoMadt11; 776*ff879b07SJung-uk Kim break; 777*ff879b07SJung-uk Kim 778*ff879b07SJung-uk Kim case ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR: 779*ff879b07SJung-uk Kim 780*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoMadt12; 781*ff879b07SJung-uk Kim break; 782*ff879b07SJung-uk Kim 783*ff879b07SJung-uk Kim case ACPI_MADT_TYPE_GENERIC_MSI_FRAME: 784*ff879b07SJung-uk Kim 785*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoMadt13; 786*ff879b07SJung-uk Kim break; 787*ff879b07SJung-uk Kim 788*ff879b07SJung-uk Kim case ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR: 789*ff879b07SJung-uk Kim 790*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoMadt14; 791*ff879b07SJung-uk Kim break; 792*ff879b07SJung-uk Kim 793*ff879b07SJung-uk Kim case ACPI_MADT_TYPE_GENERIC_TRANSLATOR: 794*ff879b07SJung-uk Kim 795*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoMadt15; 796*ff879b07SJung-uk Kim break; 797*ff879b07SJung-uk Kim 798*ff879b07SJung-uk Kim default: 799*ff879b07SJung-uk Kim 800*ff879b07SJung-uk Kim AcpiOsPrintf ("\n**** Unknown MADT subtable type 0x%X\n\n", 801*ff879b07SJung-uk Kim Subtable->Type); 802*ff879b07SJung-uk Kim 803*ff879b07SJung-uk Kim /* Attempt to continue */ 804*ff879b07SJung-uk Kim 805*ff879b07SJung-uk Kim if (!Subtable->Length) 806*ff879b07SJung-uk Kim { 807*ff879b07SJung-uk Kim AcpiOsPrintf ("Invalid zero length subtable\n"); 808*ff879b07SJung-uk Kim return; 809*ff879b07SJung-uk Kim } 810*ff879b07SJung-uk Kim 811*ff879b07SJung-uk Kim goto NextSubtable; 812*ff879b07SJung-uk Kim } 813*ff879b07SJung-uk Kim 814*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, Offset, Subtable, 815*ff879b07SJung-uk Kim Subtable->Length, InfoTable); 816*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 817*ff879b07SJung-uk Kim { 818*ff879b07SJung-uk Kim return; 819*ff879b07SJung-uk Kim } 820*ff879b07SJung-uk Kim 821*ff879b07SJung-uk Kim NextSubtable: 822*ff879b07SJung-uk Kim /* Point to next subtable */ 823*ff879b07SJung-uk Kim 824*ff879b07SJung-uk Kim Offset += Subtable->Length; 825*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Subtable, 826*ff879b07SJung-uk Kim Subtable->Length); 827*ff879b07SJung-uk Kim } 828*ff879b07SJung-uk Kim } 829*ff879b07SJung-uk Kim 830*ff879b07SJung-uk Kim 831*ff879b07SJung-uk Kim /******************************************************************************* 832*ff879b07SJung-uk Kim * 833*ff879b07SJung-uk Kim * FUNCTION: AcpiDmDumpMcfg 834*ff879b07SJung-uk Kim * 835*ff879b07SJung-uk Kim * PARAMETERS: Table - A MCFG Table 836*ff879b07SJung-uk Kim * 837*ff879b07SJung-uk Kim * RETURN: None 838*ff879b07SJung-uk Kim * 839*ff879b07SJung-uk Kim * DESCRIPTION: Format the contents of a MCFG table 840*ff879b07SJung-uk Kim * 841*ff879b07SJung-uk Kim ******************************************************************************/ 842*ff879b07SJung-uk Kim 843*ff879b07SJung-uk Kim void 844*ff879b07SJung-uk Kim AcpiDmDumpMcfg ( 845*ff879b07SJung-uk Kim ACPI_TABLE_HEADER *Table) 846*ff879b07SJung-uk Kim { 847*ff879b07SJung-uk Kim ACPI_STATUS Status; 848*ff879b07SJung-uk Kim UINT32 Offset = sizeof (ACPI_TABLE_MCFG); 849*ff879b07SJung-uk Kim ACPI_MCFG_ALLOCATION *Subtable; 850*ff879b07SJung-uk Kim 851*ff879b07SJung-uk Kim 852*ff879b07SJung-uk Kim /* Main table */ 853*ff879b07SJung-uk Kim 854*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMcfg); 855*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 856*ff879b07SJung-uk Kim { 857*ff879b07SJung-uk Kim return; 858*ff879b07SJung-uk Kim } 859*ff879b07SJung-uk Kim 860*ff879b07SJung-uk Kim /* Subtables */ 861*ff879b07SJung-uk Kim 862*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Table, Offset); 863*ff879b07SJung-uk Kim while (Offset < Table->Length) 864*ff879b07SJung-uk Kim { 865*ff879b07SJung-uk Kim if (Offset + sizeof (ACPI_MCFG_ALLOCATION) > Table->Length) 866*ff879b07SJung-uk Kim { 867*ff879b07SJung-uk Kim AcpiOsPrintf ("Warning: there are %u invalid trailing bytes\n", 868*ff879b07SJung-uk Kim sizeof (ACPI_MCFG_ALLOCATION) - (Offset - Table->Length)); 869*ff879b07SJung-uk Kim return; 870*ff879b07SJung-uk Kim } 871*ff879b07SJung-uk Kim 872*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 873*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, 874*ff879b07SJung-uk Kim sizeof (ACPI_MCFG_ALLOCATION), AcpiDmTableInfoMcfg0); 875*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 876*ff879b07SJung-uk Kim { 877*ff879b07SJung-uk Kim return; 878*ff879b07SJung-uk Kim } 879*ff879b07SJung-uk Kim 880*ff879b07SJung-uk Kim /* Point to next subtable (each subtable is of fixed length) */ 881*ff879b07SJung-uk Kim 882*ff879b07SJung-uk Kim Offset += sizeof (ACPI_MCFG_ALLOCATION); 883*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_MCFG_ALLOCATION, Subtable, 884*ff879b07SJung-uk Kim sizeof (ACPI_MCFG_ALLOCATION)); 885*ff879b07SJung-uk Kim } 886*ff879b07SJung-uk Kim } 887*ff879b07SJung-uk Kim 888*ff879b07SJung-uk Kim 889*ff879b07SJung-uk Kim /******************************************************************************* 890*ff879b07SJung-uk Kim * 891*ff879b07SJung-uk Kim * FUNCTION: AcpiDmDumpMpst 892*ff879b07SJung-uk Kim * 893*ff879b07SJung-uk Kim * PARAMETERS: Table - A MPST Table 894*ff879b07SJung-uk Kim * 895*ff879b07SJung-uk Kim * RETURN: None 896*ff879b07SJung-uk Kim * 897*ff879b07SJung-uk Kim * DESCRIPTION: Format the contents of a MPST table 898*ff879b07SJung-uk Kim * 899*ff879b07SJung-uk Kim ******************************************************************************/ 900*ff879b07SJung-uk Kim 901*ff879b07SJung-uk Kim void 902*ff879b07SJung-uk Kim AcpiDmDumpMpst ( 903*ff879b07SJung-uk Kim ACPI_TABLE_HEADER *Table) 904*ff879b07SJung-uk Kim { 905*ff879b07SJung-uk Kim ACPI_STATUS Status; 906*ff879b07SJung-uk Kim UINT32 Offset = sizeof (ACPI_TABLE_MPST); 907*ff879b07SJung-uk Kim ACPI_MPST_POWER_NODE *Subtable0; 908*ff879b07SJung-uk Kim ACPI_MPST_POWER_STATE *Subtable0A; 909*ff879b07SJung-uk Kim ACPI_MPST_COMPONENT *Subtable0B; 910*ff879b07SJung-uk Kim ACPI_MPST_DATA_HDR *Subtable1; 911*ff879b07SJung-uk Kim ACPI_MPST_POWER_DATA *Subtable2; 912*ff879b07SJung-uk Kim UINT16 SubtableCount; 913*ff879b07SJung-uk Kim UINT32 PowerStateCount; 914*ff879b07SJung-uk Kim UINT32 ComponentCount; 915*ff879b07SJung-uk Kim 916*ff879b07SJung-uk Kim 917*ff879b07SJung-uk Kim /* Main table */ 918*ff879b07SJung-uk Kim 919*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMpst); 920*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 921*ff879b07SJung-uk Kim { 922*ff879b07SJung-uk Kim return; 923*ff879b07SJung-uk Kim } 924*ff879b07SJung-uk Kim 925*ff879b07SJung-uk Kim /* Subtable: Memory Power Node(s) */ 926*ff879b07SJung-uk Kim 927*ff879b07SJung-uk Kim SubtableCount = (ACPI_CAST_PTR (ACPI_TABLE_MPST, Table))->PowerNodeCount; 928*ff879b07SJung-uk Kim Subtable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, Table, Offset); 929*ff879b07SJung-uk Kim 930*ff879b07SJung-uk Kim while ((Offset < Table->Length) && SubtableCount) 931*ff879b07SJung-uk Kim { 932*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 933*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset, Subtable0, 934*ff879b07SJung-uk Kim sizeof (ACPI_MPST_POWER_NODE), AcpiDmTableInfoMpst0); 935*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 936*ff879b07SJung-uk Kim { 937*ff879b07SJung-uk Kim return; 938*ff879b07SJung-uk Kim } 939*ff879b07SJung-uk Kim 940*ff879b07SJung-uk Kim /* Extract the sub-subtable counts */ 941*ff879b07SJung-uk Kim 942*ff879b07SJung-uk Kim PowerStateCount = Subtable0->NumPowerStates; 943*ff879b07SJung-uk Kim ComponentCount = Subtable0->NumPhysicalComponents; 944*ff879b07SJung-uk Kim Offset += sizeof (ACPI_MPST_POWER_NODE); 945*ff879b07SJung-uk Kim 946*ff879b07SJung-uk Kim /* Sub-subtables - Memory Power State Structure(s) */ 947*ff879b07SJung-uk Kim 948*ff879b07SJung-uk Kim Subtable0A = ACPI_ADD_PTR (ACPI_MPST_POWER_STATE, Subtable0, 949*ff879b07SJung-uk Kim sizeof (ACPI_MPST_POWER_NODE)); 950*ff879b07SJung-uk Kim 951*ff879b07SJung-uk Kim while (PowerStateCount) 952*ff879b07SJung-uk Kim { 953*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 954*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset, Subtable0A, 955*ff879b07SJung-uk Kim sizeof (ACPI_MPST_POWER_STATE), AcpiDmTableInfoMpst0A); 956*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 957*ff879b07SJung-uk Kim { 958*ff879b07SJung-uk Kim return; 959*ff879b07SJung-uk Kim } 960*ff879b07SJung-uk Kim 961*ff879b07SJung-uk Kim Subtable0A++; 962*ff879b07SJung-uk Kim PowerStateCount--; 963*ff879b07SJung-uk Kim Offset += sizeof (ACPI_MPST_POWER_STATE); 964*ff879b07SJung-uk Kim } 965*ff879b07SJung-uk Kim 966*ff879b07SJung-uk Kim /* Sub-subtables - Physical Component ID Structure(s) */ 967*ff879b07SJung-uk Kim 968*ff879b07SJung-uk Kim Subtable0B = ACPI_CAST_PTR (ACPI_MPST_COMPONENT, Subtable0A); 969*ff879b07SJung-uk Kim 970*ff879b07SJung-uk Kim if (ComponentCount) 971*ff879b07SJung-uk Kim { 972*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 973*ff879b07SJung-uk Kim } 974*ff879b07SJung-uk Kim 975*ff879b07SJung-uk Kim while (ComponentCount) 976*ff879b07SJung-uk Kim { 977*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset, Subtable0B, 978*ff879b07SJung-uk Kim sizeof (ACPI_MPST_COMPONENT), AcpiDmTableInfoMpst0B); 979*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 980*ff879b07SJung-uk Kim { 981*ff879b07SJung-uk Kim return; 982*ff879b07SJung-uk Kim } 983*ff879b07SJung-uk Kim 984*ff879b07SJung-uk Kim Subtable0B++; 985*ff879b07SJung-uk Kim ComponentCount--; 986*ff879b07SJung-uk Kim Offset += sizeof (ACPI_MPST_COMPONENT); 987*ff879b07SJung-uk Kim } 988*ff879b07SJung-uk Kim 989*ff879b07SJung-uk Kim /* Point to next Memory Power Node subtable */ 990*ff879b07SJung-uk Kim 991*ff879b07SJung-uk Kim SubtableCount--; 992*ff879b07SJung-uk Kim Subtable0 = ACPI_ADD_PTR (ACPI_MPST_POWER_NODE, Subtable0, 993*ff879b07SJung-uk Kim sizeof (ACPI_MPST_POWER_NODE) + 994*ff879b07SJung-uk Kim (sizeof (ACPI_MPST_POWER_STATE) * Subtable0->NumPowerStates) + 995*ff879b07SJung-uk Kim (sizeof (ACPI_MPST_COMPONENT) * Subtable0->NumPhysicalComponents)); 996*ff879b07SJung-uk Kim } 997*ff879b07SJung-uk Kim 998*ff879b07SJung-uk Kim /* Subtable: Count of Memory Power State Characteristic structures */ 999*ff879b07SJung-uk Kim 1000*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 1001*ff879b07SJung-uk Kim Subtable1 = ACPI_CAST_PTR (ACPI_MPST_DATA_HDR, Subtable0); 1002*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset, Subtable1, 1003*ff879b07SJung-uk Kim sizeof (ACPI_MPST_DATA_HDR), AcpiDmTableInfoMpst1); 1004*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1005*ff879b07SJung-uk Kim { 1006*ff879b07SJung-uk Kim return; 1007*ff879b07SJung-uk Kim } 1008*ff879b07SJung-uk Kim 1009*ff879b07SJung-uk Kim SubtableCount = Subtable1->CharacteristicsCount; 1010*ff879b07SJung-uk Kim Offset += sizeof (ACPI_MPST_DATA_HDR); 1011*ff879b07SJung-uk Kim 1012*ff879b07SJung-uk Kim /* Subtable: Memory Power State Characteristics structure(s) */ 1013*ff879b07SJung-uk Kim 1014*ff879b07SJung-uk Kim Subtable2 = ACPI_ADD_PTR (ACPI_MPST_POWER_DATA, Subtable1, 1015*ff879b07SJung-uk Kim sizeof (ACPI_MPST_DATA_HDR)); 1016*ff879b07SJung-uk Kim 1017*ff879b07SJung-uk Kim while ((Offset < Table->Length) && SubtableCount) 1018*ff879b07SJung-uk Kim { 1019*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 1020*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset, Subtable2, 1021*ff879b07SJung-uk Kim sizeof (ACPI_MPST_POWER_DATA), AcpiDmTableInfoMpst2); 1022*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1023*ff879b07SJung-uk Kim { 1024*ff879b07SJung-uk Kim return; 1025*ff879b07SJung-uk Kim } 1026*ff879b07SJung-uk Kim 1027*ff879b07SJung-uk Kim Subtable2++; 1028*ff879b07SJung-uk Kim SubtableCount--; 1029*ff879b07SJung-uk Kim Offset += sizeof (ACPI_MPST_POWER_DATA); 1030*ff879b07SJung-uk Kim } 1031*ff879b07SJung-uk Kim } 1032*ff879b07SJung-uk Kim 1033*ff879b07SJung-uk Kim 1034*ff879b07SJung-uk Kim /******************************************************************************* 1035*ff879b07SJung-uk Kim * 1036*ff879b07SJung-uk Kim * FUNCTION: AcpiDmDumpMsct 1037*ff879b07SJung-uk Kim * 1038*ff879b07SJung-uk Kim * PARAMETERS: Table - A MSCT table 1039*ff879b07SJung-uk Kim * 1040*ff879b07SJung-uk Kim * RETURN: None 1041*ff879b07SJung-uk Kim * 1042*ff879b07SJung-uk Kim * DESCRIPTION: Format the contents of a MSCT 1043*ff879b07SJung-uk Kim * 1044*ff879b07SJung-uk Kim ******************************************************************************/ 1045*ff879b07SJung-uk Kim 1046*ff879b07SJung-uk Kim void 1047*ff879b07SJung-uk Kim AcpiDmDumpMsct ( 1048*ff879b07SJung-uk Kim ACPI_TABLE_HEADER *Table) 1049*ff879b07SJung-uk Kim { 1050*ff879b07SJung-uk Kim ACPI_STATUS Status; 1051*ff879b07SJung-uk Kim UINT32 Offset = sizeof (ACPI_TABLE_MSCT); 1052*ff879b07SJung-uk Kim ACPI_MSCT_PROXIMITY *Subtable; 1053*ff879b07SJung-uk Kim 1054*ff879b07SJung-uk Kim 1055*ff879b07SJung-uk Kim /* Main table */ 1056*ff879b07SJung-uk Kim 1057*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMsct); 1058*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1059*ff879b07SJung-uk Kim { 1060*ff879b07SJung-uk Kim return; 1061*ff879b07SJung-uk Kim } 1062*ff879b07SJung-uk Kim 1063*ff879b07SJung-uk Kim /* Subtables */ 1064*ff879b07SJung-uk Kim 1065*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Table, Offset); 1066*ff879b07SJung-uk Kim while (Offset < Table->Length) 1067*ff879b07SJung-uk Kim { 1068*ff879b07SJung-uk Kim /* Common subtable header */ 1069*ff879b07SJung-uk Kim 1070*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 1071*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, 1072*ff879b07SJung-uk Kim sizeof (ACPI_MSCT_PROXIMITY), AcpiDmTableInfoMsct0); 1073*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1074*ff879b07SJung-uk Kim { 1075*ff879b07SJung-uk Kim return; 1076*ff879b07SJung-uk Kim } 1077*ff879b07SJung-uk Kim 1078*ff879b07SJung-uk Kim /* Point to next subtable */ 1079*ff879b07SJung-uk Kim 1080*ff879b07SJung-uk Kim Offset += sizeof (ACPI_MSCT_PROXIMITY); 1081*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_MSCT_PROXIMITY, Subtable, 1082*ff879b07SJung-uk Kim sizeof (ACPI_MSCT_PROXIMITY)); 1083*ff879b07SJung-uk Kim } 1084*ff879b07SJung-uk Kim } 1085*ff879b07SJung-uk Kim 1086*ff879b07SJung-uk Kim 1087*ff879b07SJung-uk Kim /******************************************************************************* 1088*ff879b07SJung-uk Kim * 1089*ff879b07SJung-uk Kim * FUNCTION: AcpiDmDumpMtmr 1090*ff879b07SJung-uk Kim * 1091*ff879b07SJung-uk Kim * PARAMETERS: Table - A MTMR table 1092*ff879b07SJung-uk Kim * 1093*ff879b07SJung-uk Kim * RETURN: None 1094*ff879b07SJung-uk Kim * 1095*ff879b07SJung-uk Kim * DESCRIPTION: Format the contents of a MTMR 1096*ff879b07SJung-uk Kim * 1097*ff879b07SJung-uk Kim ******************************************************************************/ 1098*ff879b07SJung-uk Kim 1099*ff879b07SJung-uk Kim void 1100*ff879b07SJung-uk Kim AcpiDmDumpMtmr ( 1101*ff879b07SJung-uk Kim ACPI_TABLE_HEADER *Table) 1102*ff879b07SJung-uk Kim { 1103*ff879b07SJung-uk Kim ACPI_STATUS Status; 1104*ff879b07SJung-uk Kim UINT32 Offset = sizeof (ACPI_TABLE_MTMR); 1105*ff879b07SJung-uk Kim ACPI_MTMR_ENTRY *Subtable; 1106*ff879b07SJung-uk Kim 1107*ff879b07SJung-uk Kim 1108*ff879b07SJung-uk Kim /* Main table */ 1109*ff879b07SJung-uk Kim 1110*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoMtmr); 1111*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1112*ff879b07SJung-uk Kim { 1113*ff879b07SJung-uk Kim return; 1114*ff879b07SJung-uk Kim } 1115*ff879b07SJung-uk Kim 1116*ff879b07SJung-uk Kim /* Subtables */ 1117*ff879b07SJung-uk Kim 1118*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, Table, Offset); 1119*ff879b07SJung-uk Kim while (Offset < Table->Length) 1120*ff879b07SJung-uk Kim { 1121*ff879b07SJung-uk Kim /* Common subtable header */ 1122*ff879b07SJung-uk Kim 1123*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 1124*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, 1125*ff879b07SJung-uk Kim sizeof (ACPI_MTMR_ENTRY), AcpiDmTableInfoMtmr0); 1126*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1127*ff879b07SJung-uk Kim { 1128*ff879b07SJung-uk Kim return; 1129*ff879b07SJung-uk Kim } 1130*ff879b07SJung-uk Kim 1131*ff879b07SJung-uk Kim /* Point to next subtable */ 1132*ff879b07SJung-uk Kim 1133*ff879b07SJung-uk Kim Offset += sizeof (ACPI_MTMR_ENTRY); 1134*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_MTMR_ENTRY, Subtable, 1135*ff879b07SJung-uk Kim sizeof (ACPI_MTMR_ENTRY)); 1136*ff879b07SJung-uk Kim } 1137*ff879b07SJung-uk Kim } 1138*ff879b07SJung-uk Kim 1139*ff879b07SJung-uk Kim 1140*ff879b07SJung-uk Kim /******************************************************************************* 1141*ff879b07SJung-uk Kim * 1142*ff879b07SJung-uk Kim * FUNCTION: AcpiDmDumpNfit 1143*ff879b07SJung-uk Kim * 1144*ff879b07SJung-uk Kim * PARAMETERS: Table - A NFIT table 1145*ff879b07SJung-uk Kim * 1146*ff879b07SJung-uk Kim * RETURN: None 1147*ff879b07SJung-uk Kim * 1148*ff879b07SJung-uk Kim * DESCRIPTION: Format the contents of an NFIT. 1149*ff879b07SJung-uk Kim * 1150*ff879b07SJung-uk Kim ******************************************************************************/ 1151*ff879b07SJung-uk Kim 1152*ff879b07SJung-uk Kim void 1153*ff879b07SJung-uk Kim AcpiDmDumpNfit ( 1154*ff879b07SJung-uk Kim ACPI_TABLE_HEADER *Table) 1155*ff879b07SJung-uk Kim { 1156*ff879b07SJung-uk Kim ACPI_STATUS Status; 1157*ff879b07SJung-uk Kim UINT32 Offset = sizeof (ACPI_TABLE_NFIT); 1158*ff879b07SJung-uk Kim UINT32 FieldOffset = 0; 1159*ff879b07SJung-uk Kim UINT32 Length; 1160*ff879b07SJung-uk Kim ACPI_NFIT_HEADER *Subtable; 1161*ff879b07SJung-uk Kim ACPI_DMTABLE_INFO *InfoTable; 1162*ff879b07SJung-uk Kim ACPI_NFIT_INTERLEAVE *Interleave = NULL; 1163*ff879b07SJung-uk Kim ACPI_NFIT_SMBIOS *SmbiosInfo = NULL; 1164*ff879b07SJung-uk Kim ACPI_NFIT_FLUSH_ADDRESS *Hint = NULL; 1165*ff879b07SJung-uk Kim UINT32 i; 1166*ff879b07SJung-uk Kim 1167*ff879b07SJung-uk Kim 1168*ff879b07SJung-uk Kim /* Main table */ 1169*ff879b07SJung-uk Kim 1170*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoNfit); 1171*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1172*ff879b07SJung-uk Kim { 1173*ff879b07SJung-uk Kim return; 1174*ff879b07SJung-uk Kim } 1175*ff879b07SJung-uk Kim 1176*ff879b07SJung-uk Kim /* Subtables */ 1177*ff879b07SJung-uk Kim 1178*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, Table, Offset); 1179*ff879b07SJung-uk Kim while (Offset < Table->Length) 1180*ff879b07SJung-uk Kim { 1181*ff879b07SJung-uk Kim /* NFIT subtable header */ 1182*ff879b07SJung-uk Kim 1183*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 1184*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, 1185*ff879b07SJung-uk Kim Subtable->Length, AcpiDmTableInfoNfitHdr); 1186*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1187*ff879b07SJung-uk Kim { 1188*ff879b07SJung-uk Kim return; 1189*ff879b07SJung-uk Kim } 1190*ff879b07SJung-uk Kim 1191*ff879b07SJung-uk Kim switch (Subtable->Type) 1192*ff879b07SJung-uk Kim { 1193*ff879b07SJung-uk Kim case ACPI_NFIT_TYPE_SYSTEM_ADDRESS: 1194*ff879b07SJung-uk Kim 1195*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoNfit0; 1196*ff879b07SJung-uk Kim break; 1197*ff879b07SJung-uk Kim 1198*ff879b07SJung-uk Kim case ACPI_NFIT_TYPE_MEMORY_MAP: 1199*ff879b07SJung-uk Kim 1200*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoNfit1; 1201*ff879b07SJung-uk Kim break; 1202*ff879b07SJung-uk Kim 1203*ff879b07SJung-uk Kim case ACPI_NFIT_TYPE_INTERLEAVE: 1204*ff879b07SJung-uk Kim 1205*ff879b07SJung-uk Kim /* Has a variable number of 32-bit values at the end */ 1206*ff879b07SJung-uk Kim 1207*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoNfit2; 1208*ff879b07SJung-uk Kim Interleave = ACPI_CAST_PTR (ACPI_NFIT_INTERLEAVE, Subtable); 1209*ff879b07SJung-uk Kim FieldOffset = sizeof (ACPI_NFIT_INTERLEAVE); 1210*ff879b07SJung-uk Kim break; 1211*ff879b07SJung-uk Kim 1212*ff879b07SJung-uk Kim case ACPI_NFIT_TYPE_SMBIOS: 1213*ff879b07SJung-uk Kim 1214*ff879b07SJung-uk Kim SmbiosInfo = ACPI_CAST_PTR (ACPI_NFIT_SMBIOS, Subtable); 1215*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoNfit3; 1216*ff879b07SJung-uk Kim break; 1217*ff879b07SJung-uk Kim 1218*ff879b07SJung-uk Kim case ACPI_NFIT_TYPE_CONTROL_REGION: 1219*ff879b07SJung-uk Kim 1220*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoNfit4; 1221*ff879b07SJung-uk Kim break; 1222*ff879b07SJung-uk Kim 1223*ff879b07SJung-uk Kim case ACPI_NFIT_TYPE_DATA_REGION: 1224*ff879b07SJung-uk Kim 1225*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoNfit5; 1226*ff879b07SJung-uk Kim break; 1227*ff879b07SJung-uk Kim 1228*ff879b07SJung-uk Kim case ACPI_NFIT_TYPE_FLUSH_ADDRESS: 1229*ff879b07SJung-uk Kim 1230*ff879b07SJung-uk Kim /* Has a variable number of 64-bit addresses at the end */ 1231*ff879b07SJung-uk Kim 1232*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoNfit6; 1233*ff879b07SJung-uk Kim Hint = ACPI_CAST_PTR (ACPI_NFIT_FLUSH_ADDRESS, Subtable); 1234*ff879b07SJung-uk Kim FieldOffset = sizeof (ACPI_NFIT_FLUSH_ADDRESS) - sizeof (UINT64); 1235*ff879b07SJung-uk Kim break; 1236*ff879b07SJung-uk Kim 1237*ff879b07SJung-uk Kim case ACPI_NFIT_TYPE_CAPABILITIES: /* ACPI 6.0A */ 1238*ff879b07SJung-uk Kim 1239*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoNfit7; 1240*ff879b07SJung-uk Kim break; 1241*ff879b07SJung-uk Kim 1242*ff879b07SJung-uk Kim default: 1243*ff879b07SJung-uk Kim AcpiOsPrintf ("\n**** Unknown NFIT subtable type 0x%X\n", 1244*ff879b07SJung-uk Kim Subtable->Type); 1245*ff879b07SJung-uk Kim 1246*ff879b07SJung-uk Kim /* Attempt to continue */ 1247*ff879b07SJung-uk Kim 1248*ff879b07SJung-uk Kim if (!Subtable->Length) 1249*ff879b07SJung-uk Kim { 1250*ff879b07SJung-uk Kim AcpiOsPrintf ("Invalid zero length subtable\n"); 1251*ff879b07SJung-uk Kim return; 1252*ff879b07SJung-uk Kim } 1253*ff879b07SJung-uk Kim goto NextSubtable; 1254*ff879b07SJung-uk Kim } 1255*ff879b07SJung-uk Kim 1256*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 1257*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, 1258*ff879b07SJung-uk Kim Subtable->Length, InfoTable); 1259*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1260*ff879b07SJung-uk Kim { 1261*ff879b07SJung-uk Kim return; 1262*ff879b07SJung-uk Kim } 1263*ff879b07SJung-uk Kim 1264*ff879b07SJung-uk Kim /* Per-subtable variable-length fields */ 1265*ff879b07SJung-uk Kim 1266*ff879b07SJung-uk Kim switch (Subtable->Type) 1267*ff879b07SJung-uk Kim { 1268*ff879b07SJung-uk Kim case ACPI_NFIT_TYPE_INTERLEAVE: 1269*ff879b07SJung-uk Kim 1270*ff879b07SJung-uk Kim for (i = 0; i < Interleave->LineCount; i++) 1271*ff879b07SJung-uk Kim { 1272*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset, 1273*ff879b07SJung-uk Kim &Interleave->LineOffset[i], 1274*ff879b07SJung-uk Kim sizeof (UINT32), AcpiDmTableInfoNfit2a); 1275*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1276*ff879b07SJung-uk Kim { 1277*ff879b07SJung-uk Kim return; 1278*ff879b07SJung-uk Kim } 1279*ff879b07SJung-uk Kim 1280*ff879b07SJung-uk Kim FieldOffset += sizeof (UINT32); 1281*ff879b07SJung-uk Kim } 1282*ff879b07SJung-uk Kim break; 1283*ff879b07SJung-uk Kim 1284*ff879b07SJung-uk Kim case ACPI_NFIT_TYPE_SMBIOS: 1285*ff879b07SJung-uk Kim 1286*ff879b07SJung-uk Kim Length = Subtable->Length - 1287*ff879b07SJung-uk Kim sizeof (ACPI_NFIT_SMBIOS) + sizeof (UINT8); 1288*ff879b07SJung-uk Kim 1289*ff879b07SJung-uk Kim if (Length) 1290*ff879b07SJung-uk Kim { 1291*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, 1292*ff879b07SJung-uk Kim sizeof (ACPI_NFIT_SMBIOS) - sizeof (UINT8), 1293*ff879b07SJung-uk Kim SmbiosInfo, 1294*ff879b07SJung-uk Kim Length, AcpiDmTableInfoNfit3a); 1295*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1296*ff879b07SJung-uk Kim { 1297*ff879b07SJung-uk Kim return; 1298*ff879b07SJung-uk Kim } 1299*ff879b07SJung-uk Kim } 1300*ff879b07SJung-uk Kim 1301*ff879b07SJung-uk Kim break; 1302*ff879b07SJung-uk Kim 1303*ff879b07SJung-uk Kim case ACPI_NFIT_TYPE_FLUSH_ADDRESS: 1304*ff879b07SJung-uk Kim 1305*ff879b07SJung-uk Kim for (i = 0; i < Hint->HintCount; i++) 1306*ff879b07SJung-uk Kim { 1307*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset, 1308*ff879b07SJung-uk Kim &Hint->HintAddress[i], 1309*ff879b07SJung-uk Kim sizeof (UINT64), AcpiDmTableInfoNfit6a); 1310*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1311*ff879b07SJung-uk Kim { 1312*ff879b07SJung-uk Kim return; 1313*ff879b07SJung-uk Kim } 1314*ff879b07SJung-uk Kim 1315*ff879b07SJung-uk Kim FieldOffset += sizeof (UINT64); 1316*ff879b07SJung-uk Kim } 1317*ff879b07SJung-uk Kim break; 1318*ff879b07SJung-uk Kim 1319*ff879b07SJung-uk Kim default: 1320*ff879b07SJung-uk Kim break; 1321*ff879b07SJung-uk Kim } 1322*ff879b07SJung-uk Kim 1323*ff879b07SJung-uk Kim NextSubtable: 1324*ff879b07SJung-uk Kim /* Point to next subtable */ 1325*ff879b07SJung-uk Kim 1326*ff879b07SJung-uk Kim Offset += Subtable->Length; 1327*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_NFIT_HEADER, Subtable, Subtable->Length); 1328*ff879b07SJung-uk Kim } 1329*ff879b07SJung-uk Kim } 1330*ff879b07SJung-uk Kim 1331*ff879b07SJung-uk Kim 1332*ff879b07SJung-uk Kim /******************************************************************************* 1333*ff879b07SJung-uk Kim * 1334*ff879b07SJung-uk Kim * FUNCTION: AcpiDmDumpPcct 1335*ff879b07SJung-uk Kim * 1336*ff879b07SJung-uk Kim * PARAMETERS: Table - A PCCT table 1337*ff879b07SJung-uk Kim * 1338*ff879b07SJung-uk Kim * RETURN: None 1339*ff879b07SJung-uk Kim * 1340*ff879b07SJung-uk Kim * DESCRIPTION: Format the contents of a PCCT. This table type consists 1341*ff879b07SJung-uk Kim * of an open-ended number of subtables. 1342*ff879b07SJung-uk Kim * 1343*ff879b07SJung-uk Kim ******************************************************************************/ 1344*ff879b07SJung-uk Kim 1345*ff879b07SJung-uk Kim void 1346*ff879b07SJung-uk Kim AcpiDmDumpPcct ( 1347*ff879b07SJung-uk Kim ACPI_TABLE_HEADER *Table) 1348*ff879b07SJung-uk Kim { 1349*ff879b07SJung-uk Kim ACPI_STATUS Status; 1350*ff879b07SJung-uk Kim ACPI_PCCT_SUBSPACE *Subtable; 1351*ff879b07SJung-uk Kim ACPI_DMTABLE_INFO *InfoTable; 1352*ff879b07SJung-uk Kim UINT32 Length = Table->Length; 1353*ff879b07SJung-uk Kim UINT32 Offset = sizeof (ACPI_TABLE_PCCT); 1354*ff879b07SJung-uk Kim 1355*ff879b07SJung-uk Kim 1356*ff879b07SJung-uk Kim /* Main table */ 1357*ff879b07SJung-uk Kim 1358*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPcct); 1359*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1360*ff879b07SJung-uk Kim { 1361*ff879b07SJung-uk Kim return; 1362*ff879b07SJung-uk Kim } 1363*ff879b07SJung-uk Kim 1364*ff879b07SJung-uk Kim /* Subtables */ 1365*ff879b07SJung-uk Kim 1366*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Table, Offset); 1367*ff879b07SJung-uk Kim while (Offset < Table->Length) 1368*ff879b07SJung-uk Kim { 1369*ff879b07SJung-uk Kim /* Common subtable header */ 1370*ff879b07SJung-uk Kim 1371*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 1372*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, Offset, Subtable, 1373*ff879b07SJung-uk Kim Subtable->Header.Length, AcpiDmTableInfoPcctHdr); 1374*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1375*ff879b07SJung-uk Kim { 1376*ff879b07SJung-uk Kim return; 1377*ff879b07SJung-uk Kim } 1378*ff879b07SJung-uk Kim 1379*ff879b07SJung-uk Kim switch (Subtable->Header.Type) 1380*ff879b07SJung-uk Kim { 1381*ff879b07SJung-uk Kim case ACPI_PCCT_TYPE_GENERIC_SUBSPACE: 1382*ff879b07SJung-uk Kim 1383*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoPcct0; 1384*ff879b07SJung-uk Kim break; 1385*ff879b07SJung-uk Kim 1386*ff879b07SJung-uk Kim case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE: 1387*ff879b07SJung-uk Kim 1388*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoPcct1; 1389*ff879b07SJung-uk Kim break; 1390*ff879b07SJung-uk Kim 1391*ff879b07SJung-uk Kim case ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE_TYPE2: 1392*ff879b07SJung-uk Kim 1393*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoPcct2; 1394*ff879b07SJung-uk Kim break; 1395*ff879b07SJung-uk Kim 1396*ff879b07SJung-uk Kim case ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE: 1397*ff879b07SJung-uk Kim 1398*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoPcct3; 1399*ff879b07SJung-uk Kim break; 1400*ff879b07SJung-uk Kim 1401*ff879b07SJung-uk Kim case ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE: 1402*ff879b07SJung-uk Kim 1403*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoPcct4; 1404*ff879b07SJung-uk Kim break; 1405*ff879b07SJung-uk Kim 1406*ff879b07SJung-uk Kim default: 1407*ff879b07SJung-uk Kim 1408*ff879b07SJung-uk Kim AcpiOsPrintf ( 1409*ff879b07SJung-uk Kim "\n**** Unexpected or unknown PCCT subtable type 0x%X\n\n", 1410*ff879b07SJung-uk Kim Subtable->Header.Type); 1411*ff879b07SJung-uk Kim return; 1412*ff879b07SJung-uk Kim } 1413*ff879b07SJung-uk Kim 1414*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 1415*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, Offset, Subtable, 1416*ff879b07SJung-uk Kim Subtable->Header.Length, InfoTable); 1417*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1418*ff879b07SJung-uk Kim { 1419*ff879b07SJung-uk Kim return; 1420*ff879b07SJung-uk Kim } 1421*ff879b07SJung-uk Kim 1422*ff879b07SJung-uk Kim /* Point to next subtable */ 1423*ff879b07SJung-uk Kim 1424*ff879b07SJung-uk Kim Offset += Subtable->Header.Length; 1425*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_PCCT_SUBSPACE, Subtable, 1426*ff879b07SJung-uk Kim Subtable->Header.Length); 1427*ff879b07SJung-uk Kim } 1428*ff879b07SJung-uk Kim } 1429*ff879b07SJung-uk Kim 1430*ff879b07SJung-uk Kim 1431*ff879b07SJung-uk Kim /******************************************************************************* 1432*ff879b07SJung-uk Kim * 1433*ff879b07SJung-uk Kim * FUNCTION: AcpiDmDumpPdtt 1434*ff879b07SJung-uk Kim * 1435*ff879b07SJung-uk Kim * PARAMETERS: Table - A PDTT table 1436*ff879b07SJung-uk Kim * 1437*ff879b07SJung-uk Kim * RETURN: None 1438*ff879b07SJung-uk Kim * 1439*ff879b07SJung-uk Kim * DESCRIPTION: Format the contents of a Pdtt. This is a variable-length 1440*ff879b07SJung-uk Kim * table that contains an open-ended number of IDs 1441*ff879b07SJung-uk Kim * at the end of the table. 1442*ff879b07SJung-uk Kim * 1443*ff879b07SJung-uk Kim ******************************************************************************/ 1444*ff879b07SJung-uk Kim 1445*ff879b07SJung-uk Kim void 1446*ff879b07SJung-uk Kim AcpiDmDumpPdtt ( 1447*ff879b07SJung-uk Kim ACPI_TABLE_HEADER *Table) 1448*ff879b07SJung-uk Kim { 1449*ff879b07SJung-uk Kim ACPI_STATUS Status; 1450*ff879b07SJung-uk Kim ACPI_PDTT_CHANNEL *Subtable; 1451*ff879b07SJung-uk Kim UINT32 Length = Table->Length; 1452*ff879b07SJung-uk Kim UINT32 Offset = sizeof (ACPI_TABLE_PDTT); 1453*ff879b07SJung-uk Kim 1454*ff879b07SJung-uk Kim 1455*ff879b07SJung-uk Kim /* Main table */ 1456*ff879b07SJung-uk Kim 1457*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPdtt); 1458*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1459*ff879b07SJung-uk Kim { 1460*ff879b07SJung-uk Kim return; 1461*ff879b07SJung-uk Kim } 1462*ff879b07SJung-uk Kim 1463*ff879b07SJung-uk Kim /* Subtables. Currently there is only one type, but can be multiples */ 1464*ff879b07SJung-uk Kim 1465*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_PDTT_CHANNEL, Table, Offset); 1466*ff879b07SJung-uk Kim while (Offset < Table->Length) 1467*ff879b07SJung-uk Kim { 1468*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 1469*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, Offset, Subtable, 1470*ff879b07SJung-uk Kim sizeof (ACPI_PDTT_CHANNEL), AcpiDmTableInfoPdtt0); 1471*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1472*ff879b07SJung-uk Kim { 1473*ff879b07SJung-uk Kim return; 1474*ff879b07SJung-uk Kim } 1475*ff879b07SJung-uk Kim 1476*ff879b07SJung-uk Kim /* Point to next subtable */ 1477*ff879b07SJung-uk Kim 1478*ff879b07SJung-uk Kim Offset += sizeof (ACPI_PDTT_CHANNEL); 1479*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_PDTT_CHANNEL, Subtable, 1480*ff879b07SJung-uk Kim sizeof (ACPI_PDTT_CHANNEL)); 1481*ff879b07SJung-uk Kim } 1482*ff879b07SJung-uk Kim } 1483*ff879b07SJung-uk Kim 1484*ff879b07SJung-uk Kim 1485*ff879b07SJung-uk Kim /******************************************************************************* 1486*ff879b07SJung-uk Kim * 1487*ff879b07SJung-uk Kim * FUNCTION: AcpiDmDumpPmtt 1488*ff879b07SJung-uk Kim * 1489*ff879b07SJung-uk Kim * PARAMETERS: Table - A PMTT table 1490*ff879b07SJung-uk Kim * 1491*ff879b07SJung-uk Kim * RETURN: None 1492*ff879b07SJung-uk Kim * 1493*ff879b07SJung-uk Kim * DESCRIPTION: Format the contents of a PMTT. This table type consists 1494*ff879b07SJung-uk Kim * of an open-ended number of subtables. 1495*ff879b07SJung-uk Kim * 1496*ff879b07SJung-uk Kim ******************************************************************************/ 1497*ff879b07SJung-uk Kim 1498*ff879b07SJung-uk Kim void 1499*ff879b07SJung-uk Kim AcpiDmDumpPmtt ( 1500*ff879b07SJung-uk Kim ACPI_TABLE_HEADER *Table) 1501*ff879b07SJung-uk Kim { 1502*ff879b07SJung-uk Kim ACPI_STATUS Status; 1503*ff879b07SJung-uk Kim ACPI_PMTT_HEADER *Subtable; 1504*ff879b07SJung-uk Kim ACPI_PMTT_HEADER *MemSubtable; 1505*ff879b07SJung-uk Kim ACPI_PMTT_HEADER *DimmSubtable; 1506*ff879b07SJung-uk Kim ACPI_PMTT_DOMAIN *DomainArray; 1507*ff879b07SJung-uk Kim UINT32 Length = Table->Length; 1508*ff879b07SJung-uk Kim UINT32 Offset = sizeof (ACPI_TABLE_PMTT); 1509*ff879b07SJung-uk Kim UINT32 MemOffset; 1510*ff879b07SJung-uk Kim UINT32 DimmOffset; 1511*ff879b07SJung-uk Kim UINT32 DomainOffset; 1512*ff879b07SJung-uk Kim UINT32 DomainCount; 1513*ff879b07SJung-uk Kim 1514*ff879b07SJung-uk Kim 1515*ff879b07SJung-uk Kim /* Main table */ 1516*ff879b07SJung-uk Kim 1517*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoPmtt); 1518*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1519*ff879b07SJung-uk Kim { 1520*ff879b07SJung-uk Kim return; 1521*ff879b07SJung-uk Kim } 1522*ff879b07SJung-uk Kim 1523*ff879b07SJung-uk Kim /* Subtables */ 1524*ff879b07SJung-uk Kim 1525*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Table, Offset); 1526*ff879b07SJung-uk Kim while (Offset < Table->Length) 1527*ff879b07SJung-uk Kim { 1528*ff879b07SJung-uk Kim /* Common subtable header */ 1529*ff879b07SJung-uk Kim 1530*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 1531*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, Offset, Subtable, 1532*ff879b07SJung-uk Kim Subtable->Length, AcpiDmTableInfoPmttHdr); 1533*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1534*ff879b07SJung-uk Kim { 1535*ff879b07SJung-uk Kim return; 1536*ff879b07SJung-uk Kim } 1537*ff879b07SJung-uk Kim 1538*ff879b07SJung-uk Kim /* Only Socket subtables are expected at this level */ 1539*ff879b07SJung-uk Kim 1540*ff879b07SJung-uk Kim if (Subtable->Type != ACPI_PMTT_TYPE_SOCKET) 1541*ff879b07SJung-uk Kim { 1542*ff879b07SJung-uk Kim AcpiOsPrintf ( 1543*ff879b07SJung-uk Kim "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n", 1544*ff879b07SJung-uk Kim Subtable->Type); 1545*ff879b07SJung-uk Kim return; 1546*ff879b07SJung-uk Kim } 1547*ff879b07SJung-uk Kim 1548*ff879b07SJung-uk Kim /* Dump the fixed-length portion of the subtable */ 1549*ff879b07SJung-uk Kim 1550*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, Offset, Subtable, 1551*ff879b07SJung-uk Kim Subtable->Length, AcpiDmTableInfoPmtt0); 1552*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1553*ff879b07SJung-uk Kim { 1554*ff879b07SJung-uk Kim return; 1555*ff879b07SJung-uk Kim } 1556*ff879b07SJung-uk Kim 1557*ff879b07SJung-uk Kim /* Walk the memory controller subtables */ 1558*ff879b07SJung-uk Kim 1559*ff879b07SJung-uk Kim MemOffset = sizeof (ACPI_PMTT_SOCKET); 1560*ff879b07SJung-uk Kim MemSubtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, Subtable, 1561*ff879b07SJung-uk Kim sizeof (ACPI_PMTT_SOCKET)); 1562*ff879b07SJung-uk Kim 1563*ff879b07SJung-uk Kim while (((Offset + MemOffset) < Table->Length) && 1564*ff879b07SJung-uk Kim (MemOffset < Subtable->Length)) 1565*ff879b07SJung-uk Kim { 1566*ff879b07SJung-uk Kim /* Common subtable header */ 1567*ff879b07SJung-uk Kim 1568*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 1569*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, 1570*ff879b07SJung-uk Kim Offset + MemOffset, MemSubtable, 1571*ff879b07SJung-uk Kim MemSubtable->Length, AcpiDmTableInfoPmttHdr); 1572*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1573*ff879b07SJung-uk Kim { 1574*ff879b07SJung-uk Kim return; 1575*ff879b07SJung-uk Kim } 1576*ff879b07SJung-uk Kim 1577*ff879b07SJung-uk Kim /* Only memory controller subtables are expected at this level */ 1578*ff879b07SJung-uk Kim 1579*ff879b07SJung-uk Kim if (MemSubtable->Type != ACPI_PMTT_TYPE_CONTROLLER) 1580*ff879b07SJung-uk Kim { 1581*ff879b07SJung-uk Kim AcpiOsPrintf ( 1582*ff879b07SJung-uk Kim "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n", 1583*ff879b07SJung-uk Kim MemSubtable->Type); 1584*ff879b07SJung-uk Kim return; 1585*ff879b07SJung-uk Kim } 1586*ff879b07SJung-uk Kim 1587*ff879b07SJung-uk Kim /* Dump the fixed-length portion of the controller subtable */ 1588*ff879b07SJung-uk Kim 1589*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, 1590*ff879b07SJung-uk Kim Offset + MemOffset, MemSubtable, 1591*ff879b07SJung-uk Kim MemSubtable->Length, AcpiDmTableInfoPmtt1); 1592*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1593*ff879b07SJung-uk Kim { 1594*ff879b07SJung-uk Kim return; 1595*ff879b07SJung-uk Kim } 1596*ff879b07SJung-uk Kim 1597*ff879b07SJung-uk Kim /* Walk the variable count of proximity domains */ 1598*ff879b07SJung-uk Kim 1599*ff879b07SJung-uk Kim DomainCount = ((ACPI_PMTT_CONTROLLER *) MemSubtable)->DomainCount; 1600*ff879b07SJung-uk Kim DomainOffset = sizeof (ACPI_PMTT_CONTROLLER); 1601*ff879b07SJung-uk Kim DomainArray = ACPI_ADD_PTR (ACPI_PMTT_DOMAIN, MemSubtable, 1602*ff879b07SJung-uk Kim sizeof (ACPI_PMTT_CONTROLLER)); 1603*ff879b07SJung-uk Kim 1604*ff879b07SJung-uk Kim while (((Offset + MemOffset + DomainOffset) < Table->Length) && 1605*ff879b07SJung-uk Kim ((MemOffset + DomainOffset) < Subtable->Length) && 1606*ff879b07SJung-uk Kim DomainCount) 1607*ff879b07SJung-uk Kim { 1608*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, 1609*ff879b07SJung-uk Kim Offset + MemOffset + DomainOffset, DomainArray, 1610*ff879b07SJung-uk Kim sizeof (ACPI_PMTT_DOMAIN), AcpiDmTableInfoPmtt1a); 1611*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1612*ff879b07SJung-uk Kim { 1613*ff879b07SJung-uk Kim return; 1614*ff879b07SJung-uk Kim } 1615*ff879b07SJung-uk Kim 1616*ff879b07SJung-uk Kim DomainOffset += sizeof (ACPI_PMTT_DOMAIN); 1617*ff879b07SJung-uk Kim DomainArray++; 1618*ff879b07SJung-uk Kim DomainCount--; 1619*ff879b07SJung-uk Kim } 1620*ff879b07SJung-uk Kim 1621*ff879b07SJung-uk Kim if (DomainCount) 1622*ff879b07SJung-uk Kim { 1623*ff879b07SJung-uk Kim AcpiOsPrintf ( 1624*ff879b07SJung-uk Kim "\n**** DomainCount exceeds subtable length\n\n"); 1625*ff879b07SJung-uk Kim } 1626*ff879b07SJung-uk Kim 1627*ff879b07SJung-uk Kim /* Walk the physical component (DIMM) subtables */ 1628*ff879b07SJung-uk Kim 1629*ff879b07SJung-uk Kim DimmOffset = DomainOffset; 1630*ff879b07SJung-uk Kim DimmSubtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, MemSubtable, 1631*ff879b07SJung-uk Kim DomainOffset); 1632*ff879b07SJung-uk Kim 1633*ff879b07SJung-uk Kim while (((Offset + MemOffset + DimmOffset) < Table->Length) && 1634*ff879b07SJung-uk Kim (DimmOffset < MemSubtable->Length)) 1635*ff879b07SJung-uk Kim { 1636*ff879b07SJung-uk Kim /* Common subtable header */ 1637*ff879b07SJung-uk Kim 1638*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 1639*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, 1640*ff879b07SJung-uk Kim Offset + MemOffset + DimmOffset, DimmSubtable, 1641*ff879b07SJung-uk Kim DimmSubtable->Length, AcpiDmTableInfoPmttHdr); 1642*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1643*ff879b07SJung-uk Kim { 1644*ff879b07SJung-uk Kim return; 1645*ff879b07SJung-uk Kim } 1646*ff879b07SJung-uk Kim 1647*ff879b07SJung-uk Kim /* Only DIMM subtables are expected at this level */ 1648*ff879b07SJung-uk Kim 1649*ff879b07SJung-uk Kim if (DimmSubtable->Type != ACPI_PMTT_TYPE_DIMM) 1650*ff879b07SJung-uk Kim { 1651*ff879b07SJung-uk Kim AcpiOsPrintf ( 1652*ff879b07SJung-uk Kim "\n**** Unexpected or unknown PMTT subtable type 0x%X\n\n", 1653*ff879b07SJung-uk Kim DimmSubtable->Type); 1654*ff879b07SJung-uk Kim return; 1655*ff879b07SJung-uk Kim } 1656*ff879b07SJung-uk Kim 1657*ff879b07SJung-uk Kim /* Dump the fixed-length DIMM subtable */ 1658*ff879b07SJung-uk Kim 1659*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, 1660*ff879b07SJung-uk Kim Offset + MemOffset + DimmOffset, DimmSubtable, 1661*ff879b07SJung-uk Kim DimmSubtable->Length, AcpiDmTableInfoPmtt2); 1662*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1663*ff879b07SJung-uk Kim { 1664*ff879b07SJung-uk Kim return; 1665*ff879b07SJung-uk Kim } 1666*ff879b07SJung-uk Kim 1667*ff879b07SJung-uk Kim /* Point to next DIMM subtable */ 1668*ff879b07SJung-uk Kim 1669*ff879b07SJung-uk Kim DimmOffset += DimmSubtable->Length; 1670*ff879b07SJung-uk Kim DimmSubtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, 1671*ff879b07SJung-uk Kim DimmSubtable, DimmSubtable->Length); 1672*ff879b07SJung-uk Kim } 1673*ff879b07SJung-uk Kim 1674*ff879b07SJung-uk Kim /* Point to next Controller subtable */ 1675*ff879b07SJung-uk Kim 1676*ff879b07SJung-uk Kim MemOffset += MemSubtable->Length; 1677*ff879b07SJung-uk Kim MemSubtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, 1678*ff879b07SJung-uk Kim MemSubtable, MemSubtable->Length); 1679*ff879b07SJung-uk Kim } 1680*ff879b07SJung-uk Kim 1681*ff879b07SJung-uk Kim /* Point to next Socket subtable */ 1682*ff879b07SJung-uk Kim 1683*ff879b07SJung-uk Kim Offset += Subtable->Length; 1684*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_PMTT_HEADER, 1685*ff879b07SJung-uk Kim Subtable, Subtable->Length); 1686*ff879b07SJung-uk Kim } 1687*ff879b07SJung-uk Kim } 1688*ff879b07SJung-uk Kim 1689*ff879b07SJung-uk Kim 1690*ff879b07SJung-uk Kim /******************************************************************************* 1691*ff879b07SJung-uk Kim * 1692*ff879b07SJung-uk Kim * FUNCTION: AcpiDmDumpPptt 1693*ff879b07SJung-uk Kim * 1694*ff879b07SJung-uk Kim * PARAMETERS: Table - A PMTT table 1695*ff879b07SJung-uk Kim * 1696*ff879b07SJung-uk Kim * RETURN: None 1697*ff879b07SJung-uk Kim * 1698*ff879b07SJung-uk Kim * DESCRIPTION: Format the contents of a PPTT. This table type consists 1699*ff879b07SJung-uk Kim * of an open-ended number of subtables. 1700*ff879b07SJung-uk Kim * 1701*ff879b07SJung-uk Kim ******************************************************************************/ 1702*ff879b07SJung-uk Kim 1703*ff879b07SJung-uk Kim void 1704*ff879b07SJung-uk Kim AcpiDmDumpPptt ( 1705*ff879b07SJung-uk Kim ACPI_TABLE_HEADER *Table) 1706*ff879b07SJung-uk Kim { 1707*ff879b07SJung-uk Kim ACPI_STATUS Status; 1708*ff879b07SJung-uk Kim ACPI_SUBTABLE_HEADER *Subtable; 1709*ff879b07SJung-uk Kim ACPI_PPTT_PROCESSOR *PpttProcessor; 1710*ff879b07SJung-uk Kim UINT8 Length; 1711*ff879b07SJung-uk Kim UINT8 SubtableOffset; 1712*ff879b07SJung-uk Kim UINT32 Offset = sizeof (ACPI_TABLE_FPDT); 1713*ff879b07SJung-uk Kim ACPI_DMTABLE_INFO *InfoTable; 1714*ff879b07SJung-uk Kim UINT32 i; 1715*ff879b07SJung-uk Kim 1716*ff879b07SJung-uk Kim 1717*ff879b07SJung-uk Kim /* There is no main table (other than the standard ACPI header) */ 1718*ff879b07SJung-uk Kim 1719*ff879b07SJung-uk Kim /* Subtables */ 1720*ff879b07SJung-uk Kim 1721*ff879b07SJung-uk Kim Offset = sizeof (ACPI_TABLE_HEADER); 1722*ff879b07SJung-uk Kim while (Offset < Table->Length) 1723*ff879b07SJung-uk Kim { 1724*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 1725*ff879b07SJung-uk Kim 1726*ff879b07SJung-uk Kim /* Common subtable header */ 1727*ff879b07SJung-uk Kim 1728*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Table, Offset); 1729*ff879b07SJung-uk Kim if (Subtable->Length < sizeof (ACPI_SUBTABLE_HEADER)) 1730*ff879b07SJung-uk Kim { 1731*ff879b07SJung-uk Kim AcpiOsPrintf ("Invalid subtable length\n"); 1732*ff879b07SJung-uk Kim return; 1733*ff879b07SJung-uk Kim } 1734*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, 1735*ff879b07SJung-uk Kim Subtable->Length, AcpiDmTableInfoPpttHdr); 1736*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1737*ff879b07SJung-uk Kim { 1738*ff879b07SJung-uk Kim return; 1739*ff879b07SJung-uk Kim } 1740*ff879b07SJung-uk Kim 1741*ff879b07SJung-uk Kim switch (Subtable->Type) 1742*ff879b07SJung-uk Kim { 1743*ff879b07SJung-uk Kim case ACPI_PPTT_TYPE_PROCESSOR: 1744*ff879b07SJung-uk Kim 1745*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoPptt0; 1746*ff879b07SJung-uk Kim Length = sizeof (ACPI_PPTT_PROCESSOR); 1747*ff879b07SJung-uk Kim break; 1748*ff879b07SJung-uk Kim 1749*ff879b07SJung-uk Kim case ACPI_PPTT_TYPE_CACHE: 1750*ff879b07SJung-uk Kim 1751*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoPptt1; 1752*ff879b07SJung-uk Kim Length = sizeof (ACPI_PPTT_CACHE); 1753*ff879b07SJung-uk Kim break; 1754*ff879b07SJung-uk Kim 1755*ff879b07SJung-uk Kim case ACPI_PPTT_TYPE_ID: 1756*ff879b07SJung-uk Kim 1757*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoPptt2; 1758*ff879b07SJung-uk Kim Length = sizeof (ACPI_PPTT_ID); 1759*ff879b07SJung-uk Kim break; 1760*ff879b07SJung-uk Kim 1761*ff879b07SJung-uk Kim default: 1762*ff879b07SJung-uk Kim 1763*ff879b07SJung-uk Kim AcpiOsPrintf ("\n**** Unknown PPTT subtable type 0x%X\n\n", 1764*ff879b07SJung-uk Kim Subtable->Type); 1765*ff879b07SJung-uk Kim 1766*ff879b07SJung-uk Kim /* Attempt to continue */ 1767*ff879b07SJung-uk Kim 1768*ff879b07SJung-uk Kim goto NextSubtable; 1769*ff879b07SJung-uk Kim } 1770*ff879b07SJung-uk Kim 1771*ff879b07SJung-uk Kim if (Subtable->Length < Length) 1772*ff879b07SJung-uk Kim { 1773*ff879b07SJung-uk Kim AcpiOsPrintf ("Invalid subtable length\n"); 1774*ff879b07SJung-uk Kim return; 1775*ff879b07SJung-uk Kim } 1776*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, 1777*ff879b07SJung-uk Kim Subtable->Length, InfoTable); 1778*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1779*ff879b07SJung-uk Kim { 1780*ff879b07SJung-uk Kim return; 1781*ff879b07SJung-uk Kim } 1782*ff879b07SJung-uk Kim SubtableOffset = Length; 1783*ff879b07SJung-uk Kim 1784*ff879b07SJung-uk Kim switch (Subtable->Type) 1785*ff879b07SJung-uk Kim { 1786*ff879b07SJung-uk Kim case ACPI_PPTT_TYPE_PROCESSOR: 1787*ff879b07SJung-uk Kim 1788*ff879b07SJung-uk Kim PpttProcessor = ACPI_CAST_PTR (ACPI_PPTT_PROCESSOR, Subtable); 1789*ff879b07SJung-uk Kim 1790*ff879b07SJung-uk Kim /* Dump SMBIOS handles */ 1791*ff879b07SJung-uk Kim 1792*ff879b07SJung-uk Kim if ((UINT8)(Subtable->Length - SubtableOffset) < 1793*ff879b07SJung-uk Kim (UINT8)(PpttProcessor->NumberOfPrivResources * 4)) 1794*ff879b07SJung-uk Kim { 1795*ff879b07SJung-uk Kim AcpiOsPrintf ("Invalid private resource number\n"); 1796*ff879b07SJung-uk Kim return; 1797*ff879b07SJung-uk Kim } 1798*ff879b07SJung-uk Kim for (i = 0; i < PpttProcessor->NumberOfPrivResources; i++) 1799*ff879b07SJung-uk Kim { 1800*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset + SubtableOffset, 1801*ff879b07SJung-uk Kim ACPI_ADD_PTR (ACPI_SUBTABLE_HEADER, Subtable, SubtableOffset), 1802*ff879b07SJung-uk Kim 4, AcpiDmTableInfoPptt0a); 1803*ff879b07SJung-uk Kim SubtableOffset += 4; 1804*ff879b07SJung-uk Kim } 1805*ff879b07SJung-uk Kim break; 1806*ff879b07SJung-uk Kim 1807*ff879b07SJung-uk Kim default: 1808*ff879b07SJung-uk Kim 1809*ff879b07SJung-uk Kim break; 1810*ff879b07SJung-uk Kim } 1811*ff879b07SJung-uk Kim 1812*ff879b07SJung-uk Kim NextSubtable: 1813*ff879b07SJung-uk Kim /* Point to next subtable */ 1814*ff879b07SJung-uk Kim 1815*ff879b07SJung-uk Kim Offset += Subtable->Length; 1816*ff879b07SJung-uk Kim } 1817*ff879b07SJung-uk Kim } 1818*ff879b07SJung-uk Kim 1819*ff879b07SJung-uk Kim 1820*ff879b07SJung-uk Kim /******************************************************************************* 1821*ff879b07SJung-uk Kim * 1822*ff879b07SJung-uk Kim * FUNCTION: AcpiDmDumpS3pt 1823*ff879b07SJung-uk Kim * 1824*ff879b07SJung-uk Kim * PARAMETERS: Table - A S3PT table 1825*ff879b07SJung-uk Kim * 1826*ff879b07SJung-uk Kim * RETURN: Length of the table 1827*ff879b07SJung-uk Kim * 1828*ff879b07SJung-uk Kim * DESCRIPTION: Format the contents of a S3PT 1829*ff879b07SJung-uk Kim * 1830*ff879b07SJung-uk Kim ******************************************************************************/ 1831*ff879b07SJung-uk Kim 1832*ff879b07SJung-uk Kim UINT32 1833*ff879b07SJung-uk Kim AcpiDmDumpS3pt ( 1834*ff879b07SJung-uk Kim ACPI_TABLE_HEADER *Tables) 1835*ff879b07SJung-uk Kim { 1836*ff879b07SJung-uk Kim ACPI_STATUS Status; 1837*ff879b07SJung-uk Kim UINT32 Offset = sizeof (ACPI_TABLE_S3PT); 1838*ff879b07SJung-uk Kim ACPI_FPDT_HEADER *Subtable; 1839*ff879b07SJung-uk Kim ACPI_DMTABLE_INFO *InfoTable; 1840*ff879b07SJung-uk Kim ACPI_TABLE_S3PT *S3ptTable = ACPI_CAST_PTR (ACPI_TABLE_S3PT, Tables); 1841*ff879b07SJung-uk Kim 1842*ff879b07SJung-uk Kim 1843*ff879b07SJung-uk Kim /* Main table */ 1844*ff879b07SJung-uk Kim 1845*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Offset, 0, S3ptTable, 0, AcpiDmTableInfoS3pt); 1846*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1847*ff879b07SJung-uk Kim { 1848*ff879b07SJung-uk Kim return 0; 1849*ff879b07SJung-uk Kim } 1850*ff879b07SJung-uk Kim 1851*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, S3ptTable, Offset); 1852*ff879b07SJung-uk Kim while (Offset < S3ptTable->Length) 1853*ff879b07SJung-uk Kim { 1854*ff879b07SJung-uk Kim /* Common subtable header */ 1855*ff879b07SJung-uk Kim 1856*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 1857*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (S3ptTable->Length, Offset, Subtable, 1858*ff879b07SJung-uk Kim Subtable->Length, AcpiDmTableInfoS3ptHdr); 1859*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1860*ff879b07SJung-uk Kim { 1861*ff879b07SJung-uk Kim return 0; 1862*ff879b07SJung-uk Kim } 1863*ff879b07SJung-uk Kim 1864*ff879b07SJung-uk Kim switch (Subtable->Type) 1865*ff879b07SJung-uk Kim { 1866*ff879b07SJung-uk Kim case ACPI_S3PT_TYPE_RESUME: 1867*ff879b07SJung-uk Kim 1868*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoS3pt0; 1869*ff879b07SJung-uk Kim break; 1870*ff879b07SJung-uk Kim 1871*ff879b07SJung-uk Kim case ACPI_S3PT_TYPE_SUSPEND: 1872*ff879b07SJung-uk Kim 1873*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoS3pt1; 1874*ff879b07SJung-uk Kim break; 1875*ff879b07SJung-uk Kim 1876*ff879b07SJung-uk Kim default: 1877*ff879b07SJung-uk Kim 1878*ff879b07SJung-uk Kim AcpiOsPrintf ("\n**** Unknown S3PT subtable type 0x%X\n", 1879*ff879b07SJung-uk Kim Subtable->Type); 1880*ff879b07SJung-uk Kim 1881*ff879b07SJung-uk Kim /* Attempt to continue */ 1882*ff879b07SJung-uk Kim 1883*ff879b07SJung-uk Kim if (!Subtable->Length) 1884*ff879b07SJung-uk Kim { 1885*ff879b07SJung-uk Kim AcpiOsPrintf ("Invalid zero length subtable\n"); 1886*ff879b07SJung-uk Kim return 0; 1887*ff879b07SJung-uk Kim } 1888*ff879b07SJung-uk Kim goto NextSubtable; 1889*ff879b07SJung-uk Kim } 1890*ff879b07SJung-uk Kim 1891*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 1892*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (S3ptTable->Length, Offset, Subtable, 1893*ff879b07SJung-uk Kim Subtable->Length, InfoTable); 1894*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1895*ff879b07SJung-uk Kim { 1896*ff879b07SJung-uk Kim return 0; 1897*ff879b07SJung-uk Kim } 1898*ff879b07SJung-uk Kim 1899*ff879b07SJung-uk Kim NextSubtable: 1900*ff879b07SJung-uk Kim /* Point to next subtable */ 1901*ff879b07SJung-uk Kim 1902*ff879b07SJung-uk Kim Offset += Subtable->Length; 1903*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_FPDT_HEADER, Subtable, Subtable->Length); 1904*ff879b07SJung-uk Kim } 1905*ff879b07SJung-uk Kim 1906*ff879b07SJung-uk Kim return (S3ptTable->Length); 1907*ff879b07SJung-uk Kim } 1908*ff879b07SJung-uk Kim 1909*ff879b07SJung-uk Kim 1910*ff879b07SJung-uk Kim /******************************************************************************* 1911*ff879b07SJung-uk Kim * 1912*ff879b07SJung-uk Kim * FUNCTION: AcpiDmDumpSdev 1913*ff879b07SJung-uk Kim * 1914*ff879b07SJung-uk Kim * PARAMETERS: Table - A SDEV table 1915*ff879b07SJung-uk Kim * 1916*ff879b07SJung-uk Kim * RETURN: None 1917*ff879b07SJung-uk Kim * 1918*ff879b07SJung-uk Kim * DESCRIPTION: Format the contents of a SDEV. This is a variable-length 1919*ff879b07SJung-uk Kim * table that contains variable strings and vendor data. 1920*ff879b07SJung-uk Kim * 1921*ff879b07SJung-uk Kim ******************************************************************************/ 1922*ff879b07SJung-uk Kim 1923*ff879b07SJung-uk Kim void 1924*ff879b07SJung-uk Kim AcpiDmDumpSdev ( 1925*ff879b07SJung-uk Kim ACPI_TABLE_HEADER *Table) 1926*ff879b07SJung-uk Kim { 1927*ff879b07SJung-uk Kim ACPI_STATUS Status; 1928*ff879b07SJung-uk Kim ACPI_SDEV_HEADER *Subtable; 1929*ff879b07SJung-uk Kim ACPI_SDEV_PCIE *Pcie; 1930*ff879b07SJung-uk Kim ACPI_SDEV_NAMESPACE *Namesp; 1931*ff879b07SJung-uk Kim ACPI_DMTABLE_INFO *InfoTable; 1932*ff879b07SJung-uk Kim UINT32 Length = Table->Length; 1933*ff879b07SJung-uk Kim UINT32 Offset = sizeof (ACPI_TABLE_SDEV); 1934*ff879b07SJung-uk Kim UINT16 PathOffset; 1935*ff879b07SJung-uk Kim UINT16 PathLength; 1936*ff879b07SJung-uk Kim UINT16 VendorDataOffset; 1937*ff879b07SJung-uk Kim UINT16 VendorDataLength; 1938*ff879b07SJung-uk Kim 1939*ff879b07SJung-uk Kim 1940*ff879b07SJung-uk Kim /* Main table */ 1941*ff879b07SJung-uk Kim 1942*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoSdev); 1943*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1944*ff879b07SJung-uk Kim { 1945*ff879b07SJung-uk Kim return; 1946*ff879b07SJung-uk Kim } 1947*ff879b07SJung-uk Kim 1948*ff879b07SJung-uk Kim /* Subtables */ 1949*ff879b07SJung-uk Kim 1950*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_SDEV_HEADER, Table, Offset); 1951*ff879b07SJung-uk Kim while (Offset < Table->Length) 1952*ff879b07SJung-uk Kim { 1953*ff879b07SJung-uk Kim /* Common subtable header */ 1954*ff879b07SJung-uk Kim 1955*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 1956*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, 1957*ff879b07SJung-uk Kim Subtable->Length, AcpiDmTableInfoSdevHdr); 1958*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1959*ff879b07SJung-uk Kim { 1960*ff879b07SJung-uk Kim return; 1961*ff879b07SJung-uk Kim } 1962*ff879b07SJung-uk Kim 1963*ff879b07SJung-uk Kim switch (Subtable->Type) 1964*ff879b07SJung-uk Kim { 1965*ff879b07SJung-uk Kim case ACPI_SDEV_TYPE_NAMESPACE_DEVICE: 1966*ff879b07SJung-uk Kim 1967*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoSdev0; 1968*ff879b07SJung-uk Kim break; 1969*ff879b07SJung-uk Kim 1970*ff879b07SJung-uk Kim case ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE: 1971*ff879b07SJung-uk Kim 1972*ff879b07SJung-uk Kim InfoTable = AcpiDmTableInfoSdev1; 1973*ff879b07SJung-uk Kim break; 1974*ff879b07SJung-uk Kim 1975*ff879b07SJung-uk Kim default: 1976*ff879b07SJung-uk Kim goto NextSubtable; 1977*ff879b07SJung-uk Kim } 1978*ff879b07SJung-uk Kim 1979*ff879b07SJung-uk Kim AcpiOsPrintf ("\n"); 1980*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, 1981*ff879b07SJung-uk Kim Subtable->Length, InfoTable); 1982*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 1983*ff879b07SJung-uk Kim { 1984*ff879b07SJung-uk Kim return; 1985*ff879b07SJung-uk Kim } 1986*ff879b07SJung-uk Kim 1987*ff879b07SJung-uk Kim switch (Subtable->Type) 1988*ff879b07SJung-uk Kim { 1989*ff879b07SJung-uk Kim case ACPI_SDEV_TYPE_NAMESPACE_DEVICE: 1990*ff879b07SJung-uk Kim 1991*ff879b07SJung-uk Kim /* Dump the PCIe device ID(s) */ 1992*ff879b07SJung-uk Kim 1993*ff879b07SJung-uk Kim Namesp = ACPI_CAST_PTR (ACPI_SDEV_NAMESPACE, Subtable); 1994*ff879b07SJung-uk Kim PathOffset = Namesp->DeviceIdOffset; 1995*ff879b07SJung-uk Kim PathLength = Namesp->DeviceIdLength; 1996*ff879b07SJung-uk Kim 1997*ff879b07SJung-uk Kim if (PathLength) 1998*ff879b07SJung-uk Kim { 1999*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, 0, 2000*ff879b07SJung-uk Kim ACPI_ADD_PTR (UINT8, Namesp, PathOffset), 2001*ff879b07SJung-uk Kim PathLength, AcpiDmTableInfoSdev0a); 2002*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 2003*ff879b07SJung-uk Kim { 2004*ff879b07SJung-uk Kim return; 2005*ff879b07SJung-uk Kim } 2006*ff879b07SJung-uk Kim } 2007*ff879b07SJung-uk Kim 2008*ff879b07SJung-uk Kim /* Dump the vendor-specific data */ 2009*ff879b07SJung-uk Kim 2010*ff879b07SJung-uk Kim VendorDataLength = 2011*ff879b07SJung-uk Kim Namesp->VendorDataLength; 2012*ff879b07SJung-uk Kim VendorDataOffset = 2013*ff879b07SJung-uk Kim Namesp->DeviceIdOffset + Namesp->DeviceIdLength; 2014*ff879b07SJung-uk Kim 2015*ff879b07SJung-uk Kim if (VendorDataLength) 2016*ff879b07SJung-uk Kim { 2017*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, 0, 2018*ff879b07SJung-uk Kim ACPI_ADD_PTR (UINT8, Namesp, VendorDataOffset), 2019*ff879b07SJung-uk Kim VendorDataLength, AcpiDmTableInfoSdev1b); 2020*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 2021*ff879b07SJung-uk Kim { 2022*ff879b07SJung-uk Kim return; 2023*ff879b07SJung-uk Kim } 2024*ff879b07SJung-uk Kim } 2025*ff879b07SJung-uk Kim break; 2026*ff879b07SJung-uk Kim 2027*ff879b07SJung-uk Kim case ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE: 2028*ff879b07SJung-uk Kim 2029*ff879b07SJung-uk Kim /* PCI path substructures */ 2030*ff879b07SJung-uk Kim 2031*ff879b07SJung-uk Kim Pcie = ACPI_CAST_PTR (ACPI_SDEV_PCIE, Subtable); 2032*ff879b07SJung-uk Kim PathOffset = Pcie->PathOffset; 2033*ff879b07SJung-uk Kim PathLength = Pcie->PathLength; 2034*ff879b07SJung-uk Kim 2035*ff879b07SJung-uk Kim while (PathLength) 2036*ff879b07SJung-uk Kim { 2037*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, 2038*ff879b07SJung-uk Kim PathOffset + Offset, 2039*ff879b07SJung-uk Kim ACPI_ADD_PTR (UINT8, Pcie, PathOffset), 2040*ff879b07SJung-uk Kim sizeof (ACPI_SDEV_PCIE_PATH), AcpiDmTableInfoSdev1a); 2041*ff879b07SJung-uk Kim if (ACPI_FAILURE (Status)) 2042*ff879b07SJung-uk Kim { 2043*ff879b07SJung-uk Kim return; 2044*ff879b07SJung-uk Kim } 2045*ff879b07SJung-uk Kim 2046*ff879b07SJung-uk Kim PathOffset += sizeof (ACPI_SDEV_PCIE_PATH); 2047*ff879b07SJung-uk Kim PathLength -= sizeof (ACPI_SDEV_PCIE_PATH); 2048*ff879b07SJung-uk Kim } 2049*ff879b07SJung-uk Kim 2050*ff879b07SJung-uk Kim /* VendorData */ 2051*ff879b07SJung-uk Kim 2052*ff879b07SJung-uk Kim VendorDataLength = Pcie->VendorDataLength; 2053*ff879b07SJung-uk Kim VendorDataOffset = Pcie->PathOffset + Pcie->PathLength; 2054*ff879b07SJung-uk Kim 2055*ff879b07SJung-uk Kim if (VendorDataLength) 2056*ff879b07SJung-uk Kim { 2057*ff879b07SJung-uk Kim Status = AcpiDmDumpTable (Table->Length, 0, 2058*ff879b07SJung-uk Kim ACPI_ADD_PTR (UINT8, Pcie, VendorDataOffset), 2059*ff879b07SJung-uk Kim VendorDataLength, AcpiDmTableInfoSdev1b); 2060*ff879b07SJung-uk Kim } 2061*ff879b07SJung-uk Kim break; 2062*ff879b07SJung-uk Kim 2063*ff879b07SJung-uk Kim default: 2064*ff879b07SJung-uk Kim goto NextSubtable; 2065*ff879b07SJung-uk Kim } 2066*ff879b07SJung-uk Kim 2067*ff879b07SJung-uk Kim NextSubtable: 2068*ff879b07SJung-uk Kim /* Point to next subtable */ 2069*ff879b07SJung-uk Kim 2070*ff879b07SJung-uk Kim Offset += Subtable->Length; 2071*ff879b07SJung-uk Kim Subtable = ACPI_ADD_PTR (ACPI_SDEV_HEADER, Subtable, 2072*ff879b07SJung-uk Kim Subtable->Length); 2073*ff879b07SJung-uk Kim } 2074*ff879b07SJung-uk Kim } 2075