1 /*******************************************************************************
3 * Module Name: dmresrcl.c - "Large" Resource Descriptor disassembly
6 ******************************************************************************/
8 /******************************************************************************
12 * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
13 * All rights reserved.
17 * 2.1. This is your license from Intel Corp. under its intellectual property
18 * rights. You may have additional license terms from the party that provided
19 * you this software, covering your right to use that party's intellectual
22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23 * copy of the source code appearing in this file ("Covered Code") an
24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25 * base code distributed originally by Intel ("Original Intel Code") to copy,
26 * make derivatives, distribute, use and display any portion of the Covered
27 * Code in any form, with the right to sublicense such rights; and
29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30 * license (with the right to sublicense), under only those claims of Intel
31 * patents that are infringed by the Original Intel Code, to make, use, sell,
32 * offer to sell, and import the Covered Code and derivative works thereof
33 * solely to the minimum extent necessary to exercise the above copyright
34 * license, and in no event shall the patent license extend to any additions
35 * to or modifications of the Original Intel Code. No other license or right
36 * is granted directly or by implication, estoppel or otherwise;
38 * The above copyright and patent license is granted only if the following
43 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44 * Redistribution of source code of any substantial portion of the Covered
45 * Code or modification with rights to further distribute source must include
46 * the above Copyright Notice, the above License, this list of Conditions,
47 * and the following Disclaimer and Export Compliance provision. In addition,
48 * Licensee must cause all Covered Code to which Licensee contributes to
49 * contain a file documenting the changes Licensee made to create that Covered
50 * Code and the date of any change. Licensee must include in that file the
51 * documentation of any changes made by any predecessor Licensee. Licensee
52 * must include a prominent statement that the modification is derived,
53 * directly or indirectly, from Original Intel Code.
55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56 * Redistribution of source code of any substantial portion of the Covered
57 * Code or modification without rights to further distribute source must
58 * include the following Disclaimer and Export Compliance provision in the
59 * documentation and/or other materials provided with distribution. In
60 * addition, Licensee may not authorize further sublicense of source of any
61 * portion of the Covered Code, and must include terms to the effect that the
62 * license from Licensee to its licensee is limited to the intellectual
63 * property embodied in the software Licensee provides to its licensee, and
64 * not to intellectual property embodied in modifications its licensee may
67 * 3.3. Redistribution of Executable. Redistribution in executable form of any
68 * substantial portion of the Covered Code or modification must reproduce the
69 * above Copyright Notice, and the following Disclaimer and Export Compliance
70 * provision in the documentation and/or other materials provided with the
73 * 3.4. Intel retains all right, title, and interest in and to the Original
76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77 * Intel shall be used in advertising or otherwise to promote the sale, use or
78 * other dealings in products derived from or relating to the Covered Code
79 * without prior written authorization from Intel.
81 * 4. Disclaimer and Export Compliance
83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
100 * 4.3. Licensee shall not export, either directly or indirectly, any of this
101 * software or system incorporating such software without first obtaining any
102 * required license or other approval from the U. S. Department of Commerce or
103 * any other agency or department of the United States Government. In the
104 * event Licensee exports any such software from the United States or
105 * re-exports any such software from a foreign destination, Licensee shall
106 * ensure that the distribution and export/re-export of the software is in
107 * compliance with all laws, regulations, orders, or other restrictions of the
108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109 * any of its subsidiaries will export/re-export any technical data, process,
110 * software, or service, directly or indirectly, to any country for which the
111 * United States government or any agency thereof requires an export license,
112 * other governmental approval, or letter of assurance, without first obtaining
113 * such license, approval or letter.
115 *****************************************************************************/
119 #include "acdisasm.h"
122 #ifdef ACPI_DISASSEMBLER
124 #define _COMPONENT ACPI_CA_DEBUGGER
125 ACPI_MODULE_NAME ("dbresrcl")
128 /*******************************************************************************
130 * FUNCTION: AcpiDmSpaceFlags
132 * PARAMETERS: Flags - Flag byte to be decoded
136 * DESCRIPTION: Decode the flags specific to Space Address space descriptors
138 ******************************************************************************/
144 AcpiOsPrintf ("%s, %s, %s, %s,",
145 AcpiGbl_ConsumeDecode [(Flags & 1)],
146 AcpiGbl_DECDecode [(Flags & 0x2) >> 1],
147 AcpiGbl_MinDecode [(Flags & 0x4) >> 2],
148 AcpiGbl_MaxDecode [(Flags & 0x8) >> 3]);
152 /*******************************************************************************
154 * FUNCTION: AcpiDmIoFlags
156 * PARAMETERS: Flags - Flag byte to be decoded
160 * DESCRIPTION: Decode the flags specific to IO Address space descriptors
162 ******************************************************************************/
168 AcpiOsPrintf ("%s, %s, %s, %s,",
169 AcpiGbl_ConsumeDecode [(Flags & 1)],
170 AcpiGbl_MinDecode [(Flags & 0x4) >> 2],
171 AcpiGbl_MaxDecode [(Flags & 0x8) >> 3],
172 AcpiGbl_DECDecode [(Flags & 0x2) >> 1]);
176 /*******************************************************************************
178 * FUNCTION: AcpiDmMemoryFlags
180 * PARAMETERS: Flags - Flag byte to be decoded
181 * SpecificFlags - "Specific" flag byte to be decoded
185 * DESCRIPTION: Decode flags specific to Memory Address Space descriptors
187 ******************************************************************************/
194 AcpiOsPrintf ("%s, %s, %s, %s, %s, %s,",
195 AcpiGbl_ConsumeDecode [(Flags & 1)],
196 AcpiGbl_DECDecode [(Flags & 0x2) >> 1],
197 AcpiGbl_MinDecode [(Flags & 0x4) >> 2],
198 AcpiGbl_MaxDecode [(Flags & 0x8) >> 3],
199 AcpiGbl_MEMDecode [(SpecificFlags & 0x6) >> 1],
200 AcpiGbl_RWDecode [(SpecificFlags & 0x1)]);
204 /*******************************************************************************
206 * FUNCTION: AcpiDmWordDescriptor
208 * PARAMETERS: Resource - Pointer to the resource descriptor
209 * Length - Length of the descriptor in bytes
210 * Level - Current source code indentation level
214 * DESCRIPTION: Decode a Word Address Space descriptor
216 ******************************************************************************/
219 AcpiDmWordDescriptor (
220 ASL_WORD_ADDRESS_DESC *Resource,
225 AcpiDmIndent (Level);
226 if (Resource->ResourceType >= 0xC0)
228 AcpiOsPrintf ("WordSpace (0x%2.2X, ", Resource->ResourceType);
229 AcpiDmSpaceFlags (Resource->Flags);
230 AcpiOsPrintf (" 0x%2.2X,", Resource->SpecificFlags);
234 AcpiOsPrintf ("%s (",
235 AcpiGbl_WordDecode [(Resource->ResourceType & 3)]);
237 AcpiDmIoFlags (Resource->Flags);
239 if ((Resource->ResourceType & 0x3) == 1)
241 AcpiOsPrintf (" %s,",
242 AcpiGbl_RNGDecode [(Resource->SpecificFlags & 0x3)]);
246 /* The WORD values */
249 AcpiDmIndent (Level + 1);
250 AcpiOsPrintf ("0x%4.4X, /* Address Space Granularity */\n",
251 (UINT32) Resource->Granularity);
252 AcpiDmIndent (Level + 1);
253 AcpiOsPrintf ("0x%4.4X, /* Address Range Minimum */\n",
254 (UINT32) Resource->AddressMin);
255 AcpiDmIndent (Level + 1);
256 AcpiOsPrintf ("0x%4.4X, /* Address Range Maximum */\n",
257 (UINT32) Resource->AddressMax);
258 AcpiDmIndent (Level + 1);
259 AcpiOsPrintf ("0x%4.4X, /* Address Translation Offset */\n",
260 (UINT32) Resource->TranslationOffset);
261 AcpiDmIndent (Level + 1);
262 AcpiOsPrintf ("0x%4.4X",
263 (UINT32) Resource->AddressLength);
265 /* Optional fields */
269 AcpiOsPrintf (", 0x%2.2X",
270 (UINT32) Resource->OptionalFields[0]);
275 AcpiOsPrintf (", %s",
276 &Resource->OptionalFields[1]);
278 AcpiOsPrintf (")\n");
282 /*******************************************************************************
284 * FUNCTION: AcpiDmDwordDescriptor
286 * PARAMETERS: Resource - Pointer to the resource descriptor
287 * Length - Length of the descriptor in bytes
288 * Level - Current source code indentation level
292 * DESCRIPTION: Decode a DWord Address Space descriptor
294 ******************************************************************************/
297 AcpiDmDwordDescriptor (
298 ASL_DWORD_ADDRESS_DESC *Resource,
303 AcpiDmIndent (Level);
304 if (Resource->ResourceType >= 0xC0)
306 AcpiOsPrintf ("DWordSpace (0x%2.2X, ", Resource->ResourceType);
307 AcpiDmSpaceFlags (Resource->Flags);
308 AcpiOsPrintf (" 0x%2.2X,", Resource->SpecificFlags);
312 AcpiOsPrintf ("D%s (",
313 AcpiGbl_WordDecode [(Resource->ResourceType & 3)]);
315 if ((Resource->ResourceType & 0x3) == 1)
317 AcpiDmIoFlags (Resource->Flags);
318 AcpiOsPrintf (" %s,",
319 AcpiGbl_RNGDecode [(Resource->SpecificFlags & 0x3)]);
323 AcpiDmMemoryFlags (Resource->Flags, Resource->SpecificFlags);
327 /* The DWORD values */
330 AcpiDmIndent (Level + 1);
331 AcpiOsPrintf ("0x%8.8X, /* Address Space Granularity */\n",
332 Resource->Granularity);
333 AcpiDmIndent (Level + 1);
334 AcpiOsPrintf ("0x%8.8X, /* Address Range Minimum */\n",
335 Resource->AddressMin);
336 AcpiDmIndent (Level + 1);
337 AcpiOsPrintf ("0x%8.8X, /* Address Range Maximum */\n",
338 Resource->AddressMax);
339 AcpiDmIndent (Level + 1);
340 AcpiOsPrintf ("0x%8.8X, /* Address Translation Offset */\n",
341 Resource->TranslationOffset);
342 AcpiDmIndent (Level + 1);
343 AcpiOsPrintf ("0x%8.8X",
344 Resource->AddressLength);
346 /* Optional fields */
350 AcpiOsPrintf (", 0x%2.2X",
351 Resource->OptionalFields[0]);
355 AcpiOsPrintf (", %s",
356 &Resource->OptionalFields[1]);
358 AcpiOsPrintf (")\n");
362 /*******************************************************************************
364 * FUNCTION: AcpiDmExtendedDescriptor
366 * PARAMETERS: Resource - Pointer to the resource descriptor
367 * Length - Length of the descriptor in bytes
368 * Level - Current source code indentation level
372 * DESCRIPTION: Decode a Extended Address Space descriptor
374 ******************************************************************************/
377 AcpiDmExtendedDescriptor (
378 ASL_EXTENDED_ADDRESS_DESC *Resource,
383 AcpiDmIndent (Level);
384 if (Resource->ResourceType >= 0xC0)
386 AcpiOsPrintf ("ExtendedSpace (0x%2.2X, ", Resource->ResourceType);
387 AcpiDmSpaceFlags (Resource->Flags);
388 AcpiOsPrintf (" 0x%2.2X,", Resource->SpecificFlags);
392 if ((Resource->ResourceType & 0x3) == 1)
394 AcpiOsPrintf ("ExtendedIO (");
395 AcpiDmIoFlags (Resource->Flags);
396 AcpiOsPrintf (" %s,",
397 AcpiGbl_RNGDecode [(Resource->SpecificFlags & 0x3)]);
401 AcpiOsPrintf ("ExtendedMemory (");
402 AcpiDmMemoryFlags (Resource->Flags, Resource->SpecificFlags);
406 /* The QWORD values */
409 AcpiDmIndent (Level + 1);
410 AcpiOsPrintf ("0x%8.8X%8.8X, /* Address Space Granularity */\n",
411 ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->Granularity)));
413 AcpiDmIndent (Level + 1);
414 AcpiOsPrintf ("0x%8.8X%8.8X, /* Address Range Minimum */\n",
415 ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->AddressMin)));
417 AcpiDmIndent (Level + 1);
418 AcpiOsPrintf ("0x%8.8X%8.8X, /* Address Range Maximum */\n",
419 ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->AddressMax)));
421 AcpiDmIndent (Level + 1);
422 AcpiOsPrintf ("0x%8.8X%8.8X, /* Address Translation Offset */\n",
423 ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->TranslationOffset)));
425 AcpiDmIndent (Level + 1);
426 AcpiOsPrintf ("0x%8.8X%8.8X, /* Address Length */\n",
427 ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->AddressLength)));
429 AcpiDmIndent (Level + 1);
430 AcpiOsPrintf ("0x%8.8X%8.8X) /* Type Specific Attributes */\n",
431 ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->TypeSpecificAttributes)));
435 /*******************************************************************************
437 * FUNCTION: AcpiDmQwordDescriptor
439 * PARAMETERS: Resource - Pointer to the resource descriptor
440 * Length - Length of the descriptor in bytes
441 * Level - Current source code indentation level
445 * DESCRIPTION: Decode a QWord Address Space descriptor
447 ******************************************************************************/
450 AcpiDmQwordDescriptor (
451 ASL_QWORD_ADDRESS_DESC *Resource,
456 AcpiDmIndent (Level);
457 if (Resource->ResourceType >= 0xC0)
459 AcpiOsPrintf ("QWordSpace (0x%2.2X, ", Resource->ResourceType);
460 AcpiDmSpaceFlags (Resource->Flags);
461 AcpiOsPrintf (" 0x%2.2X,", Resource->SpecificFlags);
465 AcpiOsPrintf ("Q%s (",
466 AcpiGbl_WordDecode [(Resource->ResourceType & 3)]);
468 if ((Resource->ResourceType & 0x3) == 1)
470 AcpiDmIoFlags (Resource->Flags);
471 AcpiOsPrintf (" %s,",
472 AcpiGbl_RNGDecode [(Resource->SpecificFlags & 0x3)]);
476 AcpiDmMemoryFlags (Resource->Flags, Resource->SpecificFlags);
480 /* The QWORD values */
483 AcpiDmIndent (Level + 1);
484 AcpiOsPrintf ("0x%8.8X%8.8X, /* Address Space Granularity */\n",
485 ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->Granularity)));
487 AcpiDmIndent (Level + 1);
488 AcpiOsPrintf ("0x%8.8X%8.8X, /* Address Range Minimum */\n",
489 ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->AddressMin)));
491 AcpiDmIndent (Level + 1);
492 AcpiOsPrintf ("0x%8.8X%8.8X, /* Address Range Maximum */\n",
493 ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->AddressMax)));
495 AcpiDmIndent (Level + 1);
496 AcpiOsPrintf ("0x%8.8X%8.8X, /* Address Translation Offset */\n",
497 ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->TranslationOffset)));
499 AcpiDmIndent (Level + 1);
500 AcpiOsPrintf ("0x%8.8X%8.8X",
501 ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->AddressLength)));
503 /* Optional fields */
507 AcpiOsPrintf (", 0x%2.2X",
508 Resource->OptionalFields[0]);
512 AcpiOsPrintf (", %s",
513 &Resource->OptionalFields[1]);
516 AcpiOsPrintf (")\n");
520 /*******************************************************************************
522 * FUNCTION: AcpiDmMemory24Descriptor
524 * PARAMETERS: Resource - Pointer to the resource descriptor
525 * Length - Length of the descriptor in bytes
526 * Level - Current source code indentation level
530 * DESCRIPTION: Decode a Memory24 descriptor
532 ******************************************************************************/
535 AcpiDmMemory24Descriptor (
536 ASL_MEMORY_24_DESC *Resource,
541 AcpiDmIndent (Level);
542 AcpiOsPrintf ("Memory24 (%s, 0x%4.4X, 0x%4.4X, 0x%4.4X, 0x%4.4X)\n",
543 AcpiGbl_RWDecode [Resource->Information & 1],
544 (UINT32) Resource->AddressMin,
545 (UINT32) Resource->AddressMax,
546 (UINT32) Resource->Alignment,
547 (UINT32) Resource->RangeLength);
551 /*******************************************************************************
553 * FUNCTION: AcpiDmMemory32Descriptor
555 * PARAMETERS: Resource - Pointer to the resource descriptor
556 * Length - Length of the descriptor in bytes
557 * Level - Current source code indentation level
561 * DESCRIPTION: Decode a Memory32 descriptor
563 ******************************************************************************/
566 AcpiDmMemory32Descriptor (
567 ASL_MEMORY_32_DESC *Resource,
572 AcpiDmIndent (Level);
573 AcpiOsPrintf ("Memory32 (%s, 0x%8.8X, 0x%8.8X, 0x%8.8X, 0x%8.8X)\n",
574 AcpiGbl_RWDecode [Resource->Information & 1],
575 Resource->AddressMin,
576 Resource->AddressMax,
578 Resource->RangeLength);
582 /*******************************************************************************
584 * FUNCTION: AcpiDmFixedMem32Descriptor
586 * PARAMETERS: Resource - Pointer to the resource descriptor
587 * Length - Length of the descriptor in bytes
588 * Level - Current source code indentation level
592 * DESCRIPTION: Decode a Fixed Memory32 descriptor
594 ******************************************************************************/
597 AcpiDmFixedMem32Descriptor (
598 ASL_FIXED_MEMORY_32_DESC *Resource,
603 AcpiDmIndent (Level);
604 AcpiOsPrintf ("Memory32Fixed (%s, 0x%8.8X, 0x%8.8X)\n",
605 AcpiGbl_RWDecode [Resource->Information & 1],
606 Resource->BaseAddress,
607 Resource->RangeLength);
611 /*******************************************************************************
613 * FUNCTION: AcpiDmGenericRegisterDescriptor
615 * PARAMETERS: Resource - Pointer to the resource descriptor
616 * Length - Length of the descriptor in bytes
617 * Level - Current source code indentation level
621 * DESCRIPTION: Decode a Generic Register descriptor
623 ******************************************************************************/
626 AcpiDmGenericRegisterDescriptor (
627 ASL_GENERAL_REGISTER_DESC *Resource,
632 AcpiDmIndent (Level);
633 AcpiOsPrintf ("Register (");
635 AcpiDmAddressSpace (Resource->AddressSpaceId);
637 AcpiOsPrintf ("0x%2.2X, 0x%2.2X, 0x%8.8X%8.8X)\n",
638 (UINT32) Resource->BitWidth,
639 (UINT32) Resource->BitOffset,
640 ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (Resource->Address)));
644 /*******************************************************************************
646 * FUNCTION: AcpiDmInterruptDescriptor
648 * PARAMETERS: Resource - Pointer to the resource descriptor
649 * Length - Length of the descriptor in bytes
650 * Level - Current source code indentation level
654 * DESCRIPTION: Decode a extended Interrupt descriptor
656 ******************************************************************************/
659 AcpiDmInterruptDescriptor (
660 ASL_EXTENDED_XRUPT_DESC *Resource,
668 AcpiDmIndent (Level);
669 AcpiOsPrintf ("Interrupt (%s, %s, %s, %s",
670 AcpiGbl_ConsumeDecode [(Resource->Flags & 1)],
671 AcpiGbl_HEDecode [(Resource->Flags >> 1) & 1],
672 AcpiGbl_LLDecode [(Resource->Flags >> 2) & 1],
673 AcpiGbl_SHRDecode [(Resource->Flags >> 3) & 1]);
675 /* Resource Index/Source, optional -- at end of descriptor */
677 if (Resource->Length > (UINT16) (4 * Resource->TableLength) + 2)
679 /* Get a pointer past the interrupt values */
681 Rover = ((UINT8 *) Resource) + ((4 * Resource->TableLength) + 5);
684 /* Resource Source */
686 AcpiOsPrintf (", 0x%X, \"%s\"", (UINT32) Rover[0], (char *) &Rover[1]);
689 AcpiOsPrintf (")\n");
690 AcpiDmIndent (Level);
691 AcpiOsPrintf ("{\n");
692 for (i = 0; i < Resource->TableLength; i++)
694 AcpiDmIndent (Level + 1);
695 AcpiOsPrintf ("0x%8.8X,\n", (UINT32) Resource->InterruptNumber[i]);
698 AcpiDmIndent (Level);
699 AcpiOsPrintf ("}\n");
703 /*******************************************************************************
705 * FUNCTION: AcpiDmVendorLargeDescriptor
707 * PARAMETERS: Resource - Pointer to the resource descriptor
708 * Length - Length of the descriptor in bytes
709 * Level - Current source code indentation level
713 * DESCRIPTION: Decode a Vendor Large descriptor
715 ******************************************************************************/
718 AcpiDmVendorLargeDescriptor (
719 ASL_LARGE_VENDOR_DESC *Resource,
724 AcpiDmIndent (Level);
725 AcpiOsPrintf ("VendorLong ()\n");
726 AcpiDmIndent (Level);
728 AcpiOsPrintf ("{\n");
730 AcpiDmDisasmByteList (Level + 1, (UINT8 *) Resource->VendorDefined, Length);
731 AcpiDmIndent (Level);
732 AcpiOsPrintf ("}\n");