rsdump.c revision 78986
1/*******************************************************************************
2 *
3 * Module Name: rsdump - Functions to display the resource structures.
4 *              $Revision: 20 $
5 *
6 ******************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.
13 * All rights reserved.
14 *
15 * 2. License
16 *
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
20 * property rights.
21 *
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
28 *
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;
37 *
38 * The above copyright and patent license is granted only if the following
39 * conditions are met:
40 *
41 * 3. Conditions
42 *
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.
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        MODULE_NAME         ("rsdump")
125
126
127/*******************************************************************************
128 *
129 * FUNCTION:    AcpiRsDumpIrq
130 *
131 * PARAMETERS:  Data            - pointer to the resource structure to dump.
132 *
133 * RETURN:      None
134 *
135 * DESCRIPTION: Prints out the various members of the Data structure type.
136 *
137 ******************************************************************************/
138
139void
140AcpiRsDumpIrq (
141    ACPI_RESOURCE_DATA      *Data)
142{
143    ACPI_RESOURCE_IRQ       *IrqData = (ACPI_RESOURCE_IRQ *) Data;
144    UINT8                   Index = 0;
145
146
147    AcpiOsPrintf ("IRQ Resource\n");
148
149    AcpiOsPrintf ("    %s Triggered\n",
150                LEVEL_SENSITIVE == IrqData->EdgeLevel ? "Level" : "Edge");
151
152    AcpiOsPrintf ("    Active %s\n",
153                ACTIVE_LOW == IrqData->ActiveHighLow ? "Low" : "High");
154
155    AcpiOsPrintf ("    %s\n",
156                SHARED == IrqData->SharedExclusive ? "Shared" : "Exclusive");
157
158    AcpiOsPrintf ("    %X Interrupts ( ", IrqData->NumberOfInterrupts);
159
160    for (Index = 0; Index < IrqData->NumberOfInterrupts; Index++)
161    {
162        AcpiOsPrintf ("%X ", IrqData->Interrupts[Index]);
163    }
164
165    AcpiOsPrintf (")\n");
166    return;
167}
168
169
170/*******************************************************************************
171 *
172 * FUNCTION:    AcpiRsDumpDma
173 *
174 * PARAMETERS:  Data            - pointer to the resource structure to dump.
175 *
176 * RETURN:      None
177 *
178 * DESCRIPTION: Prints out the various members of the Data structure type.
179 *
180 ******************************************************************************/
181
182void
183AcpiRsDumpDma (
184    ACPI_RESOURCE_DATA      *Data)
185{
186    ACPI_RESOURCE_DMA       *DmaData = (ACPI_RESOURCE_DMA *) Data;
187    UINT8                   Index = 0;
188
189
190    AcpiOsPrintf ("DMA Resource\n");
191
192    switch (DmaData->Type)
193    {
194    case COMPATIBILITY:
195        AcpiOsPrintf ("    Compatibility mode\n");
196        break;
197
198    case TYPE_A:
199        AcpiOsPrintf ("    Type A\n");
200        break;
201
202    case TYPE_B:
203        AcpiOsPrintf ("    Type B\n");
204        break;
205
206    case TYPE_F:
207        AcpiOsPrintf ("    Type F\n");
208        break;
209
210    default:
211        AcpiOsPrintf ("    Invalid DMA type\n");
212        break;
213    }
214
215    AcpiOsPrintf ("    %sBus Master\n",
216                BUS_MASTER == DmaData->BusMaster ? "" : "Not a ");
217
218
219    switch (DmaData->Transfer)
220    {
221    case TRANSFER_8:
222        AcpiOsPrintf ("    8-bit only transfer\n");
223        break;
224
225    case TRANSFER_8_16:
226        AcpiOsPrintf ("    8 and 16-bit transfer\n");
227        break;
228
229    case TRANSFER_16:
230        AcpiOsPrintf ("    16 bit only transfer\n");
231        break;
232
233    default:
234        AcpiOsPrintf ("    Invalid transfer preference\n");
235        break;
236    }
237
238    AcpiOsPrintf ("    Number of Channels: %X ( ", DmaData->NumberOfChannels);
239
240    for (Index = 0; Index < DmaData->NumberOfChannels; Index++)
241    {
242        AcpiOsPrintf ("%X ", DmaData->Channels[Index]);
243    }
244
245    AcpiOsPrintf (")\n");
246    return;
247}
248
249
250/*******************************************************************************
251 *
252 * FUNCTION:    AcpiRsDumpStartDependentFunctions
253 *
254 * PARAMETERS:  Data            - pointer to the resource structure to dump.
255 *
256 * RETURN:      None
257 *
258 * DESCRIPTION: Prints out the various members of the Data structure type.
259 *
260 ******************************************************************************/
261
262void
263AcpiRsDumpStartDependentFunctions (
264    ACPI_RESOURCE_DATA          *Data)
265{
266    ACPI_RESOURCE_START_DPF     *SdfData = (ACPI_RESOURCE_START_DPF *) Data;
267
268
269    AcpiOsPrintf ("Start Dependent Functions Resource\n");
270
271
272    switch (SdfData->CompatibilityPriority)
273    {
274    case GOOD_CONFIGURATION:
275        AcpiOsPrintf ("    Good configuration\n");
276        break;
277
278    case ACCEPTABLE_CONFIGURATION:
279        AcpiOsPrintf ("    Acceptable configuration\n");
280        break;
281
282    case SUB_OPTIMAL_CONFIGURATION:
283        AcpiOsPrintf ("    Sub-optimal configuration\n");
284        break;
285
286    default:
287        AcpiOsPrintf ("    Invalid compatibility priority\n");
288        break;
289    }
290
291    switch(SdfData->PerformanceRobustness)
292    {
293    case GOOD_CONFIGURATION:
294        AcpiOsPrintf ("    Good configuration\n");
295        break;
296
297    case ACCEPTABLE_CONFIGURATION:
298        AcpiOsPrintf ("    Acceptable configuration\n");
299        break;
300
301    case SUB_OPTIMAL_CONFIGURATION:
302        AcpiOsPrintf ("    Sub-optimal configuration\n");
303        break;
304
305    default:
306        AcpiOsPrintf ("    Invalid performance "
307                        "robustness preference\n");
308        break;
309    }
310
311    return;
312}
313
314
315/*******************************************************************************
316 *
317 * FUNCTION:    AcpiRsDumpIo
318 *
319 * PARAMETERS:  Data            - pointer to the resource structure to dump.
320 *
321 * RETURN:      None
322 *
323 * DESCRIPTION: Prints out the various members of the Data structure type.
324 *
325 ******************************************************************************/
326
327void
328AcpiRsDumpIo (
329    ACPI_RESOURCE_DATA      *Data)
330{
331    ACPI_RESOURCE_IO        *IoData = (ACPI_RESOURCE_IO *) Data;
332
333
334    AcpiOsPrintf ("Io Resource\n");
335
336    AcpiOsPrintf ("    %d bit decode\n",
337                DECODE_16 == IoData->IoDecode ? 16 : 10);
338
339    AcpiOsPrintf ("    Range minimum base: %08X\n",
340                IoData->MinBaseAddress);
341
342    AcpiOsPrintf ("    Range maximum base: %08X\n",
343                IoData->MaxBaseAddress);
344
345    AcpiOsPrintf ("    Alignment: %08X\n",
346                IoData->Alignment);
347
348    AcpiOsPrintf ("    Range Length: %08X\n",
349                IoData->RangeLength);
350
351    return;
352}
353
354
355/*******************************************************************************
356 *
357 * FUNCTION:    AcpiRsDumpFixedIo
358 *
359 * PARAMETERS:  Data            - pointer to the resource structure to dump.
360 *
361 * RETURN:      None
362 *
363 * DESCRIPTION: Prints out the various members of the Data structure type.
364 *
365 ******************************************************************************/
366
367void
368AcpiRsDumpFixedIo (
369    ACPI_RESOURCE_DATA      *Data)
370{
371    ACPI_RESOURCE_FIXED_IO  *FixedIoData = (ACPI_RESOURCE_FIXED_IO *) Data;
372
373
374    AcpiOsPrintf ("Fixed Io Resource\n");
375    AcpiOsPrintf ("    Range base address: %08X",
376                FixedIoData->BaseAddress);
377
378    AcpiOsPrintf ("    Range length: %08X",
379                FixedIoData->RangeLength);
380
381    return;
382}
383
384
385/*******************************************************************************
386 *
387 * FUNCTION:    AcpiRsDumpVendorSpecific
388 *
389 * PARAMETERS:  Data            - pointer to the resource structure to dump.
390 *
391 * RETURN:      None
392 *
393 * DESCRIPTION: Prints out the various members of the Data structure type.
394 *
395 ******************************************************************************/
396
397void
398AcpiRsDumpVendorSpecific (
399    ACPI_RESOURCE_DATA      *Data)
400{
401    ACPI_RESOURCE_VENDOR    *VendorData = (ACPI_RESOURCE_VENDOR *) Data;
402    UINT16                  Index = 0;
403
404
405    AcpiOsPrintf ("Vendor Specific Resource\n");
406
407    AcpiOsPrintf ("    Length: %08X\n", VendorData->Length);
408
409    for (Index = 0; Index < VendorData->Length; Index++)
410    {
411        AcpiOsPrintf ("    Byte %X: %08X\n",
412                    Index, VendorData->Reserved[Index]);
413    }
414
415    return;
416}
417
418
419/*******************************************************************************
420 *
421 * FUNCTION:    AcpiRsDumpMemory24
422 *
423 * PARAMETERS:  Data            - pointer to the resource structure to dump.
424 *
425 * RETURN:      None
426 *
427 * DESCRIPTION: Prints out the various members of the Data structure type.
428 *
429 ******************************************************************************/
430
431void
432AcpiRsDumpMemory24 (
433    ACPI_RESOURCE_DATA      *Data)
434{
435    ACPI_RESOURCE_MEM24     *Memory24Data = (ACPI_RESOURCE_MEM24 *) Data;
436
437
438    AcpiOsPrintf ("24-Bit Memory Range Resource\n");
439
440    AcpiOsPrintf ("    Read%s\n",
441                READ_WRITE_MEMORY ==
442                Memory24Data->ReadWriteAttribute ?
443                "/Write" : " only");
444
445    AcpiOsPrintf ("    Range minimum base: %08X\n",
446                Memory24Data->MinBaseAddress);
447
448    AcpiOsPrintf ("    Range maximum base: %08X\n",
449                Memory24Data->MaxBaseAddress);
450
451    AcpiOsPrintf ("    Alignment: %08X\n",
452                Memory24Data->Alignment);
453
454    AcpiOsPrintf ("    Range length: %08X\n",
455                Memory24Data->RangeLength);
456
457    return;
458}
459
460
461/*******************************************************************************
462 *
463 * FUNCTION:    AcpiRsDumpMemory32
464 *
465 * PARAMETERS:  Data            - pointer to the resource structure to dump.
466 *
467 * RETURN:      None
468 *
469 * DESCRIPTION: Prints out the various members of the Data structure type.
470 *
471 ******************************************************************************/
472
473void
474AcpiRsDumpMemory32 (
475    ACPI_RESOURCE_DATA      *Data)
476{
477    ACPI_RESOURCE_MEM32     *Memory32Data = (ACPI_RESOURCE_MEM32 *) Data;
478
479
480    AcpiOsPrintf ("32-Bit Memory Range Resource\n");
481
482    AcpiOsPrintf ("    Read%s\n",
483                READ_WRITE_MEMORY ==
484                Memory32Data->ReadWriteAttribute ?
485                "/Write" : " only");
486
487    AcpiOsPrintf ("    Range minimum base: %08X\n",
488                Memory32Data->MinBaseAddress);
489
490    AcpiOsPrintf ("    Range maximum base: %08X\n",
491                Memory32Data->MaxBaseAddress);
492
493    AcpiOsPrintf ("    Alignment: %08X\n",
494                Memory32Data->Alignment);
495
496    AcpiOsPrintf ("    Range length: %08X\n",
497                Memory32Data->RangeLength);
498
499    return;
500}
501
502
503/*******************************************************************************
504 *
505 * FUNCTION:    AcpiRsDumpFixedMemory32
506 *
507 * PARAMETERS:  Data            - pointer to the resource structure to dump.
508 *
509 * RETURN:
510 *
511 * DESCRIPTION: Prints out the various members of the Data structure type.
512 *
513 ******************************************************************************/
514
515void
516AcpiRsDumpFixedMemory32 (
517    ACPI_RESOURCE_DATA          *Data)
518{
519    ACPI_RESOURCE_FIXED_MEM32   *FixedMemory32Data = (ACPI_RESOURCE_FIXED_MEM32 *) Data;
520
521
522    AcpiOsPrintf ("32-Bit Fixed Location Memory Range Resource\n");
523
524    AcpiOsPrintf ("    Read%s\n",
525                READ_WRITE_MEMORY ==
526                FixedMemory32Data->ReadWriteAttribute ?
527                "/Write" : " Only");
528
529    AcpiOsPrintf ("    Range base address: %08X\n",
530                FixedMemory32Data->RangeBaseAddress);
531
532    AcpiOsPrintf ("    Range length: %08X\n",
533                FixedMemory32Data->RangeLength);
534
535    return;
536}
537
538
539/*******************************************************************************
540 *
541 * FUNCTION:    AcpiRsDumpAddress16
542 *
543 * PARAMETERS:  Data            - pointer to the resource structure to dump.
544 *
545 * RETURN:      None
546 *
547 * DESCRIPTION: Prints out the various members of the Data structure type.
548 *
549 ******************************************************************************/
550
551void
552AcpiRsDumpAddress16 (
553    ACPI_RESOURCE_DATA      *Data)
554{
555    ACPI_RESOURCE_ADDRESS16 *Address16Data = (ACPI_RESOURCE_ADDRESS16 *) Data;
556
557
558    AcpiOsPrintf ("16-Bit Address Space Resource\n");
559    AcpiOsPrintf ("    Resource Type: ");
560
561    switch (Address16Data->ResourceType)
562    {
563    case MEMORY_RANGE:
564
565        AcpiOsPrintf ("Memory Range\n");
566
567        switch (Address16Data->Attribute.Memory.CacheAttribute)
568        {
569        case NON_CACHEABLE_MEMORY:
570            AcpiOsPrintf ("    Type Specific: "
571                            "Noncacheable memory\n");
572            break;
573
574        case CACHABLE_MEMORY:
575            AcpiOsPrintf ("    Type Specific: "
576                            "Cacheable memory\n");
577            break;
578
579        case WRITE_COMBINING_MEMORY:
580            AcpiOsPrintf ("    Type Specific: "
581                            "Write-combining memory\n");
582            break;
583
584        case PREFETCHABLE_MEMORY:
585            AcpiOsPrintf ("    Type Specific: "
586                            "Prefetchable memory\n");
587            break;
588
589        default:
590            AcpiOsPrintf ("    Type Specific: "
591                            "Invalid cache attribute\n");
592            break;
593        }
594
595        AcpiOsPrintf ("    Type Specific: Read%s\n",
596            READ_WRITE_MEMORY ==
597            Address16Data->Attribute.Memory.ReadWriteAttribute ?
598            "/Write" : " Only");
599        break;
600
601    case IO_RANGE:
602
603        AcpiOsPrintf ("I/O Range\n");
604
605        switch (Address16Data->Attribute.Io.RangeAttribute)
606        {
607        case NON_ISA_ONLY_RANGES:
608            AcpiOsPrintf ("    Type Specific: "
609                            "Non-ISA Io Addresses\n");
610            break;
611
612        case ISA_ONLY_RANGES:
613            AcpiOsPrintf ("    Type Specific: "
614                            "ISA Io Addresses\n");
615            break;
616
617        case ENTIRE_RANGE:
618            AcpiOsPrintf ("    Type Specific: "
619                            "ISA and non-ISA Io Addresses\n");
620            break;
621
622        default:
623            AcpiOsPrintf ("    Type Specific: "
624                            "Invalid range attribute\n");
625            break;
626        }
627        break;
628
629    case BUS_NUMBER_RANGE:
630
631        AcpiOsPrintf ("Bus Number Range\n");
632        break;
633
634    default:
635
636        AcpiOsPrintf ("Invalid resource type. Exiting.\n");
637        return;
638    }
639
640    AcpiOsPrintf ("    Resource %s\n",
641            CONSUMER == Address16Data->ProducerConsumer ?
642            "Consumer" : "Producer");
643
644    AcpiOsPrintf ("    %s decode\n",
645                SUB_DECODE == Address16Data->Decode ?
646                "Subtractive" : "Positive");
647
648    AcpiOsPrintf ("    Min address is %s fixed\n",
649                ADDRESS_FIXED == Address16Data->MinAddressFixed ?
650                "" : "not");
651
652    AcpiOsPrintf ("    Max address is %s fixed\n",
653                ADDRESS_FIXED == Address16Data->MaxAddressFixed ?
654                "" : "not");
655
656    AcpiOsPrintf ("    Granularity: %08X\n",
657                Address16Data->Granularity);
658
659    AcpiOsPrintf ("    Address range min: %08X\n",
660                Address16Data->MinAddressRange);
661
662    AcpiOsPrintf ("    Address range max: %08X\n",
663                Address16Data->MaxAddressRange);
664
665    AcpiOsPrintf ("    Address translation offset: %08X\n",
666                Address16Data->AddressTranslationOffset);
667
668    AcpiOsPrintf ("    Address Length: %08X\n",
669                Address16Data->AddressLength);
670
671    if (0xFF != Address16Data->ResourceSource.Index)
672    {
673        AcpiOsPrintf ("    Resource Source Index: %X\n",
674                    Address16Data->ResourceSource.Index);
675        AcpiOsPrintf ("    Resource Source: %s\n",
676                    Address16Data->ResourceSource.StringPtr);
677    }
678
679    return;
680}
681
682
683/*******************************************************************************
684 *
685 * FUNCTION:    AcpiRsDumpAddress32
686 *
687 * PARAMETERS:  Data            - pointer to the resource structure to dump.
688 *
689 * RETURN:      None
690 *
691 * DESCRIPTION: Prints out the various members of the Data structure type.
692 *
693 ******************************************************************************/
694
695void
696AcpiRsDumpAddress32 (
697    ACPI_RESOURCE_DATA      *Data)
698{
699    ACPI_RESOURCE_ADDRESS32 *Address32Data = (ACPI_RESOURCE_ADDRESS32 *) Data;
700
701
702    AcpiOsPrintf ("32-Bit Address Space Resource\n");
703
704    switch (Address32Data->ResourceType)
705    {
706    case MEMORY_RANGE:
707
708        AcpiOsPrintf ("    Resource Type: Memory Range\n");
709
710        switch (Address32Data->Attribute.Memory.CacheAttribute)
711        {
712        case NON_CACHEABLE_MEMORY:
713            AcpiOsPrintf ("    Type Specific: "
714                            "Noncacheable memory\n");
715            break;
716
717        case CACHABLE_MEMORY:
718            AcpiOsPrintf ("    Type Specific: "
719                            "Cacheable memory\n");
720            break;
721
722        case WRITE_COMBINING_MEMORY:
723            AcpiOsPrintf ("    Type Specific: "
724                            "Write-combining memory\n");
725            break;
726
727        case PREFETCHABLE_MEMORY:
728            AcpiOsPrintf ("    Type Specific: "
729                            "Prefetchable memory\n");
730            break;
731
732        default:
733            AcpiOsPrintf ("    Type Specific: "
734                            "Invalid cache attribute\n");
735            break;
736        }
737
738        AcpiOsPrintf ("    Type Specific: Read%s\n",
739            READ_WRITE_MEMORY ==
740            Address32Data->Attribute.Memory.ReadWriteAttribute ?
741            "/Write" : " Only");
742        break;
743
744    case IO_RANGE:
745
746        AcpiOsPrintf ("    Resource Type: Io Range\n");
747
748        switch (Address32Data->Attribute.Io.RangeAttribute)
749            {
750            case NON_ISA_ONLY_RANGES:
751                AcpiOsPrintf ("    Type Specific: "
752                                "Non-ISA Io Addresses\n");
753                break;
754
755            case ISA_ONLY_RANGES:
756                AcpiOsPrintf ("    Type Specific: "
757                                "ISA Io Addresses\n");
758                break;
759
760            case ENTIRE_RANGE:
761                AcpiOsPrintf ("    Type Specific: "
762                                "ISA and non-ISA Io Addresses\n");
763                break;
764
765            default:
766                AcpiOsPrintf ("    Type Specific: "
767                                "Invalid Range attribute");
768                break;
769            }
770        break;
771
772    case BUS_NUMBER_RANGE:
773
774        AcpiOsPrintf ("    Resource Type: Bus Number Range\n");
775        break;
776
777    default:
778
779        AcpiOsPrintf ("    Invalid Resource Type..exiting.\n");
780        return;
781    }
782
783    AcpiOsPrintf ("    Resource %s\n",
784                CONSUMER == Address32Data->ProducerConsumer ?
785                "Consumer" : "Producer");
786
787    AcpiOsPrintf ("    %s decode\n",
788                SUB_DECODE == Address32Data->Decode ?
789                "Subtractive" : "Positive");
790
791    AcpiOsPrintf ("    Min address is %s fixed\n",
792                ADDRESS_FIXED == Address32Data->MinAddressFixed ?
793                "" : "not ");
794
795    AcpiOsPrintf ("    Max address is %s fixed\n",
796                ADDRESS_FIXED == Address32Data->MaxAddressFixed ?
797                "" : "not ");
798
799    AcpiOsPrintf ("    Granularity: %08X\n",
800                Address32Data->Granularity);
801
802    AcpiOsPrintf ("    Address range min: %08X\n",
803                Address32Data->MinAddressRange);
804
805    AcpiOsPrintf ("    Address range max: %08X\n",
806                Address32Data->MaxAddressRange);
807
808    AcpiOsPrintf ("    Address translation offset: %08X\n",
809                Address32Data->AddressTranslationOffset);
810
811    AcpiOsPrintf ("    Address Length: %08X\n",
812                Address32Data->AddressLength);
813
814    if(0xFF != Address32Data->ResourceSource.Index)
815    {
816        AcpiOsPrintf ("    Resource Source Index: %X\n",
817                    Address32Data->ResourceSource.Index);
818        AcpiOsPrintf ("    Resource Source: %s\n",
819                    Address32Data->ResourceSource.StringPtr);
820    }
821
822    return;
823}
824
825
826/*******************************************************************************
827 *
828 * FUNCTION:    AcpiRsDumpAddress64
829 *
830 * PARAMETERS:  Data            - pointer to the resource structure to dump.
831 *
832 * RETURN:      None
833 *
834 * DESCRIPTION: Prints out the various members of the Data structure type.
835 *
836 ******************************************************************************/
837
838void
839AcpiRsDumpAddress64 (
840    ACPI_RESOURCE_DATA      *Data)
841{
842    ACPI_RESOURCE_ADDRESS64 *Address64Data = (ACPI_RESOURCE_ADDRESS64 *) Data;
843
844
845    AcpiOsPrintf ("64-Bit Address Space Resource\n");
846
847    switch (Address64Data->ResourceType)
848    {
849    case MEMORY_RANGE:
850
851        AcpiOsPrintf ("    Resource Type: Memory Range\n");
852
853        switch (Address64Data->Attribute.Memory.CacheAttribute)
854        {
855        case NON_CACHEABLE_MEMORY:
856            AcpiOsPrintf ("    Type Specific: "
857                            "Noncacheable memory\n");
858            break;
859
860        case CACHABLE_MEMORY:
861            AcpiOsPrintf ("    Type Specific: "
862                            "Cacheable memory\n");
863            break;
864
865        case WRITE_COMBINING_MEMORY:
866            AcpiOsPrintf ("    Type Specific: "
867                            "Write-combining memory\n");
868            break;
869
870        case PREFETCHABLE_MEMORY:
871            AcpiOsPrintf ("    Type Specific: "
872                            "Prefetchable memory\n");
873            break;
874
875        default:
876            AcpiOsPrintf ("    Type Specific: "
877                            "Invalid cache attribute\n");
878            break;
879        }
880
881        AcpiOsPrintf ("    Type Specific: Read%s\n",
882            READ_WRITE_MEMORY ==
883            Address64Data->Attribute.Memory.ReadWriteAttribute ?
884            "/Write" : " Only");
885        break;
886
887    case IO_RANGE:
888
889        AcpiOsPrintf ("    Resource Type: Io Range\n");
890
891        switch (Address64Data->Attribute.Io.RangeAttribute)
892            {
893            case NON_ISA_ONLY_RANGES:
894                AcpiOsPrintf ("    Type Specific: "
895                                "Non-ISA Io Addresses\n");
896                break;
897
898            case ISA_ONLY_RANGES:
899                AcpiOsPrintf ("    Type Specific: "
900                                "ISA Io Addresses\n");
901                break;
902
903            case ENTIRE_RANGE:
904                AcpiOsPrintf ("    Type Specific: "
905                                "ISA and non-ISA Io Addresses\n");
906                break;
907
908            default:
909                AcpiOsPrintf ("    Type Specific: "
910                                "Invalid Range attribute");
911                break;
912            }
913        break;
914
915    case BUS_NUMBER_RANGE:
916
917        AcpiOsPrintf ("    Resource Type: Bus Number Range\n");
918        break;
919
920    default:
921
922        AcpiOsPrintf ("    Invalid Resource Type..exiting.\n");
923        return;
924    }
925
926    AcpiOsPrintf ("    Resource %s\n",
927                CONSUMER == Address64Data->ProducerConsumer ?
928                "Consumer" : "Producer");
929
930    AcpiOsPrintf ("    %s decode\n",
931                SUB_DECODE == Address64Data->Decode ?
932                "Subtractive" : "Positive");
933
934    AcpiOsPrintf ("    Min address is %s fixed\n",
935                ADDRESS_FIXED == Address64Data->MinAddressFixed ?
936                "" : "not ");
937
938    AcpiOsPrintf ("    Max address is %s fixed\n",
939                ADDRESS_FIXED == Address64Data->MaxAddressFixed ?
940                "" : "not ");
941
942    AcpiOsPrintf ("    Granularity: %16X\n",
943                Address64Data->Granularity);
944
945    AcpiOsPrintf ("    Address range min: %16X\n",
946                Address64Data->MinAddressRange);
947
948    AcpiOsPrintf ("    Address range max: %16X\n",
949                Address64Data->MaxAddressRange);
950
951    AcpiOsPrintf ("    Address translation offset: %16X\n",
952                Address64Data->AddressTranslationOffset);
953
954    AcpiOsPrintf ("    Address Length: %16X\n",
955                Address64Data->AddressLength);
956
957    if(0xFF != Address64Data->ResourceSource.Index)
958    {
959        AcpiOsPrintf ("    Resource Source Index: %X\n",
960                    Address64Data->ResourceSource.Index);
961        AcpiOsPrintf ("    Resource Source: %s\n",
962                    Address64Data->ResourceSource.StringPtr);
963    }
964
965    return;
966}
967
968
969/*******************************************************************************
970 *
971 * FUNCTION:    AcpiRsDumpExtendedIrq
972 *
973 * PARAMETERS:  Data            - pointer to the resource structure to dump.
974 *
975 * RETURN:      None
976 *
977 * DESCRIPTION: Prints out the various members of the Data structure type.
978 *
979 ******************************************************************************/
980
981void
982AcpiRsDumpExtendedIrq (
983    ACPI_RESOURCE_DATA      *Data)
984{
985    ACPI_RESOURCE_EXT_IRQ   *ExtIrqData = (ACPI_RESOURCE_EXT_IRQ *) Data;
986    UINT8                   Index = 0;
987
988
989    AcpiOsPrintf ("Extended IRQ Resource\n");
990
991    AcpiOsPrintf ("    Resource %s\n",
992                CONSUMER == ExtIrqData->ProducerConsumer ?
993                "Consumer" : "Producer");
994
995    AcpiOsPrintf ("    %s\n",
996                LEVEL_SENSITIVE == ExtIrqData->EdgeLevel ?
997                "Level" : "Edge");
998
999    AcpiOsPrintf ("    Active %s\n",
1000                ACTIVE_LOW == ExtIrqData->ActiveHighLow ?
1001                "low" : "high");
1002
1003    AcpiOsPrintf ("    %s\n",
1004                SHARED == ExtIrqData->SharedExclusive ?
1005                "Shared" : "Exclusive");
1006
1007    AcpiOsPrintf ("    Interrupts : %X ( ",
1008                ExtIrqData->NumberOfInterrupts);
1009
1010    for (Index = 0; Index < ExtIrqData->NumberOfInterrupts; Index++)
1011    {
1012        AcpiOsPrintf ("%X ", ExtIrqData->Interrupts[Index]);
1013    }
1014
1015    AcpiOsPrintf (")\n");
1016
1017    if(0xFF != ExtIrqData->ResourceSource.Index)
1018    {
1019        AcpiOsPrintf ("    Resource Source Index: %X",
1020                    ExtIrqData->ResourceSource.Index);
1021        AcpiOsPrintf ("    Resource Source: %s",
1022                    ExtIrqData->ResourceSource.StringPtr);
1023    }
1024
1025    return;
1026}
1027
1028
1029/*******************************************************************************
1030 *
1031 * FUNCTION:    AcpiRsDumpResourceList
1032 *
1033 * PARAMETERS:  Data            - pointer to the resource structure to dump.
1034 *
1035 * RETURN:      None
1036 *
1037 * DESCRIPTION: Dispatches the structure to the correct dump routine.
1038 *
1039 ******************************************************************************/
1040
1041void
1042AcpiRsDumpResourceList (
1043    ACPI_RESOURCE       *Resource)
1044{
1045    UINT8               Count = 0;
1046    BOOLEAN             Done = FALSE;
1047
1048
1049    if (AcpiDbgLevel & TRACE_RESOURCES && _COMPONENT & AcpiDbgLayer)
1050    {
1051        while (!Done)
1052        {
1053            AcpiOsPrintf ("Resource structure %x.\n", Count++);
1054
1055            switch (Resource->Id)
1056            {
1057            case ACPI_RSTYPE_IRQ:
1058                AcpiRsDumpIrq (&Resource->Data);
1059                break;
1060
1061            case ACPI_RSTYPE_DMA:
1062                AcpiRsDumpDma (&Resource->Data);
1063                break;
1064
1065            case ACPI_RSTYPE_START_DPF:
1066                AcpiRsDumpStartDependentFunctions (&Resource->Data);
1067                break;
1068
1069            case ACPI_RSTYPE_END_DPF:
1070                AcpiOsPrintf ("EndDependentFunctions Resource\n");
1071                /* AcpiRsDumpEndDependentFunctions (Resource->Data);*/
1072                break;
1073
1074            case ACPI_RSTYPE_IO:
1075                AcpiRsDumpIo (&Resource->Data);
1076                break;
1077
1078            case ACPI_RSTYPE_FIXED_IO:
1079                AcpiRsDumpFixedIo (&Resource->Data);
1080                break;
1081
1082            case ACPI_RSTYPE_VENDOR:
1083                AcpiRsDumpVendorSpecific (&Resource->Data);
1084                break;
1085
1086            case ACPI_RSTYPE_END_TAG:
1087                /*RsDumpEndTag (Resource->Data);*/
1088                AcpiOsPrintf ("EndTag Resource\n");
1089                Done = TRUE;
1090                break;
1091
1092            case ACPI_RSTYPE_MEM24:
1093                AcpiRsDumpMemory24 (&Resource->Data);
1094                break;
1095
1096            case ACPI_RSTYPE_MEM32:
1097                AcpiRsDumpMemory32 (&Resource->Data);
1098                break;
1099
1100            case ACPI_RSTYPE_FIXED_MEM32:
1101                AcpiRsDumpFixedMemory32 (&Resource->Data);
1102                break;
1103
1104            case ACPI_RSTYPE_ADDRESS16:
1105                AcpiRsDumpAddress16 (&Resource->Data);
1106                break;
1107
1108            case ACPI_RSTYPE_ADDRESS32:
1109                AcpiRsDumpAddress32 (&Resource->Data);
1110                break;
1111
1112            case ACPI_RSTYPE_ADDRESS64:
1113                AcpiRsDumpAddress64 (&Resource->Data);
1114                break;
1115
1116            case ACPI_RSTYPE_EXT_IRQ:
1117                AcpiRsDumpExtendedIrq (&Resource->Data);
1118                break;
1119
1120            default:
1121                AcpiOsPrintf ("Invalid resource type\n");
1122                break;
1123
1124            }
1125
1126            Resource = POINTER_ADD (ACPI_RESOURCE, Resource, Resource->Length);
1127        }
1128    }
1129
1130    return;
1131}
1132
1133/*******************************************************************************
1134 *
1135 * FUNCTION:    AcpiRsDumpIrqList
1136 *
1137 * PARAMETERS:  Data            - pointer to the routing table to dump.
1138 *
1139 * RETURN:      None
1140 *
1141 * DESCRIPTION: Dispatches the structures to the correct dump routine.
1142 *
1143 ******************************************************************************/
1144
1145void
1146AcpiRsDumpIrqList (
1147    UINT8               *RouteTable)
1148{
1149    UINT8               *Buffer = RouteTable;
1150    UINT8               Count = 0;
1151    BOOLEAN             Done = FALSE;
1152    PCI_ROUTING_TABLE   *PrtElement;
1153
1154
1155    if (AcpiDbgLevel & TRACE_RESOURCES && _COMPONENT & AcpiDbgLayer)
1156    {
1157        PrtElement = (PCI_ROUTING_TABLE *) Buffer;
1158
1159        while (!Done)
1160        {
1161            AcpiOsPrintf ("PCI IRQ Routing Table structure %X.\n", Count++);
1162
1163            AcpiOsPrintf ("    Address: %X\n",
1164                        PrtElement->Address);
1165
1166            AcpiOsPrintf ("    Pin: %X\n", PrtElement->Pin);
1167
1168            AcpiOsPrintf ("    Source: %s\n", PrtElement->Source);
1169
1170            AcpiOsPrintf ("    SourceIndex: %X\n",
1171                        PrtElement->SourceIndex);
1172
1173            Buffer += PrtElement->Length;
1174
1175            PrtElement = (PCI_ROUTING_TABLE *) Buffer;
1176
1177            if(0 == PrtElement->Length)
1178            {
1179                Done = TRUE;
1180            }
1181        }
1182    }
1183
1184    return;
1185}
1186
1187