1 /*******************************************************************************
3 * Module Name: rsdump - Functions to display the resource structures.
6 ******************************************************************************/
8 /******************************************************************************
12 * Some or all of this work - Copyright (c) 1999 - 2005, 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>
122 #include <contrib/dev/acpica/acdisasm.h>
124 #define _COMPONENT ACPI_RESOURCES
125 ACPI_MODULE_NAME ("rsdump")
128 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
130 /* Local prototypes */
167 AcpiRsDumpDwordList (
172 AcpiRsDumpShortByteList (
177 AcpiRsDumpResourceSource (
178 ACPI_RESOURCE_SOURCE *ResourceSource);
181 AcpiRsDumpAddressCommon (
182 ACPI_RESOURCE_DATA *Resource);
185 AcpiRsDumpDescriptor (
187 ACPI_RSDUMP_INFO *Table);
190 #define ACPI_RSD_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_RESOURCE_DATA,f)
191 #define ACPI_PRT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PCI_ROUTING_TABLE,f)
192 #define ACPI_RSD_TABLE_SIZE(name) (sizeof(name) / sizeof (ACPI_RSDUMP_INFO))
195 /*******************************************************************************
197 * Resource Descriptor info tables
199 * Note: The first table entry must be a Title or Literal and must contain
200 * the table length (number of table entries)
202 ******************************************************************************/
204 ACPI_RSDUMP_INFO AcpiRsDumpIrq[6] =
206 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpIrq), "IRQ", NULL},
207 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Triggering), "Triggering", AcpiGbl_HEDecode},
208 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Polarity), "Polarity", AcpiGbl_LLDecode},
209 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Sharable), "Sharing", AcpiGbl_SHRDecode},
210 {ACPI_RSD_UINT8 , ACPI_RSD_OFFSET (Irq.InterruptCount), "Interrupt Count", NULL},
211 {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Irq.Interrupts[0]), "Interrupt List", NULL}
214 ACPI_RSDUMP_INFO AcpiRsDumpDma[6] =
216 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpDma), "DMA", NULL},
217 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Dma.Type), "Speed", AcpiGbl_TYPDecode},
218 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Dma.BusMaster), "Mastering", AcpiGbl_BMDecode},
219 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Dma.Transfer), "Transfer Type", AcpiGbl_SIZDecode},
220 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Dma.ChannelCount), "Channel Count", NULL},
221 {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Dma.Channels[0]), "Channel List", NULL}
224 ACPI_RSDUMP_INFO AcpiRsDumpStartDpf[3] =
226 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpStartDpf), "Start-Dependent-Functions",NULL},
227 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (StartDpf.CompatibilityPriority), "Compatibility Priority", AcpiGbl_ConfigDecode},
228 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (StartDpf.PerformanceRobustness), "Performance/Robustness", AcpiGbl_ConfigDecode}
231 ACPI_RSDUMP_INFO AcpiRsDumpEndDpf[1] =
233 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpEndDpf), "End-Dependent-Functions", NULL}
236 ACPI_RSDUMP_INFO AcpiRsDumpIo[6] =
238 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpIo), "I/O", NULL},
239 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Io.IoDecode), "Address Decoding", AcpiGbl_IoDecode},
240 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Io.Minimum), "Address Minimum", NULL},
241 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Io.Maximum), "Address Maximum", NULL},
242 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Io.Alignment), "Alignment", NULL},
243 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Io.AddressLength), "Address Length", NULL}
246 ACPI_RSDUMP_INFO AcpiRsDumpFixedIo[3] =
248 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpFixedIo), "Fixed I/O", NULL},
249 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (FixedIo.Address), "Address", NULL},
250 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (FixedIo.AddressLength), "Address Length", NULL}
253 ACPI_RSDUMP_INFO AcpiRsDumpVendor[3] =
255 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpVendor), "Vendor Specific", NULL},
256 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Vendor.ByteLength), "Length", NULL},
257 {ACPI_RSD_LONGLIST, ACPI_RSD_OFFSET (Vendor.ByteData[0]), "Vendor Data", NULL}
260 ACPI_RSDUMP_INFO AcpiRsDumpEndTag[1] =
262 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpEndTag), "EndTag", NULL}
265 ACPI_RSDUMP_INFO AcpiRsDumpMemory24[6] =
267 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpMemory24), "24-Bit Memory Range", NULL},
268 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Memory24.WriteProtect), "Write Protect", AcpiGbl_RWDecode},
269 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Memory24.Minimum), "Address Minimum", NULL},
270 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Memory24.Maximum), "Address Maximum", NULL},
271 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Memory24.Alignment), "Alignment", NULL},
272 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Memory24.AddressLength), "Address Length", NULL}
275 ACPI_RSDUMP_INFO AcpiRsDumpMemory32[6] =
277 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpMemory32), "32-Bit Memory Range", NULL},
278 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Memory32.WriteProtect), "Write Protect", AcpiGbl_RWDecode},
279 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Memory32.Minimum), "Address Minimum", NULL},
280 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Memory32.Maximum), "Address Maximum", NULL},
281 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Memory32.Alignment), "Alignment", NULL},
282 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Memory32.AddressLength), "Address Length", NULL}
285 ACPI_RSDUMP_INFO AcpiRsDumpFixedMemory32[4] =
287 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpFixedMemory32), "32-Bit Fixed Memory Range",NULL},
288 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (FixedMemory32.WriteProtect), "Write Protect", AcpiGbl_RWDecode},
289 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (FixedMemory32.Address), "Address", NULL},
290 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (FixedMemory32.AddressLength), "Address Length", NULL}
293 ACPI_RSDUMP_INFO AcpiRsDumpAddress16[8] =
295 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress16), "16-Bit WORD Address Space",NULL},
296 {ACPI_RSD_ADDRESS, 0, NULL, NULL},
297 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Granularity), "Granularity", NULL},
298 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Minimum), "Address Minimum", NULL},
299 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Maximum), "Address Maximum", NULL},
300 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.TranslationOffset), "Translation Offset", NULL},
301 {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.AddressLength), "Address Length", NULL},
302 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address16.ResourceSource), NULL, NULL}
305 ACPI_RSDUMP_INFO AcpiRsDumpAddress32[8] =
307 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress32), "32-Bit DWORD Address Space", NULL},
308 {ACPI_RSD_ADDRESS, 0, NULL, NULL},
309 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Granularity), "Granularity", NULL},
310 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Minimum), "Address Minimum", NULL},
311 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Maximum), "Address Maximum", NULL},
312 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.TranslationOffset), "Translation Offset", NULL},
313 {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.AddressLength), "Address Length", NULL},
314 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address32.ResourceSource), NULL, NULL}
317 ACPI_RSDUMP_INFO AcpiRsDumpAddress64[8] =
319 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress64), "64-Bit QWORD Address Space", NULL},
320 {ACPI_RSD_ADDRESS, 0, NULL, NULL},
321 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Granularity), "Granularity", NULL},
322 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Minimum), "Address Minimum", NULL},
323 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Maximum), "Address Maximum", NULL},
324 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.TranslationOffset), "Translation Offset", NULL},
325 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.AddressLength), "Address Length", NULL},
326 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address64.ResourceSource), NULL, NULL}
329 ACPI_RSDUMP_INFO AcpiRsDumpExtAddress64[8] =
331 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpExtAddress64), "64-Bit Extended Address Space", NULL},
332 {ACPI_RSD_ADDRESS, 0, NULL, NULL},
333 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Granularity), "Granularity", NULL},
334 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Minimum), "Address Minimum", NULL},
335 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Maximum), "Address Maximum", NULL},
336 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.TranslationOffset), "Translation Offset", NULL},
337 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.AddressLength), "Address Length", NULL},
338 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.TypeSpecific), "Type-Specific Attribute", NULL}
341 ACPI_RSDUMP_INFO AcpiRsDumpExtIrq[8] =
343 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpExtIrq), "Extended IRQ", NULL},
344 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.ProducerConsumer), "Type", AcpiGbl_ConsumeDecode},
345 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.Triggering), "Triggering", AcpiGbl_HEDecode},
346 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.Polarity), "Polarity", AcpiGbl_LLDecode},
347 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.Sharable), "Sharing", AcpiGbl_SHRDecode},
348 {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (ExtendedIrq.ResourceSource), NULL, NULL},
349 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (ExtendedIrq.InterruptCount), "Interrupt Count", NULL},
350 {ACPI_RSD_DWORDLIST,ACPI_RSD_OFFSET (ExtendedIrq.Interrupts[0]), "Interrupt List", NULL}
353 ACPI_RSDUMP_INFO AcpiRsDumpGenericReg[6] =
355 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpGenericReg), "Generic Register", NULL},
356 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (GenericReg.SpaceId), "Space ID", NULL},
357 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (GenericReg.BitWidth), "Bit Width", NULL},
358 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (GenericReg.BitOffset), "Bit Offset", NULL},
359 {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (GenericReg.AccessSize), "Access Size", NULL},
360 {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (GenericReg.Address), "Address", NULL}
365 * Tables used for common address descriptor flag fields
367 static ACPI_RSDUMP_INFO AcpiRsDumpGeneralFlags[5] =
369 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpGeneralFlags), NULL, NULL},
370 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.ProducerConsumer), "Consumer/Producer", AcpiGbl_ConsumeDecode},
371 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Decode), "Address Decode", AcpiGbl_DECDecode},
372 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.MinAddressFixed), "Min Relocatability", AcpiGbl_MinDecode},
373 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.MaxAddressFixed), "Max Relocatability", AcpiGbl_MaxDecode}
376 static ACPI_RSDUMP_INFO AcpiRsDumpMemoryFlags[5] =
378 {ACPI_RSD_LITERAL, ACPI_RSD_TABLE_SIZE (AcpiRsDumpMemoryFlags), "Resource Type", "Memory Range"},
379 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.WriteProtect), "Write Protect", AcpiGbl_RWDecode},
380 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.Caching), "Caching", AcpiGbl_MEMDecode},
381 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.RangeType), "Range Type", AcpiGbl_MTPDecode},
382 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.Translation), "Translation", AcpiGbl_TTPDecode}
385 static ACPI_RSDUMP_INFO AcpiRsDumpIoFlags[4] =
387 {ACPI_RSD_LITERAL, ACPI_RSD_TABLE_SIZE (AcpiRsDumpIoFlags), "Resource Type", "I/O Range"},
388 {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Address.Info.Io.RangeType), "Range Type", AcpiGbl_RNGDecode},
389 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Io.Translation), "Translation", AcpiGbl_TTPDecode},
390 {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Io.TranslationType), "Translation Type", AcpiGbl_TRSDecode}
395 * Table used to dump _PRT contents
397 static ACPI_RSDUMP_INFO AcpiRsDumpPrt[5] =
399 {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpPrt), NULL, NULL},
400 {ACPI_RSD_UINT64, ACPI_PRT_OFFSET (Address), "Address", NULL},
401 {ACPI_RSD_UINT32, ACPI_PRT_OFFSET (Pin), "Pin", NULL},
402 {ACPI_RSD_STRING, ACPI_PRT_OFFSET (Source[0]), "Source", NULL},
403 {ACPI_RSD_UINT32, ACPI_PRT_OFFSET (SourceIndex), "Source Index", NULL}
407 /*******************************************************************************
409 * FUNCTION: AcpiRsDumpDescriptor
411 * PARAMETERS: Resource
417 ******************************************************************************/
420 AcpiRsDumpDescriptor (
422 ACPI_RSDUMP_INFO *Table)
425 void *PreviousTarget;
430 /* First table entry must contain the table length (# of table entries) */
432 Count = Table->Offset;
436 PreviousTarget = Target;
437 Target = ((UINT8 *) Resource) + Table->Offset;
440 switch (Table->Opcode)
444 * Optional resource title
448 AcpiOsPrintf ("%s Resource\n", Name);
454 case ACPI_RSD_LITERAL:
455 AcpiRsOutString (Name, (char *) (uintptr_t) Table->Pointer);
458 case ACPI_RSD_STRING:
459 AcpiRsOutString (Name, (char *) (uintptr_t) Target);
462 /* Data items, 8/16/32/64 bit */
465 AcpiRsOutInteger8 (Name, *(UINT8 *) Target);
468 case ACPI_RSD_UINT16:
469 AcpiRsOutInteger16 (Name, *(UINT16 *) Target);
472 case ACPI_RSD_UINT32:
473 AcpiRsOutInteger32 (Name, *(UINT32 *) Target);
476 case ACPI_RSD_UINT64:
477 AcpiRsOutInteger64 (Name, *(UINT64 *) Target);
480 /* Flags: 1-bit and 2-bit flags supported */
482 case ACPI_RSD_1BITFLAG:
483 AcpiRsOutString (Name, (char *) (uintptr_t)
484 ((const char **) (uintptr_t) Table->Pointer)[(*(UINT8 *) Target) & 0x01]);
487 case ACPI_RSD_2BITFLAG:
488 AcpiRsOutString (Name, (char *) (uintptr_t)
489 ((const char **) (uintptr_t) Table->Pointer)[(*(UINT8 *) Target) & 0x03]);
492 case ACPI_RSD_SHORTLIST:
494 * Short byte list (single line output) for DMA and IRQ resources
495 * Note: The list length is obtained from the previous table entry
499 AcpiRsOutTitle (Name);
500 AcpiRsDumpShortByteList (*((UINT8 *) PreviousTarget),
505 case ACPI_RSD_LONGLIST:
507 * Long byte list for Vendor resource data
508 * Note: The list length is obtained from the previous table entry
512 AcpiRsDumpByteList (*((UINT16 *) PreviousTarget),
517 case ACPI_RSD_DWORDLIST:
519 * Dword list for Extended Interrupt resources
520 * Note: The list length is obtained from the previous table entry
524 AcpiRsDumpDwordList (*((UINT8 *) PreviousTarget),
529 case ACPI_RSD_ADDRESS:
531 * Common flags for all Address resources
533 AcpiRsDumpAddressCommon ((ACPI_RESOURCE_DATA *) Target);
536 case ACPI_RSD_SOURCE:
538 * Optional ResourceSource for Address resources
540 AcpiRsDumpResourceSource ((ACPI_RESOURCE_SOURCE *) Target);
544 AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",
555 /*******************************************************************************
557 * FUNCTION: AcpiRsDumpResourceSource
559 * PARAMETERS: ResourceSource - Pointer to a Resource Source struct
563 * DESCRIPTION: Common routine for dumping the optional ResourceSource and the
564 * corresponding ResourceSourceIndex.
566 ******************************************************************************/
569 AcpiRsDumpResourceSource (
570 ACPI_RESOURCE_SOURCE *ResourceSource)
572 ACPI_FUNCTION_ENTRY ();
575 if (ResourceSource->Index == 0xFF)
580 AcpiRsOutInteger8 ("Resource Source Index",
581 ResourceSource->Index);
583 AcpiRsOutString ("Resource Source",
584 ResourceSource->StringPtr ?
585 ResourceSource->StringPtr : "[Not Specified]");
589 /*******************************************************************************
591 * FUNCTION: AcpiRsDumpAddressCommon
593 * PARAMETERS: Resource - Pointer to an internal resource descriptor
597 * DESCRIPTION: Dump the fields that are common to all Address resource
600 ******************************************************************************/
603 AcpiRsDumpAddressCommon (
604 ACPI_RESOURCE_DATA *Resource)
606 ACPI_FUNCTION_ENTRY ();
609 /* Decode the type-specific flags */
611 switch (Resource->Address.ResourceType)
613 case ACPI_MEMORY_RANGE:
615 AcpiRsDumpDescriptor (Resource, AcpiRsDumpMemoryFlags);
620 AcpiRsDumpDescriptor (Resource, AcpiRsDumpIoFlags);
623 case ACPI_BUS_NUMBER_RANGE:
625 AcpiRsOutString ("Resource Type", "Bus Number Range");
630 AcpiRsOutInteger8 ("Resource Type",
631 (UINT8) Resource->Address.ResourceType);
635 /* Decode the general flags */
637 AcpiRsDumpDescriptor (Resource, AcpiRsDumpGeneralFlags);
641 /*******************************************************************************
643 * FUNCTION: AcpiRsDumpResourceList
645 * PARAMETERS: ResourceList - Pointer to a resource descriptor list
649 * DESCRIPTION: Dispatches the structure to the correct dump routine.
651 ******************************************************************************/
654 AcpiRsDumpResourceList (
655 ACPI_RESOURCE *ResourceList)
661 ACPI_FUNCTION_ENTRY ();
664 if (!(AcpiDbgLevel & ACPI_LV_RESOURCES) || !( _COMPONENT & AcpiDbgLayer))
669 /* Walk list and dump all resource descriptors (END_TAG terminates) */
673 AcpiOsPrintf ("\n[%02X] ", Count);
676 /* Validate Type before dispatch */
678 Type = ResourceList->Type;
679 if (Type > ACPI_RESOURCE_TYPE_MAX)
682 "Invalid descriptor type (%X) in resource list\n",
687 /* Dump the resource descriptor */
689 AcpiRsDumpDescriptor (&ResourceList->Data,
690 AcpiGbl_DumpResourceDispatch[Type]);
692 /* Point to the next resource structure */
694 ResourceList = ACPI_PTR_ADD (ACPI_RESOURCE, ResourceList,
695 ResourceList->Length);
697 /* Exit when END_TAG descriptor is reached */
699 } while (Type != ACPI_RESOURCE_TYPE_END_TAG);
703 /*******************************************************************************
705 * FUNCTION: AcpiRsDumpIrqList
707 * PARAMETERS: RouteTable - Pointer to the routing table to dump.
711 * DESCRIPTION: Print IRQ routing table
713 ******************************************************************************/
719 ACPI_PCI_ROUTING_TABLE *PrtElement;
723 ACPI_FUNCTION_ENTRY ();
726 if (!(AcpiDbgLevel & ACPI_LV_RESOURCES) || !( _COMPONENT & AcpiDbgLayer))
731 PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, RouteTable);
733 /* Dump all table elements, Exit on zero length element */
735 for (Count = 0; PrtElement->Length; Count++)
737 AcpiOsPrintf ("\n[%02X] PCI IRQ Routing Table Package\n", Count);
738 AcpiRsDumpDescriptor (PrtElement, AcpiRsDumpPrt);
740 PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE,
741 ((UINT8 *) PrtElement) + PrtElement->Length);
746 /*******************************************************************************
748 * FUNCTION: AcpiRsOut*
750 * PARAMETERS: Title - Name of the resource field
751 * Value - Value of the resource field
755 * DESCRIPTION: Miscellaneous helper functions to consistently format the
756 * output of the resource dump routines
758 ******************************************************************************/
765 AcpiOsPrintf ("%27s : %s\n", Title, Value);
773 AcpiOsPrintf ("%27s : %2.2X\n", Title, Value);
781 AcpiOsPrintf ("%27s : %4.4X\n", Title, Value);
789 AcpiOsPrintf ("%27s : %8.8X\n", Title, Value);
797 AcpiOsPrintf ("%27s : %8.8X%8.8X\n", Title,
798 ACPI_FORMAT_UINT64 (Value));
805 AcpiOsPrintf ("%27s : ", Title);
809 /*******************************************************************************
811 * FUNCTION: AcpiRsDump*List
813 * PARAMETERS: Length - Number of elements in the list
814 * Data - Start of the list
818 * DESCRIPTION: Miscellaneous functions to dump lists of raw data
820 ******************************************************************************/
830 for (i = 0; i < Length; i++)
832 AcpiOsPrintf ("%25s%2.2X : %2.2X\n",
838 AcpiRsDumpShortByteList (
845 for (i = 0; i < Length; i++)
847 AcpiOsPrintf ("%X ", Data[i]);
853 AcpiRsDumpDwordList (
860 for (i = 0; i < Length; i++)
862 AcpiOsPrintf ("%25s%2.2X : %8.8X\n",
863 "Dword", i, Data[i]);