xref: /onnv-gate/usr/src/uts/intel/io/acpica/disassembler/dmresrcl.c (revision 9980:13d7f3eec672)
13446Smrj /*******************************************************************************
23446Smrj  *
33446Smrj  * Module Name: dmresrcl.c - "Large" Resource Descriptor disassembly
43446Smrj  *
53446Smrj  ******************************************************************************/
63446Smrj 
73446Smrj /******************************************************************************
83446Smrj  *
93446Smrj  * 1. Copyright Notice
103446Smrj  *
11*9980SDana.Myers@Sun.COM  * Some or all of this work - Copyright (c) 1999 - 2009, Intel Corp.
123446Smrj  * All rights reserved.
133446Smrj  *
143446Smrj  * 2. License
153446Smrj  *
163446Smrj  * 2.1. This is your license from Intel Corp. under its intellectual property
173446Smrj  * rights.  You may have additional license terms from the party that provided
183446Smrj  * you this software, covering your right to use that party's intellectual
193446Smrj  * property rights.
203446Smrj  *
213446Smrj  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
223446Smrj  * copy of the source code appearing in this file ("Covered Code") an
233446Smrj  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
243446Smrj  * base code distributed originally by Intel ("Original Intel Code") to copy,
253446Smrj  * make derivatives, distribute, use and display any portion of the Covered
263446Smrj  * Code in any form, with the right to sublicense such rights; and
273446Smrj  *
283446Smrj  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
293446Smrj  * license (with the right to sublicense), under only those claims of Intel
303446Smrj  * patents that are infringed by the Original Intel Code, to make, use, sell,
313446Smrj  * offer to sell, and import the Covered Code and derivative works thereof
323446Smrj  * solely to the minimum extent necessary to exercise the above copyright
333446Smrj  * license, and in no event shall the patent license extend to any additions
343446Smrj  * to or modifications of the Original Intel Code.  No other license or right
353446Smrj  * is granted directly or by implication, estoppel or otherwise;
363446Smrj  *
373446Smrj  * The above copyright and patent license is granted only if the following
383446Smrj  * conditions are met:
393446Smrj  *
403446Smrj  * 3. Conditions
413446Smrj  *
423446Smrj  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
433446Smrj  * Redistribution of source code of any substantial portion of the Covered
443446Smrj  * Code or modification with rights to further distribute source must include
453446Smrj  * the above Copyright Notice, the above License, this list of Conditions,
463446Smrj  * and the following Disclaimer and Export Compliance provision.  In addition,
473446Smrj  * Licensee must cause all Covered Code to which Licensee contributes to
483446Smrj  * contain a file documenting the changes Licensee made to create that Covered
493446Smrj  * Code and the date of any change.  Licensee must include in that file the
503446Smrj  * documentation of any changes made by any predecessor Licensee.  Licensee
513446Smrj  * must include a prominent statement that the modification is derived,
523446Smrj  * directly or indirectly, from Original Intel Code.
533446Smrj  *
543446Smrj  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
553446Smrj  * Redistribution of source code of any substantial portion of the Covered
563446Smrj  * Code or modification without rights to further distribute source must
573446Smrj  * include the following Disclaimer and Export Compliance provision in the
583446Smrj  * documentation and/or other materials provided with distribution.  In
593446Smrj  * addition, Licensee may not authorize further sublicense of source of any
603446Smrj  * portion of the Covered Code, and must include terms to the effect that the
613446Smrj  * license from Licensee to its licensee is limited to the intellectual
623446Smrj  * property embodied in the software Licensee provides to its licensee, and
633446Smrj  * not to intellectual property embodied in modifications its licensee may
643446Smrj  * make.
653446Smrj  *
663446Smrj  * 3.3. Redistribution of Executable. Redistribution in executable form of any
673446Smrj  * substantial portion of the Covered Code or modification must reproduce the
683446Smrj  * above Copyright Notice, and the following Disclaimer and Export Compliance
693446Smrj  * provision in the documentation and/or other materials provided with the
703446Smrj  * distribution.
713446Smrj  *
723446Smrj  * 3.4. Intel retains all right, title, and interest in and to the Original
733446Smrj  * Intel Code.
743446Smrj  *
753446Smrj  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
763446Smrj  * Intel shall be used in advertising or otherwise to promote the sale, use or
773446Smrj  * other dealings in products derived from or relating to the Covered Code
783446Smrj  * without prior written authorization from Intel.
793446Smrj  *
803446Smrj  * 4. Disclaimer and Export Compliance
813446Smrj  *
823446Smrj  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
833446Smrj  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
843446Smrj  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
853446Smrj  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
863446Smrj  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
873446Smrj  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
883446Smrj  * PARTICULAR PURPOSE.
893446Smrj  *
903446Smrj  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
913446Smrj  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
923446Smrj  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
933446Smrj  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
943446Smrj  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
953446Smrj  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
963446Smrj  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
973446Smrj  * LIMITED REMEDY.
983446Smrj  *
993446Smrj  * 4.3. Licensee shall not export, either directly or indirectly, any of this
1003446Smrj  * software or system incorporating such software without first obtaining any
1013446Smrj  * required license or other approval from the U. S. Department of Commerce or
1023446Smrj  * any other agency or department of the United States Government.  In the
1033446Smrj  * event Licensee exports any such software from the United States or
1043446Smrj  * re-exports any such software from a foreign destination, Licensee shall
1053446Smrj  * ensure that the distribution and export/re-export of the software is in
1063446Smrj  * compliance with all laws, regulations, orders, or other restrictions of the
1073446Smrj  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
1083446Smrj  * any of its subsidiaries will export/re-export any technical data, process,
1093446Smrj  * software, or service, directly or indirectly, to any country for which the
1103446Smrj  * United States government or any agency thereof requires an export license,
1113446Smrj  * other governmental approval, or letter of assurance, without first obtaining
1123446Smrj  * such license, approval or letter.
1133446Smrj  *
1143446Smrj  *****************************************************************************/
1153446Smrj 
1163446Smrj 
1173446Smrj #include "acpi.h"
118*9980SDana.Myers@Sun.COM #include "accommon.h"
1193446Smrj #include "acdisasm.h"
1203446Smrj 
1213446Smrj 
1223446Smrj #ifdef ACPI_DISASSEMBLER
1233446Smrj 
1243446Smrj #define _COMPONENT          ACPI_CA_DEBUGGER
1253446Smrj         ACPI_MODULE_NAME    ("dbresrcl")
1263446Smrj 
1273446Smrj 
1283446Smrj /* Common names for address and memory descriptors */
1293446Smrj 
1303446Smrj static char                 *AcpiDmAddressNames[] =
1313446Smrj {
1323446Smrj     "Granularity",
1333446Smrj     "Range Minimum",
1343446Smrj     "Range Maximum",
1353446Smrj     "Translation Offset",
1363446Smrj     "Length"
1373446Smrj };
1383446Smrj 
1393446Smrj static char                 *AcpiDmMemoryNames[] =
1403446Smrj {
1413446Smrj     "Range Minimum",
1423446Smrj     "Range Maximum",
1433446Smrj     "Alignment",
1443446Smrj     "Length"
1453446Smrj };
1463446Smrj 
1473446Smrj 
1483446Smrj /* Local prototypes */
1493446Smrj 
1503446Smrj static void
1513446Smrj AcpiDmSpaceFlags (
1523446Smrj         UINT8               Flags);
1533446Smrj 
1543446Smrj static void
1553446Smrj AcpiDmIoFlags (
1563446Smrj         UINT8               Flags);
1573446Smrj 
1583446Smrj static void
1593446Smrj AcpiDmIoFlags2 (
1603446Smrj         UINT8               SpecificFlags);
1613446Smrj 
1623446Smrj static void
1633446Smrj AcpiDmMemoryFlags (
1643446Smrj     UINT8                   Flags,
1653446Smrj     UINT8                   SpecificFlags);
1663446Smrj 
1673446Smrj static void
1683446Smrj AcpiDmMemoryFlags2 (
1693446Smrj     UINT8                   SpecificFlags);
1703446Smrj 
1713446Smrj static void
1723446Smrj AcpiDmResourceSource (
1733446Smrj     AML_RESOURCE            *Resource,
1743446Smrj     ACPI_SIZE               MinimumLength,
1753446Smrj     UINT32                  Length);
1763446Smrj 
1773446Smrj static void
1783446Smrj AcpiDmAddressFields (
1793446Smrj     void                    *Source,
1803446Smrj     UINT8                   Type,
1813446Smrj     UINT32                  Level);
1823446Smrj 
1833446Smrj static void
1843446Smrj AcpiDmAddressPrefix (
1853446Smrj     UINT8                   Type);
1863446Smrj 
1873446Smrj static void
1883446Smrj AcpiDmAddressCommon (
1893446Smrj     AML_RESOURCE            *Resource,
1903446Smrj     UINT8                   Type,
1913446Smrj     UINT32                  Level);
1923446Smrj 
1933446Smrj static void
1943446Smrj AcpiDmAddressFlags (
1953446Smrj     AML_RESOURCE            *Resource);
1963446Smrj 
1973446Smrj 
1983446Smrj /*******************************************************************************
1993446Smrj  *
2003446Smrj  * FUNCTION:    AcpiDmMemoryFields
2013446Smrj  *
2023446Smrj  * PARAMETERS:  Source              - Pointer to the contiguous data fields
2033446Smrj  *              Type                - 16 or 32 (bit)
2043446Smrj  *              Level               - Current source code indentation level
2053446Smrj  *
2063446Smrj  * RETURN:      None
2073446Smrj  *
2083446Smrj  * DESCRIPTION: Decode fields common to Memory24 and Memory32 descriptors
2093446Smrj  *
2103446Smrj  ******************************************************************************/
2113446Smrj 
2123446Smrj static void
AcpiDmMemoryFields(void * Source,UINT8 Type,UINT32 Level)2133446Smrj AcpiDmMemoryFields (
2143446Smrj     void                    *Source,
2153446Smrj     UINT8                   Type,
2163446Smrj     UINT32                  Level)
2173446Smrj {
2187851SDana.Myers@Sun.COM     UINT32                  i;
2193446Smrj 
2203446Smrj 
2213446Smrj     for (i = 0; i < 4; i++)
2223446Smrj     {
2233446Smrj         AcpiDmIndent (Level + 1);
2243446Smrj 
2253446Smrj         switch (Type)
2263446Smrj         {
2273446Smrj         case 16:
2283446Smrj             AcpiDmDumpInteger16 (ACPI_CAST_PTR (UINT16, Source)[i],
2293446Smrj                 AcpiDmMemoryNames[i]);
2303446Smrj             break;
2313446Smrj 
2323446Smrj         case 32:
2333446Smrj             AcpiDmDumpInteger32 (ACPI_CAST_PTR (UINT32, Source)[i],
2343446Smrj                 AcpiDmMemoryNames[i]);
2353446Smrj             break;
2363446Smrj 
2373446Smrj         default:
2383446Smrj             return;
2393446Smrj         }
2403446Smrj     }
2413446Smrj }
2423446Smrj 
2433446Smrj 
2443446Smrj /*******************************************************************************
2453446Smrj  *
2463446Smrj  * FUNCTION:    AcpiDmAddressFields
2473446Smrj  *
2483446Smrj  * PARAMETERS:  Source              - Pointer to the contiguous data fields
2493446Smrj  *              Type                - 16, 32, or 64 (bit)
2503446Smrj  *              Level               - Current source code indentation level
2513446Smrj  *
2523446Smrj  * RETURN:      None
2533446Smrj  *
2543446Smrj  * DESCRIPTION: Decode fields common to address descriptors
2553446Smrj  *
2563446Smrj  ******************************************************************************/
2573446Smrj 
2583446Smrj static void
AcpiDmAddressFields(void * Source,UINT8 Type,UINT32 Level)2593446Smrj AcpiDmAddressFields (
2603446Smrj     void                    *Source,
2613446Smrj     UINT8                   Type,
2623446Smrj     UINT32                  Level)
2633446Smrj {
2647851SDana.Myers@Sun.COM     UINT32                  i;
2653446Smrj 
2663446Smrj 
2673446Smrj     AcpiOsPrintf ("\n");
2683446Smrj 
2693446Smrj     for (i = 0; i < 5; i++)
2703446Smrj     {
2713446Smrj         AcpiDmIndent (Level + 1);
2723446Smrj 
2733446Smrj         switch (Type)
2743446Smrj         {
2753446Smrj         case 16:
2763446Smrj             AcpiDmDumpInteger16 (ACPI_CAST_PTR (UINT16, Source)[i],
2773446Smrj                 AcpiDmAddressNames[i]);
2783446Smrj             break;
2793446Smrj 
2803446Smrj         case 32:
2813446Smrj             AcpiDmDumpInteger32 (ACPI_CAST_PTR (UINT32, Source)[i],
2823446Smrj                 AcpiDmAddressNames[i]);
2833446Smrj             break;
2843446Smrj 
2853446Smrj         case 64:
2863446Smrj             AcpiDmDumpInteger64 (ACPI_CAST_PTR (UINT64, Source)[i],
2873446Smrj                 AcpiDmAddressNames[i]);
2883446Smrj             break;
2893446Smrj 
2903446Smrj         default:
2913446Smrj             return;
2923446Smrj         }
2933446Smrj     }
2943446Smrj }
2953446Smrj 
2963446Smrj 
2973446Smrj /*******************************************************************************
2983446Smrj  *
2993446Smrj  * FUNCTION:    AcpiDmAddressPrefix
3003446Smrj  *
3013446Smrj  * PARAMETERS:  Type                - Descriptor type
3023446Smrj  *
3033446Smrj  * RETURN:      None
3043446Smrj  *
3053446Smrj  * DESCRIPTION: Emit name prefix representing the address descriptor type
3063446Smrj  *
3073446Smrj  ******************************************************************************/
3083446Smrj 
3093446Smrj static void
AcpiDmAddressPrefix(UINT8 Type)3103446Smrj AcpiDmAddressPrefix (
3113446Smrj     UINT8                   Type)
3123446Smrj {
3133446Smrj 
3143446Smrj     switch (Type)
3153446Smrj     {
3163446Smrj     case ACPI_RESOURCE_TYPE_ADDRESS16:
3173446Smrj         AcpiOsPrintf ("Word");
3183446Smrj         break;
3193446Smrj 
3203446Smrj     case ACPI_RESOURCE_TYPE_ADDRESS32:
3213446Smrj         AcpiOsPrintf ("DWord");
3223446Smrj         break;
3233446Smrj 
3243446Smrj     case ACPI_RESOURCE_TYPE_ADDRESS64:
3253446Smrj         AcpiOsPrintf ("QWord");
3263446Smrj         break;
3273446Smrj 
3283446Smrj     case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
3293446Smrj         AcpiOsPrintf ("Extended");
3303446Smrj         break;
3313446Smrj 
3323446Smrj     default:
3333446Smrj         return;
3343446Smrj     }
3353446Smrj }
3363446Smrj 
3373446Smrj 
3383446Smrj /*******************************************************************************
3393446Smrj  *
3403446Smrj  * FUNCTION:    AcpiDmAddressCommon
3413446Smrj  *
3423446Smrj  * PARAMETERS:  Resource            - Raw AML descriptor
3433446Smrj  *              Type                - Descriptor type
3443446Smrj  *              Level               - Current source code indentation level
3453446Smrj  *
3463446Smrj  * RETURN:      None
3473446Smrj  *
3483446Smrj  * DESCRIPTION: Emit common name and flag fields common to address descriptors
3493446Smrj  *
3503446Smrj  ******************************************************************************/
3513446Smrj 
3523446Smrj static void
AcpiDmAddressCommon(AML_RESOURCE * Resource,UINT8 Type,UINT32 Level)3533446Smrj AcpiDmAddressCommon (
3543446Smrj     AML_RESOURCE            *Resource,
3553446Smrj     UINT8                   Type,
3563446Smrj     UINT32                  Level)
3573446Smrj {
3583446Smrj     UINT8                   ResourceType;
3593446Smrj     UINT8                   SpecificFlags;
3603446Smrj     UINT8                   Flags;
3613446Smrj 
3623446Smrj 
3633446Smrj     ResourceType = Resource->Address.ResourceType;
3643446Smrj     SpecificFlags = Resource->Address.SpecificFlags;
3653446Smrj     Flags = Resource->Address.Flags;
3663446Smrj 
3673446Smrj     AcpiDmIndent (Level);
3683446Smrj 
3693446Smrj     /* Validate ResourceType */
3703446Smrj 
3713446Smrj     if ((ResourceType > 2) && (ResourceType < 0xC0))
3723446Smrj     {
3733446Smrj         AcpiOsPrintf ("/**** Invalid Resource Type: 0x%X ****/", ResourceType);
3743446Smrj         return;
3753446Smrj     }
3763446Smrj 
3773446Smrj     /* Prefix is either Word, DWord, QWord, or Extended */
3783446Smrj 
3793446Smrj     AcpiDmAddressPrefix (Type);
3803446Smrj 
3813446Smrj     /* Resource Types above 0xC0 are vendor-defined */
3823446Smrj 
3833446Smrj     if (ResourceType > 2)
3843446Smrj     {
3853446Smrj         AcpiOsPrintf ("Space (0x%2.2X, ", ResourceType);
3863446Smrj         AcpiDmSpaceFlags (Flags);
3873446Smrj         AcpiOsPrintf (" 0x%2.2X,", SpecificFlags);
3883446Smrj         return;
3893446Smrj     }
3903446Smrj 
3913446Smrj     /* This is either a Memory, IO, or BusNumber descriptor (0,1,2) */
3923446Smrj 
3933446Smrj     AcpiOsPrintf ("%s (", AcpiGbl_WordDecode [ResourceType & 0x3]);
3943446Smrj 
3953446Smrj     /* Decode the general and type-specific flags */
3963446Smrj 
3973446Smrj     if (ResourceType == ACPI_MEMORY_RANGE)
3983446Smrj     {
3993446Smrj         AcpiDmMemoryFlags (Flags, SpecificFlags);
4003446Smrj     }
4013446Smrj     else /* IO range or BusNumberRange */
4023446Smrj     {
4033446Smrj         AcpiDmIoFlags (Flags);
4043446Smrj         if (ResourceType == ACPI_IO_RANGE)
4053446Smrj         {
4063446Smrj             AcpiOsPrintf (" %s,", AcpiGbl_RngDecode [SpecificFlags & 0x3]);
4073446Smrj         }
4083446Smrj     }
4093446Smrj }
4103446Smrj 
4113446Smrj 
4123446Smrj /*******************************************************************************
4133446Smrj  *
4143446Smrj  * FUNCTION:    AcpiDmAddressFlags
4153446Smrj  *
4163446Smrj  * PARAMETERS:  Resource        - Raw AML descriptor
4173446Smrj  *
4183446Smrj  * RETURN:      None
4193446Smrj  *
4203446Smrj  * DESCRIPTION: Emit flags common to address descriptors
4213446Smrj  *
4223446Smrj  ******************************************************************************/
4233446Smrj 
4243446Smrj static void
AcpiDmAddressFlags(AML_RESOURCE * Resource)4253446Smrj AcpiDmAddressFlags (
4263446Smrj     AML_RESOURCE            *Resource)
4273446Smrj {
4283446Smrj 
4293446Smrj     if (Resource->Address.ResourceType == ACPI_IO_RANGE)
4303446Smrj     {
4313446Smrj         AcpiDmIoFlags2 (Resource->Address.SpecificFlags);
4323446Smrj     }
4333446Smrj     else if (Resource->Address.ResourceType == ACPI_MEMORY_RANGE)
4343446Smrj     {
4353446Smrj         AcpiDmMemoryFlags2 (Resource->Address.SpecificFlags);
4363446Smrj     }
4373446Smrj }
4383446Smrj 
4393446Smrj 
4403446Smrj /*******************************************************************************
4413446Smrj  *
4423446Smrj  * FUNCTION:    AcpiDmSpaceFlags
4433446Smrj  *
4443446Smrj  * PARAMETERS:  Flags               - Flag byte to be decoded
4453446Smrj  *
4463446Smrj  * RETURN:      None
4473446Smrj  *
4483446Smrj  * DESCRIPTION: Decode the flags specific to Space Address space descriptors
4493446Smrj  *
4503446Smrj  ******************************************************************************/
4513446Smrj 
4523446Smrj static void
AcpiDmSpaceFlags(UINT8 Flags)4533446Smrj AcpiDmSpaceFlags (
4543446Smrj     UINT8                   Flags)
4553446Smrj {
4563446Smrj 
4573446Smrj     AcpiOsPrintf ("%s, %s, %s, %s,",
4583446Smrj         AcpiGbl_ConsumeDecode [(Flags & 1)],
4593446Smrj         AcpiGbl_DecDecode [(Flags & 0x2) >> 1],
4603446Smrj         AcpiGbl_MinDecode [(Flags & 0x4) >> 2],
4613446Smrj         AcpiGbl_MaxDecode [(Flags & 0x8) >> 3]);
4623446Smrj }
4633446Smrj 
4643446Smrj 
4653446Smrj /*******************************************************************************
4663446Smrj  *
4673446Smrj  * FUNCTION:    AcpiDmIoFlags
4683446Smrj  *
4693446Smrj  * PARAMETERS:  Flags               - Flag byte to be decoded
4703446Smrj  *
4713446Smrj  * RETURN:      None
4723446Smrj  *
4733446Smrj  * DESCRIPTION: Decode the flags specific to IO Address space descriptors
4743446Smrj  *
4753446Smrj  ******************************************************************************/
4763446Smrj 
4773446Smrj static void
AcpiDmIoFlags(UINT8 Flags)4783446Smrj AcpiDmIoFlags (
4793446Smrj         UINT8               Flags)
4803446Smrj {
4813446Smrj     AcpiOsPrintf ("%s, %s, %s, %s,",
4823446Smrj         AcpiGbl_ConsumeDecode [(Flags & 1)],
4833446Smrj         AcpiGbl_MinDecode [(Flags & 0x4) >> 2],
4843446Smrj         AcpiGbl_MaxDecode [(Flags & 0x8) >> 3],
4853446Smrj         AcpiGbl_DecDecode [(Flags & 0x2) >> 1]);
4863446Smrj }
4873446Smrj 
4883446Smrj 
4893446Smrj /*******************************************************************************
4903446Smrj  *
4913446Smrj  * FUNCTION:    AcpiDmIoFlags2
4923446Smrj  *
4933446Smrj  * PARAMETERS:  SpecificFlags       - "Specific" flag byte to be decoded
4943446Smrj  *
4953446Smrj  * RETURN:      None
4963446Smrj  *
4973446Smrj  * DESCRIPTION: Decode the flags specific to IO Address space descriptors
4983446Smrj  *
4993446Smrj  ******************************************************************************/
5003446Smrj 
5013446Smrj static void
AcpiDmIoFlags2(UINT8 SpecificFlags)5023446Smrj AcpiDmIoFlags2 (
5033446Smrj         UINT8               SpecificFlags)
5043446Smrj {
5053446Smrj 
5063446Smrj     AcpiOsPrintf (", %s",
5073446Smrj         AcpiGbl_TtpDecode [(SpecificFlags & 0x10) >> 4]);
5083446Smrj 
5093446Smrj     /* TRS is only used if TTP is TypeTranslation */
5103446Smrj 
5113446Smrj     if (SpecificFlags & 0x10)
5123446Smrj     {
5133446Smrj         AcpiOsPrintf (", %s",
5143446Smrj             AcpiGbl_TrsDecode [(SpecificFlags & 0x20) >> 5]);
5153446Smrj     }
5163446Smrj }
5173446Smrj 
5183446Smrj 
5193446Smrj /*******************************************************************************
5203446Smrj  *
5213446Smrj  * FUNCTION:    AcpiDmMemoryFlags
5223446Smrj  *
5233446Smrj  * PARAMETERS:  Flags               - Flag byte to be decoded
5243446Smrj  *              SpecificFlags       - "Specific" flag byte to be decoded
5253446Smrj  *
5263446Smrj  * RETURN:      None
5273446Smrj  *
5283446Smrj  * DESCRIPTION: Decode flags specific to Memory Address Space descriptors
5293446Smrj  *
5303446Smrj  ******************************************************************************/
5313446Smrj 
5323446Smrj static void
AcpiDmMemoryFlags(UINT8 Flags,UINT8 SpecificFlags)5333446Smrj AcpiDmMemoryFlags (
5343446Smrj     UINT8                   Flags,
5353446Smrj     UINT8                   SpecificFlags)
5363446Smrj {
5373446Smrj 
5383446Smrj     AcpiOsPrintf ("%s, %s, %s, %s, %s, %s,",
5393446Smrj         AcpiGbl_ConsumeDecode [(Flags & 1)],
5403446Smrj         AcpiGbl_DecDecode [(Flags & 0x2) >> 1],
5413446Smrj         AcpiGbl_MinDecode [(Flags & 0x4) >> 2],
5423446Smrj         AcpiGbl_MaxDecode [(Flags & 0x8) >> 3],
5433446Smrj         AcpiGbl_MemDecode [(SpecificFlags & 0x6) >> 1],
5443446Smrj         AcpiGbl_RwDecode [(SpecificFlags & 0x1)]);
5453446Smrj }
5463446Smrj 
5473446Smrj 
5483446Smrj /*******************************************************************************
5493446Smrj  *
5503446Smrj  * FUNCTION:    AcpiDmMemoryFlags2
5513446Smrj  *
5523446Smrj  * PARAMETERS:  SpecificFlags       - "Specific" flag byte to be decoded
5533446Smrj  *
5543446Smrj  * RETURN:      None
5553446Smrj  *
5563446Smrj  * DESCRIPTION: Decode flags specific to Memory Address Space descriptors
5573446Smrj  *
5583446Smrj  ******************************************************************************/
5593446Smrj 
5603446Smrj static void
AcpiDmMemoryFlags2(UINT8 SpecificFlags)5613446Smrj AcpiDmMemoryFlags2 (
5623446Smrj     UINT8                   SpecificFlags)
5633446Smrj {
5643446Smrj 
5653446Smrj     AcpiOsPrintf (", %s, %s",
5663446Smrj         AcpiGbl_MtpDecode [(SpecificFlags & 0x18) >> 3],
5673446Smrj         AcpiGbl_TtpDecode [(SpecificFlags & 0x20) >> 5]);
5683446Smrj }
5693446Smrj 
5703446Smrj 
5713446Smrj /*******************************************************************************
5723446Smrj  *
5733446Smrj  * FUNCTION:    AcpiDmResourceSource
5743446Smrj  *
5753446Smrj  * PARAMETERS:  Resource        - Raw AML descriptor
5763446Smrj  *              MinimumLength   - descriptor length without optional fields
5773446Smrj  *              ResourceLength
5783446Smrj  *
5793446Smrj  * RETURN:      None
5803446Smrj  *
5813446Smrj  * DESCRIPTION: Dump optional ResourceSource fields of an address descriptor
5823446Smrj  *
5833446Smrj  ******************************************************************************/
5843446Smrj 
5853446Smrj static void
AcpiDmResourceSource(AML_RESOURCE * Resource,ACPI_SIZE MinimumTotalLength,UINT32 ResourceLength)5863446Smrj AcpiDmResourceSource (
5873446Smrj     AML_RESOURCE            *Resource,
5883446Smrj     ACPI_SIZE               MinimumTotalLength,
5893446Smrj     UINT32                  ResourceLength)
5903446Smrj {
5913446Smrj     UINT8                   *AmlResourceSource;
5923446Smrj     UINT32                  TotalLength;
5933446Smrj 
5943446Smrj 
5953446Smrj     TotalLength = ResourceLength + sizeof (AML_RESOURCE_LARGE_HEADER);
5963446Smrj 
5973446Smrj     /* Check if the optional ResourceSource fields are present */
5983446Smrj 
5993446Smrj     if (TotalLength <= MinimumTotalLength)
6003446Smrj     {
6013446Smrj         /* The two optional fields are not used */
6023446Smrj 
6033446Smrj         AcpiOsPrintf (",, ");
6043446Smrj         return;
6053446Smrj     }
6063446Smrj 
6073446Smrj     /* Get a pointer to the ResourceSource */
6083446Smrj 
6093446Smrj     AmlResourceSource = ACPI_ADD_PTR (UINT8, Resource, MinimumTotalLength);
6103446Smrj 
6113446Smrj     /*
6123446Smrj      * Always emit the ResourceSourceIndex (Byte)
6133446Smrj      *
6143446Smrj      * NOTE: Some ASL compilers always create a 0 byte (in the AML) for the
6153446Smrj      * Index even if the String does not exist. Although this is in violation
6163446Smrj      * of the ACPI specification, it is very important to emit ASL code that
6173446Smrj      * can be compiled back to the identical AML. There may be fields and/or
6183446Smrj      * indexes into the resource template buffer that are compiled to absolute
6193446Smrj      * offsets, and these will be broken if the AML length is changed.
6203446Smrj      */
6213446Smrj     AcpiOsPrintf ("0x%2.2X,", (UINT32) AmlResourceSource[0]);
6223446Smrj 
6233446Smrj     /* Make sure that the ResourceSource string exists before dumping it */
6243446Smrj 
6253446Smrj     if (TotalLength > (MinimumTotalLength + 1))
6263446Smrj     {
6273446Smrj         AcpiOsPrintf (" ");
6283446Smrj         AcpiUtPrintString ((char *) &AmlResourceSource[1], ACPI_UINT8_MAX);
6293446Smrj     }
6303446Smrj 
6313446Smrj     AcpiOsPrintf (", ");
6323446Smrj }
6333446Smrj 
6343446Smrj 
6353446Smrj /*******************************************************************************
6363446Smrj  *
6373446Smrj  * FUNCTION:    AcpiDmWordDescriptor
6383446Smrj  *
6393446Smrj  * PARAMETERS:  Resource            - Pointer to the resource descriptor
6403446Smrj  *              Length              - Length of the descriptor in bytes
6413446Smrj  *              Level               - Current source code indentation level
6423446Smrj  *
6433446Smrj  * RETURN:      None
6443446Smrj  *
6453446Smrj  * DESCRIPTION: Decode a Word Address Space descriptor
6463446Smrj  *
6473446Smrj  ******************************************************************************/
6483446Smrj 
6493446Smrj void
AcpiDmWordDescriptor(AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)6503446Smrj AcpiDmWordDescriptor (
6513446Smrj     AML_RESOURCE            *Resource,
6523446Smrj     UINT32                  Length,
6533446Smrj     UINT32                  Level)
6543446Smrj {
6553446Smrj 
6563446Smrj     /* Dump resource name and flags */
6573446Smrj 
6583446Smrj     AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_ADDRESS16, Level);
6593446Smrj 
6603446Smrj     /* Dump the 5 contiguous WORD values */
6613446Smrj 
6623446Smrj     AcpiDmAddressFields (&Resource->Address16.Granularity, 16, Level);
6633446Smrj 
6643446Smrj     /* The ResourceSource fields are optional */
6653446Smrj 
6663446Smrj     AcpiDmIndent (Level + 1);
6673446Smrj     AcpiDmResourceSource (Resource, sizeof (AML_RESOURCE_ADDRESS16), Length);
6683446Smrj 
6693446Smrj     /* Insert a descriptor name */
6703446Smrj 
6713446Smrj     AcpiDmDescriptorName ();
6723446Smrj 
6733446Smrj     /* Type-specific flags */
6743446Smrj 
6753446Smrj     AcpiDmAddressFlags (Resource);
6763446Smrj     AcpiOsPrintf (")\n");
6773446Smrj }
6783446Smrj 
6793446Smrj 
6803446Smrj /*******************************************************************************
6813446Smrj  *
6823446Smrj  * FUNCTION:    AcpiDmDwordDescriptor
6833446Smrj  *
6843446Smrj  * PARAMETERS:  Resource            - Pointer to the resource descriptor
6853446Smrj  *              Length              - Length of the descriptor in bytes
6863446Smrj  *              Level               - Current source code indentation level
6873446Smrj  *
6883446Smrj  * RETURN:      None
6893446Smrj  *
6903446Smrj  * DESCRIPTION: Decode a DWord Address Space descriptor
6913446Smrj  *
6923446Smrj  ******************************************************************************/
6933446Smrj 
6943446Smrj void
AcpiDmDwordDescriptor(AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)6953446Smrj AcpiDmDwordDescriptor (
6963446Smrj     AML_RESOURCE            *Resource,
6973446Smrj     UINT32                  Length,
6983446Smrj     UINT32                  Level)
6993446Smrj {
7003446Smrj 
7013446Smrj     /* Dump resource name and flags */
7023446Smrj 
7033446Smrj     AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_ADDRESS32, Level);
7043446Smrj 
7053446Smrj     /* Dump the 5 contiguous DWORD values */
7063446Smrj 
7073446Smrj     AcpiDmAddressFields (&Resource->Address32.Granularity, 32, Level);
7083446Smrj 
7093446Smrj     /* The ResourceSource fields are optional */
7103446Smrj 
7113446Smrj     AcpiDmIndent (Level + 1);
7123446Smrj     AcpiDmResourceSource (Resource, sizeof (AML_RESOURCE_ADDRESS32), Length);
7133446Smrj 
7143446Smrj     /* Insert a descriptor name */
7153446Smrj 
7163446Smrj     AcpiDmDescriptorName ();
7173446Smrj 
7183446Smrj     /* Type-specific flags */
7193446Smrj 
7203446Smrj     AcpiDmAddressFlags (Resource);
7213446Smrj     AcpiOsPrintf (")\n");
7223446Smrj }
7233446Smrj 
7243446Smrj 
7253446Smrj /*******************************************************************************
7263446Smrj  *
7273446Smrj  * FUNCTION:    AcpiDmQwordDescriptor
7283446Smrj  *
7293446Smrj  * PARAMETERS:  Resource            - Pointer to the resource descriptor
7303446Smrj  *              Length              - Length of the descriptor in bytes
7313446Smrj  *              Level               - Current source code indentation level
7323446Smrj  *
7333446Smrj  * RETURN:      None
7343446Smrj  *
7353446Smrj  * DESCRIPTION: Decode a QWord Address Space descriptor
7363446Smrj  *
7373446Smrj  ******************************************************************************/
7383446Smrj 
7393446Smrj void
AcpiDmQwordDescriptor(AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)7403446Smrj AcpiDmQwordDescriptor (
7413446Smrj     AML_RESOURCE            *Resource,
7423446Smrj     UINT32                  Length,
7433446Smrj     UINT32                  Level)
7443446Smrj {
7453446Smrj 
7463446Smrj     /* Dump resource name and flags */
7473446Smrj 
7483446Smrj     AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_ADDRESS64, Level);
7493446Smrj 
7503446Smrj     /* Dump the 5 contiguous QWORD values */
7513446Smrj 
7523446Smrj     AcpiDmAddressFields (&Resource->Address64.Granularity, 64, Level);
7533446Smrj 
7543446Smrj     /* The ResourceSource fields are optional */
7553446Smrj 
7563446Smrj     AcpiDmIndent (Level + 1);
7573446Smrj     AcpiDmResourceSource (Resource, sizeof (AML_RESOURCE_ADDRESS64), Length);
7583446Smrj 
7593446Smrj     /* Insert a descriptor name */
7603446Smrj 
7613446Smrj     AcpiDmDescriptorName ();
7623446Smrj 
7633446Smrj     /* Type-specific flags */
7643446Smrj 
7653446Smrj     AcpiDmAddressFlags (Resource);
7663446Smrj     AcpiOsPrintf (")\n");
7673446Smrj }
7683446Smrj 
7693446Smrj 
7703446Smrj /*******************************************************************************
7713446Smrj  *
7723446Smrj  * FUNCTION:    AcpiDmExtendedDescriptor
7733446Smrj  *
7743446Smrj  * PARAMETERS:  Resource            - Pointer to the resource descriptor
7753446Smrj  *              Length              - Length of the descriptor in bytes
7763446Smrj  *              Level               - Current source code indentation level
7773446Smrj  *
7783446Smrj  * RETURN:      None
7793446Smrj  *
7803446Smrj  * DESCRIPTION: Decode a Extended Address Space descriptor
7813446Smrj  *
7823446Smrj  ******************************************************************************/
7833446Smrj 
7843446Smrj void
AcpiDmExtendedDescriptor(AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)7853446Smrj AcpiDmExtendedDescriptor (
7863446Smrj     AML_RESOURCE            *Resource,
7873446Smrj     UINT32                  Length,
7883446Smrj     UINT32                  Level)
7893446Smrj {
7903446Smrj 
7913446Smrj     /* Dump resource name and flags */
7923446Smrj 
7933446Smrj     AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64, Level);
7943446Smrj 
7953446Smrj     /* Dump the 5 contiguous QWORD values */
7963446Smrj 
7973446Smrj     AcpiDmAddressFields (&Resource->ExtAddress64.Granularity, 64, Level);
7983446Smrj 
7993446Smrj     /* Extra field for this descriptor only */
8003446Smrj 
8013446Smrj     AcpiDmIndent (Level + 1);
8023446Smrj     AcpiDmDumpInteger64 (Resource->ExtAddress64.TypeSpecific,
8033446Smrj         "Type-Specific Attributes");
8043446Smrj 
8053446Smrj     /* Insert a descriptor name */
8063446Smrj 
8073446Smrj     AcpiDmIndent (Level + 1);
8083446Smrj     AcpiDmDescriptorName ();
8093446Smrj 
8103446Smrj     /* Type-specific flags */
8113446Smrj 
8123446Smrj     AcpiDmAddressFlags (Resource);
8133446Smrj     AcpiOsPrintf (")\n");
8143446Smrj }
8153446Smrj 
8163446Smrj 
8173446Smrj /*******************************************************************************
8183446Smrj  *
8193446Smrj  * FUNCTION:    AcpiDmMemory24Descriptor
8203446Smrj  *
8213446Smrj  * PARAMETERS:  Resource            - Pointer to the resource descriptor
8223446Smrj  *              Length              - Length of the descriptor in bytes
8233446Smrj  *              Level               - Current source code indentation level
8243446Smrj  *
8253446Smrj  * RETURN:      None
8263446Smrj  *
8273446Smrj  * DESCRIPTION: Decode a Memory24 descriptor
8283446Smrj  *
8293446Smrj  ******************************************************************************/
8303446Smrj 
8313446Smrj void
AcpiDmMemory24Descriptor(AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)8323446Smrj AcpiDmMemory24Descriptor (
8333446Smrj     AML_RESOURCE            *Resource,
8343446Smrj     UINT32                  Length,
8353446Smrj     UINT32                  Level)
8363446Smrj {
8373446Smrj 
8383446Smrj     /* Dump name and read/write flag */
8393446Smrj 
8403446Smrj     AcpiDmIndent (Level);
8413446Smrj     AcpiOsPrintf ("Memory24 (%s,\n",
8423446Smrj         AcpiGbl_RwDecode [Resource->Memory24.Flags & 1]);
8433446Smrj 
8443446Smrj     /* Dump the 4 contiguous WORD values */
8453446Smrj 
8463446Smrj     AcpiDmMemoryFields (&Resource->Memory24.Minimum, 16, Level);
8473446Smrj 
8483446Smrj     /* Insert a descriptor name */
8493446Smrj 
8503446Smrj     AcpiDmIndent (Level + 1);
8513446Smrj     AcpiDmDescriptorName ();
8523446Smrj     AcpiOsPrintf (")\n");
8533446Smrj }
8543446Smrj 
8553446Smrj 
8563446Smrj /*******************************************************************************
8573446Smrj  *
8583446Smrj  * FUNCTION:    AcpiDmMemory32Descriptor
8593446Smrj  *
8603446Smrj  * PARAMETERS:  Resource            - Pointer to the resource descriptor
8613446Smrj  *              Length              - Length of the descriptor in bytes
8623446Smrj  *              Level               - Current source code indentation level
8633446Smrj  *
8643446Smrj  * RETURN:      None
8653446Smrj  *
8663446Smrj  * DESCRIPTION: Decode a Memory32 descriptor
8673446Smrj  *
8683446Smrj  ******************************************************************************/
8693446Smrj 
8703446Smrj void
AcpiDmMemory32Descriptor(AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)8713446Smrj AcpiDmMemory32Descriptor (
8723446Smrj     AML_RESOURCE            *Resource,
8733446Smrj     UINT32                  Length,
8743446Smrj     UINT32                  Level)
8753446Smrj {
8763446Smrj 
8773446Smrj     /* Dump name and read/write flag */
8783446Smrj 
8793446Smrj     AcpiDmIndent (Level);
8803446Smrj     AcpiOsPrintf ("Memory32 (%s,\n",
8813446Smrj         AcpiGbl_RwDecode [Resource->Memory32.Flags & 1]);
8823446Smrj 
8833446Smrj     /* Dump the 4 contiguous DWORD values */
8843446Smrj 
8853446Smrj     AcpiDmMemoryFields (&Resource->Memory32.Minimum, 32, Level);
8863446Smrj 
8873446Smrj     /* Insert a descriptor name */
8883446Smrj 
8893446Smrj     AcpiDmIndent (Level + 1);
8903446Smrj     AcpiDmDescriptorName ();
8913446Smrj     AcpiOsPrintf (")\n");
8923446Smrj }
8933446Smrj 
8943446Smrj 
8953446Smrj /*******************************************************************************
8963446Smrj  *
8973446Smrj  * FUNCTION:    AcpiDmFixedMemory32Descriptor
8983446Smrj  *
8993446Smrj  * PARAMETERS:  Resource            - Pointer to the resource descriptor
9003446Smrj  *              Length              - Length of the descriptor in bytes
9013446Smrj  *              Level               - Current source code indentation level
9023446Smrj  *
9033446Smrj  * RETURN:      None
9043446Smrj  *
9053446Smrj  * DESCRIPTION: Decode a Fixed Memory32 descriptor
9063446Smrj  *
9073446Smrj  ******************************************************************************/
9083446Smrj 
9093446Smrj void
AcpiDmFixedMemory32Descriptor(AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)9103446Smrj AcpiDmFixedMemory32Descriptor (
9113446Smrj     AML_RESOURCE            *Resource,
9123446Smrj     UINT32                  Length,
9133446Smrj     UINT32                  Level)
9143446Smrj {
9153446Smrj 
9163446Smrj     /* Dump name and read/write flag */
9173446Smrj 
9183446Smrj     AcpiDmIndent (Level);
9193446Smrj     AcpiOsPrintf ("Memory32Fixed (%s,\n",
9203446Smrj         AcpiGbl_RwDecode [Resource->FixedMemory32.Flags & 1]);
9213446Smrj 
9223446Smrj     AcpiDmIndent (Level + 1);
9233446Smrj     AcpiDmDumpInteger32 (Resource->FixedMemory32.Address, "Address Base");
9243446Smrj 
9253446Smrj     AcpiDmIndent (Level + 1);
9263446Smrj     AcpiDmDumpInteger32 (Resource->FixedMemory32.AddressLength, "Address Length");
9273446Smrj 
9283446Smrj     /* Insert a descriptor name */
9293446Smrj 
9303446Smrj     AcpiDmIndent (Level + 1);
9313446Smrj     AcpiDmDescriptorName ();
9323446Smrj     AcpiOsPrintf (")\n");
9333446Smrj }
9343446Smrj 
9353446Smrj 
9363446Smrj /*******************************************************************************
9373446Smrj  *
9383446Smrj  * FUNCTION:    AcpiDmGenericRegisterDescriptor
9393446Smrj  *
9403446Smrj  * PARAMETERS:  Resource            - Pointer to the resource descriptor
9413446Smrj  *              Length              - Length of the descriptor in bytes
9423446Smrj  *              Level               - Current source code indentation level
9433446Smrj  *
9443446Smrj  * RETURN:      None
9453446Smrj  *
9463446Smrj  * DESCRIPTION: Decode a Generic Register descriptor
9473446Smrj  *
9483446Smrj  ******************************************************************************/
9493446Smrj 
9503446Smrj void
AcpiDmGenericRegisterDescriptor(AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)9513446Smrj AcpiDmGenericRegisterDescriptor (
9523446Smrj     AML_RESOURCE            *Resource,
9533446Smrj     UINT32                  Length,
9543446Smrj     UINT32                  Level)
9553446Smrj {
9563446Smrj 
9573446Smrj     AcpiDmIndent (Level);
9583446Smrj     AcpiOsPrintf ("Register (");
9593446Smrj     AcpiDmAddressSpace (Resource->GenericReg.AddressSpaceId);
9603446Smrj     AcpiOsPrintf ("\n");
9613446Smrj 
9623446Smrj     AcpiDmIndent (Level + 1);
9633446Smrj     AcpiDmDumpInteger8 (Resource->GenericReg.BitWidth, "Bit Width");
9643446Smrj 
9653446Smrj     AcpiDmIndent (Level + 1);
9663446Smrj     AcpiDmDumpInteger8 (Resource->GenericReg.BitOffset, "Bit Offset");
9673446Smrj 
9683446Smrj     AcpiDmIndent (Level + 1);
9693446Smrj     AcpiDmDumpInteger64 (Resource->GenericReg.Address, "Address");
9703446Smrj 
9713446Smrj     /* Optional field for ACPI 3.0 */
9723446Smrj 
9733446Smrj     AcpiDmIndent (Level + 1);
9743446Smrj     if (Resource->GenericReg.AccessSize)
9753446Smrj     {
9763446Smrj         AcpiOsPrintf ("0x%2.2X,               // %s\n",
9773446Smrj             Resource->GenericReg.AccessSize, "Access Size");
9783446Smrj         AcpiDmIndent (Level + 1);
9793446Smrj     }
9803446Smrj     else
9813446Smrj     {
9823446Smrj         AcpiOsPrintf (",");
9833446Smrj     }
9843446Smrj 
9853446Smrj     /* DescriptorName was added for ACPI 3.0+ */
9863446Smrj 
9873446Smrj     AcpiDmDescriptorName ();
9883446Smrj     AcpiOsPrintf (")\n");
9893446Smrj }
9903446Smrj 
9913446Smrj 
9923446Smrj /*******************************************************************************
9933446Smrj  *
9943446Smrj  * FUNCTION:    AcpiDmInterruptDescriptor
9953446Smrj  *
9963446Smrj  * PARAMETERS:  Resource            - Pointer to the resource descriptor
9973446Smrj  *              Length              - Length of the descriptor in bytes
9983446Smrj  *              Level               - Current source code indentation level
9993446Smrj  *
10003446Smrj  * RETURN:      None
10013446Smrj  *
10023446Smrj  * DESCRIPTION: Decode a extended Interrupt descriptor
10033446Smrj  *
10043446Smrj  ******************************************************************************/
10053446Smrj 
10063446Smrj void
AcpiDmInterruptDescriptor(AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)10073446Smrj AcpiDmInterruptDescriptor (
10083446Smrj     AML_RESOURCE            *Resource,
10093446Smrj     UINT32                  Length,
10103446Smrj     UINT32                  Level)
10113446Smrj {
10123446Smrj     UINT32                  i;
10133446Smrj 
10143446Smrj 
10153446Smrj     AcpiDmIndent (Level);
10163446Smrj     AcpiOsPrintf ("Interrupt (%s, %s, %s, %s, ",
10173446Smrj         AcpiGbl_ConsumeDecode [(Resource->ExtendedIrq.Flags & 1)],
10183446Smrj         AcpiGbl_HeDecode [(Resource->ExtendedIrq.Flags >> 1) & 1],
10193446Smrj         AcpiGbl_LlDecode [(Resource->ExtendedIrq.Flags >> 2) & 1],
10203446Smrj         AcpiGbl_ShrDecode [(Resource->ExtendedIrq.Flags >> 3) & 1]);
10213446Smrj 
10223446Smrj     /*
10233446Smrj      * The ResourceSource fields are optional and appear after the interrupt
10243446Smrj      * list. Must compute length based on length of the list. First xrupt
10253446Smrj      * is included in the struct (reason for -1 below)
10263446Smrj      */
10273446Smrj     AcpiDmResourceSource (Resource,
10283446Smrj         sizeof (AML_RESOURCE_EXTENDED_IRQ) +
1029*9980SDana.Myers@Sun.COM             ((UINT32) Resource->ExtendedIrq.InterruptCount - 1) * sizeof (UINT32),
10303446Smrj         Resource->ExtendedIrq.ResourceLength);
10313446Smrj 
10323446Smrj     /* Insert a descriptor name */
10333446Smrj 
10343446Smrj     AcpiDmDescriptorName ();
10353446Smrj     AcpiOsPrintf (")\n");
10363446Smrj 
10373446Smrj     /* Dump the interrupt list */
10383446Smrj 
10393446Smrj     AcpiDmIndent (Level);
10403446Smrj     AcpiOsPrintf ("{\n");
10413446Smrj     for (i = 0; i < Resource->ExtendedIrq.InterruptCount; i++)
10423446Smrj     {
10433446Smrj         AcpiDmIndent (Level + 1);
10443446Smrj         AcpiOsPrintf ("0x%8.8X,\n",
10453446Smrj             (UINT32) Resource->ExtendedIrq.Interrupts[i]);
10463446Smrj     }
10473446Smrj 
10483446Smrj     AcpiDmIndent (Level);
10493446Smrj     AcpiOsPrintf ("}\n");
10503446Smrj }
10513446Smrj 
10523446Smrj 
10533446Smrj /*******************************************************************************
10543446Smrj  *
10553446Smrj  * FUNCTION:    AcpiDmVendorCommon
10563446Smrj  *
10573446Smrj  * PARAMETERS:  Name                - Descriptor name suffix
10583446Smrj  *              ByteData            - Pointer to the vendor byte data
10593446Smrj  *              Length              - Length of the byte data
10603446Smrj  *              Level               - Current source code indentation level
10613446Smrj  *
10623446Smrj  * RETURN:      None
10633446Smrj  *
10643446Smrj  * DESCRIPTION: Decode a Vendor descriptor, both Large and Small
10653446Smrj  *
10663446Smrj  ******************************************************************************/
10673446Smrj 
10683446Smrj void
AcpiDmVendorCommon(char * Name,UINT8 * ByteData,UINT32 Length,UINT32 Level)10693446Smrj AcpiDmVendorCommon (
10703446Smrj     char                    *Name,
10713446Smrj     UINT8                   *ByteData,
10723446Smrj     UINT32                  Length,
10733446Smrj     UINT32                  Level)
10743446Smrj {
10753446Smrj 
10763446Smrj     /* Dump macro name */
10773446Smrj 
10783446Smrj     AcpiDmIndent (Level);
10793446Smrj     AcpiOsPrintf ("Vendor%s (", Name);
10803446Smrj 
10813446Smrj     /* Insert a descriptor name */
10823446Smrj 
10833446Smrj     AcpiDmDescriptorName ();
10843446Smrj     AcpiOsPrintf (")      // Length = 0x%.2X\n", Length);
10853446Smrj 
10863446Smrj     /* Dump the vendor bytes */
10873446Smrj 
10883446Smrj     AcpiDmIndent (Level);
10893446Smrj     AcpiOsPrintf ("{\n");
10903446Smrj 
10913446Smrj     AcpiDmDisasmByteList (Level + 1, ByteData, Length);
10923446Smrj 
10933446Smrj     AcpiDmIndent (Level);
10943446Smrj     AcpiOsPrintf ("}\n");
10953446Smrj }
10963446Smrj 
10973446Smrj 
10983446Smrj /*******************************************************************************
10993446Smrj  *
11003446Smrj  * FUNCTION:    AcpiDmVendorLargeDescriptor
11013446Smrj  *
11023446Smrj  * PARAMETERS:  Resource            - Pointer to the resource descriptor
11033446Smrj  *              Length              - Length of the descriptor in bytes
11043446Smrj  *              Level               - Current source code indentation level
11053446Smrj  *
11063446Smrj  * RETURN:      None
11073446Smrj  *
11083446Smrj  * DESCRIPTION: Decode a Vendor Large descriptor
11093446Smrj  *
11103446Smrj  ******************************************************************************/
11113446Smrj 
11123446Smrj void
AcpiDmVendorLargeDescriptor(AML_RESOURCE * Resource,UINT32 Length,UINT32 Level)11133446Smrj AcpiDmVendorLargeDescriptor (
11143446Smrj     AML_RESOURCE            *Resource,
11153446Smrj     UINT32                  Length,
11163446Smrj     UINT32                  Level)
11173446Smrj {
11183446Smrj 
11193446Smrj     AcpiDmVendorCommon ("Long ",
11203446Smrj         ACPI_ADD_PTR (UINT8, Resource, sizeof (AML_RESOURCE_LARGE_HEADER)),
11213446Smrj         Length, Level);
11223446Smrj }
11233446Smrj 
11243446Smrj #endif
11253446Smrj 
1126