rsdump.c revision 151937
167754Smsmith/*******************************************************************************
267754Smsmith *
377424Smsmith * Module Name: rsdump - Functions to display the resource structures.
4151937Sjkim *              $Revision: 1.54 $
567754Smsmith *
667754Smsmith ******************************************************************************/
767754Smsmith
867754Smsmith/******************************************************************************
967754Smsmith *
1067754Smsmith * 1. Copyright Notice
1167754Smsmith *
12151937Sjkim * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
1370243Smsmith * All rights reserved.
1467754Smsmith *
1567754Smsmith * 2. License
1667754Smsmith *
1767754Smsmith * 2.1. This is your license from Intel Corp. under its intellectual property
1867754Smsmith * rights.  You may have additional license terms from the party that provided
1967754Smsmith * you this software, covering your right to use that party's intellectual
2067754Smsmith * property rights.
2167754Smsmith *
2267754Smsmith * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
2367754Smsmith * copy of the source code appearing in this file ("Covered Code") an
2467754Smsmith * irrevocable, perpetual, worldwide license under Intel's copyrights in the
2567754Smsmith * base code distributed originally by Intel ("Original Intel Code") to copy,
2667754Smsmith * make derivatives, distribute, use and display any portion of the Covered
2767754Smsmith * Code in any form, with the right to sublicense such rights; and
2867754Smsmith *
2967754Smsmith * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
3067754Smsmith * license (with the right to sublicense), under only those claims of Intel
3167754Smsmith * patents that are infringed by the Original Intel Code, to make, use, sell,
3267754Smsmith * offer to sell, and import the Covered Code and derivative works thereof
3367754Smsmith * solely to the minimum extent necessary to exercise the above copyright
3467754Smsmith * license, and in no event shall the patent license extend to any additions
3567754Smsmith * to or modifications of the Original Intel Code.  No other license or right
3667754Smsmith * is granted directly or by implication, estoppel or otherwise;
3767754Smsmith *
3867754Smsmith * The above copyright and patent license is granted only if the following
3967754Smsmith * conditions are met:
4067754Smsmith *
4167754Smsmith * 3. Conditions
4267754Smsmith *
4367754Smsmith * 3.1. Redistribution of Source with Rights to Further Distribute Source.
4467754Smsmith * Redistribution of source code of any substantial portion of the Covered
4567754Smsmith * Code or modification with rights to further distribute source must include
4667754Smsmith * the above Copyright Notice, the above License, this list of Conditions,
4767754Smsmith * and the following Disclaimer and Export Compliance provision.  In addition,
4867754Smsmith * Licensee must cause all Covered Code to which Licensee contributes to
4967754Smsmith * contain a file documenting the changes Licensee made to create that Covered
5067754Smsmith * Code and the date of any change.  Licensee must include in that file the
5167754Smsmith * documentation of any changes made by any predecessor Licensee.  Licensee
5267754Smsmith * must include a prominent statement that the modification is derived,
5367754Smsmith * directly or indirectly, from Original Intel Code.
5467754Smsmith *
5567754Smsmith * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
5667754Smsmith * Redistribution of source code of any substantial portion of the Covered
5767754Smsmith * Code or modification without rights to further distribute source must
5867754Smsmith * include the following Disclaimer and Export Compliance provision in the
5967754Smsmith * documentation and/or other materials provided with distribution.  In
6067754Smsmith * addition, Licensee may not authorize further sublicense of source of any
6167754Smsmith * portion of the Covered Code, and must include terms to the effect that the
6267754Smsmith * license from Licensee to its licensee is limited to the intellectual
6367754Smsmith * property embodied in the software Licensee provides to its licensee, and
6467754Smsmith * not to intellectual property embodied in modifications its licensee may
6567754Smsmith * make.
6667754Smsmith *
6767754Smsmith * 3.3. Redistribution of Executable. Redistribution in executable form of any
6867754Smsmith * substantial portion of the Covered Code or modification must reproduce the
6967754Smsmith * above Copyright Notice, and the following Disclaimer and Export Compliance
7067754Smsmith * provision in the documentation and/or other materials provided with the
7167754Smsmith * distribution.
7267754Smsmith *
7367754Smsmith * 3.4. Intel retains all right, title, and interest in and to the Original
7467754Smsmith * Intel Code.
7567754Smsmith *
7667754Smsmith * 3.5. Neither the name Intel nor any other trademark owned or controlled by
7767754Smsmith * Intel shall be used in advertising or otherwise to promote the sale, use or
7867754Smsmith * other dealings in products derived from or relating to the Covered Code
7967754Smsmith * without prior written authorization from Intel.
8067754Smsmith *
8167754Smsmith * 4. Disclaimer and Export Compliance
8267754Smsmith *
8367754Smsmith * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
8467754Smsmith * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
8567754Smsmith * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
8667754Smsmith * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
8767754Smsmith * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
8867754Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
8967754Smsmith * PARTICULAR PURPOSE.
9067754Smsmith *
9167754Smsmith * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
9267754Smsmith * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
9367754Smsmith * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
9467754Smsmith * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
9567754Smsmith * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
9667754Smsmith * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
9767754Smsmith * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
9867754Smsmith * LIMITED REMEDY.
9967754Smsmith *
10067754Smsmith * 4.3. Licensee shall not export, either directly or indirectly, any of this
10167754Smsmith * software or system incorporating such software without first obtaining any
10267754Smsmith * required license or other approval from the U. S. Department of Commerce or
10367754Smsmith * any other agency or department of the United States Government.  In the
10467754Smsmith * event Licensee exports any such software from the United States or
10567754Smsmith * re-exports any such software from a foreign destination, Licensee shall
10667754Smsmith * ensure that the distribution and export/re-export of the software is in
10767754Smsmith * compliance with all laws, regulations, orders, or other restrictions of the
10867754Smsmith * U.S. Export Administration Regulations. Licensee agrees that neither it nor
10967754Smsmith * any of its subsidiaries will export/re-export any technical data, process,
11067754Smsmith * software, or service, directly or indirectly, to any country for which the
11167754Smsmith * United States government or any agency thereof requires an export license,
11267754Smsmith * other governmental approval, or letter of assurance, without first obtaining
11367754Smsmith * such license, approval or letter.
11467754Smsmith *
11567754Smsmith *****************************************************************************/
11667754Smsmith
11767754Smsmith
11867754Smsmith#define __RSDUMP_C__
11967754Smsmith
120151600Sobrien#include <contrib/dev/acpica/acpi.h>
121151600Sobrien#include <contrib/dev/acpica/acresrc.h>
122151937Sjkim#include <contrib/dev/acpica/acdisasm.h>
12367754Smsmith
12477424Smsmith#define _COMPONENT          ACPI_RESOURCES
12591116Smsmith        ACPI_MODULE_NAME    ("rsdump")
12667754Smsmith
12767754Smsmith
128102550Siwasaki#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
12983174Smsmith
130151937Sjkim/* Local prototypes */
13167754Smsmith
132151937Sjkimstatic void
133151937SjkimAcpiRsOutString (
134151937Sjkim    char                    *Title,
135151937Sjkim    char                    *Value);
13667754Smsmith
137151937Sjkimstatic void
138151937SjkimAcpiRsOutInteger8 (
139151937Sjkim    char                    *Title,
140151937Sjkim    UINT8                   Value);
14167754Smsmith
142151937Sjkimstatic void
143151937SjkimAcpiRsOutInteger16 (
144151937Sjkim    char                    *Title,
145151937Sjkim    UINT16                  Value);
14683174Smsmith
147151937Sjkimstatic void
148151937SjkimAcpiRsOutInteger32 (
149151937Sjkim    char                    *Title,
150151937Sjkim    UINT32                  Value);
15183174Smsmith
152151937Sjkimstatic void
153151937SjkimAcpiRsOutInteger64 (
154151937Sjkim    char                    *Title,
155151937Sjkim    UINT64                  Value);
15667754Smsmith
157151937Sjkimstatic void
158151937SjkimAcpiRsOutTitle (
159151937Sjkim    char                    *Title);
16067754Smsmith
161151937Sjkimstatic void
162151937SjkimAcpiRsDumpByteList (
163151937Sjkim    UINT16                  Length,
164151937Sjkim    UINT8                   *Data);
16567754Smsmith
166151937Sjkimstatic void
167151937SjkimAcpiRsDumpDwordList (
168151937Sjkim    UINT8                   Length,
169151937Sjkim    UINT32                  *Data);
17067754Smsmith
171151937Sjkimstatic void
172151937SjkimAcpiRsDumpShortByteList (
173151937Sjkim    UINT8                  Length,
174151937Sjkim    UINT8                  *Data);
17567754Smsmith
176151937Sjkimstatic void
177151937SjkimAcpiRsDumpResourceSource (
178151937Sjkim    ACPI_RESOURCE_SOURCE    *ResourceSource);
17967754Smsmith
180151937Sjkimstatic void
181151937SjkimAcpiRsDumpAddressCommon (
182151937Sjkim    ACPI_RESOURCE_DATA      *Resource);
18367754Smsmith
184151937Sjkimstatic void
185151937SjkimAcpiRsDumpDescriptor (
186151937Sjkim    void                    *Resource,
187151937Sjkim    ACPI_RSDUMP_INFO *Table);
18867754Smsmith
18967754Smsmith
190151937Sjkim#define ACPI_RSD_OFFSET(f)          (UINT8) ACPI_OFFSET (ACPI_RESOURCE_DATA,f)
191151937Sjkim#define ACPI_PRT_OFFSET(f)          (UINT8) ACPI_OFFSET (ACPI_PCI_ROUTING_TABLE,f)
192151937Sjkim#define ACPI_RSD_TABLE_SIZE(name)   (sizeof(name) / sizeof (ACPI_RSDUMP_INFO))
19367754Smsmith
19467754Smsmith
19567754Smsmith/*******************************************************************************
19667754Smsmith *
197151937Sjkim * Resource Descriptor info tables
19867754Smsmith *
199151937Sjkim * Note: The first table entry must be a Title or Literal and must contain
200151937Sjkim * the table length (number of table entries)
20167754Smsmith *
20267754Smsmith ******************************************************************************/
20367754Smsmith
204151937SjkimACPI_RSDUMP_INFO        AcpiRsDumpIrq[6] =
20567754Smsmith{
206151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpIrq),                "IRQ",                      NULL},
207151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Triggering),                   "Triggering",               AcpiGbl_HEDecode},
208151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Polarity),                     "Polarity",                 AcpiGbl_LLDecode},
209151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Sharable),                     "Sharing",                  AcpiGbl_SHRDecode},
210151937Sjkim    {ACPI_RSD_UINT8 ,   ACPI_RSD_OFFSET (Irq.InterruptCount),               "Interrupt Count",          NULL},
211151937Sjkim    {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Irq.Interrupts[0]),                "Interrupt List",           NULL}
212151937Sjkim};
21367754Smsmith
214151937SjkimACPI_RSDUMP_INFO        AcpiRsDumpDma[6] =
215151937Sjkim{
216151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpDma),                "DMA",                      NULL},
217151937Sjkim    {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Dma.Type),                         "Speed",                    AcpiGbl_TYPDecode},
218151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Dma.BusMaster),                    "Mastering",                AcpiGbl_BMDecode},
219151937Sjkim    {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Dma.Transfer),                     "Transfer Type",            AcpiGbl_SIZDecode},
220151937Sjkim    {ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (Dma.ChannelCount),                 "Channel Count",            NULL},
221151937Sjkim    {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Dma.Channels[0]),                  "Channel List",             NULL}
222151937Sjkim};
22367754Smsmith
224151937SjkimACPI_RSDUMP_INFO        AcpiRsDumpStartDpf[3] =
225151937Sjkim{
226151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpStartDpf),           "Start-Dependent-Functions",NULL},
227151937Sjkim    {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (StartDpf.CompatibilityPriority),   "Compatibility Priority",   AcpiGbl_ConfigDecode},
228151937Sjkim    {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (StartDpf.PerformanceRobustness),   "Performance/Robustness",   AcpiGbl_ConfigDecode}
229151937Sjkim};
23083174Smsmith
231151937SjkimACPI_RSDUMP_INFO        AcpiRsDumpEndDpf[1] =
232151937Sjkim{
233151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpEndDpf),             "End-Dependent-Functions",  NULL}
234151937Sjkim};
23583174Smsmith
236151937SjkimACPI_RSDUMP_INFO        AcpiRsDumpIo[6] =
237151937Sjkim{
238151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpIo),                 "I/O",                      NULL},
239151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Io.IoDecode),                      "Address Decoding",         AcpiGbl_IoDecode},
240151937Sjkim    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (Io.Minimum),                       "Address Minimum",          NULL},
241151937Sjkim    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (Io.Maximum),                       "Address Maximum",          NULL},
242151937Sjkim    {ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (Io.Alignment),                     "Alignment",                NULL},
243151937Sjkim    {ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (Io.AddressLength),                 "Address Length",           NULL}
244151937Sjkim};
24567754Smsmith
246151937SjkimACPI_RSDUMP_INFO        AcpiRsDumpFixedIo[3] =
247151937Sjkim{
248151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpFixedIo),            "Fixed I/O",                NULL},
249151937Sjkim    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (FixedIo.Address),                  "Address",                  NULL},
250151937Sjkim    {ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (FixedIo.AddressLength),            "Address Length",           NULL}
251151937Sjkim};
25267754Smsmith
253151937SjkimACPI_RSDUMP_INFO        AcpiRsDumpVendor[3] =
254151937Sjkim{
255151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpVendor),             "Vendor Specific",          NULL},
256151937Sjkim    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (Vendor.ByteLength),                "Length",                   NULL},
257151937Sjkim    {ACPI_RSD_LONGLIST, ACPI_RSD_OFFSET (Vendor.ByteData[0]),               "Vendor Data",              NULL}
258151937Sjkim};
25967754Smsmith
260151937SjkimACPI_RSDUMP_INFO        AcpiRsDumpEndTag[1] =
261151937Sjkim{
262151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpEndTag),             "EndTag",                   NULL}
263151937Sjkim};
26467754Smsmith
265151937SjkimACPI_RSDUMP_INFO        AcpiRsDumpMemory24[6] =
266151937Sjkim{
267151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpMemory24),           "24-Bit Memory Range",      NULL},
268151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Memory24.WriteProtect),            "Write Protect",            AcpiGbl_RWDecode},
269151937Sjkim    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (Memory24.Minimum),                 "Address Minimum",          NULL},
270151937Sjkim    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (Memory24.Maximum),                 "Address Maximum",          NULL},
271151937Sjkim    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (Memory24.Alignment),               "Alignment",                NULL},
272151937Sjkim    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (Memory24.AddressLength),           "Address Length",           NULL}
273151937Sjkim};
27467754Smsmith
275151937SjkimACPI_RSDUMP_INFO        AcpiRsDumpMemory32[6] =
276151937Sjkim{
277151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpMemory32),           "32-Bit Memory Range",      NULL},
278151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Memory32.WriteProtect),            "Write Protect",            AcpiGbl_RWDecode},
279151937Sjkim    {ACPI_RSD_UINT32,   ACPI_RSD_OFFSET (Memory32.Minimum),                 "Address Minimum",          NULL},
280151937Sjkim    {ACPI_RSD_UINT32,   ACPI_RSD_OFFSET (Memory32.Maximum),                 "Address Maximum",          NULL},
281151937Sjkim    {ACPI_RSD_UINT32,   ACPI_RSD_OFFSET (Memory32.Alignment),               "Alignment",                NULL},
282151937Sjkim    {ACPI_RSD_UINT32,   ACPI_RSD_OFFSET (Memory32.AddressLength),           "Address Length",           NULL}
283151937Sjkim};
28467754Smsmith
285151937SjkimACPI_RSDUMP_INFO        AcpiRsDumpFixedMemory32[4] =
286151937Sjkim{
287151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpFixedMemory32),      "32-Bit Fixed Memory Range",NULL},
288151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (FixedMemory32.WriteProtect),       "Write Protect",            AcpiGbl_RWDecode},
289151937Sjkim    {ACPI_RSD_UINT32,   ACPI_RSD_OFFSET (FixedMemory32.Address),            "Address",                  NULL},
290151937Sjkim    {ACPI_RSD_UINT32,   ACPI_RSD_OFFSET (FixedMemory32.AddressLength),      "Address Length",           NULL}
291151937Sjkim};
29267754Smsmith
293151937SjkimACPI_RSDUMP_INFO        AcpiRsDumpAddress16[8] =
294151937Sjkim{
295151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress16),          "16-Bit WORD Address Space",NULL},
296151937Sjkim    {ACPI_RSD_ADDRESS,  0,                                                  NULL,                       NULL},
297151937Sjkim    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (Address16.Granularity),            "Granularity",              NULL},
298151937Sjkim    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (Address16.Minimum),                "Address Minimum",          NULL},
299151937Sjkim    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (Address16.Maximum),                "Address Maximum",          NULL},
300151937Sjkim    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (Address16.TranslationOffset),      "Translation Offset",       NULL},
301151937Sjkim    {ACPI_RSD_UINT16,   ACPI_RSD_OFFSET (Address16.AddressLength),          "Address Length",           NULL},
302151937Sjkim    {ACPI_RSD_SOURCE,   ACPI_RSD_OFFSET (Address16.ResourceSource),         NULL,                       NULL}
303151937Sjkim};
30467754Smsmith
305151937SjkimACPI_RSDUMP_INFO        AcpiRsDumpAddress32[8] =
306151937Sjkim{
307151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress32),         "32-Bit DWORD Address Space", NULL},
308151937Sjkim    {ACPI_RSD_ADDRESS,  0,                                                  NULL,                       NULL},
309151937Sjkim    {ACPI_RSD_UINT32,   ACPI_RSD_OFFSET (Address32.Granularity),            "Granularity",              NULL},
310151937Sjkim    {ACPI_RSD_UINT32,   ACPI_RSD_OFFSET (Address32.Minimum),                "Address Minimum",          NULL},
311151937Sjkim    {ACPI_RSD_UINT32,   ACPI_RSD_OFFSET (Address32.Maximum),                "Address Maximum",          NULL},
312151937Sjkim    {ACPI_RSD_UINT32,   ACPI_RSD_OFFSET (Address32.TranslationOffset),      "Translation Offset",       NULL},
313151937Sjkim    {ACPI_RSD_UINT32,   ACPI_RSD_OFFSET (Address32.AddressLength),          "Address Length",           NULL},
314151937Sjkim    {ACPI_RSD_SOURCE,   ACPI_RSD_OFFSET (Address32.ResourceSource),         NULL,                       NULL}
315151937Sjkim};
31667754Smsmith
317151937SjkimACPI_RSDUMP_INFO        AcpiRsDumpAddress64[8] =
318151937Sjkim{
319151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress64),          "64-Bit QWORD Address Space", NULL},
320151937Sjkim    {ACPI_RSD_ADDRESS,  0,                                                  NULL,                       NULL},
321151937Sjkim    {ACPI_RSD_UINT64,   ACPI_RSD_OFFSET (Address64.Granularity),            "Granularity",              NULL},
322151937Sjkim    {ACPI_RSD_UINT64,   ACPI_RSD_OFFSET (Address64.Minimum),                "Address Minimum",          NULL},
323151937Sjkim    {ACPI_RSD_UINT64,   ACPI_RSD_OFFSET (Address64.Maximum),                "Address Maximum",          NULL},
324151937Sjkim    {ACPI_RSD_UINT64,   ACPI_RSD_OFFSET (Address64.TranslationOffset),      "Translation Offset",       NULL},
325151937Sjkim    {ACPI_RSD_UINT64,   ACPI_RSD_OFFSET (Address64.AddressLength),          "Address Length",           NULL},
326151937Sjkim    {ACPI_RSD_SOURCE,   ACPI_RSD_OFFSET (Address64.ResourceSource),         NULL,                       NULL}
327151937Sjkim};
32867754Smsmith
329151937SjkimACPI_RSDUMP_INFO        AcpiRsDumpExtAddress64[8] =
330151937Sjkim{
331151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpExtAddress64),       "64-Bit Extended Address Space", NULL},
332151937Sjkim    {ACPI_RSD_ADDRESS,  0,                                                  NULL,                       NULL},
333151937Sjkim    {ACPI_RSD_UINT64,   ACPI_RSD_OFFSET (ExtAddress64.Granularity),         "Granularity",              NULL},
334151937Sjkim    {ACPI_RSD_UINT64,   ACPI_RSD_OFFSET (ExtAddress64.Minimum),             "Address Minimum",          NULL},
335151937Sjkim    {ACPI_RSD_UINT64,   ACPI_RSD_OFFSET (ExtAddress64.Maximum),             "Address Maximum",          NULL},
336151937Sjkim    {ACPI_RSD_UINT64,   ACPI_RSD_OFFSET (ExtAddress64.TranslationOffset),   "Translation Offset",       NULL},
337151937Sjkim    {ACPI_RSD_UINT64,   ACPI_RSD_OFFSET (ExtAddress64.AddressLength),       "Address Length",           NULL},
338151937Sjkim    {ACPI_RSD_UINT64,   ACPI_RSD_OFFSET (ExtAddress64.TypeSpecific),        "Type-Specific Attribute",  NULL}
339151937Sjkim};
34067754Smsmith
341151937SjkimACPI_RSDUMP_INFO        AcpiRsDumpExtIrq[8] =
342151937Sjkim{
343151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpExtIrq),             "Extended IRQ",             NULL},
344151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.ProducerConsumer),     "Type",                     AcpiGbl_ConsumeDecode},
345151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.Triggering),           "Triggering",               AcpiGbl_HEDecode},
346151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.Polarity),             "Polarity",                 AcpiGbl_LLDecode},
347151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.Sharable),             "Sharing",                  AcpiGbl_SHRDecode},
348151937Sjkim    {ACPI_RSD_SOURCE,   ACPI_RSD_OFFSET (ExtendedIrq.ResourceSource),       NULL,                       NULL},
349151937Sjkim    {ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (ExtendedIrq.InterruptCount),       "Interrupt Count",          NULL},
350151937Sjkim    {ACPI_RSD_DWORDLIST,ACPI_RSD_OFFSET (ExtendedIrq.Interrupts[0]),        "Interrupt List",           NULL}
351151937Sjkim};
35267754Smsmith
353151937SjkimACPI_RSDUMP_INFO        AcpiRsDumpGenericReg[6] =
35467754Smsmith{
355151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpGenericReg),         "Generic Register",         NULL},
356151937Sjkim    {ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (GenericReg.SpaceId),               "Space ID",                 NULL},
357151937Sjkim    {ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (GenericReg.BitWidth),              "Bit Width",                NULL},
358151937Sjkim    {ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (GenericReg.BitOffset),             "Bit Offset",               NULL},
359151937Sjkim    {ACPI_RSD_UINT8,    ACPI_RSD_OFFSET (GenericReg.AccessSize),            "Access Size",              NULL},
360151937Sjkim    {ACPI_RSD_UINT64,   ACPI_RSD_OFFSET (GenericReg.Address),               "Address",                  NULL}
361151937Sjkim};
36267754Smsmith
36367754Smsmith
364151937Sjkim/*
365151937Sjkim * Tables used for common address descriptor flag fields
366151937Sjkim */
367151937Sjkimstatic ACPI_RSDUMP_INFO AcpiRsDumpGeneralFlags[5] =
368151937Sjkim{
369151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpGeneralFlags),       NULL,                       NULL},
370151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.ProducerConsumer),         "Consumer/Producer",        AcpiGbl_ConsumeDecode},
371151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Decode),                   "Address Decode",           AcpiGbl_DECDecode},
372151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.MinAddressFixed),          "Min Relocatability",       AcpiGbl_MinDecode},
373151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.MaxAddressFixed),          "Max Relocatability",       AcpiGbl_MaxDecode}
374151937Sjkim};
37583174Smsmith
376151937Sjkimstatic ACPI_RSDUMP_INFO AcpiRsDumpMemoryFlags[5] =
377151937Sjkim{
378151937Sjkim    {ACPI_RSD_LITERAL,  ACPI_RSD_TABLE_SIZE (AcpiRsDumpMemoryFlags),        "Resource Type",            "Memory Range"},
379151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.WriteProtect),    "Write Protect",            AcpiGbl_RWDecode},
380151937Sjkim    {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.Caching),         "Caching",                  AcpiGbl_MEMDecode},
381151937Sjkim    {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.RangeType),       "Range Type",               AcpiGbl_MTPDecode},
382151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.Translation),     "Translation",              AcpiGbl_TTPDecode}
383151937Sjkim};
38483174Smsmith
385151937Sjkimstatic ACPI_RSDUMP_INFO AcpiRsDumpIoFlags[4] =
386151937Sjkim{
387151937Sjkim    {ACPI_RSD_LITERAL,  ACPI_RSD_TABLE_SIZE (AcpiRsDumpIoFlags),            "Resource Type",            "I/O Range"},
388151937Sjkim    {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Address.Info.Io.RangeType),        "Range Type",               AcpiGbl_RNGDecode},
389151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Io.Translation),      "Translation",              AcpiGbl_TTPDecode},
390151937Sjkim    {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Io.TranslationType),  "Translation Type",         AcpiGbl_TRSDecode}
391151937Sjkim};
39267754Smsmith
39367754Smsmith
394151937Sjkim/*
395151937Sjkim * Table used to dump _PRT contents
396151937Sjkim */
397151937Sjkimstatic ACPI_RSDUMP_INFO   AcpiRsDumpPrt[5] =
39867754Smsmith{
399151937Sjkim    {ACPI_RSD_TITLE,    ACPI_RSD_TABLE_SIZE (AcpiRsDumpPrt),                NULL,                       NULL},
400151937Sjkim    {ACPI_RSD_UINT64,   ACPI_PRT_OFFSET (Address),                          "Address",                  NULL},
401151937Sjkim    {ACPI_RSD_UINT32,   ACPI_PRT_OFFSET (Pin),                              "Pin",                      NULL},
402151937Sjkim    {ACPI_RSD_STRING,   ACPI_PRT_OFFSET (Source[0]),                        "Source",                   NULL},
403151937Sjkim    {ACPI_RSD_UINT32,   ACPI_PRT_OFFSET (SourceIndex),                      "Source Index",             NULL}
404151937Sjkim};
40567754Smsmith
40667754Smsmith
40767754Smsmith/*******************************************************************************
40867754Smsmith *
409151937Sjkim * FUNCTION:    AcpiRsDumpDescriptor
41067754Smsmith *
411151937Sjkim * PARAMETERS:  Resource
41267754Smsmith *
41377424Smsmith * RETURN:      None
41467754Smsmith *
415151937Sjkim * DESCRIPTION:
41667754Smsmith *
41767754Smsmith ******************************************************************************/
41867754Smsmith
419151937Sjkimstatic void
420151937SjkimAcpiRsDumpDescriptor (
421151937Sjkim    void                    *Resource,
422151937Sjkim    ACPI_RSDUMP_INFO        *Table)
42367754Smsmith{
424151937Sjkim    void                    *Target = NULL;
425151937Sjkim    void                    *PreviousTarget;
426151937Sjkim    char                    *Name;
427151937Sjkim    UINT8                    Count;
42867754Smsmith
42967754Smsmith
430151937Sjkim    /* First table entry must contain the table length (# of table entries) */
43183174Smsmith
432151937Sjkim    Count = Table->Offset;
43383174Smsmith
434151937Sjkim    while (Count)
43567754Smsmith    {
436151937Sjkim        PreviousTarget = Target;
437151937Sjkim        Target = ((UINT8 *) Resource) + Table->Offset;
438151937Sjkim        Name = Table->Name;
43967754Smsmith
440151937Sjkim        switch (Table->Opcode)
441151937Sjkim        {
442151937Sjkim        case ACPI_RSD_TITLE:
443151937Sjkim            /*
444151937Sjkim             * Optional resource title
445151937Sjkim             */
446151937Sjkim            if (Table->Name)
447151937Sjkim            {
448151937Sjkim                AcpiOsPrintf ("%s Resource\n", Name);
449151937Sjkim            }
450151937Sjkim            break;
45167754Smsmith
452151937Sjkim        /* Strings */
45367754Smsmith
454151937Sjkim        case ACPI_RSD_LITERAL:
455151937Sjkim            AcpiRsOutString (Name, (char *) Table->Pointer);
456151937Sjkim            break;
45767754Smsmith
458151937Sjkim        case ACPI_RSD_STRING:
459151937Sjkim            AcpiRsOutString (Name, (char *) Target);
460151937Sjkim            break;
46167754Smsmith
462151937Sjkim        /* Data items, 8/16/32/64 bit */
46367754Smsmith
464151937Sjkim        case ACPI_RSD_UINT8:
465151937Sjkim            AcpiRsOutInteger8 (Name, *(UINT8 *) Target);
466151937Sjkim            break;
46783174Smsmith
468151937Sjkim        case ACPI_RSD_UINT16:
469151937Sjkim            AcpiRsOutInteger16 (Name, *(UINT16 *) Target);
470151937Sjkim            break;
47183174Smsmith
472151937Sjkim        case ACPI_RSD_UINT32:
473151937Sjkim            AcpiRsOutInteger32 (Name, *(UINT32 *) Target);
474151937Sjkim            break;
47567754Smsmith
476151937Sjkim        case ACPI_RSD_UINT64:
477151937Sjkim            AcpiRsOutInteger64 (Name, *(UINT64 *) Target);
478151937Sjkim            break;
47967754Smsmith
480151937Sjkim        /* Flags: 1-bit and 2-bit flags supported */
48167754Smsmith
482151937Sjkim        case ACPI_RSD_1BITFLAG:
483151937Sjkim            AcpiRsOutString (Name, (char *)
484151937Sjkim                ((const char **) Table->Pointer)[(*(UINT8 *) Target) & 0x01]);
485151937Sjkim            break;
48667754Smsmith
487151937Sjkim        case ACPI_RSD_2BITFLAG:
488151937Sjkim            AcpiRsOutString (Name, (char *)
489151937Sjkim                ((const char **) Table->Pointer)[(*(UINT8 *) Target) & 0x03]);
490151937Sjkim            break;
49167754Smsmith
492151937Sjkim        case ACPI_RSD_SHORTLIST:
493151937Sjkim            /*
494151937Sjkim             * Short byte list (single line output) for DMA and IRQ resources
495151937Sjkim             * Note: The list length is obtained from the previous table entry
496151937Sjkim             */
497151937Sjkim            if (PreviousTarget)
498151937Sjkim            {
499151937Sjkim                AcpiRsOutTitle (Name);
500151937Sjkim                AcpiRsDumpShortByteList (*((UINT8 *) PreviousTarget),
501151937Sjkim                    (UINT8 *) Target);
502151937Sjkim            }
503151937Sjkim            break;
50467754Smsmith
505151937Sjkim        case ACPI_RSD_LONGLIST:
506151937Sjkim            /*
507151937Sjkim             * Long byte list for Vendor resource data
508151937Sjkim             * Note: The list length is obtained from the previous table entry
509151937Sjkim             */
510151937Sjkim            if (PreviousTarget)
511151937Sjkim            {
512151937Sjkim                AcpiRsDumpByteList (*((UINT16 *) PreviousTarget),
513151937Sjkim                    (UINT8 *) Target);
514151937Sjkim            }
515151937Sjkim            break;
51667754Smsmith
517151937Sjkim        case ACPI_RSD_DWORDLIST:
518151937Sjkim            /*
519151937Sjkim             * Dword list for Extended Interrupt resources
520151937Sjkim             * Note: The list length is obtained from the previous table entry
521151937Sjkim             */
522151937Sjkim            if (PreviousTarget)
523151937Sjkim            {
524151937Sjkim                AcpiRsDumpDwordList (*((UINT8 *) PreviousTarget),
525151937Sjkim                    (UINT32 *) Target);
526151937Sjkim            }
527151937Sjkim            break;
52867754Smsmith
529151937Sjkim        case ACPI_RSD_ADDRESS:
530151937Sjkim            /*
531151937Sjkim             * Common flags for all Address resources
532151937Sjkim             */
533151937Sjkim            AcpiRsDumpAddressCommon ((ACPI_RESOURCE_DATA *) Target);
534151937Sjkim            break;
53567754Smsmith
536151937Sjkim        case ACPI_RSD_SOURCE:
537151937Sjkim            /*
538151937Sjkim             * Optional ResourceSource for Address resources
539151937Sjkim             */
540151937Sjkim            AcpiRsDumpResourceSource ((ACPI_RESOURCE_SOURCE *) Target);
541151937Sjkim            break;
54267754Smsmith
543151937Sjkim        default:
544151937Sjkim            AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",
545151937Sjkim                Table->Opcode);
546151937Sjkim            return;
547151937Sjkim        }
54867754Smsmith
549151937Sjkim        Table++;
550151937Sjkim        Count--;
551151937Sjkim    }
55267754Smsmith}
55367754Smsmith
55467754Smsmith
55567754Smsmith/*******************************************************************************
55667754Smsmith *
557151937Sjkim * FUNCTION:    AcpiRsDumpResourceSource
55867754Smsmith *
559151937Sjkim * PARAMETERS:  ResourceSource      - Pointer to a Resource Source struct
56067754Smsmith *
561151937Sjkim * RETURN:      None
56267754Smsmith *
563151937Sjkim * DESCRIPTION: Common routine for dumping the optional ResourceSource and the
564151937Sjkim *              corresponding ResourceSourceIndex.
56567754Smsmith *
56667754Smsmith ******************************************************************************/
56767754Smsmith
568151937Sjkimstatic void
569151937SjkimAcpiRsDumpResourceSource (
570151937Sjkim    ACPI_RESOURCE_SOURCE    *ResourceSource)
57167754Smsmith{
57291116Smsmith    ACPI_FUNCTION_ENTRY ();
57383174Smsmith
57483174Smsmith
575151937Sjkim    if (ResourceSource->Index == 0xFF)
576151937Sjkim    {
577151937Sjkim        return;
578151937Sjkim    }
57967754Smsmith
580151937Sjkim    AcpiRsOutInteger8 ("Resource Source Index",
581151937Sjkim        ResourceSource->Index);
58267754Smsmith
583151937Sjkim    AcpiRsOutString ("Resource Source",
584151937Sjkim        ResourceSource->StringPtr ?
585151937Sjkim            ResourceSource->StringPtr : "[Not Specified]");
58667754Smsmith}
58767754Smsmith
58867754Smsmith
58967754Smsmith/*******************************************************************************
59067754Smsmith *
591151937Sjkim * FUNCTION:    AcpiRsDumpAddressCommon
59267754Smsmith *
593151937Sjkim * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
59467754Smsmith *
59577424Smsmith * RETURN:      None
59667754Smsmith *
597151937Sjkim * DESCRIPTION: Dump the fields that are common to all Address resource
598151937Sjkim *              descriptors
59967754Smsmith *
60067754Smsmith ******************************************************************************/
60167754Smsmith
602151937Sjkimstatic void
603151937SjkimAcpiRsDumpAddressCommon (
604151937Sjkim    ACPI_RESOURCE_DATA      *Resource)
60567754Smsmith{
60691116Smsmith    ACPI_FUNCTION_ENTRY ();
60783174Smsmith
60883174Smsmith
609151937Sjkim   /* Decode the type-specific flags */
61067754Smsmith
611151937Sjkim    switch (Resource->Address.ResourceType)
61267754Smsmith    {
61391116Smsmith    case ACPI_MEMORY_RANGE:
61467754Smsmith
615151937Sjkim        AcpiRsDumpDescriptor (Resource, AcpiRsDumpMemoryFlags);
61667754Smsmith        break;
61767754Smsmith
61891116Smsmith    case ACPI_IO_RANGE:
61967754Smsmith
620151937Sjkim        AcpiRsDumpDescriptor (Resource, AcpiRsDumpIoFlags);
62167754Smsmith        break;
62267754Smsmith
62391116Smsmith    case ACPI_BUS_NUMBER_RANGE:
62467754Smsmith
625151937Sjkim        AcpiRsOutString ("Resource Type", "Bus Number Range");
62667754Smsmith        break;
62767754Smsmith
62867754Smsmith    default:
62967754Smsmith
630151937Sjkim        AcpiRsOutInteger8 ("Resource Type",
631151937Sjkim            (UINT8) Resource->Address.ResourceType);
632151937Sjkim        break;
63367754Smsmith    }
63467754Smsmith
635151937Sjkim    /* Decode the general flags */
63667754Smsmith
637151937Sjkim    AcpiRsDumpDescriptor (Resource, AcpiRsDumpGeneralFlags);
63867754Smsmith}
63967754Smsmith
64067754Smsmith
64167754Smsmith/*******************************************************************************
64267754Smsmith *
643151937Sjkim * FUNCTION:    AcpiRsDumpResourceList
64467754Smsmith *
645151937Sjkim * PARAMETERS:  ResourceList        - Pointer to a resource descriptor list
64667754Smsmith *
64777424Smsmith * RETURN:      None
64867754Smsmith *
649151937Sjkim * DESCRIPTION: Dispatches the structure to the correct dump routine.
65067754Smsmith *
65167754Smsmith ******************************************************************************/
65267754Smsmith
65367754Smsmithvoid
654151937SjkimAcpiRsDumpResourceList (
655151937Sjkim    ACPI_RESOURCE           *ResourceList)
65667754Smsmith{
657151937Sjkim    UINT32                  Count = 0;
658151937Sjkim    UINT32                  Type;
65967754Smsmith
66067754Smsmith
66191116Smsmith    ACPI_FUNCTION_ENTRY ();
66283174Smsmith
66383174Smsmith
664151937Sjkim    if (!(AcpiDbgLevel & ACPI_LV_RESOURCES) || !( _COMPONENT & AcpiDbgLayer))
66567754Smsmith    {
666151937Sjkim        return;
667151937Sjkim    }
66867754Smsmith
669151937Sjkim    /* Walk list and dump all resource descriptors (END_TAG terminates) */
67067754Smsmith
671151937Sjkim    do
672151937Sjkim    {
673151937Sjkim        AcpiOsPrintf ("\n[%02X] ", Count);
674151937Sjkim        Count++;
67567754Smsmith
676151937Sjkim        /* Validate Type before dispatch */
67767754Smsmith
678151937Sjkim        Type = ResourceList->Type;
679151937Sjkim        if (Type > ACPI_RESOURCE_TYPE_MAX)
680114237Snjl        {
681151937Sjkim            AcpiOsPrintf (
682151937Sjkim                "Invalid descriptor type (%X) in resource list\n",
683151937Sjkim                ResourceList->Type);
684151937Sjkim            return;
685114237Snjl        }
686114237Snjl
687151937Sjkim        /* Dump the resource descriptor */
68867754Smsmith
689151937Sjkim        AcpiRsDumpDescriptor (&ResourceList->Data,
690151937Sjkim            AcpiGbl_DumpResourceDispatch[Type]);
69167754Smsmith
692151937Sjkim        /* Point to the next resource structure */
69367754Smsmith
694151937Sjkim        ResourceList = ACPI_PTR_ADD (ACPI_RESOURCE, ResourceList,
695151937Sjkim                            ResourceList->Length);
69667754Smsmith
697151937Sjkim        /* Exit when END_TAG descriptor is reached */
69867754Smsmith
699151937Sjkim    } while (Type != ACPI_RESOURCE_TYPE_END_TAG);
70067754Smsmith}
70167754Smsmith
70267754Smsmith
70367754Smsmith/*******************************************************************************
70467754Smsmith *
705151937Sjkim * FUNCTION:    AcpiRsDumpIrqList
70677424Smsmith *
707151937Sjkim * PARAMETERS:  RouteTable      - Pointer to the routing table to dump.
70877424Smsmith *
70977424Smsmith * RETURN:      None
71077424Smsmith *
711151937Sjkim * DESCRIPTION: Print IRQ routing table
71277424Smsmith *
71377424Smsmith ******************************************************************************/
71477424Smsmith
71577424Smsmithvoid
716151937SjkimAcpiRsDumpIrqList (
717151937Sjkim    UINT8                   *RouteTable)
71877424Smsmith{
719151937Sjkim    ACPI_PCI_ROUTING_TABLE  *PrtElement;
720151937Sjkim    UINT8                   Count;
72177424Smsmith
72277424Smsmith
72391116Smsmith    ACPI_FUNCTION_ENTRY ();
72483174Smsmith
72583174Smsmith
726151937Sjkim    if (!(AcpiDbgLevel & ACPI_LV_RESOURCES) || !( _COMPONENT & AcpiDbgLayer))
72777424Smsmith    {
72877424Smsmith        return;
72977424Smsmith    }
73077424Smsmith
731151937Sjkim    PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, RouteTable);
73277424Smsmith
733151937Sjkim    /* Dump all table elements, Exit on zero length element */
73477424Smsmith
735151937Sjkim    for (Count = 0; PrtElement->Length; Count++)
736151937Sjkim    {
737151937Sjkim        AcpiOsPrintf ("\n[%02X] PCI IRQ Routing Table Package\n", Count);
738151937Sjkim        AcpiRsDumpDescriptor (PrtElement, AcpiRsDumpPrt);
73977424Smsmith
740151937Sjkim        PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE,
741151937Sjkim                        ((UINT8 *) PrtElement) + PrtElement->Length);
74277424Smsmith    }
74377424Smsmith}
74477424Smsmith
74577424Smsmith
74677424Smsmith/*******************************************************************************
74777424Smsmith *
748151937Sjkim * FUNCTION:    AcpiRsOut*
74967754Smsmith *
750151937Sjkim * PARAMETERS:  Title       - Name of the resource field
751151937Sjkim *              Value       - Value of the resource field
75267754Smsmith *
75377424Smsmith * RETURN:      None
75467754Smsmith *
755151937Sjkim * DESCRIPTION: Miscellaneous helper functions to consistently format the
756151937Sjkim *              output of the resource dump routines
75767754Smsmith *
75867754Smsmith ******************************************************************************/
75967754Smsmith
760151937Sjkimstatic void
761151937SjkimAcpiRsOutString (
762151937Sjkim    char                    *Title,
763151937Sjkim    char                    *Value)
76467754Smsmith{
765151937Sjkim    AcpiOsPrintf ("%27s : %s\n", Title, Value);
766151937Sjkim}
76767754Smsmith
768151937Sjkimstatic void
769151937SjkimAcpiRsOutInteger8 (
770151937Sjkim    char                    *Title,
771151937Sjkim    UINT8                   Value)
772151937Sjkim{
773151937Sjkim    AcpiOsPrintf ("%27s : %2.2X\n", Title, Value);
774151937Sjkim}
77567754Smsmith
776151937Sjkimstatic void
777151937SjkimAcpiRsOutInteger16 (
778151937Sjkim    char                    *Title,
779151937Sjkim    UINT16                  Value)
780151937Sjkim{
781151937Sjkim    AcpiOsPrintf ("%27s : %4.4X\n", Title, Value);
782151937Sjkim}
78383174Smsmith
784151937Sjkimstatic void
785151937SjkimAcpiRsOutInteger32 (
786151937Sjkim    char                    *Title,
787151937Sjkim    UINT32                  Value)
788151937Sjkim{
789151937Sjkim    AcpiOsPrintf ("%27s : %8.8X\n", Title, Value);
790151937Sjkim}
79183174Smsmith
792151937Sjkimstatic void
793151937SjkimAcpiRsOutInteger64 (
794151937Sjkim    char                    *Title,
795151937Sjkim    UINT64                  Value)
796151937Sjkim{
797151937Sjkim    AcpiOsPrintf ("%27s : %8.8X%8.8X\n", Title,
798151937Sjkim        ACPI_FORMAT_UINT64 (Value));
799151937Sjkim}
80067754Smsmith
801151937Sjkimstatic void
802151937SjkimAcpiRsOutTitle (
803151937Sjkim    char                    *Title)
804151937Sjkim{
805151937Sjkim    AcpiOsPrintf ("%27s : ", Title);
80667754Smsmith}
80767754Smsmith
80867754Smsmith
80967754Smsmith/*******************************************************************************
81067754Smsmith *
811151937Sjkim * FUNCTION:    AcpiRsDump*List
81267754Smsmith *
813151937Sjkim * PARAMETERS:  Length      - Number of elements in the list
814151937Sjkim *              Data        - Start of the list
81567754Smsmith *
81677424Smsmith * RETURN:      None
81767754Smsmith *
818151937Sjkim * DESCRIPTION: Miscellaneous functions to dump lists of raw data
81967754Smsmith *
82067754Smsmith ******************************************************************************/
82167754Smsmith
822151937Sjkimstatic void
823151937SjkimAcpiRsDumpByteList (
824151937Sjkim    UINT16                  Length,
825151937Sjkim    UINT8                   *Data)
82667754Smsmith{
827151937Sjkim    UINT8                   i;
82867754Smsmith
82967754Smsmith
830151937Sjkim    for (i = 0; i < Length; i++)
83167754Smsmith    {
832151937Sjkim        AcpiOsPrintf ("%25s%2.2X : %2.2X\n",
833151937Sjkim            "Byte", i, Data[i]);
834151937Sjkim    }
835151937Sjkim}
83667754Smsmith
837151937Sjkimstatic void
838151937SjkimAcpiRsDumpShortByteList (
839151937Sjkim    UINT8                  Length,
840151937Sjkim    UINT8                  *Data)
841151937Sjkim{
842151937Sjkim    UINT8                   i;
84367754Smsmith
84467754Smsmith
845151937Sjkim    for (i = 0; i < Length; i++)
846151937Sjkim    {
847151937Sjkim        AcpiOsPrintf ("%X ", Data[i]);
84867754Smsmith    }
849151937Sjkim    AcpiOsPrintf ("\n");
85067754Smsmith}
85167754Smsmith
852151937Sjkimstatic void
853151937SjkimAcpiRsDumpDwordList (
854151937Sjkim    UINT8                   Length,
855151937Sjkim    UINT32                  *Data)
85667754Smsmith{
857151937Sjkim    UINT8                   i;
85867754Smsmith
85967754Smsmith
860151937Sjkim    for (i = 0; i < Length; i++)
86167754Smsmith    {
862151937Sjkim        AcpiOsPrintf ("%25s%2.2X : %8.8X\n",
863151937Sjkim            "Dword", i, Data[i]);
86467754Smsmith    }
86567754Smsmith}
86667754Smsmith
86783174Smsmith#endif
86883174Smsmith
869