Home | History | Annotate | Line # | Download | only in disassembler
dmresrcs.c revision 1.1.1.6
      1      1.1    jruoho /*******************************************************************************
      2      1.1    jruoho  *
      3      1.1    jruoho  * Module Name: dmresrcs.c - "Small" Resource Descriptor disassembly
      4      1.1    jruoho  *
      5      1.1    jruoho  ******************************************************************************/
      6      1.1    jruoho 
      7  1.1.1.2    jruoho /*
      8  1.1.1.6  christos  * Copyright (C) 2000 - 2016, Intel Corp.
      9      1.1    jruoho  * All rights reserved.
     10      1.1    jruoho  *
     11  1.1.1.2    jruoho  * Redistribution and use in source and binary forms, with or without
     12  1.1.1.2    jruoho  * modification, are permitted provided that the following conditions
     13  1.1.1.2    jruoho  * are met:
     14  1.1.1.2    jruoho  * 1. Redistributions of source code must retain the above copyright
     15  1.1.1.2    jruoho  *    notice, this list of conditions, and the following disclaimer,
     16  1.1.1.2    jruoho  *    without modification.
     17  1.1.1.2    jruoho  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     18  1.1.1.2    jruoho  *    substantially similar to the "NO WARRANTY" disclaimer below
     19  1.1.1.2    jruoho  *    ("Disclaimer") and any redistribution must be conditioned upon
     20  1.1.1.2    jruoho  *    including a substantially similar Disclaimer requirement for further
     21  1.1.1.2    jruoho  *    binary redistribution.
     22  1.1.1.2    jruoho  * 3. Neither the names of the above-listed copyright holders nor the names
     23  1.1.1.2    jruoho  *    of any contributors may be used to endorse or promote products derived
     24  1.1.1.2    jruoho  *    from this software without specific prior written permission.
     25  1.1.1.2    jruoho  *
     26  1.1.1.2    jruoho  * Alternatively, this software may be distributed under the terms of the
     27  1.1.1.2    jruoho  * GNU General Public License ("GPL") version 2 as published by the Free
     28  1.1.1.2    jruoho  * Software Foundation.
     29  1.1.1.2    jruoho  *
     30  1.1.1.2    jruoho  * NO WARRANTY
     31  1.1.1.2    jruoho  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     32  1.1.1.2    jruoho  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     33  1.1.1.2    jruoho  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
     34  1.1.1.2    jruoho  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     35  1.1.1.2    jruoho  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     36  1.1.1.2    jruoho  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     37  1.1.1.2    jruoho  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     38  1.1.1.2    jruoho  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     39  1.1.1.2    jruoho  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     40  1.1.1.2    jruoho  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     41  1.1.1.2    jruoho  * POSSIBILITY OF SUCH DAMAGES.
     42  1.1.1.2    jruoho  */
     43      1.1    jruoho 
     44      1.1    jruoho #include "acpi.h"
     45      1.1    jruoho #include "accommon.h"
     46      1.1    jruoho #include "acdisasm.h"
     47      1.1    jruoho 
     48      1.1    jruoho 
     49      1.1    jruoho #define _COMPONENT          ACPI_CA_DEBUGGER
     50      1.1    jruoho         ACPI_MODULE_NAME    ("dbresrcs")
     51      1.1    jruoho 
     52      1.1    jruoho 
     53      1.1    jruoho /*******************************************************************************
     54      1.1    jruoho  *
     55      1.1    jruoho  * FUNCTION:    AcpiDmIrqDescriptor
     56      1.1    jruoho  *
     57  1.1.1.4  christos  * PARAMETERS:  Info                - Extra resource info
     58  1.1.1.4  christos  *              Resource            - Pointer to the resource descriptor
     59      1.1    jruoho  *              Length              - Length of the descriptor in bytes
     60      1.1    jruoho  *              Level               - Current source code indentation level
     61      1.1    jruoho  *
     62      1.1    jruoho  * RETURN:      None
     63      1.1    jruoho  *
     64      1.1    jruoho  * DESCRIPTION: Decode a IRQ descriptor, either Irq() or IrqNoFlags()
     65      1.1    jruoho  *
     66      1.1    jruoho  ******************************************************************************/
     67      1.1    jruoho 
     68      1.1    jruoho void
     69      1.1    jruoho AcpiDmIrqDescriptor (
     70  1.1.1.4  christos     ACPI_OP_WALK_INFO       *Info,
     71      1.1    jruoho     AML_RESOURCE            *Resource,
     72      1.1    jruoho     UINT32                  Length,
     73      1.1    jruoho     UINT32                  Level)
     74      1.1    jruoho {
     75      1.1    jruoho 
     76      1.1    jruoho     AcpiDmIndent (Level);
     77      1.1    jruoho     AcpiOsPrintf ("%s (",
     78  1.1.1.3  christos         AcpiGbl_IrqDecode [ACPI_GET_1BIT_FLAG (Length)]);
     79      1.1    jruoho 
     80      1.1    jruoho     /* Decode flags byte if present */
     81      1.1    jruoho 
     82      1.1    jruoho     if (Length & 1)
     83      1.1    jruoho     {
     84      1.1    jruoho         AcpiOsPrintf ("%s, %s, %s, ",
     85  1.1.1.3  christos             AcpiGbl_HeDecode [ACPI_GET_1BIT_FLAG (Resource->Irq.Flags)],
     86  1.1.1.3  christos             AcpiGbl_LlDecode [ACPI_EXTRACT_1BIT_FLAG (Resource->Irq.Flags, 3)],
     87  1.1.1.3  christos             AcpiGbl_ShrDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Irq.Flags, 4)]);
     88      1.1    jruoho     }
     89      1.1    jruoho 
     90      1.1    jruoho     /* Insert a descriptor name */
     91      1.1    jruoho 
     92      1.1    jruoho     AcpiDmDescriptorName ();
     93      1.1    jruoho     AcpiOsPrintf (")\n");
     94      1.1    jruoho 
     95      1.1    jruoho     AcpiDmIndent (Level + 1);
     96      1.1    jruoho     AcpiDmBitList (Resource->Irq.IrqMask);
     97      1.1    jruoho }
     98      1.1    jruoho 
     99      1.1    jruoho 
    100      1.1    jruoho /*******************************************************************************
    101      1.1    jruoho  *
    102      1.1    jruoho  * FUNCTION:    AcpiDmDmaDescriptor
    103      1.1    jruoho  *
    104  1.1.1.4  christos  * PARAMETERS:  Info                - Extra resource info
    105  1.1.1.4  christos  *              Resource            - Pointer to the resource descriptor
    106      1.1    jruoho  *              Length              - Length of the descriptor in bytes
    107      1.1    jruoho  *              Level               - Current source code indentation level
    108      1.1    jruoho  *
    109      1.1    jruoho  * RETURN:      None
    110      1.1    jruoho  *
    111      1.1    jruoho  * DESCRIPTION: Decode a DMA descriptor
    112      1.1    jruoho  *
    113      1.1    jruoho  ******************************************************************************/
    114      1.1    jruoho 
    115      1.1    jruoho void
    116      1.1    jruoho AcpiDmDmaDescriptor (
    117  1.1.1.4  christos     ACPI_OP_WALK_INFO       *Info,
    118      1.1    jruoho     AML_RESOURCE            *Resource,
    119      1.1    jruoho     UINT32                  Length,
    120      1.1    jruoho     UINT32                  Level)
    121      1.1    jruoho {
    122      1.1    jruoho 
    123      1.1    jruoho     AcpiDmIndent (Level);
    124      1.1    jruoho     AcpiOsPrintf ("DMA (%s, %s, %s, ",
    125  1.1.1.3  christos         AcpiGbl_TypDecode [ACPI_EXTRACT_2BIT_FLAG (Resource->Dma.Flags, 5)],
    126  1.1.1.3  christos         AcpiGbl_BmDecode  [ACPI_EXTRACT_1BIT_FLAG (Resource->Dma.Flags, 2)],
    127  1.1.1.3  christos         AcpiGbl_SizDecode [ACPI_GET_2BIT_FLAG (Resource->Dma.Flags)]);
    128      1.1    jruoho 
    129      1.1    jruoho     /* Insert a descriptor name */
    130      1.1    jruoho 
    131      1.1    jruoho     AcpiDmDescriptorName ();
    132      1.1    jruoho     AcpiOsPrintf (")\n");
    133      1.1    jruoho 
    134      1.1    jruoho     AcpiDmIndent (Level + 1);
    135      1.1    jruoho     AcpiDmBitList (Resource->Dma.DmaChannelMask);
    136      1.1    jruoho }
    137      1.1    jruoho 
    138      1.1    jruoho 
    139      1.1    jruoho /*******************************************************************************
    140      1.1    jruoho  *
    141  1.1.1.3  christos  * FUNCTION:    AcpiDmFixedDmaDescriptor
    142  1.1.1.3  christos  *
    143  1.1.1.4  christos  * PARAMETERS:  Info                - Extra resource info
    144  1.1.1.4  christos  *              Resource            - Pointer to the resource descriptor
    145  1.1.1.3  christos  *              Length              - Length of the descriptor in bytes
    146  1.1.1.3  christos  *              Level               - Current source code indentation level
    147  1.1.1.3  christos  *
    148  1.1.1.3  christos  * RETURN:      None
    149  1.1.1.3  christos  *
    150  1.1.1.3  christos  * DESCRIPTION: Decode a FixedDMA descriptor
    151  1.1.1.3  christos  *
    152  1.1.1.3  christos  ******************************************************************************/
    153  1.1.1.3  christos 
    154  1.1.1.3  christos void
    155  1.1.1.3  christos AcpiDmFixedDmaDescriptor (
    156  1.1.1.4  christos     ACPI_OP_WALK_INFO       *Info,
    157  1.1.1.3  christos     AML_RESOURCE            *Resource,
    158  1.1.1.3  christos     UINT32                  Length,
    159  1.1.1.3  christos     UINT32                  Level)
    160  1.1.1.3  christos {
    161  1.1.1.3  christos 
    162  1.1.1.3  christos     AcpiDmIndent (Level);
    163  1.1.1.3  christos     AcpiOsPrintf ("FixedDMA (0x%4.4X, 0x%4.4X, ",
    164  1.1.1.3  christos         Resource->FixedDma.RequestLines,
    165  1.1.1.3  christos         Resource->FixedDma.Channels);
    166  1.1.1.3  christos 
    167  1.1.1.3  christos     if (Resource->FixedDma.Width <= 5)
    168  1.1.1.3  christos     {
    169  1.1.1.3  christos         AcpiOsPrintf ("%s, ",
    170  1.1.1.3  christos             AcpiGbl_DtsDecode [Resource->FixedDma.Width]);
    171  1.1.1.3  christos     }
    172  1.1.1.3  christos     else
    173  1.1.1.3  christos     {
    174  1.1.1.6  christos         AcpiOsPrintf ("%X /* INVALID DMA WIDTH */, ",
    175  1.1.1.6  christos             Resource->FixedDma.Width);
    176  1.1.1.3  christos     }
    177  1.1.1.3  christos 
    178  1.1.1.3  christos     /* Insert a descriptor name */
    179  1.1.1.3  christos 
    180  1.1.1.3  christos     AcpiDmDescriptorName ();
    181  1.1.1.3  christos     AcpiOsPrintf (")\n");
    182  1.1.1.3  christos }
    183  1.1.1.3  christos 
    184  1.1.1.3  christos 
    185  1.1.1.3  christos /*******************************************************************************
    186  1.1.1.3  christos  *
    187      1.1    jruoho  * FUNCTION:    AcpiDmIoDescriptor
    188      1.1    jruoho  *
    189  1.1.1.4  christos  * PARAMETERS:  Info                - Extra resource info
    190  1.1.1.4  christos  *              Resource            - Pointer to the resource descriptor
    191      1.1    jruoho  *              Length              - Length of the descriptor in bytes
    192      1.1    jruoho  *              Level               - Current source code indentation level
    193      1.1    jruoho  *
    194      1.1    jruoho  * RETURN:      None
    195      1.1    jruoho  *
    196      1.1    jruoho  * DESCRIPTION: Decode an IO descriptor
    197      1.1    jruoho  *
    198      1.1    jruoho  ******************************************************************************/
    199      1.1    jruoho 
    200      1.1    jruoho void
    201      1.1    jruoho AcpiDmIoDescriptor (
    202  1.1.1.4  christos     ACPI_OP_WALK_INFO       *Info,
    203      1.1    jruoho     AML_RESOURCE            *Resource,
    204      1.1    jruoho     UINT32                  Length,
    205      1.1    jruoho     UINT32                  Level)
    206      1.1    jruoho {
    207      1.1    jruoho 
    208      1.1    jruoho     AcpiDmIndent (Level);
    209      1.1    jruoho     AcpiOsPrintf ("IO (%s,\n",
    210  1.1.1.3  christos         AcpiGbl_IoDecode [ACPI_GET_1BIT_FLAG (Resource->Io.Flags)]);
    211      1.1    jruoho 
    212      1.1    jruoho     AcpiDmIndent (Level + 1);
    213      1.1    jruoho     AcpiDmDumpInteger16 (Resource->Io.Minimum, "Range Minimum");
    214      1.1    jruoho 
    215      1.1    jruoho     AcpiDmIndent (Level + 1);
    216      1.1    jruoho     AcpiDmDumpInteger16 (Resource->Io.Maximum, "Range Maximum");
    217      1.1    jruoho 
    218      1.1    jruoho     AcpiDmIndent (Level + 1);
    219      1.1    jruoho     AcpiDmDumpInteger8 (Resource->Io.Alignment, "Alignment");
    220      1.1    jruoho 
    221      1.1    jruoho     AcpiDmIndent (Level + 1);
    222      1.1    jruoho     AcpiDmDumpInteger8 (Resource->Io.AddressLength, "Length");
    223      1.1    jruoho 
    224      1.1    jruoho     /* Insert a descriptor name */
    225      1.1    jruoho 
    226      1.1    jruoho     AcpiDmIndent (Level + 1);
    227      1.1    jruoho     AcpiDmDescriptorName ();
    228      1.1    jruoho     AcpiOsPrintf (")\n");
    229      1.1    jruoho }
    230      1.1    jruoho 
    231      1.1    jruoho 
    232      1.1    jruoho /*******************************************************************************
    233      1.1    jruoho  *
    234      1.1    jruoho  * FUNCTION:    AcpiDmFixedIoDescriptor
    235      1.1    jruoho  *
    236  1.1.1.4  christos  * PARAMETERS:  Info                - Extra resource info
    237  1.1.1.4  christos  *              Resource            - Pointer to the resource descriptor
    238      1.1    jruoho  *              Length              - Length of the descriptor in bytes
    239      1.1    jruoho  *              Level               - Current source code indentation level
    240      1.1    jruoho  *
    241      1.1    jruoho  * RETURN:      None
    242      1.1    jruoho  *
    243      1.1    jruoho  * DESCRIPTION: Decode a Fixed IO descriptor
    244      1.1    jruoho  *
    245      1.1    jruoho  ******************************************************************************/
    246      1.1    jruoho 
    247      1.1    jruoho void
    248      1.1    jruoho AcpiDmFixedIoDescriptor (
    249  1.1.1.4  christos     ACPI_OP_WALK_INFO       *Info,
    250      1.1    jruoho     AML_RESOURCE            *Resource,
    251      1.1    jruoho     UINT32                  Length,
    252      1.1    jruoho     UINT32                  Level)
    253      1.1    jruoho {
    254      1.1    jruoho 
    255      1.1    jruoho     AcpiDmIndent (Level);
    256      1.1    jruoho     AcpiOsPrintf ("FixedIO (\n");
    257      1.1    jruoho 
    258      1.1    jruoho     AcpiDmIndent (Level + 1);
    259      1.1    jruoho     AcpiDmDumpInteger16 (Resource->FixedIo.Address, "Address");
    260      1.1    jruoho 
    261      1.1    jruoho     AcpiDmIndent (Level + 1);
    262      1.1    jruoho     AcpiDmDumpInteger8 (Resource->FixedIo.AddressLength, "Length");
    263      1.1    jruoho 
    264      1.1    jruoho     /* Insert a descriptor name */
    265      1.1    jruoho 
    266      1.1    jruoho     AcpiDmIndent (Level + 1);
    267      1.1    jruoho     AcpiDmDescriptorName ();
    268      1.1    jruoho     AcpiOsPrintf (")\n");
    269      1.1    jruoho }
    270      1.1    jruoho 
    271      1.1    jruoho 
    272      1.1    jruoho /*******************************************************************************
    273      1.1    jruoho  *
    274      1.1    jruoho  * FUNCTION:    AcpiDmStartDependentDescriptor
    275      1.1    jruoho  *
    276  1.1.1.4  christos  * PARAMETERS:  Info                - Extra resource info
    277  1.1.1.4  christos  *              Resource            - Pointer to the resource descriptor
    278      1.1    jruoho  *              Length              - Length of the descriptor in bytes
    279      1.1    jruoho  *              Level               - Current source code indentation level
    280      1.1    jruoho  *
    281      1.1    jruoho  * RETURN:      None
    282      1.1    jruoho  *
    283      1.1    jruoho  * DESCRIPTION: Decode a Start Dependendent functions descriptor
    284      1.1    jruoho  *
    285      1.1    jruoho  ******************************************************************************/
    286      1.1    jruoho 
    287      1.1    jruoho void
    288      1.1    jruoho AcpiDmStartDependentDescriptor (
    289  1.1.1.4  christos     ACPI_OP_WALK_INFO       *Info,
    290      1.1    jruoho     AML_RESOURCE            *Resource,
    291      1.1    jruoho     UINT32                  Length,
    292      1.1    jruoho     UINT32                  Level)
    293      1.1    jruoho {
    294      1.1    jruoho 
    295      1.1    jruoho     AcpiDmIndent (Level);
    296      1.1    jruoho 
    297      1.1    jruoho     if (Length & 1)
    298      1.1    jruoho     {
    299      1.1    jruoho         AcpiOsPrintf ("StartDependentFn (0x%2.2X, 0x%2.2X)\n",
    300  1.1.1.3  christos             (UINT32) ACPI_GET_2BIT_FLAG (Resource->StartDpf.Flags),
    301  1.1.1.3  christos             (UINT32) ACPI_EXTRACT_2BIT_FLAG (Resource->StartDpf.Flags, 2));
    302      1.1    jruoho     }
    303      1.1    jruoho     else
    304      1.1    jruoho     {
    305      1.1    jruoho         AcpiOsPrintf ("StartDependentFnNoPri ()\n");
    306      1.1    jruoho     }
    307      1.1    jruoho 
    308      1.1    jruoho     AcpiDmIndent (Level);
    309      1.1    jruoho     AcpiOsPrintf ("{\n");
    310      1.1    jruoho }
    311      1.1    jruoho 
    312      1.1    jruoho 
    313      1.1    jruoho /*******************************************************************************
    314      1.1    jruoho  *
    315      1.1    jruoho  * FUNCTION:    AcpiDmEndDependentDescriptor
    316      1.1    jruoho  *
    317  1.1.1.4  christos  * PARAMETERS:  Info                - Extra resource info
    318  1.1.1.4  christos  *              Resource            - Pointer to the resource descriptor
    319      1.1    jruoho  *              Length              - Length of the descriptor in bytes
    320      1.1    jruoho  *              Level               - Current source code indentation level
    321      1.1    jruoho  *
    322      1.1    jruoho  * RETURN:      None
    323      1.1    jruoho  *
    324      1.1    jruoho  * DESCRIPTION: Decode an End Dependent functions descriptor
    325      1.1    jruoho  *
    326      1.1    jruoho  ******************************************************************************/
    327      1.1    jruoho 
    328      1.1    jruoho void
    329      1.1    jruoho AcpiDmEndDependentDescriptor (
    330  1.1.1.4  christos     ACPI_OP_WALK_INFO       *Info,
    331      1.1    jruoho     AML_RESOURCE            *Resource,
    332      1.1    jruoho     UINT32                  Length,
    333      1.1    jruoho     UINT32                  Level)
    334      1.1    jruoho {
    335      1.1    jruoho 
    336      1.1    jruoho     AcpiDmIndent (Level);
    337      1.1    jruoho     AcpiOsPrintf ("}\n");
    338      1.1    jruoho     AcpiDmIndent (Level);
    339      1.1    jruoho     AcpiOsPrintf ("EndDependentFn ()\n");
    340      1.1    jruoho }
    341      1.1    jruoho 
    342      1.1    jruoho 
    343      1.1    jruoho /*******************************************************************************
    344      1.1    jruoho  *
    345      1.1    jruoho  * FUNCTION:    AcpiDmVendorSmallDescriptor
    346      1.1    jruoho  *
    347  1.1.1.4  christos  * PARAMETERS:  Info                - Extra resource info
    348  1.1.1.4  christos  *              Resource            - Pointer to the resource descriptor
    349      1.1    jruoho  *              Length              - Length of the descriptor in bytes
    350      1.1    jruoho  *              Level               - Current source code indentation level
    351      1.1    jruoho  *
    352      1.1    jruoho  * RETURN:      None
    353      1.1    jruoho  *
    354      1.1    jruoho  * DESCRIPTION: Decode a Vendor Small Descriptor
    355      1.1    jruoho  *
    356      1.1    jruoho  ******************************************************************************/
    357      1.1    jruoho 
    358      1.1    jruoho void
    359      1.1    jruoho AcpiDmVendorSmallDescriptor (
    360  1.1.1.4  christos     ACPI_OP_WALK_INFO       *Info,
    361      1.1    jruoho     AML_RESOURCE            *Resource,
    362      1.1    jruoho     UINT32                  Length,
    363      1.1    jruoho     UINT32                  Level)
    364      1.1    jruoho {
    365      1.1    jruoho 
    366      1.1    jruoho     AcpiDmVendorCommon ("Short",
    367      1.1    jruoho         ACPI_ADD_PTR (UINT8, Resource, sizeof (AML_RESOURCE_SMALL_HEADER)),
    368      1.1    jruoho         Length, Level);
    369      1.1    jruoho }
    370