1 /*******************************************************************************
3 * Module Name: rsdump - Functions to display the resource structures.
6 ******************************************************************************/
8 /******************************************************************************
12 * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp.
13 * All rights reserved.
17 * 2.1. This is your license from Intel Corp. under its intellectual property
18 * rights. You may have additional license terms from the party that provided
19 * you this software, covering your right to use that party's intellectual
22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23 * copy of the source code appearing in this file ("Covered Code") an
24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25 * base code distributed originally by Intel ("Original Intel Code") to copy,
26 * make derivatives, distribute, use and display any portion of the Covered
27 * Code in any form, with the right to sublicense such rights; and
29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30 * license (with the right to sublicense), under only those claims of Intel
31 * patents that are infringed by the Original Intel Code, to make, use, sell,
32 * offer to sell, and import the Covered Code and derivative works thereof
33 * solely to the minimum extent necessary to exercise the above copyright
34 * license, and in no event shall the patent license extend to any additions
35 * to or modifications of the Original Intel Code. No other license or right
36 * is granted directly or by implication, estoppel or otherwise;
38 * The above copyright and patent license is granted only if the following
43 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44 * Redistribution of source code of any substantial portion of the Covered
45 * Code or modification with rights to further distribute source must include
46 * the above Copyright Notice, the above License, this list of Conditions,
47 * and the following Disclaimer and Export Compliance provision. In addition,
48 * Licensee must cause all Covered Code to which Licensee contributes to
49 * contain a file documenting the changes Licensee made to create that Covered
50 * Code and the date of any change. Licensee must include in that file the
51 * documentation of any changes made by any predecessor Licensee. Licensee
52 * must include a prominent statement that the modification is derived,
53 * directly or indirectly, from Original Intel Code.
55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56 * Redistribution of source code of any substantial portion of the Covered
57 * Code or modification without rights to further distribute source must
58 * include the following Disclaimer and Export Compliance provision in the
59 * documentation and/or other materials provided with distribution. In
60 * addition, Licensee may not authorize further sublicense of source of any
61 * portion of the Covered Code, and must include terms to the effect that the
62 * license from Licensee to its licensee is limited to the intellectual
63 * property embodied in the software Licensee provides to its licensee, and
64 * not to intellectual property embodied in modifications its licensee may
67 * 3.3. Redistribution of Executable. Redistribution in executable form of any
68 * substantial portion of the Covered Code or modification must reproduce the
69 * above Copyright Notice, and the following Disclaimer and Export Compliance
70 * provision in the documentation and/or other materials provided with the
73 * 3.4. Intel retains all right, title, and interest in and to the Original
76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77 * Intel shall be used in advertising or otherwise to promote the sale, use or
78 * other dealings in products derived from or relating to the Covered Code
79 * without prior written authorization from Intel.
81 * 4. Disclaimer and Export Compliance
83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
100 * 4.3. Licensee shall not export, either directly or indirectly, any of this
101 * software or system incorporating such software without first obtaining any
102 * required license or other approval from the U. S. Department of Commerce or
103 * any other agency or department of the United States Government. In the
104 * event Licensee exports any such software from the United States or
105 * re-exports any such software from a foreign destination, Licensee shall
106 * ensure that the distribution and export/re-export of the software is in
107 * compliance with all laws, regulations, orders, or other restrictions of the
108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109 * any of its subsidiaries will export/re-export any technical data, process,
110 * software, or service, directly or indirectly, to any country for which the
111 * United States government or any agency thereof requires an export license,
112 * other governmental approval, or letter of assurance, without first obtaining
113 * such license, approval or letter.
115 *****************************************************************************/
120 #include <contrib/dev/acpica/acpi.h>
121 #include <contrib/dev/acpica/acresrc.h>
123 #define _COMPONENT ACPI_RESOURCES
124 ACPI_MODULE_NAME ("rsdump")
127 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
129 /* Local prototypes */
166 AcpiRsDumpDwordList (
171 AcpiRsDumpShortByteList (
176 AcpiRsDumpResourceSource (
177 ACPI_RESOURCE_SOURCE *ResourceSource);
180 AcpiRsDumpAddressCommon (
181 ACPI_RESOURCE_DATA *Resource);
184 AcpiRsDumpDescriptor (
186 ACPI_RSDUMP_INFO *Table);
189 #define ACPI_RSD_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_RESOURCE_DATA,f)
190 #define ACPI_PRT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PCI_ROUTING_TABLE,f)
191 #define ACPI_RSD_TABLE_SIZE(name) (sizeof(name) / sizeof (ACPI_RSDUMP_INFO))
194 /*******************************************************************************
196 * Resource Descriptor info tables
198 * Note: The first table entry must be a Title or Literal and must contain
199 * the table length (number of table entries)
201 ******************************************************************************/
203 ACPI_RSDUMP_INFO AcpiRsDumpIrq[6] =
205 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpIrq), "IRQ", NULL},
206 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Triggering), "Triggering", AcpiGbl_HeDecode},
207 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Polarity), "Polarity", AcpiGbl_LlDecode},
208 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Sharable), "Sharing", AcpiGbl_ShrDecode},
209 {ACPI_RSD_UINT8 , ACPI_RSD_OFFSET (Irq.InterruptCount), "Interrupt Count", NULL},
210 {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Irq.Interrupts[0]), "Interrupt List", NULL}
213 ACPI_RSDUMP_INFO AcpiRsDumpDma[6] =
215 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpDma), "DMA", NULL},
216 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Dma.Type), "Speed", AcpiGbl_TypDecode},
217 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Dma.BusMaster), "Mastering", AcpiGbl_BmDecode},
218 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Dma.Transfer), "Transfer Type", AcpiGbl_SizDecode},
219 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Dma.ChannelCount), "Channel Count", NULL},
220 {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Dma.Channels[0]), "Channel List", NULL}
223 ACPI_RSDUMP_INFO AcpiRsDumpStartDpf[3] =
225 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpStartDpf), "Start-Dependent-Functions",NULL},
226 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (StartDpf.CompatibilityPriority), "Compatibility Priority", AcpiGbl_ConfigDecode},
227 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (StartDpf.PerformanceRobustness), "Performance/Robustness", AcpiGbl_ConfigDecode}
230 ACPI_RSDUMP_INFO AcpiRsDumpEndDpf[1] =
232 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpEndDpf), "End-Dependent-Functions", NULL}
235 ACPI_RSDUMP_INFO AcpiRsDumpIo[6] =
237 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpIo), "I/O", NULL},
238 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Io.IoDecode), "Address Decoding", AcpiGbl_IoDecode},
239 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Io.Minimum), "Address Minimum", NULL},
240 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Io.Maximum), "Address Maximum", NULL},
241 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Io.Alignment), "Alignment", NULL},
242 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Io.AddressLength), "Address Length", NULL}
245 ACPI_RSDUMP_INFO AcpiRsDumpFixedIo[3] =
247 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpFixedIo), "Fixed I/O", NULL},
248 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (FixedIo.Address), "Address", NULL},
249 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (FixedIo.AddressLength), "Address Length", NULL}
252 ACPI_RSDUMP_INFO AcpiRsDumpVendor[3] =
254 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpVendor), "Vendor Specific", NULL},
255 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Vendor.ByteLength), "Length", NULL},
256 {ACPI_RSD_LONGLIST, ACPI_RSD_OFFSET (Vendor.ByteData[0]), "Vendor Data", NULL}
259 ACPI_RSDUMP_INFO AcpiRsDumpEndTag[1] =
261 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpEndTag), "EndTag", NULL}
264 ACPI_RSDUMP_INFO AcpiRsDumpMemory24[6] =
266 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpMemory24), "24-Bit Memory Range", NULL},
267 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Memory24.WriteProtect), "Write Protect", AcpiGbl_RwDecode},
268 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Memory24.Minimum), "Address Minimum", NULL},
269 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Memory24.Maximum), "Address Maximum", NULL},
270 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Memory24.Alignment), "Alignment", NULL},
271 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Memory24.AddressLength), "Address Length", NULL}
274 ACPI_RSDUMP_INFO AcpiRsDumpMemory32[6] =
276 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpMemory32), "32-Bit Memory Range", NULL},
277 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Memory32.WriteProtect), "Write Protect", AcpiGbl_RwDecode},
278 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Memory32.Minimum), "Address Minimum", NULL},
279 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Memory32.Maximum), "Address Maximum", NULL},
280 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Memory32.Alignment), "Alignment", NULL},
281 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Memory32.AddressLength), "Address Length", NULL}
284 ACPI_RSDUMP_INFO AcpiRsDumpFixedMemory32[4] =
286 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpFixedMemory32), "32-Bit Fixed Memory Range",NULL},
287 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (FixedMemory32.WriteProtect), "Write Protect", AcpiGbl_RwDecode},
288 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (FixedMemory32.Address), "Address", NULL},
289 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (FixedMemory32.AddressLength), "Address Length", NULL}
292 ACPI_RSDUMP_INFO AcpiRsDumpAddress16[8] =
294 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress16), "16-Bit WORD Address Space",NULL},
295 {ACPI_RSD_ADDRESS, 0, NULL, NULL},
296 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Granularity), "Granularity", NULL},
297 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Minimum), "Address Minimum", NULL},
298 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Maximum), "Address Maximum", NULL},
299 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.TranslationOffset), "Translation Offset", NULL},
300 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.AddressLength), "Address Length", NULL},
301 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address16.ResourceSource), NULL, NULL}
304 ACPI_RSDUMP_INFO AcpiRsDumpAddress32[8] =
306 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress32), "32-Bit DWORD Address Space", NULL},
307 {ACPI_RSD_ADDRESS, 0, NULL, NULL},
308 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Granularity), "Granularity", NULL},
309 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Minimum), "Address Minimum", NULL},
310 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Maximum), "Address Maximum", NULL},
311 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.TranslationOffset), "Translation Offset", NULL},
312 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.AddressLength), "Address Length", NULL},
313 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address32.ResourceSource), NULL, NULL}
316 ACPI_RSDUMP_INFO AcpiRsDumpAddress64[8] =
318 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress64), "64-Bit QWORD Address Space", NULL},
319 {ACPI_RSD_ADDRESS, 0, NULL, NULL},
320 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Granularity), "Granularity", NULL},
321 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Minimum), "Address Minimum", NULL},
322 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Maximum), "Address Maximum", NULL},
323 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.TranslationOffset), "Translation Offset", NULL},
324 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.AddressLength), "Address Length", NULL},
325 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address64.ResourceSource), NULL, NULL}
328 ACPI_RSDUMP_INFO AcpiRsDumpExtAddress64[8] =
330 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpExtAddress64), "64-Bit Extended Address Space", NULL},
331 {ACPI_RSD_ADDRESS, 0, NULL, NULL},
332 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Granularity), "Granularity", NULL},
333 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Minimum), "Address Minimum", NULL},
334 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Maximum), "Address Maximum", NULL},
335 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.TranslationOffset), "Translation Offset", NULL},
336 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.AddressLength), "Address Length", NULL},
337 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.TypeSpecific), "Type-Specific Attribute", NULL}
340 ACPI_RSDUMP_INFO AcpiRsDumpExtIrq[8] =
342 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpExtIrq), "Extended IRQ", NULL},
343 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.ProducerConsumer), "Type", AcpiGbl_ConsumeDecode},
344 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.Triggering), "Triggering", AcpiGbl_HeDecode},
345 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.Polarity), "Polarity", AcpiGbl_LlDecode},
346 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.Sharable), "Sharing", AcpiGbl_ShrDecode},
347 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (ExtendedIrq.ResourceSource), NULL, NULL},
348 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (ExtendedIrq.InterruptCount), "Interrupt Count", NULL},
349 {ACPI_RSD_DWORDLIST,ACPI_RSD_OFFSET (ExtendedIrq.Interrupts[0]), "Interrupt List", NULL}
352 ACPI_RSDUMP_INFO AcpiRsDumpGenericReg[6] =
354 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpGenericReg), "Generic Register", NULL},
355 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (GenericReg.SpaceId), "Space ID", NULL},
356 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (GenericReg.BitWidth), "Bit Width", NULL},
357 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (GenericReg.BitOffset), "Bit Offset", NULL},
358 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (GenericReg.AccessSize), "Access Size", NULL},
359 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (GenericReg.Address), "Address", NULL}
364 * Tables used for common address descriptor flag fields
366 static ACPI_RSDUMP_INFO AcpiRsDumpGeneralFlags[5] =
368 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpGeneralFlags), NULL, NULL},
369 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.ProducerConsumer), "Consumer/Producer", AcpiGbl_ConsumeDecode},
370 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Decode), "Address Decode", AcpiGbl_DecDecode},
371 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.MinAddressFixed), "Min Relocatability", AcpiGbl_MinDecode},
372 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.MaxAddressFixed), "Max Relocatability", AcpiGbl_MaxDecode}
375 static ACPI_RSDUMP_INFO AcpiRsDumpMemoryFlags[5] =
377 {ACPI_RSD_LITERAL, ACPI_RSD_TABLE_SIZE (AcpiRsDumpMemoryFlags), "Resource Type", (void *) "Memory Range"},
378 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.WriteProtect), "Write Protect", AcpiGbl_RwDecode},
379 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.Caching), "Caching", AcpiGbl_MemDecode},
380 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.RangeType), "Range Type", AcpiGbl_MtpDecode},
381 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.Translation), "Translation", AcpiGbl_TtpDecode}
384 static ACPI_RSDUMP_INFO AcpiRsDumpIoFlags[4] =
386 {ACPI_RSD_LITERAL, ACPI_RSD_TABLE_SIZE (AcpiRsDumpIoFlags), "Resource Type", (void *) "I/O Range"},
387 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Address.Info.Io.RangeType), "Range Type", AcpiGbl_RngDecode},
388 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Io.Translation), "Translation", AcpiGbl_TtpDecode},
389 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Io.TranslationType), "Translation Type", AcpiGbl_TrsDecode}
394 * Table used to dump _PRT contents
396 static ACPI_RSDUMP_INFO AcpiRsDumpPrt[5] =
398 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpPrt), NULL, NULL},
399 {ACPI_RSD_UINT64, ACPI_PRT_OFFSET (Address), "Address", NULL},
400 {ACPI_RSD_UINT32, ACPI_PRT_OFFSET (Pin), "Pin", NULL},
401 {ACPI_RSD_STRING, ACPI_PRT_OFFSET (Source[0]), "Source", NULL},
402 {ACPI_RSD_UINT32, ACPI_PRT_OFFSET (SourceIndex), "Source Index", NULL}
406 /*******************************************************************************
408 * FUNCTION: AcpiRsDumpDescriptor
410 * PARAMETERS: Resource
416 ******************************************************************************/
419 AcpiRsDumpDescriptor (
421 ACPI_RSDUMP_INFO *Table)
423 UINT8 *Target = NULL;
424 UINT8 *PreviousTarget;
429 /* First table entry must contain the table length (# of table entries) */
431 Count = Table->Offset;
435 PreviousTarget = Target;
436 Target = ACPI_ADD_PTR (UINT8, Resource, Table->Offset);
439 switch (Table->Opcode)
443 * Optional resource title
447 AcpiOsPrintf ("%s Resource\n", Name);
453 case ACPI_RSD_LITERAL:
454 AcpiRsOutString (Name, ACPI_CAST_PTR (char, Table->Pointer));
457 case ACPI_RSD_STRING:
458 AcpiRsOutString (Name, ACPI_CAST_PTR (char, Target));
461 /* Data items, 8/16/32/64 bit */
464 AcpiRsOutInteger8 (Name, ACPI_GET8 (Target));
467 case ACPI_RSD_UINT16:
468 AcpiRsOutInteger16 (Name, ACPI_GET16 (Target));
471 case ACPI_RSD_UINT32:
472 AcpiRsOutInteger32 (Name, ACPI_GET32 (Target));
475 case ACPI_RSD_UINT64:
476 AcpiRsOutInteger64 (Name, ACPI_GET64 (Target));
479 /* Flags: 1-bit and 2-bit flags supported */
481 case ACPI_RSD_1BITFLAG:
482 AcpiRsOutString (Name, ACPI_CAST_PTR (char,
483 Table->Pointer [*Target & 0x01]));
486 case ACPI_RSD_2BITFLAG:
487 AcpiRsOutString (Name, ACPI_CAST_PTR (char,
488 Table->Pointer [*Target & 0x03]));
491 case ACPI_RSD_SHORTLIST:
493 * Short byte list (single line output) for DMA and IRQ resources
494 * Note: The list length is obtained from the previous table entry
498 AcpiRsOutTitle (Name);
499 AcpiRsDumpShortByteList (*PreviousTarget, Target);
503 case ACPI_RSD_LONGLIST:
505 * Long byte list for Vendor resource data
506 * Note: The list length is obtained from the previous table entry
510 AcpiRsDumpByteList (ACPI_GET16 (PreviousTarget), Target);
514 case ACPI_RSD_DWORDLIST:
516 * Dword list for Extended Interrupt resources
517 * Note: The list length is obtained from the previous table entry
521 AcpiRsDumpDwordList (*PreviousTarget,
522 ACPI_CAST_PTR (UINT32, Target));
526 case ACPI_RSD_ADDRESS:
528 * Common flags for all Address resources
530 AcpiRsDumpAddressCommon (ACPI_CAST_PTR (ACPI_RESOURCE_DATA, Target));
533 case ACPI_RSD_SOURCE:
535 * Optional ResourceSource for Address resources
537 AcpiRsDumpResourceSource (ACPI_CAST_PTR (ACPI_RESOURCE_SOURCE, Target));
541 AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",
552 /*******************************************************************************
554 * FUNCTION: AcpiRsDumpResourceSource
556 * PARAMETERS: ResourceSource - Pointer to a Resource Source struct
560 * DESCRIPTION: Common routine for dumping the optional ResourceSource and the
561 * corresponding ResourceSourceIndex.
563 ******************************************************************************/
566 AcpiRsDumpResourceSource (
567 ACPI_RESOURCE_SOURCE *ResourceSource)
569 ACPI_FUNCTION_ENTRY ();
572 if (ResourceSource->Index == 0xFF)
577 AcpiRsOutInteger8 ("Resource Source Index",
578 ResourceSource->Index);
580 AcpiRsOutString ("Resource Source",
581 ResourceSource->StringPtr ?
582 ResourceSource->StringPtr : "[Not Specified]");
586 /*******************************************************************************
588 * FUNCTION: AcpiRsDumpAddressCommon
590 * PARAMETERS: Resource - Pointer to an internal resource descriptor
594 * DESCRIPTION: Dump the fields that are common to all Address resource
597 ******************************************************************************/
600 AcpiRsDumpAddressCommon (
601 ACPI_RESOURCE_DATA *Resource)
603 ACPI_FUNCTION_ENTRY ();
606 /* Decode the type-specific flags */
608 switch (Resource->Address.ResourceType)
610 case ACPI_MEMORY_RANGE:
612 AcpiRsDumpDescriptor (Resource, AcpiRsDumpMemoryFlags);
617 AcpiRsDumpDescriptor (Resource, AcpiRsDumpIoFlags);
620 case ACPI_BUS_NUMBER_RANGE:
622 AcpiRsOutString ("Resource Type", "Bus Number Range");
627 AcpiRsOutInteger8 ("Resource Type",
628 (UINT8) Resource->Address.ResourceType);
632 /* Decode the general flags */
634 AcpiRsDumpDescriptor (Resource, AcpiRsDumpGeneralFlags);
638 /*******************************************************************************
640 * FUNCTION: AcpiRsDumpResourceList
642 * PARAMETERS: ResourceList - Pointer to a resource descriptor list
646 * DESCRIPTION: Dispatches the structure to the correct dump routine.
648 ******************************************************************************/
651 AcpiRsDumpResourceList (
652 ACPI_RESOURCE *ResourceList)
658 ACPI_FUNCTION_ENTRY ();
661 if (!(AcpiDbgLevel & ACPI_LV_RESOURCES) || !( _COMPONENT & AcpiDbgLayer))
666 /* Walk list and dump all resource descriptors (END_TAG terminates) */
670 AcpiOsPrintf ("\n[%02X] ", Count);
673 /* Validate Type before dispatch */
675 Type = ResourceList->Type;
676 if (Type > ACPI_RESOURCE_TYPE_MAX)
679 "Invalid descriptor type (%X) in resource list\n",
684 /* Dump the resource descriptor */
686 AcpiRsDumpDescriptor (&ResourceList->Data,
687 AcpiGbl_DumpResourceDispatch[Type]);
689 /* Point to the next resource structure */
691 ResourceList = ACPI_ADD_PTR (ACPI_RESOURCE, ResourceList,
692 ResourceList->Length);
694 /* Exit when END_TAG descriptor is reached */
696 } while (Type != ACPI_RESOURCE_TYPE_END_TAG);
700 /*******************************************************************************
702 * FUNCTION: AcpiRsDumpIrqList
704 * PARAMETERS: RouteTable - Pointer to the routing table to dump.
708 * DESCRIPTION: Print IRQ routing table
710 ******************************************************************************/
716 ACPI_PCI_ROUTING_TABLE *PrtElement;
720 ACPI_FUNCTION_ENTRY ();
723 if (!(AcpiDbgLevel & ACPI_LV_RESOURCES) || !( _COMPONENT & AcpiDbgLayer))
728 PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, RouteTable);
730 /* Dump all table elements, Exit on zero length element */
732 for (Count = 0; PrtElement->Length; Count++)
734 AcpiOsPrintf ("\n[%02X] PCI IRQ Routing Table Package\n", Count);
735 AcpiRsDumpDescriptor (PrtElement, AcpiRsDumpPrt);
737 PrtElement = ACPI_ADD_PTR (ACPI_PCI_ROUTING_TABLE,
738 PrtElement, PrtElement->Length);
743 /*******************************************************************************
745 * FUNCTION: AcpiRsOut*
747 * PARAMETERS: Title - Name of the resource field
748 * Value - Value of the resource field
752 * DESCRIPTION: Miscellaneous helper functions to consistently format the
753 * output of the resource dump routines
755 ******************************************************************************/
762 AcpiOsPrintf ("%27s : %s", Title, Value);
765 AcpiOsPrintf ("[NULL NAMESTRING]");
775 AcpiOsPrintf ("%27s : %2.2X\n", Title, Value);
783 AcpiOsPrintf ("%27s : %4.4X\n", Title, Value);
791 AcpiOsPrintf ("%27s : %8.8X\n", Title, Value);
799 AcpiOsPrintf ("%27s : %8.8X%8.8X\n", Title,
800 ACPI_FORMAT_UINT64 (Value));
807 AcpiOsPrintf ("%27s : ", Title);
811 /*******************************************************************************
813 * FUNCTION: AcpiRsDump*List
815 * PARAMETERS: Length - Number of elements in the list
816 * Data - Start of the list
820 * DESCRIPTION: Miscellaneous functions to dump lists of raw data
822 ******************************************************************************/
832 for (i = 0; i < Length; i++)
834 AcpiOsPrintf ("%25s%2.2X : %2.2X\n",
840 AcpiRsDumpShortByteList (
847 for (i = 0; i < Length; i++)
849 AcpiOsPrintf ("%X ", Data[i]);
855 AcpiRsDumpDwordList (
862 for (i = 0; i < Length; i++)
864 AcpiOsPrintf ("%25s%2.2X : %8.8X\n",
865 "Dword", i, Data[i]);