Home | History | Annotate | Line # | Download | only in resources
      1 /*******************************************************************************
      2  *
      3  * Module Name: rsdump - AML debugger support for resource structures.
      4  *
      5  ******************************************************************************/
      6 
      7 /******************************************************************************
      8  *
      9  * 1. Copyright Notice
     10  *
     11  * Some or all of this work - Copyright (c) 1999 - 2025, Intel Corp.
     12  * All rights reserved.
     13  *
     14  * 2. License
     15  *
     16  * 2.1. This is your license from Intel Corp. under its intellectual property
     17  * rights. You may have additional license terms from the party that provided
     18  * you this software, covering your right to use that party's intellectual
     19  * property rights.
     20  *
     21  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
     22  * copy of the source code appearing in this file ("Covered Code") an
     23  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
     24  * base code distributed originally by Intel ("Original Intel Code") to copy,
     25  * make derivatives, distribute, use and display any portion of the Covered
     26  * Code in any form, with the right to sublicense such rights; and
     27  *
     28  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
     29  * license (with the right to sublicense), under only those claims of Intel
     30  * patents that are infringed by the Original Intel Code, to make, use, sell,
     31  * offer to sell, and import the Covered Code and derivative works thereof
     32  * solely to the minimum extent necessary to exercise the above copyright
     33  * license, and in no event shall the patent license extend to any additions
     34  * to or modifications of the Original Intel Code. No other license or right
     35  * is granted directly or by implication, estoppel or otherwise;
     36  *
     37  * The above copyright and patent license is granted only if the following
     38  * conditions are met:
     39  *
     40  * 3. Conditions
     41  *
     42  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
     43  * Redistribution of source code of any substantial portion of the Covered
     44  * Code or modification with rights to further distribute source must include
     45  * the above Copyright Notice, the above License, this list of Conditions,
     46  * and the following Disclaimer and Export Compliance provision. In addition,
     47  * Licensee must cause all Covered Code to which Licensee contributes to
     48  * contain a file documenting the changes Licensee made to create that Covered
     49  * Code and the date of any change. Licensee must include in that file the
     50  * documentation of any changes made by any predecessor Licensee. Licensee
     51  * must include a prominent statement that the modification is derived,
     52  * directly or indirectly, from Original Intel Code.
     53  *
     54  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
     55  * Redistribution of source code of any substantial portion of the Covered
     56  * Code or modification without rights to further distribute source must
     57  * include the following Disclaimer and Export Compliance provision in the
     58  * documentation and/or other materials provided with distribution. In
     59  * addition, Licensee may not authorize further sublicense of source of any
     60  * portion of the Covered Code, and must include terms to the effect that the
     61  * license from Licensee to its licensee is limited to the intellectual
     62  * property embodied in the software Licensee provides to its licensee, and
     63  * not to intellectual property embodied in modifications its licensee may
     64  * make.
     65  *
     66  * 3.3. Redistribution of Executable. Redistribution in executable form of any
     67  * substantial portion of the Covered Code or modification must reproduce the
     68  * above Copyright Notice, and the following Disclaimer and Export Compliance
     69  * provision in the documentation and/or other materials provided with the
     70  * distribution.
     71  *
     72  * 3.4. Intel retains all right, title, and interest in and to the Original
     73  * Intel Code.
     74  *
     75  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
     76  * Intel shall be used in advertising or otherwise to promote the sale, use or
     77  * other dealings in products derived from or relating to the Covered Code
     78  * without prior written authorization from Intel.
     79  *
     80  * 4. Disclaimer and Export Compliance
     81  *
     82  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
     83  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
     84  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
     85  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
     86  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
     87  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
     88  * PARTICULAR PURPOSE.
     89  *
     90  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
     91  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
     92  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
     93  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
     94  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
     95  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
     96  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
     97  * LIMITED REMEDY.
     98  *
     99  * 4.3. Licensee shall not export, either directly or indirectly, any of this
    100  * software or system incorporating such software without first obtaining any
    101  * required license or other approval from the U. S. Department of Commerce or
    102  * any other agency or department of the United States Government. In the
    103  * event Licensee exports any such software from the United States or
    104  * re-exports any such software from a foreign destination, Licensee shall
    105  * ensure that the distribution and export/re-export of the software is in
    106  * compliance with all laws, regulations, orders, or other restrictions of the
    107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
    108  * any of its subsidiaries will export/re-export any technical data, process,
    109  * software, or service, directly or indirectly, to any country for which the
    110  * United States government or any agency thereof requires an export license,
    111  * other governmental approval, or letter of assurance, without first obtaining
    112  * such license, approval or letter.
    113  *
    114  *****************************************************************************
    115  *
    116  * Alternatively, you may choose to be licensed under the terms of the
    117  * following license:
    118  *
    119  * Redistribution and use in source and binary forms, with or without
    120  * modification, are permitted provided that the following conditions
    121  * are met:
    122  * 1. Redistributions of source code must retain the above copyright
    123  *    notice, this list of conditions, and the following disclaimer,
    124  *    without modification.
    125  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
    126  *    substantially similar to the "NO WARRANTY" disclaimer below
    127  *    ("Disclaimer") and any redistribution must be conditioned upon
    128  *    including a substantially similar Disclaimer requirement for further
    129  *    binary redistribution.
    130  * 3. Neither the names of the above-listed copyright holders nor the names
    131  *    of any contributors may be used to endorse or promote products derived
    132  *    from this software without specific prior written permission.
    133  *
    134  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    135  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    136  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    137  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    138  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    139  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    140  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    141  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    142  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    143  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    144  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    145  *
    146  * Alternatively, you may choose to be licensed under the terms of the
    147  * GNU General Public License ("GPL") version 2 as published by the Free
    148  * Software Foundation.
    149  *
    150  *****************************************************************************/
    151 
    152 #include "acpi.h"
    153 #include "accommon.h"
    154 #include "acresrc.h"
    155 
    156 #define _COMPONENT          ACPI_RESOURCES
    157         ACPI_MODULE_NAME    ("rsdump")
    158 
    159 /*
    160  * All functions in this module are used by the AML Debugger only
    161  */
    162 
    163 /* Local prototypes */
    164 
    165 static void
    166 AcpiRsOutString (
    167     const char              *Title,
    168     const char              *Value);
    169 
    170 static void
    171 AcpiRsOutInteger8 (
    172     const char              *Title,
    173     UINT8                   Value);
    174 
    175 static void
    176 AcpiRsOutInteger16 (
    177     const char              *Title,
    178     UINT16                  Value);
    179 
    180 static void
    181 AcpiRsOutInteger32 (
    182     const char              *Title,
    183     UINT32                  Value);
    184 
    185 static void
    186 AcpiRsOutInteger64 (
    187     const char              *Title,
    188     UINT64                  Value);
    189 
    190 static void
    191 AcpiRsOutTitle (
    192     const char              *Title);
    193 
    194 static void
    195 AcpiRsDumpByteList (
    196     UINT16                  Length,
    197     UINT8                   *Data);
    198 
    199 static void
    200 AcpiRsDumpWordList (
    201     UINT16                  Length,
    202     UINT16                  *Data);
    203 
    204 static void
    205 AcpiRsDumpDwordList (
    206     UINT8                   Length,
    207     UINT32                  *Data);
    208 
    209 static void
    210 AcpiRsDumpShortByteList (
    211     UINT8                   Length,
    212     UINT8                   *Data);
    213 
    214 static void
    215 AcpiRsDumpResourceSource (
    216     ACPI_RESOURCE_SOURCE    *ResourceSource);
    217 
    218 static void
    219 AcpiRsDumpResourceLabel (
    220     const char             *Title,
    221     ACPI_RESOURCE_LABEL    *ResourceLabel);
    222 
    223 static void
    224 AcpiRsDumpAddressCommon (
    225     ACPI_RESOURCE_DATA      *Resource);
    226 
    227 static void
    228 AcpiRsDumpDescriptor (
    229     void                    *Resource,
    230     ACPI_RSDUMP_INFO        *Table);
    231 
    232 
    233 /*******************************************************************************
    234  *
    235  * FUNCTION:    AcpiRsDumpResourceList
    236  *
    237  * PARAMETERS:  ResourceList        - Pointer to a resource descriptor list
    238  *
    239  * RETURN:      None
    240  *
    241  * DESCRIPTION: Dispatches the structure to the correct dump routine.
    242  *
    243  ******************************************************************************/
    244 
    245 void
    246 AcpiRsDumpResourceList (
    247     ACPI_RESOURCE           *ResourceList)
    248 {
    249     UINT32                  Count = 0;
    250     UINT32                  Type;
    251 
    252 
    253     ACPI_FUNCTION_ENTRY ();
    254 
    255 
    256     /* Check if debug output enabled */
    257 
    258     if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT))
    259     {
    260         return;
    261     }
    262 
    263     /* Walk list and dump all resource descriptors (END_TAG terminates) */
    264 
    265     do
    266     {
    267         AcpiOsPrintf ("\n[%02X] ", Count);
    268         Count++;
    269 
    270         /* Validate Type before dispatch */
    271 
    272         Type = ResourceList->Type;
    273         if (Type > ACPI_RESOURCE_TYPE_MAX)
    274         {
    275             AcpiOsPrintf (
    276                 "Invalid descriptor type (%X) in resource list\n",
    277                 ResourceList->Type);
    278             return;
    279         }
    280         else if (!ResourceList->Type)
    281         {
    282             ACPI_ERROR ((AE_INFO, "Invalid Zero Resource Type"));
    283             return;
    284         }
    285 
    286         /* Sanity check the length. It must not be zero, or we loop forever */
    287 
    288         if (!ResourceList->Length)
    289         {
    290             AcpiOsPrintf (
    291                 "Invalid zero length descriptor in resource list\n");
    292             return;
    293         }
    294 
    295         /* Dump the resource descriptor */
    296 
    297         if (Type == ACPI_RESOURCE_TYPE_SERIAL_BUS)
    298         {
    299             AcpiRsDumpDescriptor (&ResourceList->Data,
    300                 AcpiGbl_DumpSerialBusDispatch[
    301                     ResourceList->Data.CommonSerialBus.Type]);
    302         }
    303         else
    304         {
    305             AcpiRsDumpDescriptor (&ResourceList->Data,
    306                 AcpiGbl_DumpResourceDispatch[Type]);
    307         }
    308 
    309         /* Point to the next resource structure */
    310 
    311         ResourceList = ACPI_NEXT_RESOURCE (ResourceList);
    312 
    313         /* Exit when END_TAG descriptor is reached */
    314 
    315     } while (Type != ACPI_RESOURCE_TYPE_END_TAG);
    316 }
    317 
    318 
    319 /*******************************************************************************
    320  *
    321  * FUNCTION:    AcpiRsDumpIrqList
    322  *
    323  * PARAMETERS:  RouteTable      - Pointer to the routing table to dump.
    324  *
    325  * RETURN:      None
    326  *
    327  * DESCRIPTION: Print IRQ routing table
    328  *
    329  ******************************************************************************/
    330 
    331 void
    332 AcpiRsDumpIrqList (
    333     UINT8                   *RouteTable)
    334 {
    335     ACPI_PCI_ROUTING_TABLE  *PrtElement;
    336     UINT8                   Count;
    337 
    338 
    339     ACPI_FUNCTION_ENTRY ();
    340 
    341 
    342     /* Check if debug output enabled */
    343 
    344     if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT))
    345     {
    346         return;
    347     }
    348 
    349     PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, RouteTable);
    350 
    351     /* Dump all table elements, Exit on zero length element */
    352 
    353     for (Count = 0; PrtElement->Length; Count++)
    354     {
    355         AcpiOsPrintf ("\n[%02X] PCI IRQ Routing Table Package\n", Count);
    356         AcpiRsDumpDescriptor (PrtElement, AcpiRsDumpPrt);
    357 
    358         PrtElement = ACPI_ADD_PTR (ACPI_PCI_ROUTING_TABLE,
    359             PrtElement, PrtElement->Length);
    360     }
    361 }
    362 
    363 
    364 /*******************************************************************************
    365  *
    366  * FUNCTION:    AcpiRsDumpDescriptor
    367  *
    368  * PARAMETERS:  Resource            - Buffer containing the resource
    369  *              Table               - Table entry to decode the resource
    370  *
    371  * RETURN:      None
    372  *
    373  * DESCRIPTION: Dump a resource descriptor based on a dump table entry.
    374  *
    375  ******************************************************************************/
    376 
    377 static void
    378 AcpiRsDumpDescriptor (
    379     void                    *Resource,
    380     ACPI_RSDUMP_INFO        *Table)
    381 {
    382     UINT8                   *Target = NULL;
    383     UINT8                   *PreviousTarget;
    384     const char              *Name;
    385     UINT8                   Count;
    386 
    387 
    388     /* First table entry must contain the table length (# of table entries) */
    389 
    390     Count = Table->Offset;
    391 
    392     while (Count)
    393     {
    394         PreviousTarget = Target;
    395         Target = ACPI_ADD_PTR (UINT8, Resource, Table->Offset);
    396         Name = Table->Name;
    397 
    398         switch (Table->Opcode)
    399         {
    400         case ACPI_RSD_TITLE:
    401             /*
    402              * Optional resource title
    403              */
    404             if (Table->Name)
    405             {
    406                 AcpiOsPrintf ("%s Resource\n", Name);
    407             }
    408             break;
    409 
    410         /* Strings */
    411 
    412         case ACPI_RSD_LITERAL:
    413 
    414             AcpiRsOutString (Name, ACPI_CAST_PTR (char, Table->Pointer));
    415             break;
    416 
    417         case ACPI_RSD_STRING:
    418 
    419             AcpiRsOutString (Name, ACPI_CAST_PTR (char, Target));
    420             break;
    421 
    422         /* Data items, 8/16/32/64 bit */
    423 
    424         case ACPI_RSD_UINT8:
    425 
    426             if (Table->Pointer)
    427             {
    428                 AcpiRsOutString (Name, Table->Pointer [*Target]);
    429             }
    430             else
    431             {
    432                 AcpiRsOutInteger8 (Name, ACPI_GET8 (Target));
    433             }
    434             break;
    435 
    436         case ACPI_RSD_UINT16:
    437 
    438             AcpiRsOutInteger16 (Name, ACPI_GET16 (Target));
    439             break;
    440 
    441         case ACPI_RSD_UINT32:
    442 
    443             AcpiRsOutInteger32 (Name, ACPI_GET32 (Target));
    444             break;
    445 
    446         case ACPI_RSD_UINT64:
    447 
    448             AcpiRsOutInteger64 (Name, ACPI_GET64 (Target));
    449             break;
    450 
    451         /* Flags: 1-bit and 2-bit flags supported */
    452 
    453         case ACPI_RSD_1BITFLAG:
    454 
    455             AcpiRsOutString (Name, Table->Pointer [*Target & 0x01]);
    456             break;
    457 
    458         case ACPI_RSD_2BITFLAG:
    459 
    460             AcpiRsOutString (Name, Table->Pointer [*Target & 0x03]);
    461             break;
    462 
    463         case ACPI_RSD_3BITFLAG:
    464 
    465             AcpiRsOutString (Name, Table->Pointer [*Target & 0x07]);
    466             break;
    467 
    468         case ACPI_RSD_6BITFLAG:
    469 
    470             AcpiRsOutInteger8 (Name, (ACPI_GET8 (Target) & 0x3F));
    471             break;
    472 
    473         case ACPI_RSD_SHORTLIST:
    474             /*
    475              * Short byte list (single line output) for DMA and IRQ resources
    476              * Note: The list length is obtained from the previous table entry
    477              */
    478             if (PreviousTarget)
    479             {
    480                 AcpiRsOutTitle (Name);
    481                 AcpiRsDumpShortByteList (*PreviousTarget, Target);
    482             }
    483             break;
    484 
    485         case ACPI_RSD_SHORTLISTX:
    486             /*
    487              * Short byte list (single line output) for GPIO vendor data
    488              * Note: The list length is obtained from the previous table entry
    489              */
    490             if (PreviousTarget)
    491             {
    492                 AcpiRsOutTitle (Name);
    493                 AcpiRsDumpShortByteList (*PreviousTarget,
    494                     *(ACPI_CAST_INDIRECT_PTR (UINT8, Target)));
    495             }
    496             break;
    497 
    498         case ACPI_RSD_LONGLIST:
    499             /*
    500              * Long byte list for Vendor resource data
    501              * Note: The list length is obtained from the previous table entry
    502              */
    503             if (PreviousTarget)
    504             {
    505                 AcpiRsDumpByteList (ACPI_GET16 (PreviousTarget), Target);
    506             }
    507             break;
    508 
    509         case ACPI_RSD_DWORDLIST:
    510             /*
    511              * Dword list for Extended Interrupt resources
    512              * Note: The list length is obtained from the previous table entry
    513              */
    514             if (PreviousTarget)
    515             {
    516                 AcpiRsDumpDwordList (*PreviousTarget,
    517                     ACPI_CAST_PTR (UINT32, Target));
    518             }
    519             break;
    520 
    521         case ACPI_RSD_WORDLIST:
    522             /*
    523              * Word list for GPIO Pin Table
    524              * Note: The list length is obtained from the previous table entry
    525              */
    526             if (PreviousTarget)
    527             {
    528                 AcpiRsDumpWordList (*PreviousTarget,
    529                     *(ACPI_CAST_INDIRECT_PTR (UINT16, Target)));
    530             }
    531             break;
    532 
    533         case ACPI_RSD_ADDRESS:
    534             /*
    535              * Common flags for all Address resources
    536              */
    537             AcpiRsDumpAddressCommon (ACPI_CAST_PTR (
    538                 ACPI_RESOURCE_DATA, Target));
    539             break;
    540 
    541         case ACPI_RSD_SOURCE:
    542             /*
    543              * Optional ResourceSource for Address resources
    544              */
    545             AcpiRsDumpResourceSource (ACPI_CAST_PTR (
    546                 ACPI_RESOURCE_SOURCE, Target));
    547             break;
    548 
    549         case ACPI_RSD_LABEL:
    550             /*
    551              * ResourceLabel
    552              */
    553             AcpiRsDumpResourceLabel ("Resource Label", ACPI_CAST_PTR (
    554                 ACPI_RESOURCE_LABEL, Target));
    555             break;
    556 
    557         case ACPI_RSD_SOURCE_LABEL:
    558             /*
    559              * ResourceSourceLabel
    560              */
    561             AcpiRsDumpResourceLabel ("Resource Source Label", ACPI_CAST_PTR (
    562                 ACPI_RESOURCE_LABEL, Target));
    563             break;
    564 
    565         default:
    566 
    567             AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",
    568                 Table->Opcode);
    569             return;
    570         }
    571 
    572         Table++;
    573         Count--;
    574     }
    575 }
    576 
    577 
    578 /*******************************************************************************
    579  *
    580  * FUNCTION:    AcpiRsDumpResourceSource
    581  *
    582  * PARAMETERS:  ResourceSource      - Pointer to a Resource Source struct
    583  *
    584  * RETURN:      None
    585  *
    586  * DESCRIPTION: Common routine for dumping the optional ResourceSource and the
    587  *              corresponding ResourceSourceIndex.
    588  *
    589  ******************************************************************************/
    590 
    591 static void
    592 AcpiRsDumpResourceSource (
    593     ACPI_RESOURCE_SOURCE    *ResourceSource)
    594 {
    595     ACPI_FUNCTION_ENTRY ();
    596 
    597 
    598     if (ResourceSource->Index == 0xFF)
    599     {
    600         return;
    601     }
    602 
    603     AcpiRsOutInteger8 ("Resource Source Index",
    604         ResourceSource->Index);
    605 
    606     AcpiRsOutString ("Resource Source",
    607         ResourceSource->StringPtr ?
    608             ResourceSource->StringPtr : "[Not Specified]");
    609 }
    610 
    611 
    612 /*******************************************************************************
    613  *
    614  * FUNCTION:    AcpiRsDumpResourceLabel
    615  *
    616  * PARAMETERS:  Title              - Title of the dumped resource field
    617  *              ResourceLabel      - Pointer to a Resource Label struct
    618  *
    619  * RETURN:      None
    620  *
    621  * DESCRIPTION: Common routine for dumping the ResourceLabel
    622  *
    623  ******************************************************************************/
    624 
    625 static void
    626 AcpiRsDumpResourceLabel (
    627     const char             *Title,
    628     ACPI_RESOURCE_LABEL    *ResourceLabel)
    629 {
    630     ACPI_FUNCTION_ENTRY ();
    631 
    632     AcpiRsOutString (Title,
    633         ResourceLabel->StringPtr ?
    634             ResourceLabel->StringPtr : "[Not Specified]");
    635 }
    636 
    637 
    638 /*******************************************************************************
    639  *
    640  * FUNCTION:    AcpiRsDumpAddressCommon
    641  *
    642  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
    643  *
    644  * RETURN:      None
    645  *
    646  * DESCRIPTION: Dump the fields that are common to all Address resource
    647  *              descriptors
    648  *
    649  ******************************************************************************/
    650 
    651 static void
    652 AcpiRsDumpAddressCommon (
    653     ACPI_RESOURCE_DATA      *Resource)
    654 {
    655     ACPI_FUNCTION_ENTRY ();
    656 
    657 
    658    /* Decode the type-specific flags */
    659 
    660     switch (Resource->Address.ResourceType)
    661     {
    662     case ACPI_MEMORY_RANGE:
    663 
    664         AcpiRsDumpDescriptor (Resource, AcpiRsDumpMemoryFlags);
    665         break;
    666 
    667     case ACPI_IO_RANGE:
    668 
    669         AcpiRsDumpDescriptor (Resource, AcpiRsDumpIoFlags);
    670         break;
    671 
    672     case ACPI_BUS_NUMBER_RANGE:
    673 
    674         AcpiRsOutString ("Resource Type", "Bus Number Range");
    675         break;
    676 
    677     default:
    678 
    679         AcpiRsOutInteger8 ("Resource Type",
    680             (UINT8) Resource->Address.ResourceType);
    681         break;
    682     }
    683 
    684     /* Decode the general flags */
    685 
    686     AcpiRsDumpDescriptor (Resource, AcpiRsDumpGeneralFlags);
    687 }
    688 
    689 
    690 /*******************************************************************************
    691  *
    692  * FUNCTION:    AcpiRsOut*
    693  *
    694  * PARAMETERS:  Title       - Name of the resource field
    695  *              Value       - Value of the resource field
    696  *
    697  * RETURN:      None
    698  *
    699  * DESCRIPTION: Miscellaneous helper functions to consistently format the
    700  *              output of the resource dump routines
    701  *
    702  ******************************************************************************/
    703 
    704 static void
    705 AcpiRsOutString (
    706     const char              *Title,
    707     const char              *Value)
    708 {
    709 
    710     AcpiOsPrintf ("%27s : %s", Title, Value);
    711     if (!*Value)
    712     {
    713         AcpiOsPrintf ("[NULL NAMESTRING]");
    714     }
    715     AcpiOsPrintf ("\n");
    716 }
    717 
    718 static void
    719 AcpiRsOutInteger8 (
    720     const char              *Title,
    721     UINT8                   Value)
    722 {
    723     AcpiOsPrintf ("%27s : %2.2X\n", Title, Value);
    724 }
    725 
    726 static void
    727 AcpiRsOutInteger16 (
    728     const char              *Title,
    729     UINT16                  Value)
    730 {
    731 
    732     AcpiOsPrintf ("%27s : %4.4X\n", Title, Value);
    733 }
    734 
    735 static void
    736 AcpiRsOutInteger32 (
    737     const char              *Title,
    738     UINT32                  Value)
    739 {
    740 
    741     AcpiOsPrintf ("%27s : %8.8X\n", Title, Value);
    742 }
    743 
    744 static void
    745 AcpiRsOutInteger64 (
    746     const char              *Title,
    747     UINT64                  Value)
    748 {
    749 
    750     AcpiOsPrintf ("%27s : %8.8X%8.8X\n", Title,
    751         ACPI_FORMAT_UINT64 (Value));
    752 }
    753 
    754 static void
    755 AcpiRsOutTitle (
    756     const char              *Title)
    757 {
    758 
    759     AcpiOsPrintf ("%27s : ", Title);
    760 }
    761 
    762 
    763 /*******************************************************************************
    764  *
    765  * FUNCTION:    AcpiRsDump*List
    766  *
    767  * PARAMETERS:  Length      - Number of elements in the list
    768  *              Data        - Start of the list
    769  *
    770  * RETURN:      None
    771  *
    772  * DESCRIPTION: Miscellaneous functions to dump lists of raw data
    773  *
    774  ******************************************************************************/
    775 
    776 static void
    777 AcpiRsDumpByteList (
    778     UINT16                  Length,
    779     UINT8                   *Data)
    780 {
    781     UINT16                  i;
    782 
    783 
    784     for (i = 0; i < Length; i++)
    785     {
    786         AcpiOsPrintf ("%25s%2.2X : %2.2X\n", "Byte", i, Data[i]);
    787     }
    788 }
    789 
    790 static void
    791 AcpiRsDumpShortByteList (
    792     UINT8                   Length,
    793     UINT8                   *Data)
    794 {
    795     UINT8                   i;
    796 
    797 
    798     for (i = 0; i < Length; i++)
    799     {
    800         AcpiOsPrintf ("%X ", Data[i]);
    801     }
    802 
    803     AcpiOsPrintf ("\n");
    804 }
    805 
    806 static void
    807 AcpiRsDumpDwordList (
    808     UINT8                   Length,
    809     UINT32                  *Data)
    810 {
    811     UINT8                   i;
    812 
    813 
    814     for (i = 0; i < Length; i++)
    815     {
    816         AcpiOsPrintf ("%25s%2.2X : %8.8X\n", "Dword", i, Data[i]);
    817     }
    818 }
    819 
    820 static void
    821 AcpiRsDumpWordList (
    822     UINT16                  Length,
    823     UINT16                  *Data)
    824 {
    825     UINT16                  i;
    826 
    827 
    828     for (i = 0; i < Length; i++)
    829     {
    830         AcpiOsPrintf ("%25s%2.2X : %4.4X\n", "Word", i, Data[i]);
    831     }
    832 }
    833