Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:03

0001 /*******************************************************************************
0002  *
0003  * Module Name: rsdump - AML debugger support for resource structures.
0004  *
0005  ******************************************************************************/
0006 
0007 /******************************************************************************
0008  *
0009  * 1. Copyright Notice
0010  *
0011  * Some or all of this work - Copyright (c) 1999 - 2024, Intel Corp.
0012  * All rights reserved.
0013  *
0014  * 2. License
0015  *
0016  * 2.1. This is your license from Intel Corp. under its intellectual property
0017  * rights. You may have additional license terms from the party that provided
0018  * you this software, covering your right to use that party's intellectual
0019  * property rights.
0020  *
0021  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
0022  * copy of the source code appearing in this file ("Covered Code") an
0023  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
0024  * base code distributed originally by Intel ("Original Intel Code") to copy,
0025  * make derivatives, distribute, use and display any portion of the Covered
0026  * Code in any form, with the right to sublicense such rights; and
0027  *
0028  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
0029  * license (with the right to sublicense), under only those claims of Intel
0030  * patents that are infringed by the Original Intel Code, to make, use, sell,
0031  * offer to sell, and import the Covered Code and derivative works thereof
0032  * solely to the minimum extent necessary to exercise the above copyright
0033  * license, and in no event shall the patent license extend to any additions
0034  * to or modifications of the Original Intel Code. No other license or right
0035  * is granted directly or by implication, estoppel or otherwise;
0036  *
0037  * The above copyright and patent license is granted only if the following
0038  * conditions are met:
0039  *
0040  * 3. Conditions
0041  *
0042  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
0043  * Redistribution of source code of any substantial portion of the Covered
0044  * Code or modification with rights to further distribute source must include
0045  * the above Copyright Notice, the above License, this list of Conditions,
0046  * and the following Disclaimer and Export Compliance provision. In addition,
0047  * Licensee must cause all Covered Code to which Licensee contributes to
0048  * contain a file documenting the changes Licensee made to create that Covered
0049  * Code and the date of any change. Licensee must include in that file the
0050  * documentation of any changes made by any predecessor Licensee. Licensee
0051  * must include a prominent statement that the modification is derived,
0052  * directly or indirectly, from Original Intel Code.
0053  *
0054  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
0055  * Redistribution of source code of any substantial portion of the Covered
0056  * Code or modification without rights to further distribute source must
0057  * include the following Disclaimer and Export Compliance provision in the
0058  * documentation and/or other materials provided with distribution. In
0059  * addition, Licensee may not authorize further sublicense of source of any
0060  * portion of the Covered Code, and must include terms to the effect that the
0061  * license from Licensee to its licensee is limited to the intellectual
0062  * property embodied in the software Licensee provides to its licensee, and
0063  * not to intellectual property embodied in modifications its licensee may
0064  * make.
0065  *
0066  * 3.3. Redistribution of Executable. Redistribution in executable form of any
0067  * substantial portion of the Covered Code or modification must reproduce the
0068  * above Copyright Notice, and the following Disclaimer and Export Compliance
0069  * provision in the documentation and/or other materials provided with the
0070  * distribution.
0071  *
0072  * 3.4. Intel retains all right, title, and interest in and to the Original
0073  * Intel Code.
0074  *
0075  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
0076  * Intel shall be used in advertising or otherwise to promote the sale, use or
0077  * other dealings in products derived from or relating to the Covered Code
0078  * without prior written authorization from Intel.
0079  *
0080  * 4. Disclaimer and Export Compliance
0081  *
0082  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
0083  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
0084  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
0085  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
0086  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
0087  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
0088  * PARTICULAR PURPOSE.
0089  *
0090  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
0091  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
0092  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
0093  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
0094  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
0095  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
0096  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
0097  * LIMITED REMEDY.
0098  *
0099  * 4.3. Licensee shall not export, either directly or indirectly, any of this
0100  * software or system incorporating such software without first obtaining any
0101  * required license or other approval from the U. S. Department of Commerce or
0102  * any other agency or department of the United States Government. In the
0103  * event Licensee exports any such software from the United States or
0104  * re-exports any such software from a foreign destination, Licensee shall
0105  * ensure that the distribution and export/re-export of the software is in
0106  * compliance with all laws, regulations, orders, or other restrictions of the
0107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
0108  * any of its subsidiaries will export/re-export any technical data, process,
0109  * software, or service, directly or indirectly, to any country for which the
0110  * United States government or any agency thereof requires an export license,
0111  * other governmental approval, or letter of assurance, without first obtaining
0112  * such license, approval or letter.
0113  *
0114  *****************************************************************************
0115  *
0116  * Alternatively, you may choose to be licensed under the terms of the
0117  * following license:
0118  *
0119  * Redistribution and use in source and binary forms, with or without
0120  * modification, are permitted provided that the following conditions
0121  * are met:
0122  * 1. Redistributions of source code must retain the above copyright
0123  *    notice, this list of conditions, and the following disclaimer,
0124  *    without modification.
0125  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
0126  *    substantially similar to the "NO WARRANTY" disclaimer below
0127  *    ("Disclaimer") and any redistribution must be conditioned upon
0128  *    including a substantially similar Disclaimer requirement for further
0129  *    binary redistribution.
0130  * 3. Neither the names of the above-listed copyright holders nor the names
0131  *    of any contributors may be used to endorse or promote products derived
0132  *    from this software without specific prior written permission.
0133  *
0134  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0135  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0136  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0137  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0138  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0139  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0140  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0141  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0142  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0143  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0144  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0145  *
0146  * Alternatively, you may choose to be licensed under the terms of the
0147  * GNU General Public License ("GPL") version 2 as published by the Free
0148  * Software Foundation.
0149  *
0150  *****************************************************************************/
0151 
0152 #include "acpi.h"
0153 #include "accommon.h"
0154 #include "acresrc.h"
0155 
0156 #define _COMPONENT          ACPI_RESOURCES
0157         ACPI_MODULE_NAME    ("rsdump")
0158 
0159 /*
0160  * All functions in this module are used by the AML Debugger only
0161  */
0162 
0163 /* Local prototypes */
0164 
0165 static void
0166 AcpiRsOutString (
0167     const char              *Title,
0168     const char              *Value);
0169 
0170 static void
0171 AcpiRsOutInteger8 (
0172     const char              *Title,
0173     UINT8                   Value);
0174 
0175 static void
0176 AcpiRsOutInteger16 (
0177     const char              *Title,
0178     UINT16                  Value);
0179 
0180 static void
0181 AcpiRsOutInteger32 (
0182     const char              *Title,
0183     UINT32                  Value);
0184 
0185 static void
0186 AcpiRsOutInteger64 (
0187     const char              *Title,
0188     UINT64                  Value);
0189 
0190 static void
0191 AcpiRsOutTitle (
0192     const char              *Title);
0193 
0194 static void
0195 AcpiRsDumpByteList (
0196     UINT16                  Length,
0197     UINT8                   *Data);
0198 
0199 static void
0200 AcpiRsDumpWordList (
0201     UINT16                  Length,
0202     UINT16                  *Data);
0203 
0204 static void
0205 AcpiRsDumpDwordList (
0206     UINT8                   Length,
0207     UINT32                  *Data);
0208 
0209 static void
0210 AcpiRsDumpShortByteList (
0211     UINT8                   Length,
0212     UINT8                   *Data);
0213 
0214 static void
0215 AcpiRsDumpResourceSource (
0216     ACPI_RESOURCE_SOURCE    *ResourceSource);
0217 
0218 static void
0219 AcpiRsDumpResourceLabel (
0220     char                   *Title,
0221     ACPI_RESOURCE_LABEL    *ResourceLabel);
0222 
0223 static void
0224 AcpiRsDumpAddressCommon (
0225     ACPI_RESOURCE_DATA      *Resource);
0226 
0227 static void
0228 AcpiRsDumpDescriptor (
0229     void                    *Resource,
0230     ACPI_RSDUMP_INFO        *Table);
0231 
0232 
0233 /*******************************************************************************
0234  *
0235  * FUNCTION:    AcpiRsDumpResourceList
0236  *
0237  * PARAMETERS:  ResourceList        - Pointer to a resource descriptor list
0238  *
0239  * RETURN:      None
0240  *
0241  * DESCRIPTION: Dispatches the structure to the correct dump routine.
0242  *
0243  ******************************************************************************/
0244 
0245 void
0246 AcpiRsDumpResourceList (
0247     ACPI_RESOURCE           *ResourceList)
0248 {
0249     UINT32                  Count = 0;
0250     UINT32                  Type;
0251 
0252 
0253     ACPI_FUNCTION_ENTRY ();
0254 
0255 
0256     /* Check if debug output enabled */
0257 
0258     if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT))
0259     {
0260         return;
0261     }
0262 
0263     /* Walk list and dump all resource descriptors (END_TAG terminates) */
0264 
0265     do
0266     {
0267         AcpiOsPrintf ("\n[%02X] ", Count);
0268         Count++;
0269 
0270         /* Validate Type before dispatch */
0271 
0272         Type = ResourceList->Type;
0273         if (Type > ACPI_RESOURCE_TYPE_MAX)
0274         {
0275             AcpiOsPrintf (
0276                 "Invalid descriptor type (%X) in resource list\n",
0277                 ResourceList->Type);
0278             return;
0279         }
0280         else if (!ResourceList->Type)
0281         {
0282             ACPI_ERROR ((AE_INFO, "Invalid Zero Resource Type"));
0283             return;
0284         }
0285 
0286         /* Sanity check the length. It must not be zero, or we loop forever */
0287 
0288         if (!ResourceList->Length)
0289         {
0290             AcpiOsPrintf (
0291                 "Invalid zero length descriptor in resource list\n");
0292             return;
0293         }
0294 
0295         /* Dump the resource descriptor */
0296 
0297         if (Type == ACPI_RESOURCE_TYPE_SERIAL_BUS)
0298         {
0299             AcpiRsDumpDescriptor (&ResourceList->Data,
0300                 AcpiGbl_DumpSerialBusDispatch[
0301                     ResourceList->Data.CommonSerialBus.Type]);
0302         }
0303         else
0304         {
0305             AcpiRsDumpDescriptor (&ResourceList->Data,
0306                 AcpiGbl_DumpResourceDispatch[Type]);
0307         }
0308 
0309         /* Point to the next resource structure */
0310 
0311         ResourceList = ACPI_NEXT_RESOURCE (ResourceList);
0312 
0313         /* Exit when END_TAG descriptor is reached */
0314 
0315     } while (Type != ACPI_RESOURCE_TYPE_END_TAG);
0316 }
0317 
0318 
0319 /*******************************************************************************
0320  *
0321  * FUNCTION:    AcpiRsDumpIrqList
0322  *
0323  * PARAMETERS:  RouteTable      - Pointer to the routing table to dump.
0324  *
0325  * RETURN:      None
0326  *
0327  * DESCRIPTION: Print IRQ routing table
0328  *
0329  ******************************************************************************/
0330 
0331 void
0332 AcpiRsDumpIrqList (
0333     UINT8                   *RouteTable)
0334 {
0335     ACPI_PCI_ROUTING_TABLE  *PrtElement;
0336     UINT8                   Count;
0337 
0338 
0339     ACPI_FUNCTION_ENTRY ();
0340 
0341 
0342     /* Check if debug output enabled */
0343 
0344     if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT))
0345     {
0346         return;
0347     }
0348 
0349     PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, RouteTable);
0350 
0351     /* Dump all table elements, Exit on zero length element */
0352 
0353     for (Count = 0; PrtElement->Length; Count++)
0354     {
0355         AcpiOsPrintf ("\n[%02X] PCI IRQ Routing Table Package\n", Count);
0356         AcpiRsDumpDescriptor (PrtElement, AcpiRsDumpPrt);
0357 
0358         PrtElement = ACPI_ADD_PTR (ACPI_PCI_ROUTING_TABLE,
0359             PrtElement, PrtElement->Length);
0360     }
0361 }
0362 
0363 
0364 /*******************************************************************************
0365  *
0366  * FUNCTION:    AcpiRsDumpDescriptor
0367  *
0368  * PARAMETERS:  Resource            - Buffer containing the resource
0369  *              Table               - Table entry to decode the resource
0370  *
0371  * RETURN:      None
0372  *
0373  * DESCRIPTION: Dump a resource descriptor based on a dump table entry.
0374  *
0375  ******************************************************************************/
0376 
0377 static void
0378 AcpiRsDumpDescriptor (
0379     void                    *Resource,
0380     ACPI_RSDUMP_INFO        *Table)
0381 {
0382     UINT8                   *Target = NULL;
0383     UINT8                   *PreviousTarget;
0384     const char              *Name;
0385     UINT8                   Count;
0386 
0387 
0388     /* First table entry must contain the table length (# of table entries) */
0389 
0390     Count = Table->Offset;
0391 
0392     while (Count)
0393     {
0394         PreviousTarget = Target;
0395         Target = ACPI_ADD_PTR (UINT8, Resource, Table->Offset);
0396         Name = Table->Name;
0397 
0398         switch (Table->Opcode)
0399         {
0400         case ACPI_RSD_TITLE:
0401             /*
0402              * Optional resource title
0403              */
0404             if (Table->Name)
0405             {
0406                 AcpiOsPrintf ("%s Resource\n", Name);
0407             }
0408             break;
0409 
0410         /* Strings */
0411 
0412         case ACPI_RSD_LITERAL:
0413 
0414             AcpiRsOutString (Name, ACPI_CAST_PTR (char, Table->Pointer));
0415             break;
0416 
0417         case ACPI_RSD_STRING:
0418 
0419             AcpiRsOutString (Name, ACPI_CAST_PTR (char, Target));
0420             break;
0421 
0422         /* Data items, 8/16/32/64 bit */
0423 
0424         case ACPI_RSD_UINT8:
0425 
0426             if (Table->Pointer)
0427             {
0428                 AcpiRsOutString (Name, Table->Pointer [*Target]);
0429             }
0430             else
0431             {
0432                 AcpiRsOutInteger8 (Name, ACPI_GET8 (Target));
0433             }
0434             break;
0435 
0436         case ACPI_RSD_UINT16:
0437 
0438             AcpiRsOutInteger16 (Name, ACPI_GET16 (Target));
0439             break;
0440 
0441         case ACPI_RSD_UINT32:
0442 
0443             AcpiRsOutInteger32 (Name, ACPI_GET32 (Target));
0444             break;
0445 
0446         case ACPI_RSD_UINT64:
0447 
0448             AcpiRsOutInteger64 (Name, ACPI_GET64 (Target));
0449             break;
0450 
0451         /* Flags: 1-bit and 2-bit flags supported */
0452 
0453         case ACPI_RSD_1BITFLAG:
0454 
0455             AcpiRsOutString (Name, Table->Pointer [*Target & 0x01]);
0456             break;
0457 
0458         case ACPI_RSD_2BITFLAG:
0459 
0460             AcpiRsOutString (Name, Table->Pointer [*Target & 0x03]);
0461             break;
0462 
0463         case ACPI_RSD_3BITFLAG:
0464 
0465             AcpiRsOutString (Name, Table->Pointer [*Target & 0x07]);
0466             break;
0467 
0468         case ACPI_RSD_6BITFLAG:
0469 
0470             AcpiRsOutInteger8 (Name, (ACPI_GET8 (Target) & 0x3F));
0471             break;
0472 
0473         case ACPI_RSD_SHORTLIST:
0474             /*
0475              * Short byte list (single line output) for DMA and IRQ resources
0476              * Note: The list length is obtained from the previous table entry
0477              */
0478             if (PreviousTarget)
0479             {
0480                 AcpiRsOutTitle (Name);
0481                 AcpiRsDumpShortByteList (*PreviousTarget, Target);
0482             }
0483             break;
0484 
0485         case ACPI_RSD_SHORTLISTX:
0486             /*
0487              * Short byte list (single line output) for GPIO vendor data
0488              * Note: The list length is obtained from the previous table entry
0489              */
0490             if (PreviousTarget)
0491             {
0492                 AcpiRsOutTitle (Name);
0493                 AcpiRsDumpShortByteList (*PreviousTarget,
0494                     *(ACPI_CAST_INDIRECT_PTR (UINT8, Target)));
0495             }
0496             break;
0497 
0498         case ACPI_RSD_LONGLIST:
0499             /*
0500              * Long byte list for Vendor resource data
0501              * Note: The list length is obtained from the previous table entry
0502              */
0503             if (PreviousTarget)
0504             {
0505                 AcpiRsDumpByteList (ACPI_GET16 (PreviousTarget), Target);
0506             }
0507             break;
0508 
0509         case ACPI_RSD_DWORDLIST:
0510             /*
0511              * Dword list for Extended Interrupt resources
0512              * Note: The list length is obtained from the previous table entry
0513              */
0514             if (PreviousTarget)
0515             {
0516                 AcpiRsDumpDwordList (*PreviousTarget,
0517                     ACPI_CAST_PTR (UINT32, Target));
0518             }
0519             break;
0520 
0521         case ACPI_RSD_WORDLIST:
0522             /*
0523              * Word list for GPIO Pin Table
0524              * Note: The list length is obtained from the previous table entry
0525              */
0526             if (PreviousTarget)
0527             {
0528                 AcpiRsDumpWordList (*PreviousTarget,
0529                     *(ACPI_CAST_INDIRECT_PTR (UINT16, Target)));
0530             }
0531             break;
0532 
0533         case ACPI_RSD_ADDRESS:
0534             /*
0535              * Common flags for all Address resources
0536              */
0537             AcpiRsDumpAddressCommon (ACPI_CAST_PTR (
0538                 ACPI_RESOURCE_DATA, Target));
0539             break;
0540 
0541         case ACPI_RSD_SOURCE:
0542             /*
0543              * Optional ResourceSource for Address resources
0544              */
0545             AcpiRsDumpResourceSource (ACPI_CAST_PTR (
0546                 ACPI_RESOURCE_SOURCE, Target));
0547             break;
0548 
0549         case ACPI_RSD_LABEL:
0550             /*
0551              * ResourceLabel
0552              */
0553             AcpiRsDumpResourceLabel ("Resource Label", ACPI_CAST_PTR (
0554                 ACPI_RESOURCE_LABEL, Target));
0555             break;
0556 
0557         case ACPI_RSD_SOURCE_LABEL:
0558             /*
0559              * ResourceSourceLabel
0560              */
0561             AcpiRsDumpResourceLabel ("Resource Source Label", ACPI_CAST_PTR (
0562                 ACPI_RESOURCE_LABEL, Target));
0563             break;
0564 
0565         default:
0566 
0567             AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",
0568                 Table->Opcode);
0569             return;
0570         }
0571 
0572         Table++;
0573         Count--;
0574     }
0575 }
0576 
0577 
0578 /*******************************************************************************
0579  *
0580  * FUNCTION:    AcpiRsDumpResourceSource
0581  *
0582  * PARAMETERS:  ResourceSource      - Pointer to a Resource Source struct
0583  *
0584  * RETURN:      None
0585  *
0586  * DESCRIPTION: Common routine for dumping the optional ResourceSource and the
0587  *              corresponding ResourceSourceIndex.
0588  *
0589  ******************************************************************************/
0590 
0591 static void
0592 AcpiRsDumpResourceSource (
0593     ACPI_RESOURCE_SOURCE    *ResourceSource)
0594 {
0595     ACPI_FUNCTION_ENTRY ();
0596 
0597 
0598     if (ResourceSource->Index == 0xFF)
0599     {
0600         return;
0601     }
0602 
0603     AcpiRsOutInteger8 ("Resource Source Index",
0604         ResourceSource->Index);
0605 
0606     AcpiRsOutString ("Resource Source",
0607         ResourceSource->StringPtr ?
0608             ResourceSource->StringPtr : "[Not Specified]");
0609 }
0610 
0611 
0612 /*******************************************************************************
0613  *
0614  * FUNCTION:    AcpiRsDumpResourceLabel
0615  *
0616  * PARAMETERS:  Title              - Title of the dumped resource field
0617  *              ResourceLabel      - Pointer to a Resource Label struct
0618  *
0619  * RETURN:      None
0620  *
0621  * DESCRIPTION: Common routine for dumping the ResourceLabel
0622  *
0623  ******************************************************************************/
0624 
0625 static void
0626 AcpiRsDumpResourceLabel (
0627     char                   *Title,
0628     ACPI_RESOURCE_LABEL    *ResourceLabel)
0629 {
0630     ACPI_FUNCTION_ENTRY ();
0631 
0632     AcpiRsOutString (Title,
0633         ResourceLabel->StringPtr ?
0634             ResourceLabel->StringPtr : "[Not Specified]");
0635 }
0636 
0637 
0638 /*******************************************************************************
0639  *
0640  * FUNCTION:    AcpiRsDumpAddressCommon
0641  *
0642  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
0643  *
0644  * RETURN:      None
0645  *
0646  * DESCRIPTION: Dump the fields that are common to all Address resource
0647  *              descriptors
0648  *
0649  ******************************************************************************/
0650 
0651 static void
0652 AcpiRsDumpAddressCommon (
0653     ACPI_RESOURCE_DATA      *Resource)
0654 {
0655     ACPI_FUNCTION_ENTRY ();
0656 
0657 
0658    /* Decode the type-specific flags */
0659 
0660     switch (Resource->Address.ResourceType)
0661     {
0662     case ACPI_MEMORY_RANGE:
0663 
0664         AcpiRsDumpDescriptor (Resource, AcpiRsDumpMemoryFlags);
0665         break;
0666 
0667     case ACPI_IO_RANGE:
0668 
0669         AcpiRsDumpDescriptor (Resource, AcpiRsDumpIoFlags);
0670         break;
0671 
0672     case ACPI_BUS_NUMBER_RANGE:
0673 
0674         AcpiRsOutString ("Resource Type", "Bus Number Range");
0675         break;
0676 
0677     default:
0678 
0679         AcpiRsOutInteger8 ("Resource Type",
0680             (UINT8) Resource->Address.ResourceType);
0681         break;
0682     }
0683 
0684     /* Decode the general flags */
0685 
0686     AcpiRsDumpDescriptor (Resource, AcpiRsDumpGeneralFlags);
0687 }
0688 
0689 
0690 /*******************************************************************************
0691  *
0692  * FUNCTION:    AcpiRsOut*
0693  *
0694  * PARAMETERS:  Title       - Name of the resource field
0695  *              Value       - Value of the resource field
0696  *
0697  * RETURN:      None
0698  *
0699  * DESCRIPTION: Miscellaneous helper functions to consistently format the
0700  *              output of the resource dump routines
0701  *
0702  ******************************************************************************/
0703 
0704 static void
0705 AcpiRsOutString (
0706     const char              *Title,
0707     const char              *Value)
0708 {
0709 
0710     AcpiOsPrintf ("%27s : %s", Title, Value);
0711     if (!*Value)
0712     {
0713         AcpiOsPrintf ("[NULL NAMESTRING]");
0714     }
0715     AcpiOsPrintf ("\n");
0716 }
0717 
0718 static void
0719 AcpiRsOutInteger8 (
0720     const char              *Title,
0721     UINT8                   Value)
0722 {
0723     AcpiOsPrintf ("%27s : %2.2X\n", Title, Value);
0724 }
0725 
0726 static void
0727 AcpiRsOutInteger16 (
0728     const char              *Title,
0729     UINT16                  Value)
0730 {
0731 
0732     AcpiOsPrintf ("%27s : %4.4X\n", Title, Value);
0733 }
0734 
0735 static void
0736 AcpiRsOutInteger32 (
0737     const char              *Title,
0738     UINT32                  Value)
0739 {
0740 
0741     AcpiOsPrintf ("%27s : %8.8X\n", Title, Value);
0742 }
0743 
0744 static void
0745 AcpiRsOutInteger64 (
0746     const char              *Title,
0747     UINT64                  Value)
0748 {
0749 
0750     AcpiOsPrintf ("%27s : %8.8X%8.8X\n", Title,
0751         ACPI_FORMAT_UINT64 (Value));
0752 }
0753 
0754 static void
0755 AcpiRsOutTitle (
0756     const char              *Title)
0757 {
0758 
0759     AcpiOsPrintf ("%27s : ", Title);
0760 }
0761 
0762 
0763 /*******************************************************************************
0764  *
0765  * FUNCTION:    AcpiRsDump*List
0766  *
0767  * PARAMETERS:  Length      - Number of elements in the list
0768  *              Data        - Start of the list
0769  *
0770  * RETURN:      None
0771  *
0772  * DESCRIPTION: Miscellaneous functions to dump lists of raw data
0773  *
0774  ******************************************************************************/
0775 
0776 static void
0777 AcpiRsDumpByteList (
0778     UINT16                  Length,
0779     UINT8                   *Data)
0780 {
0781     UINT16                  i;
0782 
0783 
0784     for (i = 0; i < Length; i++)
0785     {
0786         AcpiOsPrintf ("%25s%2.2X : %2.2X\n", "Byte", i, Data[i]);
0787     }
0788 }
0789 
0790 static void
0791 AcpiRsDumpShortByteList (
0792     UINT8                   Length,
0793     UINT8                   *Data)
0794 {
0795     UINT8                   i;
0796 
0797 
0798     for (i = 0; i < Length; i++)
0799     {
0800         AcpiOsPrintf ("%X ", Data[i]);
0801     }
0802 
0803     AcpiOsPrintf ("\n");
0804 }
0805 
0806 static void
0807 AcpiRsDumpDwordList (
0808     UINT8                   Length,
0809     UINT32                  *Data)
0810 {
0811     UINT8                   i;
0812 
0813 
0814     for (i = 0; i < Length; i++)
0815     {
0816         AcpiOsPrintf ("%25s%2.2X : %8.8X\n", "Dword", i, Data[i]);
0817     }
0818 }
0819 
0820 static void
0821 AcpiRsDumpWordList (
0822     UINT16                  Length,
0823     UINT16                  *Data)
0824 {
0825     UINT16                  i;
0826 
0827 
0828     for (i = 0; i < Length; i++)
0829     {
0830         AcpiOsPrintf ("%25s%2.2X : %4.4X\n", "Word", i, Data[i]);
0831     }
0832 }