rsdump.c revision 102550
144743Smarkm/*******************************************************************************
244743Smarkm *
344743Smarkm * Module Name: rsdump - Functions to display the resource structures.
444743Smarkm *              $Revision: 33 $
544743Smarkm *
644743Smarkm ******************************************************************************/
744743Smarkm
844743Smarkm/******************************************************************************
944743Smarkm *
1044743Smarkm * 1. Copyright Notice
1144743Smarkm *
1244743Smarkm * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
1344743Smarkm * All rights reserved.
1444743Smarkm *
1544743Smarkm * 2. License
1644743Smarkm *
1744743Smarkm * 2.1. This is your license from Intel Corp. under its intellectual property
1844743Smarkm * rights.  You may have additional license terms from the party that provided
1944743Smarkm * you this software, covering your right to use that party's intellectual
2044743Smarkm * property rights.
2144743Smarkm *
2244743Smarkm * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
2344743Smarkm * copy of the source code appearing in this file ("Covered Code") an
2444743Smarkm * irrevocable, perpetual, worldwide license under Intel's copyrights in the
2544743Smarkm * base code distributed originally by Intel ("Original Intel Code") to copy,
2644743Smarkm * make derivatives, distribute, use and display any portion of the Covered
2744743Smarkm * Code in any form, with the right to sublicense such rights; and
2844743Smarkm *
2944743Smarkm * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
3044743Smarkm * license (with the right to sublicense), under only those claims of Intel
3144743Smarkm * patents that are infringed by the Original Intel Code, to make, use, sell,
3244743Smarkm * offer to sell, and import the Covered Code and derivative works thereof
3344743Smarkm * solely to the minimum extent necessary to exercise the above copyright
3444743Smarkm * license, and in no event shall the patent license extend to any additions
3544743Smarkm * to or modifications of the Original Intel Code.  No other license or right
3644743Smarkm * is granted directly or by implication, estoppel or otherwise;
3744743Smarkm *
3844743Smarkm * The above copyright and patent license is granted only if the following
3944743Smarkm * conditions are met:
4044743Smarkm *
4144743Smarkm * 3. Conditions
4244743Smarkm *
4344743Smarkm * 3.1. Redistribution of Source with Rights to Further Distribute Source.
4444743Smarkm * Redistribution of source code of any substantial portion of the Covered
4544743Smarkm * Code or modification with rights to further distribute source must include
4644743Smarkm * the above Copyright Notice, the above License, this list of Conditions,
4744743Smarkm * and the following Disclaimer and Export Compliance provision.  In addition,
4844743Smarkm * Licensee must cause all Covered Code to which Licensee contributes to
4944743Smarkm * contain a file documenting the changes Licensee made to create that Covered
5044743Smarkm * Code and the date of any change.  Licensee must include in that file the
5144743Smarkm * documentation of any changes made by any predecessor Licensee.  Licensee
5244743Smarkm * must include a prominent statement that the modification is derived,
53 * directly or indirectly, from Original Intel Code.
54 *
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
65 * make.
66 *
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
71 * distribution.
72 *
73 * 3.4. Intel retains all right, title, and interest in and to the Original
74 * Intel Code.
75 *
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.
80 *
81 * 4. Disclaimer and Export Compliance
82 *
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
89 * PARTICULAR PURPOSE.
90 *
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
98 * LIMITED REMEDY.
99 *
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.
114 *
115 *****************************************************************************/
116
117
118#define __RSDUMP_C__
119
120#include "acpi.h"
121#include "acresrc.h"
122
123#define _COMPONENT          ACPI_RESOURCES
124        ACPI_MODULE_NAME    ("rsdump")
125
126
127#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
128
129/*******************************************************************************
130 *
131 * FUNCTION:    AcpiRsDumpIrq
132 *
133 * PARAMETERS:  Data            - pointer to the resource structure to dump.
134 *
135 * RETURN:      None
136 *
137 * DESCRIPTION: Prints out the various members of the Data structure type.
138 *
139 ******************************************************************************/
140
141void
142AcpiRsDumpIrq (
143    ACPI_RESOURCE_DATA      *Data)
144{
145    ACPI_RESOURCE_IRQ       *IrqData = (ACPI_RESOURCE_IRQ *) Data;
146    UINT8                   Index = 0;
147
148
149    ACPI_FUNCTION_ENTRY ();
150
151
152    AcpiOsPrintf ("IRQ Resource\n");
153
154    AcpiOsPrintf ("    %s Triggered\n",
155                ACPI_LEVEL_SENSITIVE == IrqData->EdgeLevel ? "Level" : "Edge");
156
157    AcpiOsPrintf ("    Active %s\n",
158                ACPI_ACTIVE_LOW == IrqData->ActiveHighLow ? "Low" : "High");
159
160    AcpiOsPrintf ("    %s\n",
161                ACPI_SHARED == IrqData->SharedExclusive ? "Shared" : "Exclusive");
162
163    AcpiOsPrintf ("    %X Interrupts ( ", IrqData->NumberOfInterrupts);
164
165    for (Index = 0; Index < IrqData->NumberOfInterrupts; Index++)
166    {
167        AcpiOsPrintf ("%X ", IrqData->Interrupts[Index]);
168    }
169
170    AcpiOsPrintf (")\n");
171    return;
172}
173
174
175/*******************************************************************************
176 *
177 * FUNCTION:    AcpiRsDumpDma
178 *
179 * PARAMETERS:  Data            - pointer to the resource structure to dump.
180 *
181 * RETURN:      None
182 *
183 * DESCRIPTION: Prints out the various members of the Data structure type.
184 *
185 ******************************************************************************/
186
187void
188AcpiRsDumpDma (
189    ACPI_RESOURCE_DATA      *Data)
190{
191    ACPI_RESOURCE_DMA       *DmaData = (ACPI_RESOURCE_DMA *) Data;
192    UINT8                   Index = 0;
193
194
195    ACPI_FUNCTION_ENTRY ();
196
197
198    AcpiOsPrintf ("DMA Resource\n");
199
200    switch (DmaData->Type)
201    {
202    case ACPI_COMPATIBILITY:
203        AcpiOsPrintf ("    Compatibility mode\n");
204        break;
205
206    case ACPI_TYPE_A:
207        AcpiOsPrintf ("    Type A\n");
208        break;
209
210    case ACPI_TYPE_B:
211        AcpiOsPrintf ("    Type B\n");
212        break;
213
214    case ACPI_TYPE_F:
215        AcpiOsPrintf ("    Type F\n");
216        break;
217
218    default:
219        AcpiOsPrintf ("    Invalid DMA type\n");
220        break;
221    }
222
223    AcpiOsPrintf ("    %sBus Master\n",
224                ACPI_BUS_MASTER == DmaData->BusMaster ? "" : "Not a ");
225
226
227    switch (DmaData->Transfer)
228    {
229    case ACPI_TRANSFER_8:
230        AcpiOsPrintf ("    8-bit only transfer\n");
231        break;
232
233    case ACPI_TRANSFER_8_16:
234        AcpiOsPrintf ("    8 and 16-bit transfer\n");
235        break;
236
237    case ACPI_TRANSFER_16:
238        AcpiOsPrintf ("    16 bit only transfer\n");
239        break;
240
241    default:
242        AcpiOsPrintf ("    Invalid transfer preference\n");
243        break;
244    }
245
246    AcpiOsPrintf ("    Number of Channels: %X ( ", DmaData->NumberOfChannels);
247
248    for (Index = 0; Index < DmaData->NumberOfChannels; Index++)
249    {
250        AcpiOsPrintf ("%X ", DmaData->Channels[Index]);
251    }
252
253    AcpiOsPrintf (")\n");
254    return;
255}
256
257
258/*******************************************************************************
259 *
260 * FUNCTION:    AcpiRsDumpStartDependFns
261 *
262 * PARAMETERS:  Data            - pointer to the resource structure to dump.
263 *
264 * RETURN:      None
265 *
266 * DESCRIPTION: Prints out the various members of the Data structure type.
267 *
268 ******************************************************************************/
269
270void
271AcpiRsDumpStartDependFns (
272    ACPI_RESOURCE_DATA      *Data)
273{
274    ACPI_RESOURCE_START_DPF *SdfData = (ACPI_RESOURCE_START_DPF *) Data;
275
276
277    ACPI_FUNCTION_ENTRY ();
278
279
280    AcpiOsPrintf ("Start Dependent Functions Resource\n");
281
282    switch (SdfData->CompatibilityPriority)
283    {
284    case ACPI_GOOD_CONFIGURATION:
285        AcpiOsPrintf ("    Good configuration\n");
286        break;
287
288    case ACPI_ACCEPTABLE_CONFIGURATION:
289        AcpiOsPrintf ("    Acceptable configuration\n");
290        break;
291
292    case ACPI_SUB_OPTIMAL_CONFIGURATION:
293        AcpiOsPrintf ("    Sub-optimal configuration\n");
294        break;
295
296    default:
297        AcpiOsPrintf ("    Invalid compatibility priority\n");
298        break;
299    }
300
301    switch(SdfData->PerformanceRobustness)
302    {
303    case ACPI_GOOD_CONFIGURATION:
304        AcpiOsPrintf ("    Good configuration\n");
305        break;
306
307    case ACPI_ACCEPTABLE_CONFIGURATION:
308        AcpiOsPrintf ("    Acceptable configuration\n");
309        break;
310
311    case ACPI_SUB_OPTIMAL_CONFIGURATION:
312        AcpiOsPrintf ("    Sub-optimal configuration\n");
313        break;
314
315    default:
316        AcpiOsPrintf ("    Invalid performance "
317                        "robustness preference\n");
318        break;
319    }
320
321    return;
322}
323
324
325/*******************************************************************************
326 *
327 * FUNCTION:    AcpiRsDumpIo
328 *
329 * PARAMETERS:  Data            - pointer to the resource structure to dump.
330 *
331 * RETURN:      None
332 *
333 * DESCRIPTION: Prints out the various members of the Data structure type.
334 *
335 ******************************************************************************/
336
337void
338AcpiRsDumpIo (
339    ACPI_RESOURCE_DATA      *Data)
340{
341    ACPI_RESOURCE_IO        *IoData = (ACPI_RESOURCE_IO *) Data;
342
343
344    ACPI_FUNCTION_ENTRY ();
345
346
347    AcpiOsPrintf ("Io Resource\n");
348
349    AcpiOsPrintf ("    %d bit decode\n",
350                ACPI_DECODE_16 == IoData->IoDecode ? 16 : 10);
351
352    AcpiOsPrintf ("    Range minimum base: %08X\n",
353                IoData->MinBaseAddress);
354
355    AcpiOsPrintf ("    Range maximum base: %08X\n",
356                IoData->MaxBaseAddress);
357
358    AcpiOsPrintf ("    Alignment: %08X\n",
359                IoData->Alignment);
360
361    AcpiOsPrintf ("    Range Length: %08X\n",
362                IoData->RangeLength);
363
364    return;
365}
366
367
368/*******************************************************************************
369 *
370 * FUNCTION:    AcpiRsDumpFixedIo
371 *
372 * PARAMETERS:  Data            - pointer to the resource structure to dump.
373 *
374 * RETURN:      None
375 *
376 * DESCRIPTION: Prints out the various members of the Data structure type.
377 *
378 ******************************************************************************/
379
380void
381AcpiRsDumpFixedIo (
382    ACPI_RESOURCE_DATA      *Data)
383{
384    ACPI_RESOURCE_FIXED_IO  *FixedIoData = (ACPI_RESOURCE_FIXED_IO *) Data;
385
386
387    ACPI_FUNCTION_ENTRY ();
388
389
390    AcpiOsPrintf ("Fixed Io Resource\n");
391    AcpiOsPrintf ("    Range base address: %08X",
392                FixedIoData->BaseAddress);
393
394    AcpiOsPrintf ("    Range length: %08X",
395                FixedIoData->RangeLength);
396
397    return;
398}
399
400
401/*******************************************************************************
402 *
403 * FUNCTION:    AcpiRsDumpVendorSpecific
404 *
405 * PARAMETERS:  Data            - pointer to the resource structure to dump.
406 *
407 * RETURN:      None
408 *
409 * DESCRIPTION: Prints out the various members of the Data structure type.
410 *
411 ******************************************************************************/
412
413void
414AcpiRsDumpVendorSpecific (
415    ACPI_RESOURCE_DATA      *Data)
416{
417    ACPI_RESOURCE_VENDOR    *VendorData = (ACPI_RESOURCE_VENDOR *) Data;
418    UINT16                  Index = 0;
419
420
421    ACPI_FUNCTION_ENTRY ();
422
423
424    AcpiOsPrintf ("Vendor Specific Resource\n");
425
426    AcpiOsPrintf ("    Length: %08X\n", VendorData->Length);
427
428    for (Index = 0; Index < VendorData->Length; Index++)
429    {
430        AcpiOsPrintf ("    Byte %X: %08X\n",
431                    Index, VendorData->Reserved[Index]);
432    }
433
434    return;
435}
436
437
438/*******************************************************************************
439 *
440 * FUNCTION:    AcpiRsDumpMemory24
441 *
442 * PARAMETERS:  Data            - pointer to the resource structure to dump.
443 *
444 * RETURN:      None
445 *
446 * DESCRIPTION: Prints out the various members of the Data structure type.
447 *
448 ******************************************************************************/
449
450void
451AcpiRsDumpMemory24 (
452    ACPI_RESOURCE_DATA      *Data)
453{
454    ACPI_RESOURCE_MEM24     *Memory24Data = (ACPI_RESOURCE_MEM24 *) Data;
455
456
457    ACPI_FUNCTION_ENTRY ();
458
459
460    AcpiOsPrintf ("24-Bit Memory Range Resource\n");
461
462    AcpiOsPrintf ("    Read%s\n",
463                ACPI_READ_WRITE_MEMORY ==
464                Memory24Data->ReadWriteAttribute ?
465                "/Write" : " only");
466
467    AcpiOsPrintf ("    Range minimum base: %08X\n",
468                Memory24Data->MinBaseAddress);
469
470    AcpiOsPrintf ("    Range maximum base: %08X\n",
471                Memory24Data->MaxBaseAddress);
472
473    AcpiOsPrintf ("    Alignment: %08X\n",
474                Memory24Data->Alignment);
475
476    AcpiOsPrintf ("    Range length: %08X\n",
477                Memory24Data->RangeLength);
478
479    return;
480}
481
482
483/*******************************************************************************
484 *
485 * FUNCTION:    AcpiRsDumpMemory32
486 *
487 * PARAMETERS:  Data            - pointer to the resource structure to dump.
488 *
489 * RETURN:      None
490 *
491 * DESCRIPTION: Prints out the various members of the Data structure type.
492 *
493 ******************************************************************************/
494
495void
496AcpiRsDumpMemory32 (
497    ACPI_RESOURCE_DATA      *Data)
498{
499    ACPI_RESOURCE_MEM32     *Memory32Data = (ACPI_RESOURCE_MEM32 *) Data;
500
501
502    ACPI_FUNCTION_ENTRY ();
503
504
505    AcpiOsPrintf ("32-Bit Memory Range Resource\n");
506
507    AcpiOsPrintf ("    Read%s\n",
508                ACPI_READ_WRITE_MEMORY ==
509                Memory32Data->ReadWriteAttribute ?
510                "/Write" : " only");
511
512    AcpiOsPrintf ("    Range minimum base: %08X\n",
513                Memory32Data->MinBaseAddress);
514
515    AcpiOsPrintf ("    Range maximum base: %08X\n",
516                Memory32Data->MaxBaseAddress);
517
518    AcpiOsPrintf ("    Alignment: %08X\n",
519                Memory32Data->Alignment);
520
521    AcpiOsPrintf ("    Range length: %08X\n",
522                Memory32Data->RangeLength);
523
524    return;
525}
526
527
528/*******************************************************************************
529 *
530 * FUNCTION:    AcpiRsDumpFixedMemory32
531 *
532 * PARAMETERS:  Data            - pointer to the resource structure to dump.
533 *
534 * RETURN:
535 *
536 * DESCRIPTION: Prints out the various members of the Data structure type.
537 *
538 ******************************************************************************/
539
540void
541AcpiRsDumpFixedMemory32 (
542    ACPI_RESOURCE_DATA          *Data)
543{
544    ACPI_RESOURCE_FIXED_MEM32   *FixedMemory32Data = (ACPI_RESOURCE_FIXED_MEM32 *) Data;
545
546
547    ACPI_FUNCTION_ENTRY ();
548
549
550    AcpiOsPrintf ("32-Bit Fixed Location Memory Range Resource\n");
551
552    AcpiOsPrintf ("    Read%s\n",
553                ACPI_READ_WRITE_MEMORY ==
554                FixedMemory32Data->ReadWriteAttribute ?
555                "/Write" : " Only");
556
557    AcpiOsPrintf ("    Range base address: %08X\n",
558                FixedMemory32Data->RangeBaseAddress);
559
560    AcpiOsPrintf ("    Range length: %08X\n",
561                FixedMemory32Data->RangeLength);
562
563    return;
564}
565
566
567/*******************************************************************************
568 *
569 * FUNCTION:    AcpiRsDumpAddress16
570 *
571 * PARAMETERS:  Data            - pointer to the resource structure to dump.
572 *
573 * RETURN:      None
574 *
575 * DESCRIPTION: Prints out the various members of the Data structure type.
576 *
577 ******************************************************************************/
578
579void
580AcpiRsDumpAddress16 (
581    ACPI_RESOURCE_DATA      *Data)
582{
583    ACPI_RESOURCE_ADDRESS16 *Address16Data = (ACPI_RESOURCE_ADDRESS16 *) Data;
584
585
586    ACPI_FUNCTION_ENTRY ();
587
588
589    AcpiOsPrintf ("16-Bit Address Space Resource\n");
590    AcpiOsPrintf ("    Resource Type: ");
591
592    switch (Address16Data->ResourceType)
593    {
594    case ACPI_MEMORY_RANGE:
595
596        AcpiOsPrintf ("Memory Range\n");
597
598        switch (Address16Data->Attribute.Memory.CacheAttribute)
599        {
600        case ACPI_NON_CACHEABLE_MEMORY:
601            AcpiOsPrintf ("    Type Specific: "
602                            "Noncacheable memory\n");
603            break;
604
605        case ACPI_CACHABLE_MEMORY:
606            AcpiOsPrintf ("    Type Specific: "
607                            "Cacheable memory\n");
608            break;
609
610        case ACPI_WRITE_COMBINING_MEMORY:
611            AcpiOsPrintf ("    Type Specific: "
612                            "Write-combining memory\n");
613            break;
614
615        case ACPI_PREFETCHABLE_MEMORY:
616            AcpiOsPrintf ("    Type Specific: "
617                            "Prefetchable memory\n");
618            break;
619
620        default:
621            AcpiOsPrintf ("    Type Specific: "
622                            "Invalid cache attribute\n");
623            break;
624        }
625
626        AcpiOsPrintf ("    Type Specific: Read%s\n",
627            ACPI_READ_WRITE_MEMORY ==
628            Address16Data->Attribute.Memory.ReadWriteAttribute ?
629            "/Write" : " Only");
630        break;
631
632    case ACPI_IO_RANGE:
633
634        AcpiOsPrintf ("I/O Range\n");
635
636        switch (Address16Data->Attribute.Io.RangeAttribute)
637        {
638        case ACPI_NON_ISA_ONLY_RANGES:
639            AcpiOsPrintf ("    Type Specific: "
640                            "Non-ISA Io Addresses\n");
641            break;
642
643        case ACPI_ISA_ONLY_RANGES:
644            AcpiOsPrintf ("    Type Specific: "
645                            "ISA Io Addresses\n");
646            break;
647
648        case ACPI_ENTIRE_RANGE:
649            AcpiOsPrintf ("    Type Specific: "
650                            "ISA and non-ISA Io Addresses\n");
651            break;
652
653        default:
654            AcpiOsPrintf ("    Type Specific: "
655                            "Invalid range attribute\n");
656            break;
657        }
658        break;
659
660    case ACPI_BUS_NUMBER_RANGE:
661
662        AcpiOsPrintf ("Bus Number Range\n");
663        break;
664
665    default:
666
667        AcpiOsPrintf ("Invalid resource type. Exiting.\n");
668        return;
669    }
670
671    AcpiOsPrintf ("    Resource %s\n",
672            ACPI_CONSUMER == Address16Data->ProducerConsumer ?
673            "Consumer" : "Producer");
674
675    AcpiOsPrintf ("    %s decode\n",
676                ACPI_SUB_DECODE == Address16Data->Decode ?
677                "Subtractive" : "Positive");
678
679    AcpiOsPrintf ("    Min address is %s fixed\n",
680                ACPI_ADDRESS_FIXED == Address16Data->MinAddressFixed ?
681                "" : "not");
682
683    AcpiOsPrintf ("    Max address is %s fixed\n",
684                ACPI_ADDRESS_FIXED == Address16Data->MaxAddressFixed ?
685                "" : "not");
686
687    AcpiOsPrintf ("    Granularity: %08X\n",
688                Address16Data->Granularity);
689
690    AcpiOsPrintf ("    Address range min: %08X\n",
691                Address16Data->MinAddressRange);
692
693    AcpiOsPrintf ("    Address range max: %08X\n",
694                Address16Data->MaxAddressRange);
695
696    AcpiOsPrintf ("    Address translation offset: %08X\n",
697                Address16Data->AddressTranslationOffset);
698
699    AcpiOsPrintf ("    Address Length: %08X\n",
700                Address16Data->AddressLength);
701
702    if (0xFF != Address16Data->ResourceSource.Index)
703    {
704        AcpiOsPrintf ("    Resource Source Index: %X\n",
705                    Address16Data->ResourceSource.Index);
706        AcpiOsPrintf ("    Resource Source: %s\n",
707                    Address16Data->ResourceSource.StringPtr);
708    }
709
710    return;
711}
712
713
714/*******************************************************************************
715 *
716 * FUNCTION:    AcpiRsDumpAddress32
717 *
718 * PARAMETERS:  Data            - pointer to the resource structure to dump.
719 *
720 * RETURN:      None
721 *
722 * DESCRIPTION: Prints out the various members of the Data structure type.
723 *
724 ******************************************************************************/
725
726void
727AcpiRsDumpAddress32 (
728    ACPI_RESOURCE_DATA      *Data)
729{
730    ACPI_RESOURCE_ADDRESS32 *Address32Data = (ACPI_RESOURCE_ADDRESS32 *) Data;
731
732
733    ACPI_FUNCTION_ENTRY ();
734
735
736    AcpiOsPrintf ("32-Bit Address Space Resource\n");
737
738    switch (Address32Data->ResourceType)
739    {
740    case ACPI_MEMORY_RANGE:
741
742        AcpiOsPrintf ("    Resource Type: Memory Range\n");
743
744        switch (Address32Data->Attribute.Memory.CacheAttribute)
745        {
746        case ACPI_NON_CACHEABLE_MEMORY:
747            AcpiOsPrintf ("    Type Specific: "
748                            "Noncacheable memory\n");
749            break;
750
751        case ACPI_CACHABLE_MEMORY:
752            AcpiOsPrintf ("    Type Specific: "
753                            "Cacheable memory\n");
754            break;
755
756        case ACPI_WRITE_COMBINING_MEMORY:
757            AcpiOsPrintf ("    Type Specific: "
758                            "Write-combining memory\n");
759            break;
760
761        case ACPI_PREFETCHABLE_MEMORY:
762            AcpiOsPrintf ("    Type Specific: "
763                            "Prefetchable memory\n");
764            break;
765
766        default:
767            AcpiOsPrintf ("    Type Specific: "
768                            "Invalid cache attribute\n");
769            break;
770        }
771
772        AcpiOsPrintf ("    Type Specific: Read%s\n",
773            ACPI_READ_WRITE_MEMORY ==
774            Address32Data->Attribute.Memory.ReadWriteAttribute ?
775            "/Write" : " Only");
776        break;
777
778    case ACPI_IO_RANGE:
779
780        AcpiOsPrintf ("    Resource Type: Io Range\n");
781
782        switch (Address32Data->Attribute.Io.RangeAttribute)
783            {
784            case ACPI_NON_ISA_ONLY_RANGES:
785                AcpiOsPrintf ("    Type Specific: "
786                                "Non-ISA Io Addresses\n");
787                break;
788
789            case ACPI_ISA_ONLY_RANGES:
790                AcpiOsPrintf ("    Type Specific: "
791                                "ISA Io Addresses\n");
792                break;
793
794            case ACPI_ENTIRE_RANGE:
795                AcpiOsPrintf ("    Type Specific: "
796                                "ISA and non-ISA Io Addresses\n");
797                break;
798
799            default:
800                AcpiOsPrintf ("    Type Specific: "
801                                "Invalid Range attribute");
802                break;
803            }
804        break;
805
806    case ACPI_BUS_NUMBER_RANGE:
807
808        AcpiOsPrintf ("    Resource Type: Bus Number Range\n");
809        break;
810
811    default:
812
813        AcpiOsPrintf ("    Invalid Resource Type..exiting.\n");
814        return;
815    }
816
817    AcpiOsPrintf ("    Resource %s\n",
818                ACPI_CONSUMER == Address32Data->ProducerConsumer ?
819                "Consumer" : "Producer");
820
821    AcpiOsPrintf ("    %s decode\n",
822                ACPI_SUB_DECODE == Address32Data->Decode ?
823                "Subtractive" : "Positive");
824
825    AcpiOsPrintf ("    Min address is %s fixed\n",
826                ACPI_ADDRESS_FIXED == Address32Data->MinAddressFixed ?
827                "" : "not ");
828
829    AcpiOsPrintf ("    Max address is %s fixed\n",
830                ACPI_ADDRESS_FIXED == Address32Data->MaxAddressFixed ?
831                "" : "not ");
832
833    AcpiOsPrintf ("    Granularity: %08X\n",
834                Address32Data->Granularity);
835
836    AcpiOsPrintf ("    Address range min: %08X\n",
837                Address32Data->MinAddressRange);
838
839    AcpiOsPrintf ("    Address range max: %08X\n",
840                Address32Data->MaxAddressRange);
841
842    AcpiOsPrintf ("    Address translation offset: %08X\n",
843                Address32Data->AddressTranslationOffset);
844
845    AcpiOsPrintf ("    Address Length: %08X\n",
846                Address32Data->AddressLength);
847
848    if(0xFF != Address32Data->ResourceSource.Index)
849    {
850        AcpiOsPrintf ("    Resource Source Index: %X\n",
851                    Address32Data->ResourceSource.Index);
852        AcpiOsPrintf ("    Resource Source: %s\n",
853                    Address32Data->ResourceSource.StringPtr);
854    }
855
856    return;
857}
858
859
860/*******************************************************************************
861 *
862 * FUNCTION:    AcpiRsDumpAddress64
863 *
864 * PARAMETERS:  Data            - pointer to the resource structure to dump.
865 *
866 * RETURN:      None
867 *
868 * DESCRIPTION: Prints out the various members of the Data structure type.
869 *
870 ******************************************************************************/
871
872void
873AcpiRsDumpAddress64 (
874    ACPI_RESOURCE_DATA      *Data)
875{
876    ACPI_RESOURCE_ADDRESS64 *Address64Data = (ACPI_RESOURCE_ADDRESS64 *) Data;
877
878
879    ACPI_FUNCTION_ENTRY ();
880
881
882    AcpiOsPrintf ("64-Bit Address Space Resource\n");
883
884    switch (Address64Data->ResourceType)
885    {
886    case ACPI_MEMORY_RANGE:
887
888        AcpiOsPrintf ("    Resource Type: Memory Range\n");
889
890        switch (Address64Data->Attribute.Memory.CacheAttribute)
891        {
892        case ACPI_NON_CACHEABLE_MEMORY:
893            AcpiOsPrintf ("    Type Specific: "
894                            "Noncacheable memory\n");
895            break;
896
897        case ACPI_CACHABLE_MEMORY:
898            AcpiOsPrintf ("    Type Specific: "
899                            "Cacheable memory\n");
900            break;
901
902        case ACPI_WRITE_COMBINING_MEMORY:
903            AcpiOsPrintf ("    Type Specific: "
904                            "Write-combining memory\n");
905            break;
906
907        case ACPI_PREFETCHABLE_MEMORY:
908            AcpiOsPrintf ("    Type Specific: "
909                            "Prefetchable memory\n");
910            break;
911
912        default:
913            AcpiOsPrintf ("    Type Specific: "
914                            "Invalid cache attribute\n");
915            break;
916        }
917
918        AcpiOsPrintf ("    Type Specific: Read%s\n",
919            ACPI_READ_WRITE_MEMORY ==
920            Address64Data->Attribute.Memory.ReadWriteAttribute ?
921            "/Write" : " Only");
922        break;
923
924    case ACPI_IO_RANGE:
925
926        AcpiOsPrintf ("    Resource Type: Io Range\n");
927
928        switch (Address64Data->Attribute.Io.RangeAttribute)
929            {
930            case ACPI_NON_ISA_ONLY_RANGES:
931                AcpiOsPrintf ("    Type Specific: "
932                                "Non-ISA Io Addresses\n");
933                break;
934
935            case ACPI_ISA_ONLY_RANGES:
936                AcpiOsPrintf ("    Type Specific: "
937                                "ISA Io Addresses\n");
938                break;
939
940            case ACPI_ENTIRE_RANGE:
941                AcpiOsPrintf ("    Type Specific: "
942                                "ISA and non-ISA Io Addresses\n");
943                break;
944
945            default:
946                AcpiOsPrintf ("    Type Specific: "
947                                "Invalid Range attribute");
948                break;
949            }
950        break;
951
952    case ACPI_BUS_NUMBER_RANGE:
953
954        AcpiOsPrintf ("    Resource Type: Bus Number Range\n");
955        break;
956
957    default:
958
959        AcpiOsPrintf ("    Invalid Resource Type..exiting.\n");
960        return;
961    }
962
963    AcpiOsPrintf ("    Resource %s\n",
964                ACPI_CONSUMER == Address64Data->ProducerConsumer ?
965                "Consumer" : "Producer");
966
967    AcpiOsPrintf ("    %s decode\n",
968                ACPI_SUB_DECODE == Address64Data->Decode ?
969                "Subtractive" : "Positive");
970
971    AcpiOsPrintf ("    Min address is %s fixed\n",
972                ACPI_ADDRESS_FIXED == Address64Data->MinAddressFixed ?
973                "" : "not ");
974
975    AcpiOsPrintf ("    Max address is %s fixed\n",
976                ACPI_ADDRESS_FIXED == Address64Data->MaxAddressFixed ?
977                "" : "not ");
978
979    AcpiOsPrintf ("    Granularity: %16X\n",
980                Address64Data->Granularity);
981
982    AcpiOsPrintf ("    Address range min: %16X\n",
983                Address64Data->MinAddressRange);
984
985    AcpiOsPrintf ("    Address range max: %16X\n",
986                Address64Data->MaxAddressRange);
987
988    AcpiOsPrintf ("    Address translation offset: %16X\n",
989                Address64Data->AddressTranslationOffset);
990
991    AcpiOsPrintf ("    Address Length: %16X\n",
992                Address64Data->AddressLength);
993
994    if(0xFF != Address64Data->ResourceSource.Index)
995    {
996        AcpiOsPrintf ("    Resource Source Index: %X\n",
997                    Address64Data->ResourceSource.Index);
998        AcpiOsPrintf ("    Resource Source: %s\n",
999                    Address64Data->ResourceSource.StringPtr);
1000    }
1001
1002    return;
1003}
1004
1005
1006/*******************************************************************************
1007 *
1008 * FUNCTION:    AcpiRsDumpExtendedIrq
1009 *
1010 * PARAMETERS:  Data            - pointer to the resource structure to dump.
1011 *
1012 * RETURN:      None
1013 *
1014 * DESCRIPTION: Prints out the various members of the Data structure type.
1015 *
1016 ******************************************************************************/
1017
1018void
1019AcpiRsDumpExtendedIrq (
1020    ACPI_RESOURCE_DATA      *Data)
1021{
1022    ACPI_RESOURCE_EXT_IRQ   *ExtIrqData = (ACPI_RESOURCE_EXT_IRQ *) Data;
1023    UINT8                   Index = 0;
1024
1025
1026    ACPI_FUNCTION_ENTRY ();
1027
1028
1029    AcpiOsPrintf ("Extended IRQ Resource\n");
1030
1031    AcpiOsPrintf ("    Resource %s\n",
1032                ACPI_CONSUMER == ExtIrqData->ProducerConsumer ?
1033                "Consumer" : "Producer");
1034
1035    AcpiOsPrintf ("    %s\n",
1036                ACPI_LEVEL_SENSITIVE == ExtIrqData->EdgeLevel ?
1037                "Level" : "Edge");
1038
1039    AcpiOsPrintf ("    Active %s\n",
1040                ACPI_ACTIVE_LOW == ExtIrqData->ActiveHighLow ?
1041                "low" : "high");
1042
1043    AcpiOsPrintf ("    %s\n",
1044                ACPI_SHARED == ExtIrqData->SharedExclusive ?
1045                "Shared" : "Exclusive");
1046
1047    AcpiOsPrintf ("    Interrupts : %X ( ",
1048                ExtIrqData->NumberOfInterrupts);
1049
1050    for (Index = 0; Index < ExtIrqData->NumberOfInterrupts; Index++)
1051    {
1052        AcpiOsPrintf ("%X ", ExtIrqData->Interrupts[Index]);
1053    }
1054
1055    AcpiOsPrintf (")\n");
1056
1057    if(0xFF != ExtIrqData->ResourceSource.Index)
1058    {
1059        AcpiOsPrintf ("    Resource Source Index: %X",
1060                    ExtIrqData->ResourceSource.Index);
1061        AcpiOsPrintf ("    Resource Source: %s",
1062                    ExtIrqData->ResourceSource.StringPtr);
1063    }
1064
1065    return;
1066}
1067
1068
1069/*******************************************************************************
1070 *
1071 * FUNCTION:    AcpiRsDumpResourceList
1072 *
1073 * PARAMETERS:  Data            - pointer to the resource structure to dump.
1074 *
1075 * RETURN:      None
1076 *
1077 * DESCRIPTION: Dispatches the structure to the correct dump routine.
1078 *
1079 ******************************************************************************/
1080
1081void
1082AcpiRsDumpResourceList (
1083    ACPI_RESOURCE       *Resource)
1084{
1085    UINT8               Count = 0;
1086    BOOLEAN             Done = FALSE;
1087
1088
1089    ACPI_FUNCTION_ENTRY ();
1090
1091
1092    if (AcpiDbgLevel & ACPI_LV_RESOURCES && _COMPONENT & AcpiDbgLayer)
1093    {
1094        while (!Done)
1095        {
1096            AcpiOsPrintf ("Resource structure %X.\n", Count++);
1097
1098            switch (Resource->Id)
1099            {
1100            case ACPI_RSTYPE_IRQ:
1101                AcpiRsDumpIrq (&Resource->Data);
1102                break;
1103
1104            case ACPI_RSTYPE_DMA:
1105                AcpiRsDumpDma (&Resource->Data);
1106                break;
1107
1108            case ACPI_RSTYPE_START_DPF:
1109                AcpiRsDumpStartDependFns (&Resource->Data);
1110                break;
1111
1112            case ACPI_RSTYPE_END_DPF:
1113                AcpiOsPrintf ("EndDependentFunctions Resource\n");
1114                /* AcpiRsDumpEndDependentFunctions (Resource->Data);*/
1115                break;
1116
1117            case ACPI_RSTYPE_IO:
1118                AcpiRsDumpIo (&Resource->Data);
1119                break;
1120
1121            case ACPI_RSTYPE_FIXED_IO:
1122                AcpiRsDumpFixedIo (&Resource->Data);
1123                break;
1124
1125            case ACPI_RSTYPE_VENDOR:
1126                AcpiRsDumpVendorSpecific (&Resource->Data);
1127                break;
1128
1129            case ACPI_RSTYPE_END_TAG:
1130                /*RsDumpEndTag (Resource->Data);*/
1131                AcpiOsPrintf ("EndTag Resource\n");
1132                Done = TRUE;
1133                break;
1134
1135            case ACPI_RSTYPE_MEM24:
1136                AcpiRsDumpMemory24 (&Resource->Data);
1137                break;
1138
1139            case ACPI_RSTYPE_MEM32:
1140                AcpiRsDumpMemory32 (&Resource->Data);
1141                break;
1142
1143            case ACPI_RSTYPE_FIXED_MEM32:
1144                AcpiRsDumpFixedMemory32 (&Resource->Data);
1145                break;
1146
1147            case ACPI_RSTYPE_ADDRESS16:
1148                AcpiRsDumpAddress16 (&Resource->Data);
1149                break;
1150
1151            case ACPI_RSTYPE_ADDRESS32:
1152                AcpiRsDumpAddress32 (&Resource->Data);
1153                break;
1154
1155            case ACPI_RSTYPE_ADDRESS64:
1156                AcpiRsDumpAddress64 (&Resource->Data);
1157                break;
1158
1159            case ACPI_RSTYPE_EXT_IRQ:
1160                AcpiRsDumpExtendedIrq (&Resource->Data);
1161                break;
1162
1163            default:
1164                AcpiOsPrintf ("Invalid resource type\n");
1165                break;
1166
1167            }
1168
1169            Resource = ACPI_PTR_ADD (ACPI_RESOURCE, Resource, Resource->Length);
1170        }
1171    }
1172
1173    return;
1174}
1175
1176/*******************************************************************************
1177 *
1178 * FUNCTION:    AcpiRsDumpIrqList
1179 *
1180 * PARAMETERS:  Data            - pointer to the routing table to dump.
1181 *
1182 * RETURN:      None
1183 *
1184 * DESCRIPTION: Dispatches the structures to the correct dump routine.
1185 *
1186 ******************************************************************************/
1187
1188void
1189AcpiRsDumpIrqList (
1190    UINT8                   *RouteTable)
1191{
1192    UINT8                   *Buffer = RouteTable;
1193    UINT8                   Count = 0;
1194    BOOLEAN                 Done = FALSE;
1195    ACPI_PCI_ROUTING_TABLE  *PrtElement;
1196
1197
1198    ACPI_FUNCTION_ENTRY ();
1199
1200
1201    if (AcpiDbgLevel & ACPI_LV_RESOURCES && _COMPONENT & AcpiDbgLayer)
1202    {
1203        PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, Buffer);
1204
1205        while (!Done)
1206        {
1207            AcpiOsPrintf ("PCI IRQ Routing Table structure %X.\n", Count++);
1208
1209            AcpiOsPrintf ("    Address: %8.8X%8.8X\n",
1210                        ACPI_HIDWORD (PrtElement->Address),
1211                        ACPI_LODWORD (PrtElement->Address));
1212
1213            AcpiOsPrintf ("    Pin: %X\n", PrtElement->Pin);
1214
1215            AcpiOsPrintf ("    Source: %s\n", PrtElement->Source);
1216
1217            AcpiOsPrintf ("    SourceIndex: %X\n",
1218                        PrtElement->SourceIndex);
1219
1220            Buffer += PrtElement->Length;
1221
1222            PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, Buffer);
1223
1224            if(0 == PrtElement->Length)
1225            {
1226                Done = TRUE;
1227            }
1228        }
1229    }
1230
1231    return;
1232}
1233
1234#endif
1235
1236