dmresrcs.c revision 193267
1100966Siwasaki/******************************************************************************* 2100966Siwasaki * 3100966Siwasaki * Module Name: dmresrcs.c - "Small" Resource Descriptor disassembly 4100966Siwasaki * 5100966Siwasaki ******************************************************************************/ 6100966Siwasaki 7100966Siwasaki/****************************************************************************** 8100966Siwasaki * 9100966Siwasaki * 1. Copyright Notice 10100966Siwasaki * 11193267Sjkim * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp. 12100966Siwasaki * All rights reserved. 13100966Siwasaki * 14100966Siwasaki * 2. License 15100966Siwasaki * 16100966Siwasaki * 2.1. This is your license from Intel Corp. under its intellectual property 17100966Siwasaki * rights. You may have additional license terms from the party that provided 18100966Siwasaki * you this software, covering your right to use that party's intellectual 19100966Siwasaki * property rights. 20100966Siwasaki * 21100966Siwasaki * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a 22100966Siwasaki * copy of the source code appearing in this file ("Covered Code") an 23100966Siwasaki * irrevocable, perpetual, worldwide license under Intel's copyrights in the 24100966Siwasaki * base code distributed originally by Intel ("Original Intel Code") to copy, 25100966Siwasaki * make derivatives, distribute, use and display any portion of the Covered 26100966Siwasaki * Code in any form, with the right to sublicense such rights; and 27100966Siwasaki * 28100966Siwasaki * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent 29100966Siwasaki * license (with the right to sublicense), under only those claims of Intel 30100966Siwasaki * patents that are infringed by the Original Intel Code, to make, use, sell, 31100966Siwasaki * offer to sell, and import the Covered Code and derivative works thereof 32100966Siwasaki * solely to the minimum extent necessary to exercise the above copyright 33100966Siwasaki * license, and in no event shall the patent license extend to any additions 34100966Siwasaki * to or modifications of the Original Intel Code. No other license or right 35100966Siwasaki * is granted directly or by implication, estoppel or otherwise; 36100966Siwasaki * 37100966Siwasaki * The above copyright and patent license is granted only if the following 38100966Siwasaki * conditions are met: 39100966Siwasaki * 40100966Siwasaki * 3. Conditions 41100966Siwasaki * 42100966Siwasaki * 3.1. Redistribution of Source with Rights to Further Distribute Source. 43100966Siwasaki * Redistribution of source code of any substantial portion of the Covered 44100966Siwasaki * Code or modification with rights to further distribute source must include 45100966Siwasaki * the above Copyright Notice, the above License, this list of Conditions, 46100966Siwasaki * and the following Disclaimer and Export Compliance provision. In addition, 47100966Siwasaki * Licensee must cause all Covered Code to which Licensee contributes to 48100966Siwasaki * contain a file documenting the changes Licensee made to create that Covered 49100966Siwasaki * Code and the date of any change. Licensee must include in that file the 50100966Siwasaki * documentation of any changes made by any predecessor Licensee. Licensee 51100966Siwasaki * must include a prominent statement that the modification is derived, 52100966Siwasaki * directly or indirectly, from Original Intel Code. 53100966Siwasaki * 54100966Siwasaki * 3.2. Redistribution of Source with no Rights to Further Distribute Source. 55100966Siwasaki * Redistribution of source code of any substantial portion of the Covered 56100966Siwasaki * Code or modification without rights to further distribute source must 57100966Siwasaki * include the following Disclaimer and Export Compliance provision in the 58100966Siwasaki * documentation and/or other materials provided with distribution. In 59100966Siwasaki * addition, Licensee may not authorize further sublicense of source of any 60100966Siwasaki * portion of the Covered Code, and must include terms to the effect that the 61100966Siwasaki * license from Licensee to its licensee is limited to the intellectual 62100966Siwasaki * property embodied in the software Licensee provides to its licensee, and 63100966Siwasaki * not to intellectual property embodied in modifications its licensee may 64100966Siwasaki * make. 65100966Siwasaki * 66100966Siwasaki * 3.3. Redistribution of Executable. Redistribution in executable form of any 67100966Siwasaki * substantial portion of the Covered Code or modification must reproduce the 68100966Siwasaki * above Copyright Notice, and the following Disclaimer and Export Compliance 69100966Siwasaki * provision in the documentation and/or other materials provided with the 70100966Siwasaki * distribution. 71100966Siwasaki * 72100966Siwasaki * 3.4. Intel retains all right, title, and interest in and to the Original 73100966Siwasaki * Intel Code. 74100966Siwasaki * 75100966Siwasaki * 3.5. Neither the name Intel nor any other trademark owned or controlled by 76100966Siwasaki * Intel shall be used in advertising or otherwise to promote the sale, use or 77100966Siwasaki * other dealings in products derived from or relating to the Covered Code 78100966Siwasaki * without prior written authorization from Intel. 79100966Siwasaki * 80100966Siwasaki * 4. Disclaimer and Export Compliance 81100966Siwasaki * 82100966Siwasaki * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED 83100966Siwasaki * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE 84100966Siwasaki * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, 85100966Siwasaki * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY 86100966Siwasaki * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY 87100966Siwasaki * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A 88100966Siwasaki * PARTICULAR PURPOSE. 89100966Siwasaki * 90100966Siwasaki * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES 91100966Siwasaki * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR 92100966Siwasaki * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, 93100966Siwasaki * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY 94100966Siwasaki * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL 95100966Siwasaki * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS 96100966Siwasaki * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY 97100966Siwasaki * LIMITED REMEDY. 98100966Siwasaki * 99100966Siwasaki * 4.3. Licensee shall not export, either directly or indirectly, any of this 100100966Siwasaki * software or system incorporating such software without first obtaining any 101100966Siwasaki * required license or other approval from the U. S. Department of Commerce or 102100966Siwasaki * any other agency or department of the United States Government. In the 103100966Siwasaki * event Licensee exports any such software from the United States or 104100966Siwasaki * re-exports any such software from a foreign destination, Licensee shall 105100966Siwasaki * ensure that the distribution and export/re-export of the software is in 106100966Siwasaki * compliance with all laws, regulations, orders, or other restrictions of the 107100966Siwasaki * U.S. Export Administration Regulations. Licensee agrees that neither it nor 108100966Siwasaki * any of its subsidiaries will export/re-export any technical data, process, 109100966Siwasaki * software, or service, directly or indirectly, to any country for which the 110100966Siwasaki * United States government or any agency thereof requires an export license, 111100966Siwasaki * other governmental approval, or letter of assurance, without first obtaining 112100966Siwasaki * such license, approval or letter. 113100966Siwasaki * 114100966Siwasaki *****************************************************************************/ 115100966Siwasaki 116100966Siwasaki 117193251Sjkim#include "acpi.h" 118193267Sjkim#include "accommon.h" 119193251Sjkim#include "acdisasm.h" 120100966Siwasaki 121100966Siwasaki 122100966Siwasaki#ifdef ACPI_DISASSEMBLER 123100966Siwasaki 124102550Siwasaki#define _COMPONENT ACPI_CA_DEBUGGER 125100966Siwasaki ACPI_MODULE_NAME ("dbresrcs") 126100966Siwasaki 127100966Siwasaki 128100966Siwasaki/******************************************************************************* 129100966Siwasaki * 130100966Siwasaki * FUNCTION: AcpiDmIrqDescriptor 131100966Siwasaki * 132100966Siwasaki * PARAMETERS: Resource - Pointer to the resource descriptor 133100966Siwasaki * Length - Length of the descriptor in bytes 134100966Siwasaki * Level - Current source code indentation level 135100966Siwasaki * 136100966Siwasaki * RETURN: None 137100966Siwasaki * 138151937Sjkim * DESCRIPTION: Decode a IRQ descriptor, either Irq() or IrqNoFlags() 139100966Siwasaki * 140100966Siwasaki ******************************************************************************/ 141100966Siwasaki 142100966Siwasakivoid 143100966SiwasakiAcpiDmIrqDescriptor ( 144151937Sjkim AML_RESOURCE *Resource, 145100966Siwasaki UINT32 Length, 146100966Siwasaki UINT32 Level) 147100966Siwasaki{ 148100966Siwasaki 149100966Siwasaki AcpiDmIndent (Level); 150100966Siwasaki AcpiOsPrintf ("%s (", 151100966Siwasaki AcpiGbl_IrqDecode [Length & 1]); 152100966Siwasaki 153151937Sjkim /* Decode flags byte if present */ 154151937Sjkim 155100966Siwasaki if (Length & 1) 156100966Siwasaki { 157167802Sjkim AcpiOsPrintf ("%s, %s, %s, ", 158167802Sjkim AcpiGbl_HeDecode [Resource->Irq.Flags & 1], 159167802Sjkim AcpiGbl_LlDecode [(Resource->Irq.Flags >> 3) & 1], 160167802Sjkim AcpiGbl_ShrDecode [(Resource->Irq.Flags >> 4) & 1]); 161100966Siwasaki } 162167802Sjkim 163167802Sjkim /* Insert a descriptor name */ 164167802Sjkim 165167802Sjkim AcpiDmDescriptorName (); 166151937Sjkim AcpiOsPrintf (")\n"); 167100966Siwasaki 168151937Sjkim AcpiDmIndent (Level + 1); 169151937Sjkim AcpiDmBitList (Resource->Irq.IrqMask); 170100966Siwasaki} 171100966Siwasaki 172100966Siwasaki 173100966Siwasaki/******************************************************************************* 174100966Siwasaki * 175100966Siwasaki * FUNCTION: AcpiDmDmaDescriptor 176100966Siwasaki * 177100966Siwasaki * PARAMETERS: Resource - Pointer to the resource descriptor 178100966Siwasaki * Length - Length of the descriptor in bytes 179100966Siwasaki * Level - Current source code indentation level 180100966Siwasaki * 181100966Siwasaki * RETURN: None 182100966Siwasaki * 183100966Siwasaki * DESCRIPTION: Decode a DMA descriptor 184100966Siwasaki * 185100966Siwasaki ******************************************************************************/ 186100966Siwasaki 187100966Siwasakivoid 188100966SiwasakiAcpiDmDmaDescriptor ( 189151937Sjkim AML_RESOURCE *Resource, 190100966Siwasaki UINT32 Length, 191100966Siwasaki UINT32 Level) 192100966Siwasaki{ 193100966Siwasaki 194100966Siwasaki AcpiDmIndent (Level); 195167802Sjkim AcpiOsPrintf ("DMA (%s, %s, %s, ", 196167802Sjkim AcpiGbl_TypDecode [(Resource->Dma.Flags >> 5) & 3], 197167802Sjkim AcpiGbl_BmDecode [(Resource->Dma.Flags >> 2) & 1], 198167802Sjkim AcpiGbl_SizDecode [(Resource->Dma.Flags >> 0) & 3]); 199100966Siwasaki 200167802Sjkim /* Insert a descriptor name */ 201167802Sjkim 202167802Sjkim AcpiDmDescriptorName (); 203167802Sjkim AcpiOsPrintf (")\n"); 204167802Sjkim 205151937Sjkim AcpiDmIndent (Level + 1); 206151937Sjkim AcpiDmBitList (Resource->Dma.DmaChannelMask); 207100966Siwasaki} 208100966Siwasaki 209100966Siwasaki 210100966Siwasaki/******************************************************************************* 211100966Siwasaki * 212100966Siwasaki * FUNCTION: AcpiDmIoDescriptor 213100966Siwasaki * 214100966Siwasaki * PARAMETERS: Resource - Pointer to the resource descriptor 215100966Siwasaki * Length - Length of the descriptor in bytes 216100966Siwasaki * Level - Current source code indentation level 217100966Siwasaki * 218100966Siwasaki * RETURN: None 219100966Siwasaki * 220100966Siwasaki * DESCRIPTION: Decode an IO descriptor 221100966Siwasaki * 222100966Siwasaki ******************************************************************************/ 223100966Siwasaki 224100966Siwasakivoid 225100966SiwasakiAcpiDmIoDescriptor ( 226151937Sjkim AML_RESOURCE *Resource, 227100966Siwasaki UINT32 Length, 228100966Siwasaki UINT32 Level) 229100966Siwasaki{ 230100966Siwasaki 231100966Siwasaki AcpiDmIndent (Level); 232151937Sjkim AcpiOsPrintf ("IO (%s,\n", 233151937Sjkim AcpiGbl_IoDecode [(Resource->Io.Flags & 1)]); 234151937Sjkim 235151937Sjkim AcpiDmIndent (Level + 1); 236167802Sjkim AcpiDmDumpInteger16 (Resource->Io.Minimum, "Range Minimum"); 237151937Sjkim 238151937Sjkim AcpiDmIndent (Level + 1); 239167802Sjkim AcpiDmDumpInteger16 (Resource->Io.Maximum, "Range Maximum"); 240151937Sjkim 241151937Sjkim AcpiDmIndent (Level + 1); 242167802Sjkim AcpiDmDumpInteger8 (Resource->Io.Alignment, "Alignment"); 243151937Sjkim 244151937Sjkim AcpiDmIndent (Level + 1); 245167802Sjkim AcpiDmDumpInteger8 (Resource->Io.AddressLength, "Length"); 246151937Sjkim 247167802Sjkim /* Insert a descriptor name */ 248167802Sjkim 249151937Sjkim AcpiDmIndent (Level + 1); 250167802Sjkim AcpiDmDescriptorName (); 251151937Sjkim AcpiOsPrintf (")\n"); 252100966Siwasaki} 253100966Siwasaki 254100966Siwasaki 255100966Siwasaki/******************************************************************************* 256100966Siwasaki * 257100966Siwasaki * FUNCTION: AcpiDmFixedIoDescriptor 258100966Siwasaki * 259100966Siwasaki * PARAMETERS: Resource - Pointer to the resource descriptor 260100966Siwasaki * Length - Length of the descriptor in bytes 261100966Siwasaki * Level - Current source code indentation level 262100966Siwasaki * 263100966Siwasaki * RETURN: None 264100966Siwasaki * 265100966Siwasaki * DESCRIPTION: Decode a Fixed IO descriptor 266100966Siwasaki * 267100966Siwasaki ******************************************************************************/ 268100966Siwasaki 269100966Siwasakivoid 270100966SiwasakiAcpiDmFixedIoDescriptor ( 271151937Sjkim AML_RESOURCE *Resource, 272100966Siwasaki UINT32 Length, 273100966Siwasaki UINT32 Level) 274100966Siwasaki{ 275100966Siwasaki 276100966Siwasaki AcpiDmIndent (Level); 277151937Sjkim AcpiOsPrintf ("FixedIO (\n"); 278151937Sjkim 279151937Sjkim AcpiDmIndent (Level + 1); 280167802Sjkim AcpiDmDumpInteger16 (Resource->FixedIo.Address, "Address"); 281151937Sjkim 282151937Sjkim AcpiDmIndent (Level + 1); 283167802Sjkim AcpiDmDumpInteger8 (Resource->FixedIo.AddressLength, "Length"); 284151937Sjkim 285167802Sjkim /* Insert a descriptor name */ 286167802Sjkim 287151937Sjkim AcpiDmIndent (Level + 1); 288167802Sjkim AcpiDmDescriptorName (); 289151937Sjkim AcpiOsPrintf (")\n"); 290100966Siwasaki} 291100966Siwasaki 292100966Siwasaki 293100966Siwasaki/******************************************************************************* 294100966Siwasaki * 295100966Siwasaki * FUNCTION: AcpiDmStartDependentDescriptor 296100966Siwasaki * 297100966Siwasaki * PARAMETERS: Resource - Pointer to the resource descriptor 298100966Siwasaki * Length - Length of the descriptor in bytes 299100966Siwasaki * Level - Current source code indentation level 300100966Siwasaki * 301100966Siwasaki * RETURN: None 302100966Siwasaki * 303100966Siwasaki * DESCRIPTION: Decode a Start Dependendent functions descriptor 304100966Siwasaki * 305100966Siwasaki ******************************************************************************/ 306100966Siwasaki 307100966Siwasakivoid 308100966SiwasakiAcpiDmStartDependentDescriptor ( 309151937Sjkim AML_RESOURCE *Resource, 310100966Siwasaki UINT32 Length, 311100966Siwasaki UINT32 Level) 312100966Siwasaki{ 313100966Siwasaki 314100966Siwasaki AcpiDmIndent (Level); 315100966Siwasaki 316100966Siwasaki if (Length & 1) 317100966Siwasaki { 318100966Siwasaki AcpiOsPrintf ("StartDependentFn (0x%2.2X, 0x%2.2X)\n", 319151937Sjkim (UINT32) Resource->StartDpf.Flags & 3, 320151937Sjkim (UINT32) (Resource->StartDpf.Flags >> 2) & 3); 321100966Siwasaki } 322100966Siwasaki else 323100966Siwasaki { 324100966Siwasaki AcpiOsPrintf ("StartDependentFnNoPri ()\n"); 325100966Siwasaki } 326100966Siwasaki 327100966Siwasaki AcpiDmIndent (Level); 328100966Siwasaki AcpiOsPrintf ("{\n"); 329100966Siwasaki} 330100966Siwasaki 331100966Siwasaki 332100966Siwasaki/******************************************************************************* 333100966Siwasaki * 334100966Siwasaki * FUNCTION: AcpiDmEndDependentDescriptor 335100966Siwasaki * 336100966Siwasaki * PARAMETERS: Resource - Pointer to the resource descriptor 337100966Siwasaki * Length - Length of the descriptor in bytes 338100966Siwasaki * Level - Current source code indentation level 339100966Siwasaki * 340100966Siwasaki * RETURN: None 341100966Siwasaki * 342100966Siwasaki * DESCRIPTION: Decode an End Dependent functions descriptor 343100966Siwasaki * 344100966Siwasaki ******************************************************************************/ 345100966Siwasaki 346100966Siwasakivoid 347100966SiwasakiAcpiDmEndDependentDescriptor ( 348151937Sjkim AML_RESOURCE *Resource, 349100966Siwasaki UINT32 Length, 350100966Siwasaki UINT32 Level) 351100966Siwasaki{ 352100966Siwasaki 353100966Siwasaki AcpiDmIndent (Level); 354100966Siwasaki AcpiOsPrintf ("}\n"); 355100966Siwasaki AcpiDmIndent (Level); 356100966Siwasaki AcpiOsPrintf ("EndDependentFn ()\n"); 357100966Siwasaki} 358100966Siwasaki 359100966Siwasaki 360100966Siwasaki/******************************************************************************* 361100966Siwasaki * 362100966Siwasaki * FUNCTION: AcpiDmVendorSmallDescriptor 363100966Siwasaki * 364100966Siwasaki * PARAMETERS: Resource - Pointer to the resource descriptor 365100966Siwasaki * Length - Length of the descriptor in bytes 366100966Siwasaki * Level - Current source code indentation level 367100966Siwasaki * 368100966Siwasaki * RETURN: None 369100966Siwasaki * 370100966Siwasaki * DESCRIPTION: Decode a Vendor Small Descriptor 371100966Siwasaki * 372100966Siwasaki ******************************************************************************/ 373100966Siwasaki 374100966Siwasakivoid 375100966SiwasakiAcpiDmVendorSmallDescriptor ( 376151937Sjkim AML_RESOURCE *Resource, 377100966Siwasaki UINT32 Length, 378100966Siwasaki UINT32 Level) 379100966Siwasaki{ 380100966Siwasaki 381167802Sjkim AcpiDmVendorCommon ("Short", 382167802Sjkim ACPI_ADD_PTR (UINT8, Resource, sizeof (AML_RESOURCE_SMALL_HEADER)), 383151937Sjkim Length, Level); 384100966Siwasaki} 385100966Siwasaki 386100966Siwasaki#endif 387100966Siwasaki 388