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