1 /*******************************************************************************
3 * Module Name: dmresrcl.c - "Large" Resource Descriptor disassembly
5 ******************************************************************************/
7 /******************************************************************************
11 * Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
12 * All rights reserved.
16 * 2.1. This is your license from Intel Corp. under its intellectual property
17 * rights. You may have additional license terms from the party that provided
18 * you this software, covering your right to use that party's intellectual
21 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22 * copy of the source code appearing in this file ("Covered Code") an
23 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24 * base code distributed originally by Intel ("Original Intel Code") to copy,
25 * make derivatives, distribute, use and display any portion of the Covered
26 * Code in any form, with the right to sublicense such rights; and
28 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29 * license (with the right to sublicense), under only those claims of Intel
30 * patents that are infringed by the Original Intel Code, to make, use, sell,
31 * offer to sell, and import the Covered Code and derivative works thereof
32 * solely to the minimum extent necessary to exercise the above copyright
33 * license, and in no event shall the patent license extend to any additions
34 * to or modifications of the Original Intel Code. No other license or right
35 * is granted directly or by implication, estoppel or otherwise;
37 * The above copyright and patent license is granted only if the following
42 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43 * Redistribution of source code of any substantial portion of the Covered
44 * Code or modification with rights to further distribute source must include
45 * the above Copyright Notice, the above License, this list of Conditions,
46 * and the following Disclaimer and Export Compliance provision. In addition,
47 * Licensee must cause all Covered Code to which Licensee contributes to
48 * contain a file documenting the changes Licensee made to create that Covered
49 * Code and the date of any change. Licensee must include in that file the
50 * documentation of any changes made by any predecessor Licensee. Licensee
51 * must include a prominent statement that the modification is derived,
52 * directly or indirectly, from Original Intel Code.
54 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55 * Redistribution of source code of any substantial portion of the Covered
56 * Code or modification without rights to further distribute source must
57 * include the following Disclaimer and Export Compliance provision in the
58 * documentation and/or other materials provided with distribution. In
59 * addition, Licensee may not authorize further sublicense of source of any
60 * portion of the Covered Code, and must include terms to the effect that the
61 * license from Licensee to its licensee is limited to the intellectual
62 * property embodied in the software Licensee provides to its licensee, and
63 * not to intellectual property embodied in modifications its licensee may
66 * 3.3. Redistribution of Executable. Redistribution in executable form of any
67 * substantial portion of the Covered Code or modification must reproduce the
68 * above Copyright Notice, and the following Disclaimer and Export Compliance
69 * provision in the documentation and/or other materials provided with the
72 * 3.4. Intel retains all right, title, and interest in and to the Original
75 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76 * Intel shall be used in advertising or otherwise to promote the sale, use or
77 * other dealings in products derived from or relating to the Covered Code
78 * without prior written authorization from Intel.
80 * 4. Disclaimer and Export Compliance
82 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
90 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
99 * 4.3. Licensee shall not export, either directly or indirectly, any of this
100 * software or system incorporating such software without first obtaining any
101 * required license or other approval from the U. S. Department of Commerce or
102 * any other agency or department of the United States Government. In the
103 * event Licensee exports any such software from the United States or
104 * re-exports any such software from a foreign destination, Licensee shall
105 * ensure that the distribution and export/re-export of the software is in
106 * compliance with all laws, regulations, orders, or other restrictions of the
107 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108 * any of its subsidiaries will export/re-export any technical data, process,
109 * software, or service, directly or indirectly, to any country for which the
110 * United States government or any agency thereof requires an export license,
111 * other governmental approval, or letter of assurance, without first obtaining
112 * such license, approval or letter.
114 *****************************************************************************
116 * Alternatively, you may choose to be licensed under the terms of the
119 * Redistribution and use in source and binary forms, with or without
120 * modification, are permitted provided that the following conditions
122 * 1. Redistributions of source code must retain the above copyright
123 * notice, this list of conditions, and the following disclaimer,
124 * without modification.
125 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126 * substantially similar to the "NO WARRANTY" disclaimer below
127 * ("Disclaimer") and any redistribution must be conditioned upon
128 * including a substantially similar Disclaimer requirement for further
129 * binary redistribution.
130 * 3. Neither the names of the above-listed copyright holders nor the names
131 * of any contributors may be used to endorse or promote products derived
132 * from this software without specific prior written permission.
134 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
146 * Alternatively, you may choose to be licensed under the terms of the
147 * GNU General Public License ("GPL") version 2 as published by the Free
148 * Software Foundation.
150 *****************************************************************************/
152 #include <contrib/dev/acpica/include/acpi.h>
153 #include <contrib/dev/acpica/include/accommon.h>
154 #include <contrib/dev/acpica/include/acdisasm.h>
157 #define _COMPONENT ACPI_CA_DEBUGGER
158 ACPI_MODULE_NAME ("dbresrcl")
161 /* Common names for address and memory descriptors */
163 static const char *AcpiDmAddressNames[] =
168 "Translation Offset",
172 static const char *AcpiDmMemoryNames[] =
181 /* Local prototypes */
193 UINT8 SpecificFlags);
198 UINT8 SpecificFlags);
202 UINT8 SpecificFlags);
205 AcpiDmResourceSource (
206 AML_RESOURCE *Resource,
207 ACPI_SIZE MinimumLength,
211 AcpiDmAddressFields (
217 AcpiDmAddressPrefix (
221 AcpiDmAddressCommon (
222 AML_RESOURCE *Resource,
228 AML_RESOURCE *Resource);
231 /*******************************************************************************
233 * FUNCTION: AcpiDmMemoryFields
235 * PARAMETERS: Source - Pointer to the contiguous data fields
236 * Type - 16 or 32 (bit)
237 * Level - Current source code indentation level
241 * DESCRIPTION: Decode fields common to Memory24 and Memory32 descriptors
243 ******************************************************************************/
254 for (i = 0; i < 4; i++)
256 AcpiDmIndent (Level + 1);
262 AcpiDmDumpInteger16 (ACPI_CAST_PTR (UINT16, Source)[i],
263 AcpiDmMemoryNames[i]);
268 AcpiDmDumpInteger32 (ACPI_CAST_PTR (UINT32, Source)[i],
269 AcpiDmMemoryNames[i]);
280 /*******************************************************************************
282 * FUNCTION: AcpiDmAddressFields
284 * PARAMETERS: Source - Pointer to the contiguous data fields
285 * Type - 16, 32, or 64 (bit)
286 * Level - Current source code indentation level
290 * DESCRIPTION: Decode fields common to address descriptors
292 ******************************************************************************/
295 AcpiDmAddressFields (
305 for (i = 0; i < 5; i++)
307 AcpiDmIndent (Level + 1);
313 AcpiDmDumpInteger16 (ACPI_CAST_PTR (UINT16, Source)[i],
314 AcpiDmAddressNames[i]);
319 AcpiDmDumpInteger32 (ACPI_CAST_PTR (UINT32, Source)[i],
320 AcpiDmAddressNames[i]);
325 AcpiDmDumpInteger64 (ACPI_CAST_PTR (UINT64, Source)[i],
326 AcpiDmAddressNames[i]);
337 /*******************************************************************************
339 * FUNCTION: AcpiDmAddressPrefix
341 * PARAMETERS: Type - Descriptor type
345 * DESCRIPTION: Emit name prefix representing the address descriptor type
347 ******************************************************************************/
350 AcpiDmAddressPrefix (
356 case ACPI_RESOURCE_TYPE_ADDRESS16:
358 AcpiOsPrintf ("Word");
361 case ACPI_RESOURCE_TYPE_ADDRESS32:
363 AcpiOsPrintf ("DWord");
366 case ACPI_RESOURCE_TYPE_ADDRESS64:
368 AcpiOsPrintf ("QWord");
371 case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
373 AcpiOsPrintf ("Extended");
383 /*******************************************************************************
385 * FUNCTION: AcpiDmAddressCommon
387 * PARAMETERS: Resource - Raw AML descriptor
388 * Type - Descriptor type
389 * Level - Current source code indentation level
393 * DESCRIPTION: Emit common name and flag fields common to address descriptors
395 ******************************************************************************/
398 AcpiDmAddressCommon (
399 AML_RESOURCE *Resource,
408 ResourceType = Resource->Address.ResourceType;
409 SpecificFlags = Resource->Address.SpecificFlags;
410 Flags = Resource->Address.Flags;
412 AcpiDmIndent (Level);
414 /* Validate ResourceType */
416 if ((ResourceType > 2) && (ResourceType < 0xC0))
419 "/**** Invalid Resource Type: 0x%X ****/", ResourceType);
423 /* Prefix is either Word, DWord, QWord, or Extended */
425 AcpiDmAddressPrefix (Type);
427 /* Resource Types above 0xC0 are vendor-defined */
429 if (ResourceType > 2)
431 AcpiOsPrintf ("Space (0x%2.2X, ", ResourceType);
432 AcpiDmSpaceFlags (Flags);
433 AcpiOsPrintf (" 0x%2.2X,", SpecificFlags);
437 /* This is either a Memory, IO, or BusNumber descriptor (0,1,2) */
439 AcpiOsPrintf ("%s (",
440 AcpiGbl_WordDecode [ACPI_GET_2BIT_FLAG (ResourceType)]);
442 /* Decode the general and type-specific flags */
444 if (ResourceType == ACPI_MEMORY_RANGE)
446 AcpiDmMemoryFlags (Flags, SpecificFlags);
448 else /* IO range or BusNumberRange */
450 AcpiDmIoFlags (Flags);
451 if (ResourceType == ACPI_IO_RANGE)
453 AcpiOsPrintf (" %s,",
454 AcpiGbl_RngDecode [ACPI_GET_2BIT_FLAG (SpecificFlags)]);
460 /*******************************************************************************
462 * FUNCTION: AcpiDmAddressFlags
464 * PARAMETERS: Resource - Raw AML descriptor
468 * DESCRIPTION: Emit flags common to address descriptors
470 ******************************************************************************/
474 AML_RESOURCE *Resource)
477 if (Resource->Address.ResourceType == ACPI_IO_RANGE)
479 AcpiDmIoFlags2 (Resource->Address.SpecificFlags);
481 else if (Resource->Address.ResourceType == ACPI_MEMORY_RANGE)
483 AcpiDmMemoryFlags2 (Resource->Address.SpecificFlags);
488 /*******************************************************************************
490 * FUNCTION: AcpiDmSpaceFlags
492 * PARAMETERS: Flags - Flag byte to be decoded
496 * DESCRIPTION: Decode the flags specific to Space Address space descriptors
498 ******************************************************************************/
505 AcpiOsPrintf ("%s, %s, %s, %s,",
506 AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Flags)],
507 AcpiGbl_DecDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 1)],
508 AcpiGbl_MinDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 2)],
509 AcpiGbl_MaxDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 3)]);
513 /*******************************************************************************
515 * FUNCTION: AcpiDmIoFlags
517 * PARAMETERS: Flags - Flag byte to be decoded
521 * DESCRIPTION: Decode the flags specific to IO Address space descriptors
523 ******************************************************************************/
529 AcpiOsPrintf ("%s, %s, %s, %s,",
530 AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Flags)],
531 AcpiGbl_MinDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 2)],
532 AcpiGbl_MaxDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 3)],
533 AcpiGbl_DecDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 1)]);
537 /*******************************************************************************
539 * FUNCTION: AcpiDmIoFlags2
541 * PARAMETERS: SpecificFlags - "Specific" flag byte to be decoded
545 * DESCRIPTION: Decode the flags specific to IO Address space descriptors
547 ******************************************************************************/
556 AcpiOsPrintf (", %s",
557 AcpiGbl_TtpDecode [ACPI_EXTRACT_1BIT_FLAG (SpecificFlags, 4)]);
560 * TRS is only used if TTP is TypeTranslation. However, the disassembler
561 * always emits exactly what is in the AML.
563 AcpiOsPrintf (", %s",
564 AcpiGbl_TrsDecode [ACPI_EXTRACT_1BIT_FLAG (SpecificFlags, 5)]);
568 /*******************************************************************************
570 * FUNCTION: AcpiDmMemoryFlags
572 * PARAMETERS: Flags - Flag byte to be decoded
573 * SpecificFlags - "Specific" flag byte to be decoded
577 * DESCRIPTION: Decode flags specific to Memory Address Space descriptors
579 ******************************************************************************/
587 AcpiOsPrintf ("%s, %s, %s, %s, %s, %s,",
588 AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Flags)],
589 AcpiGbl_DecDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 1)],
590 AcpiGbl_MinDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 2)],
591 AcpiGbl_MaxDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 3)],
592 AcpiGbl_MemDecode [ACPI_EXTRACT_2BIT_FLAG (SpecificFlags, 1)],
593 AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (SpecificFlags)]);
597 /*******************************************************************************
599 * FUNCTION: AcpiDmMemoryFlags2
601 * PARAMETERS: SpecificFlags - "Specific" flag byte to be decoded
605 * DESCRIPTION: Decode flags specific to Memory Address Space descriptors
607 ******************************************************************************/
614 AcpiOsPrintf (", %s, %s",
615 AcpiGbl_MtpDecode [ACPI_EXTRACT_2BIT_FLAG (SpecificFlags, 3)],
616 AcpiGbl_TtpDecode [ACPI_EXTRACT_1BIT_FLAG (SpecificFlags, 5)]);
620 /*******************************************************************************
622 * FUNCTION: AcpiDmResourceSource
624 * PARAMETERS: Resource - Raw AML descriptor
625 * MinimumLength - descriptor length without optional fields
630 * DESCRIPTION: Dump optional ResourceSource fields of an address descriptor
632 ******************************************************************************/
635 AcpiDmResourceSource (
636 AML_RESOURCE *Resource,
637 ACPI_SIZE MinimumTotalLength,
638 UINT32 ResourceLength)
640 UINT8 *AmlResourceSource;
644 TotalLength = ResourceLength + sizeof (AML_RESOURCE_LARGE_HEADER);
646 /* Check if the optional ResourceSource fields are present */
648 if (TotalLength <= MinimumTotalLength)
650 /* The two optional fields are not used */
652 AcpiOsPrintf (",, ");
656 /* Get a pointer to the ResourceSource */
658 AmlResourceSource = ACPI_ADD_PTR (UINT8, Resource, MinimumTotalLength);
661 * Always emit the ResourceSourceIndex (Byte)
663 * NOTE: Some ASL compilers always create a 0 byte (in the AML) for the
664 * Index even if the String does not exist. Although this is in violation
665 * of the ACPI specification, it is very important to emit ASL code that
666 * can be compiled back to the identical AML. There may be fields and/or
667 * indexes into the resource template buffer that are compiled to absolute
668 * offsets, and these will be broken if the AML length is changed.
670 AcpiOsPrintf ("0x%2.2X,", (UINT32) AmlResourceSource[0]);
672 /* Make sure that the ResourceSource string exists before dumping it */
674 if (TotalLength > (MinimumTotalLength + 1))
677 AcpiUtPrintString ((char *) &AmlResourceSource[1], ACPI_UINT16_MAX);
684 /*******************************************************************************
686 * FUNCTION: AcpiDmWordDescriptor
688 * PARAMETERS: Info - Extra resource info
689 * Resource - Pointer to the resource descriptor
690 * Length - Length of the descriptor in bytes
691 * Level - Current source code indentation level
695 * DESCRIPTION: Decode a Word Address Space descriptor
697 ******************************************************************************/
700 AcpiDmWordDescriptor (
701 ACPI_OP_WALK_INFO *Info,
702 AML_RESOURCE *Resource,
707 /* Dump resource name and flags */
709 AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_ADDRESS16, Level);
711 /* Dump the 5 contiguous WORD values */
713 AcpiDmAddressFields (&Resource->Address16.Granularity, 16, Level);
715 /* The ResourceSource fields are optional */
717 AcpiDmIndent (Level + 1);
718 AcpiDmResourceSource (Resource, sizeof (AML_RESOURCE_ADDRESS16), Length);
720 /* Insert a descriptor name */
722 AcpiDmDescriptorName ();
724 /* Type-specific flags */
726 AcpiDmAddressFlags (Resource);
727 AcpiOsPrintf (")\n");
731 /*******************************************************************************
733 * FUNCTION: AcpiDmDwordDescriptor
735 * PARAMETERS: Info - Extra resource info
736 * Resource - Pointer to the resource descriptor
737 * Length - Length of the descriptor in bytes
738 * Level - Current source code indentation level
742 * DESCRIPTION: Decode a DWord Address Space descriptor
744 ******************************************************************************/
747 AcpiDmDwordDescriptor (
748 ACPI_OP_WALK_INFO *Info,
749 AML_RESOURCE *Resource,
754 /* Dump resource name and flags */
756 AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_ADDRESS32, Level);
758 /* Dump the 5 contiguous DWORD values */
760 AcpiDmAddressFields (&Resource->Address32.Granularity, 32, Level);
762 /* The ResourceSource fields are optional */
764 AcpiDmIndent (Level + 1);
765 AcpiDmResourceSource (Resource, sizeof (AML_RESOURCE_ADDRESS32), Length);
767 /* Insert a descriptor name */
769 AcpiDmDescriptorName ();
771 /* Type-specific flags */
773 AcpiDmAddressFlags (Resource);
774 AcpiOsPrintf (")\n");
778 /*******************************************************************************
780 * FUNCTION: AcpiDmQwordDescriptor
782 * PARAMETERS: Info - Extra resource info
783 * Resource - Pointer to the resource descriptor
784 * Length - Length of the descriptor in bytes
785 * Level - Current source code indentation level
789 * DESCRIPTION: Decode a QWord Address Space descriptor
791 ******************************************************************************/
794 AcpiDmQwordDescriptor (
795 ACPI_OP_WALK_INFO *Info,
796 AML_RESOURCE *Resource,
801 /* Dump resource name and flags */
803 AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_ADDRESS64, Level);
805 /* Dump the 5 contiguous QWORD values */
807 AcpiDmAddressFields (&Resource->Address64.Granularity, 64, Level);
809 /* The ResourceSource fields are optional */
811 AcpiDmIndent (Level + 1);
812 AcpiDmResourceSource (Resource, sizeof (AML_RESOURCE_ADDRESS64), Length);
814 /* Insert a descriptor name */
816 AcpiDmDescriptorName ();
818 /* Type-specific flags */
820 AcpiDmAddressFlags (Resource);
821 AcpiOsPrintf (")\n");
825 /*******************************************************************************
827 * FUNCTION: AcpiDmExtendedDescriptor
829 * PARAMETERS: Info - Extra resource info
830 * Resource - Pointer to the resource descriptor
831 * Length - Length of the descriptor in bytes
832 * Level - Current source code indentation level
836 * DESCRIPTION: Decode a Extended Address Space descriptor
838 ******************************************************************************/
841 AcpiDmExtendedDescriptor (
842 ACPI_OP_WALK_INFO *Info,
843 AML_RESOURCE *Resource,
848 /* Dump resource name and flags */
850 AcpiDmAddressCommon (
851 Resource, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64, Level);
853 /* Dump the 5 contiguous QWORD values */
855 AcpiDmAddressFields (&Resource->ExtAddress64.Granularity, 64, Level);
857 /* Extra field for this descriptor only */
859 AcpiDmIndent (Level + 1);
860 AcpiDmDumpInteger64 (Resource->ExtAddress64.TypeSpecific,
861 "Type-Specific Attributes");
863 /* Insert a descriptor name */
865 AcpiDmIndent (Level + 1);
866 AcpiDmDescriptorName ();
868 /* Type-specific flags */
870 AcpiDmAddressFlags (Resource);
871 AcpiOsPrintf (")\n");
875 /*******************************************************************************
877 * FUNCTION: AcpiDmMemory24Descriptor
879 * PARAMETERS: Info - Extra resource info
880 * Resource - Pointer to the resource descriptor
881 * Length - Length of the descriptor in bytes
882 * Level - Current source code indentation level
886 * DESCRIPTION: Decode a Memory24 descriptor
888 ******************************************************************************/
891 AcpiDmMemory24Descriptor (
892 ACPI_OP_WALK_INFO *Info,
893 AML_RESOURCE *Resource,
898 /* Dump name and read/write flag */
900 AcpiDmIndent (Level);
901 AcpiOsPrintf ("Memory24 (%s,\n",
902 AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->Memory24.Flags)]);
904 /* Dump the 4 contiguous WORD values */
906 AcpiDmMemoryFields (&Resource->Memory24.Minimum, 16, Level);
908 /* Insert a descriptor name */
910 AcpiDmIndent (Level + 1);
911 AcpiDmDescriptorName ();
912 AcpiOsPrintf (")\n");
916 /*******************************************************************************
918 * FUNCTION: AcpiDmMemory32Descriptor
920 * PARAMETERS: Info - Extra resource info
921 * Resource - Pointer to the resource descriptor
922 * Length - Length of the descriptor in bytes
923 * Level - Current source code indentation level
927 * DESCRIPTION: Decode a Memory32 descriptor
929 ******************************************************************************/
932 AcpiDmMemory32Descriptor (
933 ACPI_OP_WALK_INFO *Info,
934 AML_RESOURCE *Resource,
939 /* Dump name and read/write flag */
941 AcpiDmIndent (Level);
942 AcpiOsPrintf ("Memory32 (%s,\n",
943 AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->Memory32.Flags)]);
945 /* Dump the 4 contiguous DWORD values */
947 AcpiDmMemoryFields (&Resource->Memory32.Minimum, 32, Level);
949 /* Insert a descriptor name */
951 AcpiDmIndent (Level + 1);
952 AcpiDmDescriptorName ();
953 AcpiOsPrintf (")\n");
957 /*******************************************************************************
959 * FUNCTION: AcpiDmFixedMemory32Descriptor
961 * PARAMETERS: Info - Extra resource info
962 * Resource - Pointer to the resource descriptor
963 * Length - Length of the descriptor in bytes
964 * Level - Current source code indentation level
968 * DESCRIPTION: Decode a Fixed Memory32 descriptor
970 ******************************************************************************/
973 AcpiDmFixedMemory32Descriptor (
974 ACPI_OP_WALK_INFO *Info,
975 AML_RESOURCE *Resource,
980 /* Dump name and read/write flag */
982 AcpiDmIndent (Level);
983 AcpiOsPrintf ("Memory32Fixed (%s,\n",
984 AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->FixedMemory32.Flags)]);
986 AcpiDmIndent (Level + 1);
987 AcpiDmDumpInteger32 (Resource->FixedMemory32.Address,
990 AcpiDmIndent (Level + 1);
991 AcpiDmDumpInteger32 (Resource->FixedMemory32.AddressLength,
994 /* Insert a descriptor name */
996 AcpiDmIndent (Level + 1);
997 AcpiDmDescriptorName ();
998 AcpiOsPrintf (")\n");
1002 /*******************************************************************************
1004 * FUNCTION: AcpiDmGenericRegisterDescriptor
1006 * PARAMETERS: Info - Extra resource info
1007 * Resource - Pointer to the resource descriptor
1008 * Length - Length of the descriptor in bytes
1009 * Level - Current source code indentation level
1013 * DESCRIPTION: Decode a Generic Register descriptor
1015 ******************************************************************************/
1018 AcpiDmGenericRegisterDescriptor (
1019 ACPI_OP_WALK_INFO *Info,
1020 AML_RESOURCE *Resource,
1025 AcpiDmIndent (Level);
1026 AcpiOsPrintf ("Register (");
1027 AcpiDmAddressSpace (Resource->GenericReg.AddressSpaceId);
1028 AcpiOsPrintf ("\n");
1030 AcpiDmIndent (Level + 1);
1031 AcpiDmDumpInteger8 (Resource->GenericReg.BitWidth, "Bit Width");
1033 AcpiDmIndent (Level + 1);
1034 AcpiDmDumpInteger8 (Resource->GenericReg.BitOffset, "Bit Offset");
1036 AcpiDmIndent (Level + 1);
1037 AcpiDmDumpInteger64 (Resource->GenericReg.Address, "Address");
1039 /* Optional field for ACPI 3.0 */
1041 AcpiDmIndent (Level + 1);
1042 if (Resource->GenericReg.AccessSize)
1044 AcpiOsPrintf ("0x%2.2X, // %s\n",
1045 Resource->GenericReg.AccessSize, "Access Size");
1046 AcpiDmIndent (Level + 1);
1053 /* DescriptorName was added for ACPI 3.0+ */
1055 AcpiDmDescriptorName ();
1056 AcpiOsPrintf (")\n");
1060 /*******************************************************************************
1062 * FUNCTION: AcpiDmInterruptDescriptor
1064 * PARAMETERS: Info - Extra resource info
1065 * Resource - Pointer to the resource descriptor
1066 * Length - Length of the descriptor in bytes
1067 * Level - Current source code indentation level
1071 * DESCRIPTION: Decode a extended Interrupt descriptor
1073 ******************************************************************************/
1076 AcpiDmInterruptDescriptor (
1077 ACPI_OP_WALK_INFO *Info,
1078 AML_RESOURCE *Resource,
1085 AcpiDmIndent (Level);
1086 AcpiOsPrintf ("Interrupt (%s, %s, %s, %s, ",
1087 AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->ExtendedIrq.Flags)],
1088 AcpiGbl_HeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->ExtendedIrq.Flags, 1)],
1089 AcpiGbl_LlDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->ExtendedIrq.Flags, 2)],
1090 AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->ExtendedIrq.Flags, 3)]);
1093 * The ResourceSource fields are optional and appear after the interrupt
1094 * list. Must compute length based on length of the list. First xrupt
1095 * is included in the struct (reason for -1 below)
1097 AcpiDmResourceSource (Resource,
1098 sizeof (AML_RESOURCE_EXTENDED_IRQ) +
1099 ((UINT32) Resource->ExtendedIrq.InterruptCount - 1) * sizeof (UINT32),
1100 Resource->ExtendedIrq.ResourceLength);
1102 /* Insert a descriptor name */
1104 AcpiDmDescriptorName ();
1105 AcpiOsPrintf (")\n");
1107 /* Dump the interrupt list */
1109 AcpiDmIndent (Level);
1110 AcpiOsPrintf ("{\n");
1111 for (i = 0; i < Resource->ExtendedIrq.InterruptCount; i++)
1113 AcpiDmIndent (Level + 1);
1114 AcpiOsPrintf ("0x%8.8X,\n",
1115 (UINT32) Resource->ExtendedIrq.Interrupts[i]);
1118 AcpiDmIndent (Level);
1119 AcpiOsPrintf ("}\n");
1123 /*******************************************************************************
1125 * FUNCTION: AcpiDmVendorCommon
1127 * PARAMETERS: Name - Descriptor name suffix
1128 * ByteData - Pointer to the vendor byte data
1129 * Length - Length of the byte data
1130 * Level - Current source code indentation level
1134 * DESCRIPTION: Decode a Vendor descriptor, both Large and Small
1136 ******************************************************************************/
1139 AcpiDmVendorCommon (
1146 /* Dump macro name */
1148 AcpiDmIndent (Level);
1149 AcpiOsPrintf ("Vendor%s (", Name);
1151 /* Insert a descriptor name */
1153 AcpiDmDescriptorName ();
1154 AcpiOsPrintf (") // Length = 0x%.2X\n", Length);
1156 /* Dump the vendor bytes */
1158 AcpiDmIndent (Level);
1159 AcpiOsPrintf ("{\n");
1161 AcpiDmDisasmByteList (Level + 1, ByteData, Length);
1163 AcpiDmIndent (Level);
1164 AcpiOsPrintf ("}\n");
1168 /*******************************************************************************
1170 * FUNCTION: AcpiDmVendorLargeDescriptor
1172 * PARAMETERS: Info - Extra resource info
1173 * Resource - Pointer to the resource descriptor
1174 * Length - Length of the descriptor in bytes
1175 * Level - Current source code indentation level
1179 * DESCRIPTION: Decode a Vendor Large descriptor
1181 ******************************************************************************/
1184 AcpiDmVendorLargeDescriptor (
1185 ACPI_OP_WALK_INFO *Info,
1186 AML_RESOURCE *Resource,
1191 AcpiDmVendorCommon ("Long ",
1192 ACPI_ADD_PTR (UINT8, Resource, sizeof (AML_RESOURCE_LARGE_HEADER)),