Home | History | Annotate | Line # | Download | only in disassembler
      1   1.1    jruoho /*******************************************************************************
      2   1.1    jruoho  *
      3   1.1    jruoho  * Module Name: dmresrcl.c - "Large" Resource Descriptor disassembly
      4   1.1    jruoho  *
      5   1.1    jruoho  ******************************************************************************/
      6   1.1    jruoho 
      7  1.16  christos /******************************************************************************
      8  1.16  christos  *
      9  1.16  christos  * 1. Copyright Notice
     10  1.16  christos  *
     11  1.17  christos  * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
     12   1.1    jruoho  * All rights reserved.
     13   1.1    jruoho  *
     14  1.16  christos  * 2. License
     15  1.16  christos  *
     16  1.16  christos  * 2.1. This is your license from Intel Corp. under its intellectual property
     17  1.16  christos  * rights. You may have additional license terms from the party that provided
     18  1.16  christos  * you this software, covering your right to use that party's intellectual
     19  1.16  christos  * property rights.
     20  1.16  christos  *
     21  1.16  christos  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
     22  1.16  christos  * copy of the source code appearing in this file ("Covered Code") an
     23  1.16  christos  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
     24  1.16  christos  * base code distributed originally by Intel ("Original Intel Code") to copy,
     25  1.16  christos  * make derivatives, distribute, use and display any portion of the Covered
     26  1.16  christos  * Code in any form, with the right to sublicense such rights; and
     27  1.16  christos  *
     28  1.16  christos  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
     29  1.16  christos  * license (with the right to sublicense), under only those claims of Intel
     30  1.16  christos  * patents that are infringed by the Original Intel Code, to make, use, sell,
     31  1.16  christos  * offer to sell, and import the Covered Code and derivative works thereof
     32  1.16  christos  * solely to the minimum extent necessary to exercise the above copyright
     33  1.16  christos  * license, and in no event shall the patent license extend to any additions
     34  1.16  christos  * to or modifications of the Original Intel Code. No other license or right
     35  1.16  christos  * is granted directly or by implication, estoppel or otherwise;
     36  1.16  christos  *
     37  1.16  christos  * The above copyright and patent license is granted only if the following
     38  1.16  christos  * conditions are met:
     39  1.16  christos  *
     40  1.16  christos  * 3. Conditions
     41  1.16  christos  *
     42  1.16  christos  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
     43  1.16  christos  * Redistribution of source code of any substantial portion of the Covered
     44  1.16  christos  * Code or modification with rights to further distribute source must include
     45  1.16  christos  * the above Copyright Notice, the above License, this list of Conditions,
     46  1.16  christos  * and the following Disclaimer and Export Compliance provision. In addition,
     47  1.16  christos  * Licensee must cause all Covered Code to which Licensee contributes to
     48  1.16  christos  * contain a file documenting the changes Licensee made to create that Covered
     49  1.16  christos  * Code and the date of any change. Licensee must include in that file the
     50  1.16  christos  * documentation of any changes made by any predecessor Licensee. Licensee
     51  1.16  christos  * must include a prominent statement that the modification is derived,
     52  1.16  christos  * directly or indirectly, from Original Intel Code.
     53  1.16  christos  *
     54  1.16  christos  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
     55  1.16  christos  * Redistribution of source code of any substantial portion of the Covered
     56  1.16  christos  * Code or modification without rights to further distribute source must
     57  1.16  christos  * include the following Disclaimer and Export Compliance provision in the
     58  1.16  christos  * documentation and/or other materials provided with distribution. In
     59  1.16  christos  * addition, Licensee may not authorize further sublicense of source of any
     60  1.16  christos  * portion of the Covered Code, and must include terms to the effect that the
     61  1.16  christos  * license from Licensee to its licensee is limited to the intellectual
     62  1.16  christos  * property embodied in the software Licensee provides to its licensee, and
     63  1.16  christos  * not to intellectual property embodied in modifications its licensee may
     64  1.16  christos  * make.
     65  1.16  christos  *
     66  1.16  christos  * 3.3. Redistribution of Executable. Redistribution in executable form of any
     67  1.16  christos  * substantial portion of the Covered Code or modification must reproduce the
     68  1.16  christos  * above Copyright Notice, and the following Disclaimer and Export Compliance
     69  1.16  christos  * provision in the documentation and/or other materials provided with the
     70  1.16  christos  * distribution.
     71  1.16  christos  *
     72  1.16  christos  * 3.4. Intel retains all right, title, and interest in and to the Original
     73  1.16  christos  * Intel Code.
     74  1.16  christos  *
     75  1.16  christos  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
     76  1.16  christos  * Intel shall be used in advertising or otherwise to promote the sale, use or
     77  1.16  christos  * other dealings in products derived from or relating to the Covered Code
     78  1.16  christos  * without prior written authorization from Intel.
     79  1.16  christos  *
     80  1.16  christos  * 4. Disclaimer and Export Compliance
     81  1.16  christos  *
     82  1.16  christos  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
     83  1.16  christos  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
     84  1.16  christos  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
     85  1.16  christos  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
     86  1.16  christos  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
     87  1.16  christos  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
     88  1.16  christos  * PARTICULAR PURPOSE.
     89  1.16  christos  *
     90  1.16  christos  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
     91  1.16  christos  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
     92  1.16  christos  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
     93  1.16  christos  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
     94  1.16  christos  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
     95  1.16  christos  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
     96  1.16  christos  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
     97  1.16  christos  * LIMITED REMEDY.
     98  1.16  christos  *
     99  1.16  christos  * 4.3. Licensee shall not export, either directly or indirectly, any of this
    100  1.16  christos  * software or system incorporating such software without first obtaining any
    101  1.16  christos  * required license or other approval from the U. S. Department of Commerce or
    102  1.16  christos  * any other agency or department of the United States Government. In the
    103  1.16  christos  * event Licensee exports any such software from the United States or
    104  1.16  christos  * re-exports any such software from a foreign destination, Licensee shall
    105  1.16  christos  * ensure that the distribution and export/re-export of the software is in
    106  1.16  christos  * compliance with all laws, regulations, orders, or other restrictions of the
    107  1.16  christos  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
    108  1.16  christos  * any of its subsidiaries will export/re-export any technical data, process,
    109  1.16  christos  * software, or service, directly or indirectly, to any country for which the
    110  1.16  christos  * United States government or any agency thereof requires an export license,
    111  1.16  christos  * other governmental approval, or letter of assurance, without first obtaining
    112  1.16  christos  * such license, approval or letter.
    113  1.16  christos  *
    114  1.16  christos  *****************************************************************************
    115  1.16  christos  *
    116  1.16  christos  * Alternatively, you may choose to be licensed under the terms of the
    117  1.16  christos  * following license:
    118  1.16  christos  *
    119   1.3    jruoho  * Redistribution and use in source and binary forms, with or without
    120   1.3    jruoho  * modification, are permitted provided that the following conditions
    121   1.3    jruoho  * are met:
    122   1.3    jruoho  * 1. Redistributions of source code must retain the above copyright
    123   1.3    jruoho  *    notice, this list of conditions, and the following disclaimer,
    124   1.3    jruoho  *    without modification.
    125   1.3    jruoho  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
    126   1.3    jruoho  *    substantially similar to the "NO WARRANTY" disclaimer below
    127   1.3    jruoho  *    ("Disclaimer") and any redistribution must be conditioned upon
    128   1.3    jruoho  *    including a substantially similar Disclaimer requirement for further
    129   1.3    jruoho  *    binary redistribution.
    130   1.3    jruoho  * 3. Neither the names of the above-listed copyright holders nor the names
    131   1.3    jruoho  *    of any contributors may be used to endorse or promote products derived
    132   1.3    jruoho  *    from this software without specific prior written permission.
    133   1.3    jruoho  *
    134   1.3    jruoho  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    135   1.3    jruoho  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    136  1.13  christos  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    137   1.3    jruoho  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    138  1.16  christos  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    139  1.16  christos  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    140  1.16  christos  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    141  1.16  christos  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    142  1.16  christos  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    143  1.16  christos  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    144  1.16  christos  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    145  1.16  christos  *
    146  1.16  christos  * Alternatively, you may choose to be licensed under the terms of the
    147  1.16  christos  * GNU General Public License ("GPL") version 2 as published by the Free
    148  1.16  christos  * Software Foundation.
    149  1.16  christos  *
    150  1.16  christos  *****************************************************************************/
    151   1.1    jruoho 
    152   1.1    jruoho #include "acpi.h"
    153   1.1    jruoho #include "accommon.h"
    154   1.1    jruoho #include "acdisasm.h"
    155   1.1    jruoho 
    156   1.1    jruoho 
    157   1.1    jruoho #define _COMPONENT          ACPI_CA_DEBUGGER
    158   1.1    jruoho         ACPI_MODULE_NAME    ("dbresrcl")
    159   1.1    jruoho 
    160   1.1    jruoho 
    161   1.1    jruoho /* Common names for address and memory descriptors */
    162   1.1    jruoho 
    163   1.2    jruoho static const char           *AcpiDmAddressNames[] =
    164   1.1    jruoho {
    165   1.1    jruoho     "Granularity",
    166   1.1    jruoho     "Range Minimum",
    167   1.1    jruoho     "Range Maximum",
    168   1.1    jruoho     "Translation Offset",
    169   1.1    jruoho     "Length"
    170   1.1    jruoho };
    171   1.1    jruoho 
    172   1.2    jruoho static const char           *AcpiDmMemoryNames[] =
    173   1.1    jruoho {
    174   1.1    jruoho     "Range Minimum",
    175   1.1    jruoho     "Range Maximum",
    176   1.1    jruoho     "Alignment",
    177   1.1    jruoho     "Length"
    178   1.1    jruoho };
    179   1.1    jruoho 
    180   1.1    jruoho 
    181   1.1    jruoho /* Local prototypes */
    182   1.1    jruoho 
    183   1.1    jruoho static void
    184   1.1    jruoho AcpiDmSpaceFlags (
    185   1.1    jruoho         UINT8               Flags);
    186   1.1    jruoho 
    187   1.1    jruoho static void
    188   1.1    jruoho AcpiDmIoFlags (
    189   1.1    jruoho         UINT8               Flags);
    190   1.1    jruoho 
    191   1.1    jruoho static void
    192   1.1    jruoho AcpiDmIoFlags2 (
    193   1.1    jruoho         UINT8               SpecificFlags);
    194   1.1    jruoho 
    195   1.1    jruoho static void
    196   1.1    jruoho AcpiDmMemoryFlags (
    197   1.1    jruoho     UINT8                   Flags,
    198   1.1    jruoho     UINT8                   SpecificFlags);
    199   1.1    jruoho 
    200   1.1    jruoho static void
    201   1.1    jruoho AcpiDmMemoryFlags2 (
    202   1.1    jruoho     UINT8                   SpecificFlags);
    203   1.1    jruoho 
    204   1.1    jruoho static void
    205   1.1    jruoho AcpiDmResourceSource (
    206   1.1    jruoho     AML_RESOURCE            *Resource,
    207   1.1    jruoho     ACPI_SIZE               MinimumLength,
    208   1.1    jruoho     UINT32                  Length);
    209   1.1    jruoho 
    210   1.1    jruoho static void
    211   1.1    jruoho AcpiDmAddressFields (
    212   1.1    jruoho     void                    *Source,
    213   1.1    jruoho     UINT8                   Type,
    214   1.1    jruoho     UINT32                  Level);
    215   1.1    jruoho 
    216   1.1    jruoho static void
    217   1.1    jruoho AcpiDmAddressPrefix (
    218   1.1    jruoho     UINT8                   Type);
    219   1.1    jruoho 
    220   1.1    jruoho static void
    221   1.1    jruoho AcpiDmAddressCommon (
    222   1.1    jruoho     AML_RESOURCE            *Resource,
    223   1.1    jruoho     UINT8                   Type,
    224   1.1    jruoho     UINT32                  Level);
    225   1.1    jruoho 
    226   1.1    jruoho static void
    227   1.1    jruoho AcpiDmAddressFlags (
    228   1.1    jruoho     AML_RESOURCE            *Resource);
    229   1.1    jruoho 
    230   1.1    jruoho 
    231   1.1    jruoho /*******************************************************************************
    232   1.1    jruoho  *
    233   1.1    jruoho  * FUNCTION:    AcpiDmMemoryFields
    234   1.1    jruoho  *
    235   1.1    jruoho  * PARAMETERS:  Source              - Pointer to the contiguous data fields
    236   1.1    jruoho  *              Type                - 16 or 32 (bit)
    237   1.1    jruoho  *              Level               - Current source code indentation level
    238   1.1    jruoho  *
    239   1.1    jruoho  * RETURN:      None
    240   1.1    jruoho  *
    241   1.1    jruoho  * DESCRIPTION: Decode fields common to Memory24 and Memory32 descriptors
    242   1.1    jruoho  *
    243   1.1    jruoho  ******************************************************************************/
    244   1.1    jruoho 
    245   1.1    jruoho static void
    246   1.1    jruoho AcpiDmMemoryFields (
    247   1.1    jruoho     void                    *Source,
    248   1.1    jruoho     UINT8                   Type,
    249   1.1    jruoho     UINT32                  Level)
    250   1.1    jruoho {
    251   1.1    jruoho     UINT32                  i;
    252   1.1    jruoho 
    253   1.1    jruoho 
    254   1.1    jruoho     for (i = 0; i < 4; i++)
    255   1.1    jruoho     {
    256   1.1    jruoho         AcpiDmIndent (Level + 1);
    257   1.1    jruoho 
    258   1.1    jruoho         switch (Type)
    259   1.1    jruoho         {
    260   1.1    jruoho         case 16:
    261   1.4  christos 
    262   1.1    jruoho             AcpiDmDumpInteger16 (ACPI_CAST_PTR (UINT16, Source)[i],
    263   1.1    jruoho                 AcpiDmMemoryNames[i]);
    264   1.1    jruoho             break;
    265   1.1    jruoho 
    266   1.1    jruoho         case 32:
    267   1.4  christos 
    268   1.1    jruoho             AcpiDmDumpInteger32 (ACPI_CAST_PTR (UINT32, Source)[i],
    269   1.1    jruoho                 AcpiDmMemoryNames[i]);
    270   1.1    jruoho             break;
    271   1.1    jruoho 
    272   1.1    jruoho         default:
    273   1.4  christos 
    274   1.1    jruoho             return;
    275   1.1    jruoho         }
    276   1.1    jruoho     }
    277   1.1    jruoho }
    278   1.1    jruoho 
    279   1.1    jruoho 
    280   1.1    jruoho /*******************************************************************************
    281   1.1    jruoho  *
    282   1.1    jruoho  * FUNCTION:    AcpiDmAddressFields
    283   1.1    jruoho  *
    284   1.1    jruoho  * PARAMETERS:  Source              - Pointer to the contiguous data fields
    285   1.1    jruoho  *              Type                - 16, 32, or 64 (bit)
    286   1.1    jruoho  *              Level               - Current source code indentation level
    287   1.1    jruoho  *
    288   1.1    jruoho  * RETURN:      None
    289   1.1    jruoho  *
    290   1.1    jruoho  * DESCRIPTION: Decode fields common to address descriptors
    291   1.1    jruoho  *
    292   1.1    jruoho  ******************************************************************************/
    293   1.1    jruoho 
    294   1.1    jruoho static void
    295   1.1    jruoho AcpiDmAddressFields (
    296   1.1    jruoho     void                    *Source,
    297   1.1    jruoho     UINT8                   Type,
    298   1.1    jruoho     UINT32                  Level)
    299   1.1    jruoho {
    300   1.1    jruoho     UINT32                  i;
    301   1.1    jruoho 
    302   1.1    jruoho 
    303   1.1    jruoho     AcpiOsPrintf ("\n");
    304   1.1    jruoho 
    305   1.1    jruoho     for (i = 0; i < 5; i++)
    306   1.1    jruoho     {
    307   1.1    jruoho         AcpiDmIndent (Level + 1);
    308   1.1    jruoho 
    309   1.1    jruoho         switch (Type)
    310   1.1    jruoho         {
    311   1.1    jruoho         case 16:
    312   1.4  christos 
    313   1.1    jruoho             AcpiDmDumpInteger16 (ACPI_CAST_PTR (UINT16, Source)[i],
    314   1.1    jruoho                 AcpiDmAddressNames[i]);
    315   1.1    jruoho             break;
    316   1.1    jruoho 
    317   1.1    jruoho         case 32:
    318   1.4  christos 
    319   1.1    jruoho             AcpiDmDumpInteger32 (ACPI_CAST_PTR (UINT32, Source)[i],
    320   1.1    jruoho                 AcpiDmAddressNames[i]);
    321   1.1    jruoho             break;
    322   1.1    jruoho 
    323   1.1    jruoho         case 64:
    324   1.4  christos 
    325   1.1    jruoho             AcpiDmDumpInteger64 (ACPI_CAST_PTR (UINT64, Source)[i],
    326   1.1    jruoho                 AcpiDmAddressNames[i]);
    327   1.1    jruoho             break;
    328   1.1    jruoho 
    329   1.1    jruoho         default:
    330   1.4  christos 
    331   1.1    jruoho             return;
    332   1.1    jruoho         }
    333   1.1    jruoho     }
    334   1.1    jruoho }
    335   1.1    jruoho 
    336   1.1    jruoho 
    337   1.1    jruoho /*******************************************************************************
    338   1.1    jruoho  *
    339   1.1    jruoho  * FUNCTION:    AcpiDmAddressPrefix
    340   1.1    jruoho  *
    341   1.1    jruoho  * PARAMETERS:  Type                - Descriptor type
    342   1.1    jruoho  *
    343   1.1    jruoho  * RETURN:      None
    344   1.1    jruoho  *
    345   1.1    jruoho  * DESCRIPTION: Emit name prefix representing the address descriptor type
    346   1.1    jruoho  *
    347   1.1    jruoho  ******************************************************************************/
    348   1.1    jruoho 
    349   1.1    jruoho static void
    350   1.1    jruoho AcpiDmAddressPrefix (
    351   1.1    jruoho     UINT8                   Type)
    352   1.1    jruoho {
    353   1.1    jruoho 
    354   1.1    jruoho     switch (Type)
    355   1.1    jruoho     {
    356   1.1    jruoho     case ACPI_RESOURCE_TYPE_ADDRESS16:
    357   1.4  christos 
    358   1.1    jruoho         AcpiOsPrintf ("Word");
    359   1.1    jruoho         break;
    360   1.1    jruoho 
    361   1.1    jruoho     case ACPI_RESOURCE_TYPE_ADDRESS32:
    362   1.4  christos 
    363   1.1    jruoho         AcpiOsPrintf ("DWord");
    364   1.1    jruoho         break;
    365   1.1    jruoho 
    366   1.1    jruoho     case ACPI_RESOURCE_TYPE_ADDRESS64:
    367   1.4  christos 
    368   1.1    jruoho         AcpiOsPrintf ("QWord");
    369   1.1    jruoho         break;
    370   1.1    jruoho 
    371   1.1    jruoho     case ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64:
    372   1.4  christos 
    373   1.1    jruoho         AcpiOsPrintf ("Extended");
    374   1.1    jruoho         break;
    375   1.1    jruoho 
    376   1.1    jruoho     default:
    377   1.4  christos 
    378   1.1    jruoho         return;
    379   1.1    jruoho     }
    380   1.1    jruoho }
    381   1.1    jruoho 
    382   1.1    jruoho 
    383   1.1    jruoho /*******************************************************************************
    384   1.1    jruoho  *
    385   1.1    jruoho  * FUNCTION:    AcpiDmAddressCommon
    386   1.1    jruoho  *
    387   1.1    jruoho  * PARAMETERS:  Resource            - Raw AML descriptor
    388   1.1    jruoho  *              Type                - Descriptor type
    389   1.1    jruoho  *              Level               - Current source code indentation level
    390   1.1    jruoho  *
    391   1.1    jruoho  * RETURN:      None
    392   1.1    jruoho  *
    393   1.1    jruoho  * DESCRIPTION: Emit common name and flag fields common to address descriptors
    394   1.1    jruoho  *
    395   1.1    jruoho  ******************************************************************************/
    396   1.1    jruoho 
    397   1.1    jruoho static void
    398   1.1    jruoho AcpiDmAddressCommon (
    399   1.1    jruoho     AML_RESOURCE            *Resource,
    400   1.1    jruoho     UINT8                   Type,
    401   1.1    jruoho     UINT32                  Level)
    402   1.1    jruoho {
    403   1.1    jruoho     UINT8                   ResourceType;
    404   1.1    jruoho     UINT8                   SpecificFlags;
    405   1.1    jruoho     UINT8                   Flags;
    406   1.1    jruoho 
    407   1.1    jruoho 
    408   1.1    jruoho     ResourceType = Resource->Address.ResourceType;
    409   1.1    jruoho     SpecificFlags = Resource->Address.SpecificFlags;
    410   1.1    jruoho     Flags = Resource->Address.Flags;
    411   1.1    jruoho 
    412   1.1    jruoho     AcpiDmIndent (Level);
    413   1.1    jruoho 
    414   1.1    jruoho     /* Validate ResourceType */
    415   1.1    jruoho 
    416   1.1    jruoho     if ((ResourceType > 2) && (ResourceType < 0xC0))
    417   1.1    jruoho     {
    418   1.7  christos         AcpiOsPrintf (
    419   1.7  christos             "/**** Invalid Resource Type: 0x%X ****/", ResourceType);
    420   1.1    jruoho         return;
    421   1.1    jruoho     }
    422   1.1    jruoho 
    423   1.1    jruoho     /* Prefix is either Word, DWord, QWord, or Extended */
    424   1.1    jruoho 
    425   1.1    jruoho     AcpiDmAddressPrefix (Type);
    426   1.1    jruoho 
    427   1.1    jruoho     /* Resource Types above 0xC0 are vendor-defined */
    428   1.1    jruoho 
    429   1.1    jruoho     if (ResourceType > 2)
    430   1.1    jruoho     {
    431   1.1    jruoho         AcpiOsPrintf ("Space (0x%2.2X, ", ResourceType);
    432   1.1    jruoho         AcpiDmSpaceFlags (Flags);
    433   1.1    jruoho         AcpiOsPrintf (" 0x%2.2X,", SpecificFlags);
    434   1.1    jruoho         return;
    435   1.1    jruoho     }
    436   1.1    jruoho 
    437   1.1    jruoho     /* This is either a Memory, IO, or BusNumber descriptor (0,1,2) */
    438   1.1    jruoho 
    439   1.7  christos     AcpiOsPrintf ("%s (",
    440   1.7  christos         AcpiGbl_WordDecode [ACPI_GET_2BIT_FLAG (ResourceType)]);
    441   1.1    jruoho 
    442   1.1    jruoho     /* Decode the general and type-specific flags */
    443   1.1    jruoho 
    444   1.1    jruoho     if (ResourceType == ACPI_MEMORY_RANGE)
    445   1.1    jruoho     {
    446   1.1    jruoho         AcpiDmMemoryFlags (Flags, SpecificFlags);
    447   1.1    jruoho     }
    448   1.1    jruoho     else /* IO range or BusNumberRange */
    449   1.1    jruoho     {
    450   1.1    jruoho         AcpiDmIoFlags (Flags);
    451   1.1    jruoho         if (ResourceType == ACPI_IO_RANGE)
    452   1.1    jruoho         {
    453   1.7  christos             AcpiOsPrintf (" %s,",
    454   1.7  christos                 AcpiGbl_RngDecode [ACPI_GET_2BIT_FLAG (SpecificFlags)]);
    455   1.1    jruoho         }
    456   1.1    jruoho     }
    457   1.1    jruoho }
    458   1.1    jruoho 
    459   1.1    jruoho 
    460   1.1    jruoho /*******************************************************************************
    461   1.1    jruoho  *
    462   1.1    jruoho  * FUNCTION:    AcpiDmAddressFlags
    463   1.1    jruoho  *
    464   1.1    jruoho  * PARAMETERS:  Resource        - Raw AML descriptor
    465   1.1    jruoho  *
    466   1.1    jruoho  * RETURN:      None
    467   1.1    jruoho  *
    468   1.1    jruoho  * DESCRIPTION: Emit flags common to address descriptors
    469   1.1    jruoho  *
    470   1.1    jruoho  ******************************************************************************/
    471   1.1    jruoho 
    472   1.1    jruoho static void
    473   1.1    jruoho AcpiDmAddressFlags (
    474   1.1    jruoho     AML_RESOURCE            *Resource)
    475   1.1    jruoho {
    476   1.1    jruoho 
    477   1.1    jruoho     if (Resource->Address.ResourceType == ACPI_IO_RANGE)
    478   1.1    jruoho     {
    479   1.1    jruoho         AcpiDmIoFlags2 (Resource->Address.SpecificFlags);
    480   1.1    jruoho     }
    481   1.1    jruoho     else if (Resource->Address.ResourceType == ACPI_MEMORY_RANGE)
    482   1.1    jruoho     {
    483   1.1    jruoho         AcpiDmMemoryFlags2 (Resource->Address.SpecificFlags);
    484   1.1    jruoho     }
    485   1.1    jruoho }
    486   1.1    jruoho 
    487   1.1    jruoho 
    488   1.1    jruoho /*******************************************************************************
    489   1.1    jruoho  *
    490   1.1    jruoho  * FUNCTION:    AcpiDmSpaceFlags
    491   1.1    jruoho  *
    492   1.1    jruoho  * PARAMETERS:  Flags               - Flag byte to be decoded
    493   1.1    jruoho  *
    494   1.1    jruoho  * RETURN:      None
    495   1.1    jruoho  *
    496   1.1    jruoho  * DESCRIPTION: Decode the flags specific to Space Address space descriptors
    497   1.1    jruoho  *
    498   1.1    jruoho  ******************************************************************************/
    499   1.1    jruoho 
    500   1.1    jruoho static void
    501   1.1    jruoho AcpiDmSpaceFlags (
    502   1.1    jruoho     UINT8                   Flags)
    503   1.1    jruoho {
    504   1.1    jruoho 
    505   1.1    jruoho     AcpiOsPrintf ("%s, %s, %s, %s,",
    506   1.4  christos         AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Flags)],
    507   1.4  christos         AcpiGbl_DecDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 1)],
    508   1.4  christos         AcpiGbl_MinDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 2)],
    509   1.4  christos         AcpiGbl_MaxDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 3)]);
    510   1.1    jruoho }
    511   1.1    jruoho 
    512   1.1    jruoho 
    513   1.1    jruoho /*******************************************************************************
    514   1.1    jruoho  *
    515   1.1    jruoho  * FUNCTION:    AcpiDmIoFlags
    516   1.1    jruoho  *
    517   1.1    jruoho  * PARAMETERS:  Flags               - Flag byte to be decoded
    518   1.1    jruoho  *
    519   1.1    jruoho  * RETURN:      None
    520   1.1    jruoho  *
    521   1.1    jruoho  * DESCRIPTION: Decode the flags specific to IO Address space descriptors
    522   1.1    jruoho  *
    523   1.1    jruoho  ******************************************************************************/
    524   1.1    jruoho 
    525   1.1    jruoho static void
    526   1.1    jruoho AcpiDmIoFlags (
    527   1.1    jruoho         UINT8               Flags)
    528   1.1    jruoho {
    529   1.1    jruoho     AcpiOsPrintf ("%s, %s, %s, %s,",
    530   1.4  christos         AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Flags)],
    531   1.4  christos         AcpiGbl_MinDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 2)],
    532   1.4  christos         AcpiGbl_MaxDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 3)],
    533   1.4  christos         AcpiGbl_DecDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 1)]);
    534   1.1    jruoho }
    535   1.1    jruoho 
    536   1.1    jruoho 
    537   1.1    jruoho /*******************************************************************************
    538   1.1    jruoho  *
    539   1.1    jruoho  * FUNCTION:    AcpiDmIoFlags2
    540   1.1    jruoho  *
    541   1.1    jruoho  * PARAMETERS:  SpecificFlags       - "Specific" flag byte to be decoded
    542   1.1    jruoho  *
    543   1.1    jruoho  * RETURN:      None
    544   1.1    jruoho  *
    545   1.1    jruoho  * DESCRIPTION: Decode the flags specific to IO Address space descriptors
    546   1.1    jruoho  *
    547   1.1    jruoho  ******************************************************************************/
    548   1.1    jruoho 
    549   1.1    jruoho static void
    550   1.1    jruoho AcpiDmIoFlags2 (
    551   1.1    jruoho         UINT8               SpecificFlags)
    552   1.1    jruoho {
    553   1.1    jruoho 
    554   1.8  christos     /* _TTP */
    555   1.8  christos 
    556   1.1    jruoho     AcpiOsPrintf (", %s",
    557   1.4  christos         AcpiGbl_TtpDecode [ACPI_EXTRACT_1BIT_FLAG (SpecificFlags, 4)]);
    558   1.1    jruoho 
    559   1.8  christos     /*
    560   1.8  christos      * TRS is only used if TTP is TypeTranslation. However, the disassembler
    561   1.8  christos      * always emits exactly what is in the AML.
    562   1.8  christos      */
    563   1.8  christos     AcpiOsPrintf (", %s",
    564   1.8  christos         AcpiGbl_TrsDecode [ACPI_EXTRACT_1BIT_FLAG (SpecificFlags, 5)]);
    565   1.1    jruoho }
    566   1.1    jruoho 
    567   1.1    jruoho 
    568   1.1    jruoho /*******************************************************************************
    569   1.1    jruoho  *
    570   1.1    jruoho  * FUNCTION:    AcpiDmMemoryFlags
    571   1.1    jruoho  *
    572   1.1    jruoho  * PARAMETERS:  Flags               - Flag byte to be decoded
    573   1.1    jruoho  *              SpecificFlags       - "Specific" flag byte to be decoded
    574   1.1    jruoho  *
    575   1.1    jruoho  * RETURN:      None
    576   1.1    jruoho  *
    577   1.1    jruoho  * DESCRIPTION: Decode flags specific to Memory Address Space descriptors
    578   1.1    jruoho  *
    579   1.1    jruoho  ******************************************************************************/
    580   1.1    jruoho 
    581   1.1    jruoho static void
    582   1.1    jruoho AcpiDmMemoryFlags (
    583   1.1    jruoho     UINT8                   Flags,
    584   1.1    jruoho     UINT8                   SpecificFlags)
    585   1.1    jruoho {
    586   1.1    jruoho 
    587   1.1    jruoho     AcpiOsPrintf ("%s, %s, %s, %s, %s, %s,",
    588   1.4  christos         AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Flags)],
    589   1.4  christos         AcpiGbl_DecDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 1)],
    590   1.4  christos         AcpiGbl_MinDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 2)],
    591   1.4  christos         AcpiGbl_MaxDecode [ACPI_EXTRACT_1BIT_FLAG (Flags, 3)],
    592   1.4  christos         AcpiGbl_MemDecode [ACPI_EXTRACT_2BIT_FLAG (SpecificFlags, 1)],
    593   1.4  christos         AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (SpecificFlags)]);
    594   1.1    jruoho }
    595   1.1    jruoho 
    596   1.1    jruoho 
    597   1.1    jruoho /*******************************************************************************
    598   1.1    jruoho  *
    599   1.1    jruoho  * FUNCTION:    AcpiDmMemoryFlags2
    600   1.1    jruoho  *
    601   1.1    jruoho  * PARAMETERS:  SpecificFlags       - "Specific" flag byte to be decoded
    602   1.1    jruoho  *
    603   1.1    jruoho  * RETURN:      None
    604   1.1    jruoho  *
    605   1.1    jruoho  * DESCRIPTION: Decode flags specific to Memory Address Space descriptors
    606   1.1    jruoho  *
    607   1.1    jruoho  ******************************************************************************/
    608   1.1    jruoho 
    609   1.1    jruoho static void
    610   1.1    jruoho AcpiDmMemoryFlags2 (
    611   1.1    jruoho     UINT8                   SpecificFlags)
    612   1.1    jruoho {
    613   1.1    jruoho 
    614   1.1    jruoho     AcpiOsPrintf (", %s, %s",
    615   1.4  christos         AcpiGbl_MtpDecode [ACPI_EXTRACT_2BIT_FLAG (SpecificFlags, 3)],
    616   1.4  christos         AcpiGbl_TtpDecode [ACPI_EXTRACT_1BIT_FLAG (SpecificFlags, 5)]);
    617   1.1    jruoho }
    618   1.1    jruoho 
    619   1.1    jruoho 
    620   1.1    jruoho /*******************************************************************************
    621   1.1    jruoho  *
    622   1.1    jruoho  * FUNCTION:    AcpiDmResourceSource
    623   1.1    jruoho  *
    624   1.1    jruoho  * PARAMETERS:  Resource        - Raw AML descriptor
    625   1.1    jruoho  *              MinimumLength   - descriptor length without optional fields
    626   1.1    jruoho  *              ResourceLength
    627   1.1    jruoho  *
    628   1.1    jruoho  * RETURN:      None
    629   1.1    jruoho  *
    630   1.1    jruoho  * DESCRIPTION: Dump optional ResourceSource fields of an address descriptor
    631   1.1    jruoho  *
    632   1.1    jruoho  ******************************************************************************/
    633   1.1    jruoho 
    634   1.1    jruoho static void
    635   1.1    jruoho AcpiDmResourceSource (
    636   1.1    jruoho     AML_RESOURCE            *Resource,
    637   1.1    jruoho     ACPI_SIZE               MinimumTotalLength,
    638   1.1    jruoho     UINT32                  ResourceLength)
    639   1.1    jruoho {
    640   1.1    jruoho     UINT8                   *AmlResourceSource;
    641   1.1    jruoho     UINT32                  TotalLength;
    642   1.1    jruoho 
    643   1.1    jruoho 
    644   1.1    jruoho     TotalLength = ResourceLength + sizeof (AML_RESOURCE_LARGE_HEADER);
    645   1.1    jruoho 
    646   1.1    jruoho     /* Check if the optional ResourceSource fields are present */
    647   1.1    jruoho 
    648   1.1    jruoho     if (TotalLength <= MinimumTotalLength)
    649   1.1    jruoho     {
    650   1.1    jruoho         /* The two optional fields are not used */
    651   1.1    jruoho 
    652   1.1    jruoho         AcpiOsPrintf (",, ");
    653   1.1    jruoho         return;
    654   1.1    jruoho     }
    655   1.1    jruoho 
    656   1.1    jruoho     /* Get a pointer to the ResourceSource */
    657   1.1    jruoho 
    658   1.1    jruoho     AmlResourceSource = ACPI_ADD_PTR (UINT8, Resource, MinimumTotalLength);
    659   1.1    jruoho 
    660   1.1    jruoho     /*
    661   1.1    jruoho      * Always emit the ResourceSourceIndex (Byte)
    662   1.1    jruoho      *
    663   1.1    jruoho      * NOTE: Some ASL compilers always create a 0 byte (in the AML) for the
    664   1.1    jruoho      * Index even if the String does not exist. Although this is in violation
    665   1.1    jruoho      * of the ACPI specification, it is very important to emit ASL code that
    666   1.1    jruoho      * can be compiled back to the identical AML. There may be fields and/or
    667   1.1    jruoho      * indexes into the resource template buffer that are compiled to absolute
    668   1.1    jruoho      * offsets, and these will be broken if the AML length is changed.
    669   1.1    jruoho      */
    670   1.1    jruoho     AcpiOsPrintf ("0x%2.2X,", (UINT32) AmlResourceSource[0]);
    671   1.1    jruoho 
    672   1.1    jruoho     /* Make sure that the ResourceSource string exists before dumping it */
    673   1.1    jruoho 
    674   1.1    jruoho     if (TotalLength > (MinimumTotalLength + 1))
    675   1.1    jruoho     {
    676   1.1    jruoho         AcpiOsPrintf (" ");
    677   1.4  christos         AcpiUtPrintString ((char *) &AmlResourceSource[1], ACPI_UINT16_MAX);
    678   1.1    jruoho     }
    679   1.1    jruoho 
    680   1.1    jruoho     AcpiOsPrintf (", ");
    681   1.1    jruoho }
    682   1.1    jruoho 
    683   1.1    jruoho 
    684   1.1    jruoho /*******************************************************************************
    685   1.1    jruoho  *
    686   1.1    jruoho  * FUNCTION:    AcpiDmWordDescriptor
    687   1.1    jruoho  *
    688   1.5  christos  * PARAMETERS:  Info                - Extra resource info
    689   1.5  christos  *              Resource            - Pointer to the resource descriptor
    690   1.1    jruoho  *              Length              - Length of the descriptor in bytes
    691   1.1    jruoho  *              Level               - Current source code indentation level
    692   1.1    jruoho  *
    693   1.1    jruoho  * RETURN:      None
    694   1.1    jruoho  *
    695   1.1    jruoho  * DESCRIPTION: Decode a Word Address Space descriptor
    696   1.1    jruoho  *
    697   1.1    jruoho  ******************************************************************************/
    698   1.1    jruoho 
    699   1.1    jruoho void
    700   1.1    jruoho AcpiDmWordDescriptor (
    701   1.5  christos     ACPI_OP_WALK_INFO       *Info,
    702   1.1    jruoho     AML_RESOURCE            *Resource,
    703   1.1    jruoho     UINT32                  Length,
    704   1.1    jruoho     UINT32                  Level)
    705   1.1    jruoho {
    706   1.1    jruoho 
    707   1.1    jruoho     /* Dump resource name and flags */
    708   1.1    jruoho 
    709   1.1    jruoho     AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_ADDRESS16, Level);
    710   1.1    jruoho 
    711   1.1    jruoho     /* Dump the 5 contiguous WORD values */
    712   1.1    jruoho 
    713   1.1    jruoho     AcpiDmAddressFields (&Resource->Address16.Granularity, 16, Level);
    714   1.1    jruoho 
    715   1.1    jruoho     /* The ResourceSource fields are optional */
    716   1.1    jruoho 
    717   1.1    jruoho     AcpiDmIndent (Level + 1);
    718   1.1    jruoho     AcpiDmResourceSource (Resource, sizeof (AML_RESOURCE_ADDRESS16), Length);
    719   1.1    jruoho 
    720   1.1    jruoho     /* Insert a descriptor name */
    721   1.1    jruoho 
    722   1.1    jruoho     AcpiDmDescriptorName ();
    723   1.1    jruoho 
    724   1.1    jruoho     /* Type-specific flags */
    725   1.1    jruoho 
    726   1.1    jruoho     AcpiDmAddressFlags (Resource);
    727   1.1    jruoho     AcpiOsPrintf (")\n");
    728   1.1    jruoho }
    729   1.1    jruoho 
    730   1.1    jruoho 
    731   1.1    jruoho /*******************************************************************************
    732   1.1    jruoho  *
    733   1.1    jruoho  * FUNCTION:    AcpiDmDwordDescriptor
    734   1.1    jruoho  *
    735   1.5  christos  * PARAMETERS:  Info                - Extra resource info
    736   1.5  christos  *              Resource            - Pointer to the resource descriptor
    737   1.1    jruoho  *              Length              - Length of the descriptor in bytes
    738   1.1    jruoho  *              Level               - Current source code indentation level
    739   1.1    jruoho  *
    740   1.1    jruoho  * RETURN:      None
    741   1.1    jruoho  *
    742   1.1    jruoho  * DESCRIPTION: Decode a DWord Address Space descriptor
    743   1.1    jruoho  *
    744   1.1    jruoho  ******************************************************************************/
    745   1.1    jruoho 
    746   1.1    jruoho void
    747   1.1    jruoho AcpiDmDwordDescriptor (
    748   1.5  christos     ACPI_OP_WALK_INFO       *Info,
    749   1.1    jruoho     AML_RESOURCE            *Resource,
    750   1.1    jruoho     UINT32                  Length,
    751   1.1    jruoho     UINT32                  Level)
    752   1.1    jruoho {
    753   1.1    jruoho 
    754   1.1    jruoho     /* Dump resource name and flags */
    755   1.1    jruoho 
    756   1.1    jruoho     AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_ADDRESS32, Level);
    757   1.1    jruoho 
    758   1.1    jruoho     /* Dump the 5 contiguous DWORD values */
    759   1.1    jruoho 
    760   1.1    jruoho     AcpiDmAddressFields (&Resource->Address32.Granularity, 32, Level);
    761   1.1    jruoho 
    762   1.1    jruoho     /* The ResourceSource fields are optional */
    763   1.1    jruoho 
    764   1.1    jruoho     AcpiDmIndent (Level + 1);
    765   1.1    jruoho     AcpiDmResourceSource (Resource, sizeof (AML_RESOURCE_ADDRESS32), Length);
    766   1.1    jruoho 
    767   1.1    jruoho     /* Insert a descriptor name */
    768   1.1    jruoho 
    769   1.1    jruoho     AcpiDmDescriptorName ();
    770   1.1    jruoho 
    771   1.1    jruoho     /* Type-specific flags */
    772   1.1    jruoho 
    773   1.1    jruoho     AcpiDmAddressFlags (Resource);
    774   1.1    jruoho     AcpiOsPrintf (")\n");
    775   1.1    jruoho }
    776   1.1    jruoho 
    777   1.1    jruoho 
    778   1.1    jruoho /*******************************************************************************
    779   1.1    jruoho  *
    780   1.1    jruoho  * FUNCTION:    AcpiDmQwordDescriptor
    781   1.1    jruoho  *
    782   1.5  christos  * PARAMETERS:  Info                - Extra resource info
    783   1.5  christos  *              Resource            - Pointer to the resource descriptor
    784   1.1    jruoho  *              Length              - Length of the descriptor in bytes
    785   1.1    jruoho  *              Level               - Current source code indentation level
    786   1.1    jruoho  *
    787   1.1    jruoho  * RETURN:      None
    788   1.1    jruoho  *
    789   1.1    jruoho  * DESCRIPTION: Decode a QWord Address Space descriptor
    790   1.1    jruoho  *
    791   1.1    jruoho  ******************************************************************************/
    792   1.1    jruoho 
    793   1.1    jruoho void
    794   1.1    jruoho AcpiDmQwordDescriptor (
    795   1.5  christos     ACPI_OP_WALK_INFO       *Info,
    796   1.1    jruoho     AML_RESOURCE            *Resource,
    797   1.1    jruoho     UINT32                  Length,
    798   1.1    jruoho     UINT32                  Level)
    799   1.1    jruoho {
    800   1.1    jruoho 
    801   1.1    jruoho     /* Dump resource name and flags */
    802   1.1    jruoho 
    803   1.1    jruoho     AcpiDmAddressCommon (Resource, ACPI_RESOURCE_TYPE_ADDRESS64, Level);
    804   1.1    jruoho 
    805   1.1    jruoho     /* Dump the 5 contiguous QWORD values */
    806   1.1    jruoho 
    807   1.1    jruoho     AcpiDmAddressFields (&Resource->Address64.Granularity, 64, Level);
    808   1.1    jruoho 
    809   1.1    jruoho     /* The ResourceSource fields are optional */
    810   1.1    jruoho 
    811   1.1    jruoho     AcpiDmIndent (Level + 1);
    812   1.1    jruoho     AcpiDmResourceSource (Resource, sizeof (AML_RESOURCE_ADDRESS64), Length);
    813   1.1    jruoho 
    814   1.1    jruoho     /* Insert a descriptor name */
    815   1.1    jruoho 
    816   1.1    jruoho     AcpiDmDescriptorName ();
    817   1.1    jruoho 
    818   1.1    jruoho     /* Type-specific flags */
    819   1.1    jruoho 
    820   1.1    jruoho     AcpiDmAddressFlags (Resource);
    821   1.1    jruoho     AcpiOsPrintf (")\n");
    822   1.1    jruoho }
    823   1.1    jruoho 
    824   1.1    jruoho 
    825   1.1    jruoho /*******************************************************************************
    826   1.1    jruoho  *
    827   1.1    jruoho  * FUNCTION:    AcpiDmExtendedDescriptor
    828   1.1    jruoho  *
    829   1.5  christos  * PARAMETERS:  Info                - Extra resource info
    830   1.5  christos  *              Resource            - Pointer to the resource descriptor
    831   1.1    jruoho  *              Length              - Length of the descriptor in bytes
    832   1.1    jruoho  *              Level               - Current source code indentation level
    833   1.1    jruoho  *
    834   1.1    jruoho  * RETURN:      None
    835   1.1    jruoho  *
    836   1.1    jruoho  * DESCRIPTION: Decode a Extended Address Space descriptor
    837   1.1    jruoho  *
    838   1.1    jruoho  ******************************************************************************/
    839   1.1    jruoho 
    840   1.1    jruoho void
    841   1.1    jruoho AcpiDmExtendedDescriptor (
    842   1.5  christos     ACPI_OP_WALK_INFO       *Info,
    843   1.1    jruoho     AML_RESOURCE            *Resource,
    844   1.1    jruoho     UINT32                  Length,
    845   1.1    jruoho     UINT32                  Level)
    846   1.1    jruoho {
    847   1.1    jruoho 
    848   1.1    jruoho     /* Dump resource name and flags */
    849   1.1    jruoho 
    850   1.7  christos     AcpiDmAddressCommon (
    851   1.7  christos         Resource, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64, Level);
    852   1.1    jruoho 
    853   1.1    jruoho     /* Dump the 5 contiguous QWORD values */
    854   1.1    jruoho 
    855   1.1    jruoho     AcpiDmAddressFields (&Resource->ExtAddress64.Granularity, 64, Level);
    856   1.1    jruoho 
    857   1.1    jruoho     /* Extra field for this descriptor only */
    858   1.1    jruoho 
    859   1.1    jruoho     AcpiDmIndent (Level + 1);
    860   1.1    jruoho     AcpiDmDumpInteger64 (Resource->ExtAddress64.TypeSpecific,
    861   1.1    jruoho         "Type-Specific Attributes");
    862   1.1    jruoho 
    863   1.1    jruoho     /* Insert a descriptor name */
    864   1.1    jruoho 
    865   1.1    jruoho     AcpiDmIndent (Level + 1);
    866   1.1    jruoho     AcpiDmDescriptorName ();
    867   1.1    jruoho 
    868   1.1    jruoho     /* Type-specific flags */
    869   1.1    jruoho 
    870   1.1    jruoho     AcpiDmAddressFlags (Resource);
    871   1.1    jruoho     AcpiOsPrintf (")\n");
    872   1.1    jruoho }
    873   1.1    jruoho 
    874   1.1    jruoho 
    875   1.1    jruoho /*******************************************************************************
    876   1.1    jruoho  *
    877   1.1    jruoho  * FUNCTION:    AcpiDmMemory24Descriptor
    878   1.1    jruoho  *
    879   1.5  christos  * PARAMETERS:  Info                - Extra resource info
    880   1.5  christos  *              Resource            - Pointer to the resource descriptor
    881   1.1    jruoho  *              Length              - Length of the descriptor in bytes
    882   1.1    jruoho  *              Level               - Current source code indentation level
    883   1.1    jruoho  *
    884   1.1    jruoho  * RETURN:      None
    885   1.1    jruoho  *
    886   1.1    jruoho  * DESCRIPTION: Decode a Memory24 descriptor
    887   1.1    jruoho  *
    888   1.1    jruoho  ******************************************************************************/
    889   1.1    jruoho 
    890   1.1    jruoho void
    891   1.1    jruoho AcpiDmMemory24Descriptor (
    892   1.5  christos     ACPI_OP_WALK_INFO       *Info,
    893   1.1    jruoho     AML_RESOURCE            *Resource,
    894   1.1    jruoho     UINT32                  Length,
    895   1.1    jruoho     UINT32                  Level)
    896   1.1    jruoho {
    897   1.1    jruoho 
    898   1.1    jruoho     /* Dump name and read/write flag */
    899   1.1    jruoho 
    900   1.1    jruoho     AcpiDmIndent (Level);
    901   1.1    jruoho     AcpiOsPrintf ("Memory24 (%s,\n",
    902   1.4  christos         AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->Memory24.Flags)]);
    903   1.1    jruoho 
    904   1.1    jruoho     /* Dump the 4 contiguous WORD values */
    905   1.1    jruoho 
    906   1.1    jruoho     AcpiDmMemoryFields (&Resource->Memory24.Minimum, 16, Level);
    907   1.1    jruoho 
    908   1.1    jruoho     /* Insert a descriptor name */
    909   1.1    jruoho 
    910   1.1    jruoho     AcpiDmIndent (Level + 1);
    911   1.1    jruoho     AcpiDmDescriptorName ();
    912   1.1    jruoho     AcpiOsPrintf (")\n");
    913   1.1    jruoho }
    914   1.1    jruoho 
    915   1.1    jruoho 
    916   1.1    jruoho /*******************************************************************************
    917   1.1    jruoho  *
    918   1.1    jruoho  * FUNCTION:    AcpiDmMemory32Descriptor
    919   1.1    jruoho  *
    920   1.5  christos  * PARAMETERS:  Info                - Extra resource info
    921   1.5  christos  *              Resource            - Pointer to the resource descriptor
    922   1.1    jruoho  *              Length              - Length of the descriptor in bytes
    923   1.1    jruoho  *              Level               - Current source code indentation level
    924   1.1    jruoho  *
    925   1.1    jruoho  * RETURN:      None
    926   1.1    jruoho  *
    927   1.1    jruoho  * DESCRIPTION: Decode a Memory32 descriptor
    928   1.1    jruoho  *
    929   1.1    jruoho  ******************************************************************************/
    930   1.1    jruoho 
    931   1.1    jruoho void
    932   1.1    jruoho AcpiDmMemory32Descriptor (
    933   1.5  christos     ACPI_OP_WALK_INFO       *Info,
    934   1.1    jruoho     AML_RESOURCE            *Resource,
    935   1.1    jruoho     UINT32                  Length,
    936   1.1    jruoho     UINT32                  Level)
    937   1.1    jruoho {
    938   1.1    jruoho 
    939   1.1    jruoho     /* Dump name and read/write flag */
    940   1.1    jruoho 
    941   1.1    jruoho     AcpiDmIndent (Level);
    942   1.1    jruoho     AcpiOsPrintf ("Memory32 (%s,\n",
    943   1.4  christos         AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->Memory32.Flags)]);
    944   1.1    jruoho 
    945   1.1    jruoho     /* Dump the 4 contiguous DWORD values */
    946   1.1    jruoho 
    947   1.1    jruoho     AcpiDmMemoryFields (&Resource->Memory32.Minimum, 32, Level);
    948   1.1    jruoho 
    949   1.1    jruoho     /* Insert a descriptor name */
    950   1.1    jruoho 
    951   1.1    jruoho     AcpiDmIndent (Level + 1);
    952   1.1    jruoho     AcpiDmDescriptorName ();
    953   1.1    jruoho     AcpiOsPrintf (")\n");
    954   1.1    jruoho }
    955   1.1    jruoho 
    956   1.1    jruoho 
    957   1.1    jruoho /*******************************************************************************
    958   1.1    jruoho  *
    959   1.1    jruoho  * FUNCTION:    AcpiDmFixedMemory32Descriptor
    960   1.1    jruoho  *
    961   1.5  christos  * PARAMETERS:  Info                - Extra resource info
    962   1.5  christos  *              Resource            - Pointer to the resource descriptor
    963   1.1    jruoho  *              Length              - Length of the descriptor in bytes
    964   1.1    jruoho  *              Level               - Current source code indentation level
    965   1.1    jruoho  *
    966   1.1    jruoho  * RETURN:      None
    967   1.1    jruoho  *
    968   1.1    jruoho  * DESCRIPTION: Decode a Fixed Memory32 descriptor
    969   1.1    jruoho  *
    970   1.1    jruoho  ******************************************************************************/
    971   1.1    jruoho 
    972   1.1    jruoho void
    973   1.1    jruoho AcpiDmFixedMemory32Descriptor (
    974   1.5  christos     ACPI_OP_WALK_INFO       *Info,
    975   1.1    jruoho     AML_RESOURCE            *Resource,
    976   1.1    jruoho     UINT32                  Length,
    977   1.1    jruoho     UINT32                  Level)
    978   1.1    jruoho {
    979   1.1    jruoho 
    980   1.1    jruoho     /* Dump name and read/write flag */
    981   1.1    jruoho 
    982   1.1    jruoho     AcpiDmIndent (Level);
    983   1.1    jruoho     AcpiOsPrintf ("Memory32Fixed (%s,\n",
    984   1.4  christos         AcpiGbl_RwDecode [ACPI_GET_1BIT_FLAG (Resource->FixedMemory32.Flags)]);
    985   1.1    jruoho 
    986   1.1    jruoho     AcpiDmIndent (Level + 1);
    987   1.7  christos     AcpiDmDumpInteger32 (Resource->FixedMemory32.Address,
    988   1.7  christos         "Address Base");
    989   1.1    jruoho 
    990   1.1    jruoho     AcpiDmIndent (Level + 1);
    991   1.7  christos     AcpiDmDumpInteger32 (Resource->FixedMemory32.AddressLength,
    992   1.7  christos         "Address Length");
    993   1.1    jruoho 
    994   1.1    jruoho     /* Insert a descriptor name */
    995   1.1    jruoho 
    996   1.1    jruoho     AcpiDmIndent (Level + 1);
    997   1.1    jruoho     AcpiDmDescriptorName ();
    998   1.1    jruoho     AcpiOsPrintf (")\n");
    999   1.1    jruoho }
   1000   1.1    jruoho 
   1001   1.1    jruoho 
   1002   1.1    jruoho /*******************************************************************************
   1003   1.1    jruoho  *
   1004   1.1    jruoho  * FUNCTION:    AcpiDmGenericRegisterDescriptor
   1005   1.1    jruoho  *
   1006   1.5  christos  * PARAMETERS:  Info                - Extra resource info
   1007   1.5  christos  *              Resource            - Pointer to the resource descriptor
   1008   1.1    jruoho  *              Length              - Length of the descriptor in bytes
   1009   1.1    jruoho  *              Level               - Current source code indentation level
   1010   1.1    jruoho  *
   1011   1.1    jruoho  * RETURN:      None
   1012   1.1    jruoho  *
   1013   1.1    jruoho  * DESCRIPTION: Decode a Generic Register descriptor
   1014   1.1    jruoho  *
   1015   1.1    jruoho  ******************************************************************************/
   1016   1.1    jruoho 
   1017   1.1    jruoho void
   1018   1.1    jruoho AcpiDmGenericRegisterDescriptor (
   1019   1.5  christos     ACPI_OP_WALK_INFO       *Info,
   1020   1.1    jruoho     AML_RESOURCE            *Resource,
   1021   1.1    jruoho     UINT32                  Length,
   1022   1.1    jruoho     UINT32                  Level)
   1023   1.1    jruoho {
   1024   1.1    jruoho 
   1025   1.1    jruoho     AcpiDmIndent (Level);
   1026   1.1    jruoho     AcpiOsPrintf ("Register (");
   1027   1.1    jruoho     AcpiDmAddressSpace (Resource->GenericReg.AddressSpaceId);
   1028   1.1    jruoho     AcpiOsPrintf ("\n");
   1029   1.1    jruoho 
   1030   1.1    jruoho     AcpiDmIndent (Level + 1);
   1031   1.1    jruoho     AcpiDmDumpInteger8 (Resource->GenericReg.BitWidth, "Bit Width");
   1032   1.1    jruoho 
   1033   1.1    jruoho     AcpiDmIndent (Level + 1);
   1034   1.1    jruoho     AcpiDmDumpInteger8 (Resource->GenericReg.BitOffset, "Bit Offset");
   1035   1.1    jruoho 
   1036   1.1    jruoho     AcpiDmIndent (Level + 1);
   1037   1.1    jruoho     AcpiDmDumpInteger64 (Resource->GenericReg.Address, "Address");
   1038   1.1    jruoho 
   1039   1.1    jruoho     /* Optional field for ACPI 3.0 */
   1040   1.1    jruoho 
   1041   1.1    jruoho     AcpiDmIndent (Level + 1);
   1042   1.1    jruoho     if (Resource->GenericReg.AccessSize)
   1043   1.1    jruoho     {
   1044   1.1    jruoho         AcpiOsPrintf ("0x%2.2X,               // %s\n",
   1045   1.1    jruoho             Resource->GenericReg.AccessSize, "Access Size");
   1046   1.1    jruoho         AcpiDmIndent (Level + 1);
   1047   1.1    jruoho     }
   1048   1.1    jruoho     else
   1049   1.1    jruoho     {
   1050   1.1    jruoho         AcpiOsPrintf (",");
   1051   1.1    jruoho     }
   1052   1.1    jruoho 
   1053   1.1    jruoho     /* DescriptorName was added for ACPI 3.0+ */
   1054   1.1    jruoho 
   1055   1.1    jruoho     AcpiDmDescriptorName ();
   1056   1.1    jruoho     AcpiOsPrintf (")\n");
   1057   1.1    jruoho }
   1058   1.1    jruoho 
   1059   1.1    jruoho 
   1060   1.1    jruoho /*******************************************************************************
   1061   1.1    jruoho  *
   1062   1.1    jruoho  * FUNCTION:    AcpiDmInterruptDescriptor
   1063   1.1    jruoho  *
   1064   1.5  christos  * PARAMETERS:  Info                - Extra resource info
   1065   1.5  christos  *              Resource            - Pointer to the resource descriptor
   1066   1.1    jruoho  *              Length              - Length of the descriptor in bytes
   1067   1.1    jruoho  *              Level               - Current source code indentation level
   1068   1.1    jruoho  *
   1069   1.1    jruoho  * RETURN:      None
   1070   1.1    jruoho  *
   1071   1.1    jruoho  * DESCRIPTION: Decode a extended Interrupt descriptor
   1072   1.1    jruoho  *
   1073   1.1    jruoho  ******************************************************************************/
   1074   1.1    jruoho 
   1075   1.1    jruoho void
   1076   1.1    jruoho AcpiDmInterruptDescriptor (
   1077   1.5  christos     ACPI_OP_WALK_INFO       *Info,
   1078   1.1    jruoho     AML_RESOURCE            *Resource,
   1079   1.1    jruoho     UINT32                  Length,
   1080   1.1    jruoho     UINT32                  Level)
   1081   1.1    jruoho {
   1082   1.1    jruoho     UINT32                  i;
   1083   1.1    jruoho 
   1084   1.1    jruoho 
   1085   1.1    jruoho     AcpiDmIndent (Level);
   1086   1.1    jruoho     AcpiOsPrintf ("Interrupt (%s, %s, %s, %s, ",
   1087   1.4  christos         AcpiGbl_ConsumeDecode [ACPI_GET_1BIT_FLAG (Resource->ExtendedIrq.Flags)],
   1088   1.4  christos         AcpiGbl_HeDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->ExtendedIrq.Flags, 1)],
   1089   1.4  christos         AcpiGbl_LlDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->ExtendedIrq.Flags, 2)],
   1090   1.4  christos         AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->ExtendedIrq.Flags, 3)]);
   1091   1.1    jruoho 
   1092   1.1    jruoho     /*
   1093   1.1    jruoho      * The ResourceSource fields are optional and appear after the interrupt
   1094   1.1    jruoho      * list. Must compute length based on length of the list. First xrupt
   1095   1.1    jruoho      * is included in the struct (reason for -1 below)
   1096   1.1    jruoho      */
   1097   1.1    jruoho     AcpiDmResourceSource (Resource,
   1098   1.1    jruoho         sizeof (AML_RESOURCE_EXTENDED_IRQ) +
   1099   1.1    jruoho             ((UINT32) Resource->ExtendedIrq.InterruptCount - 1) * sizeof (UINT32),
   1100   1.1    jruoho         Resource->ExtendedIrq.ResourceLength);
   1101   1.1    jruoho 
   1102   1.1    jruoho     /* Insert a descriptor name */
   1103   1.1    jruoho 
   1104   1.1    jruoho     AcpiDmDescriptorName ();
   1105   1.1    jruoho     AcpiOsPrintf (")\n");
   1106   1.1    jruoho 
   1107   1.1    jruoho     /* Dump the interrupt list */
   1108   1.1    jruoho 
   1109   1.1    jruoho     AcpiDmIndent (Level);
   1110   1.1    jruoho     AcpiOsPrintf ("{\n");
   1111   1.1    jruoho     for (i = 0; i < Resource->ExtendedIrq.InterruptCount; i++)
   1112   1.1    jruoho     {
   1113   1.1    jruoho         AcpiDmIndent (Level + 1);
   1114   1.1    jruoho         AcpiOsPrintf ("0x%8.8X,\n",
   1115   1.1    jruoho             (UINT32) Resource->ExtendedIrq.Interrupts[i]);
   1116   1.1    jruoho     }
   1117   1.1    jruoho 
   1118   1.1    jruoho     AcpiDmIndent (Level);
   1119   1.1    jruoho     AcpiOsPrintf ("}\n");
   1120   1.1    jruoho }
   1121   1.1    jruoho 
   1122   1.1    jruoho 
   1123   1.1    jruoho /*******************************************************************************
   1124   1.1    jruoho  *
   1125   1.1    jruoho  * FUNCTION:    AcpiDmVendorCommon
   1126   1.1    jruoho  *
   1127   1.1    jruoho  * PARAMETERS:  Name                - Descriptor name suffix
   1128   1.1    jruoho  *              ByteData            - Pointer to the vendor byte data
   1129   1.1    jruoho  *              Length              - Length of the byte data
   1130   1.1    jruoho  *              Level               - Current source code indentation level
   1131   1.1    jruoho  *
   1132   1.1    jruoho  * RETURN:      None
   1133   1.1    jruoho  *
   1134   1.1    jruoho  * DESCRIPTION: Decode a Vendor descriptor, both Large and Small
   1135   1.1    jruoho  *
   1136   1.1    jruoho  ******************************************************************************/
   1137   1.1    jruoho 
   1138   1.1    jruoho void
   1139   1.1    jruoho AcpiDmVendorCommon (
   1140   1.2    jruoho     const char              *Name,
   1141   1.1    jruoho     UINT8                   *ByteData,
   1142   1.1    jruoho     UINT32                  Length,
   1143   1.1    jruoho     UINT32                  Level)
   1144   1.1    jruoho {
   1145   1.1    jruoho 
   1146   1.1    jruoho     /* Dump macro name */
   1147   1.1    jruoho 
   1148   1.1    jruoho     AcpiDmIndent (Level);
   1149   1.1    jruoho     AcpiOsPrintf ("Vendor%s (", Name);
   1150   1.1    jruoho 
   1151   1.1    jruoho     /* Insert a descriptor name */
   1152   1.1    jruoho 
   1153   1.1    jruoho     AcpiDmDescriptorName ();
   1154   1.1    jruoho     AcpiOsPrintf (")      // Length = 0x%.2X\n", Length);
   1155   1.1    jruoho 
   1156   1.1    jruoho     /* Dump the vendor bytes */
   1157   1.1    jruoho 
   1158   1.1    jruoho     AcpiDmIndent (Level);
   1159   1.1    jruoho     AcpiOsPrintf ("{\n");
   1160   1.1    jruoho 
   1161   1.1    jruoho     AcpiDmDisasmByteList (Level + 1, ByteData, Length);
   1162   1.1    jruoho 
   1163   1.1    jruoho     AcpiDmIndent (Level);
   1164   1.1    jruoho     AcpiOsPrintf ("}\n");
   1165   1.1    jruoho }
   1166   1.1    jruoho 
   1167   1.1    jruoho 
   1168   1.1    jruoho /*******************************************************************************
   1169   1.1    jruoho  *
   1170   1.1    jruoho  * FUNCTION:    AcpiDmVendorLargeDescriptor
   1171   1.1    jruoho  *
   1172   1.5  christos  * PARAMETERS:  Info                - Extra resource info
   1173   1.5  christos  *              Resource            - Pointer to the resource descriptor
   1174   1.1    jruoho  *              Length              - Length of the descriptor in bytes
   1175   1.1    jruoho  *              Level               - Current source code indentation level
   1176   1.1    jruoho  *
   1177   1.1    jruoho  * RETURN:      None
   1178   1.1    jruoho  *
   1179   1.1    jruoho  * DESCRIPTION: Decode a Vendor Large descriptor
   1180   1.1    jruoho  *
   1181   1.1    jruoho  ******************************************************************************/
   1182   1.1    jruoho 
   1183   1.1    jruoho void
   1184   1.1    jruoho AcpiDmVendorLargeDescriptor (
   1185   1.5  christos     ACPI_OP_WALK_INFO       *Info,
   1186   1.1    jruoho     AML_RESOURCE            *Resource,
   1187   1.1    jruoho     UINT32                  Length,
   1188   1.1    jruoho     UINT32                  Level)
   1189   1.1    jruoho {
   1190   1.1    jruoho 
   1191   1.1    jruoho     AcpiDmVendorCommon ("Long ",
   1192   1.1    jruoho         ACPI_ADD_PTR (UINT8, Resource, sizeof (AML_RESOURCE_LARGE_HEADER)),
   1193   1.1    jruoho         Length, Level);
   1194   1.1    jruoho }
   1195