Merge from vendor branch NTPD:
[dragonfly.git] / sys / contrib / dev / acpica-unix-20040527 / resources / rsdump.c
1 /*******************************************************************************
2  *
3  * Module Name: rsdump - Functions to display the resource structures.
4  *              $Revision: 38 $
5  *
6  ******************************************************************************/
7
8 /******************************************************************************
9  *
10  * 1. Copyright Notice
11  *
12  * Some or all of this work - Copyright (c) 1999 - 2004, 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         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
141 void
142 AcpiRsDumpIrq (
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
187 void
188 AcpiRsDumpDma (
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
270 void
271 AcpiRsDumpStartDependFns (
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
337 void
338 AcpiRsDumpIo (
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
380 void
381 AcpiRsDumpFixedIo (
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
413 void
414 AcpiRsDumpVendorSpecific (
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
450 void
451 AcpiRsDumpMemory24 (
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
495 void
496 AcpiRsDumpMemory32 (
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
540 void
541 AcpiRsDumpFixedMemory32 (
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
579 void
580 AcpiRsDumpAddress16 (
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
659         AcpiOsPrintf ("  Type Specific: %s Translation\n",
660             ACPI_SPARSE_TRANSLATION ==
661             Address16Data->Attribute.Io.TranslationAttribute ?
662             "Sparse" : "Dense");
663         break;
664
665     case ACPI_BUS_NUMBER_RANGE:
666
667         AcpiOsPrintf ("Bus Number Range\n");
668         break;
669
670     default:
671
672         AcpiOsPrintf ("Invalid resource type. Exiting.\n");
673         return;
674     }
675
676     AcpiOsPrintf ("    Resource %s\n",
677             ACPI_CONSUMER == Address16Data->ProducerConsumer ?
678             "Consumer" : "Producer");
679
680     AcpiOsPrintf ("    %s decode\n",
681                 ACPI_SUB_DECODE == Address16Data->Decode ?
682                 "Subtractive" : "Positive");
683
684     AcpiOsPrintf ("    Min address is %s fixed\n",
685                 ACPI_ADDRESS_FIXED == Address16Data->MinAddressFixed ?
686                 "" : "not");
687
688     AcpiOsPrintf ("    Max address is %s fixed\n",
689                 ACPI_ADDRESS_FIXED == Address16Data->MaxAddressFixed ?
690                 "" : "not");
691
692     AcpiOsPrintf ("    Granularity: %08X\n",
693                 Address16Data->Granularity);
694
695     AcpiOsPrintf ("    Address range min: %08X\n",
696                 Address16Data->MinAddressRange);
697
698     AcpiOsPrintf ("    Address range max: %08X\n",
699                 Address16Data->MaxAddressRange);
700
701     AcpiOsPrintf ("    Address translation offset: %08X\n",
702                 Address16Data->AddressTranslationOffset);
703
704     AcpiOsPrintf ("    Address Length: %08X\n",
705                 Address16Data->AddressLength);
706
707     if (0xFF != Address16Data->ResourceSource.Index)
708     {
709         AcpiOsPrintf ("    Resource Source Index: %X\n",
710                     Address16Data->ResourceSource.Index);
711         AcpiOsPrintf ("    Resource Source: %s\n",
712                     Address16Data->ResourceSource.StringPtr);
713     }
714
715     return;
716 }
717
718
719 /*******************************************************************************
720  *
721  * FUNCTION:    AcpiRsDumpAddress32
722  *
723  * PARAMETERS:  Data            - pointer to the resource structure to dump.
724  *
725  * RETURN:      None
726  *
727  * DESCRIPTION: Prints out the various members of the Data structure type.
728  *
729  ******************************************************************************/
730
731 void
732 AcpiRsDumpAddress32 (
733     ACPI_RESOURCE_DATA      *Data)
734 {
735     ACPI_RESOURCE_ADDRESS32 *Address32Data = (ACPI_RESOURCE_ADDRESS32 *) Data;
736
737
738     ACPI_FUNCTION_ENTRY ();
739
740
741     AcpiOsPrintf ("32-Bit Address Space Resource\n");
742
743     switch (Address32Data->ResourceType)
744     {
745     case ACPI_MEMORY_RANGE:
746
747         AcpiOsPrintf ("    Resource Type: Memory Range\n");
748
749         switch (Address32Data->Attribute.Memory.CacheAttribute)
750         {
751         case ACPI_NON_CACHEABLE_MEMORY:
752             AcpiOsPrintf ("    Type Specific: "
753                             "Noncacheable memory\n");
754             break;
755
756         case ACPI_CACHABLE_MEMORY:
757             AcpiOsPrintf ("    Type Specific: "
758                             "Cacheable memory\n");
759             break;
760
761         case ACPI_WRITE_COMBINING_MEMORY:
762             AcpiOsPrintf ("    Type Specific: "
763                             "Write-combining memory\n");
764             break;
765
766         case ACPI_PREFETCHABLE_MEMORY:
767             AcpiOsPrintf ("    Type Specific: "
768                             "Prefetchable memory\n");
769             break;
770
771         default:
772             AcpiOsPrintf ("    Type Specific: "
773                             "Invalid cache attribute\n");
774             break;
775         }
776
777         AcpiOsPrintf ("    Type Specific: Read%s\n",
778             ACPI_READ_WRITE_MEMORY ==
779             Address32Data->Attribute.Memory.ReadWriteAttribute ?
780             "/Write" : " Only");
781         break;
782
783     case ACPI_IO_RANGE:
784
785         AcpiOsPrintf ("    Resource Type: Io Range\n");
786
787         switch (Address32Data->Attribute.Io.RangeAttribute)
788         {
789         case ACPI_NON_ISA_ONLY_RANGES:
790             AcpiOsPrintf ("    Type Specific: "
791                             "Non-ISA Io Addresses\n");
792             break;
793
794         case ACPI_ISA_ONLY_RANGES:
795             AcpiOsPrintf ("    Type Specific: "
796                             "ISA Io Addresses\n");
797             break;
798
799         case ACPI_ENTIRE_RANGE:
800             AcpiOsPrintf ("    Type Specific: "
801                             "ISA and non-ISA Io Addresses\n");
802             break;
803
804         default:
805             AcpiOsPrintf ("    Type Specific: "
806                             "Invalid Range attribute");
807             break;
808         }
809
810         AcpiOsPrintf ("  Type Specific: %s Translation\n",
811             ACPI_SPARSE_TRANSLATION ==
812             Address32Data->Attribute.Io.TranslationAttribute ?
813             "Sparse" : "Dense");
814         break;
815
816     case ACPI_BUS_NUMBER_RANGE:
817
818         AcpiOsPrintf ("    Resource Type: Bus Number Range\n");
819         break;
820
821     default:
822
823         AcpiOsPrintf ("    Invalid Resource Type..exiting.\n");
824         return;
825     }
826
827     AcpiOsPrintf ("    Resource %s\n",
828                 ACPI_CONSUMER == Address32Data->ProducerConsumer ?
829                 "Consumer" : "Producer");
830
831     AcpiOsPrintf ("    %s decode\n",
832                 ACPI_SUB_DECODE == Address32Data->Decode ?
833                 "Subtractive" : "Positive");
834
835     AcpiOsPrintf ("    Min address is %s fixed\n",
836                 ACPI_ADDRESS_FIXED == Address32Data->MinAddressFixed ?
837                 "" : "not ");
838
839     AcpiOsPrintf ("    Max address is %s fixed\n",
840                 ACPI_ADDRESS_FIXED == Address32Data->MaxAddressFixed ?
841                 "" : "not ");
842
843     AcpiOsPrintf ("    Granularity: %08X\n",
844                 Address32Data->Granularity);
845
846     AcpiOsPrintf ("    Address range min: %08X\n",
847                 Address32Data->MinAddressRange);
848
849     AcpiOsPrintf ("    Address range max: %08X\n",
850                 Address32Data->MaxAddressRange);
851
852     AcpiOsPrintf ("    Address translation offset: %08X\n",
853                 Address32Data->AddressTranslationOffset);
854
855     AcpiOsPrintf ("    Address Length: %08X\n",
856                 Address32Data->AddressLength);
857
858     if(0xFF != Address32Data->ResourceSource.Index)
859     {
860         AcpiOsPrintf ("    Resource Source Index: %X\n",
861                     Address32Data->ResourceSource.Index);
862         AcpiOsPrintf ("    Resource Source: %s\n",
863                     Address32Data->ResourceSource.StringPtr);
864     }
865
866     return;
867 }
868
869
870 /*******************************************************************************
871  *
872  * FUNCTION:    AcpiRsDumpAddress64
873  *
874  * PARAMETERS:  Data            - pointer to the resource structure to dump.
875  *
876  * RETURN:      None
877  *
878  * DESCRIPTION: Prints out the various members of the Data structure type.
879  *
880  ******************************************************************************/
881
882 void
883 AcpiRsDumpAddress64 (
884     ACPI_RESOURCE_DATA      *Data)
885 {
886     ACPI_RESOURCE_ADDRESS64 *Address64Data = (ACPI_RESOURCE_ADDRESS64 *) Data;
887
888
889     ACPI_FUNCTION_ENTRY ();
890
891
892     AcpiOsPrintf ("64-Bit Address Space Resource\n");
893
894     switch (Address64Data->ResourceType)
895     {
896     case ACPI_MEMORY_RANGE:
897
898         AcpiOsPrintf ("    Resource Type: Memory Range\n");
899
900         switch (Address64Data->Attribute.Memory.CacheAttribute)
901         {
902         case ACPI_NON_CACHEABLE_MEMORY:
903             AcpiOsPrintf ("    Type Specific: "
904                             "Noncacheable memory\n");
905             break;
906
907         case ACPI_CACHABLE_MEMORY:
908             AcpiOsPrintf ("    Type Specific: "
909                             "Cacheable memory\n");
910             break;
911
912         case ACPI_WRITE_COMBINING_MEMORY:
913             AcpiOsPrintf ("    Type Specific: "
914                             "Write-combining memory\n");
915             break;
916
917         case ACPI_PREFETCHABLE_MEMORY:
918             AcpiOsPrintf ("    Type Specific: "
919                             "Prefetchable memory\n");
920             break;
921
922         default:
923             AcpiOsPrintf ("    Type Specific: "
924                             "Invalid cache attribute\n");
925             break;
926         }
927
928         AcpiOsPrintf ("    Type Specific: Read%s\n",
929             ACPI_READ_WRITE_MEMORY ==
930             Address64Data->Attribute.Memory.ReadWriteAttribute ?
931             "/Write" : " Only");
932         break;
933
934     case ACPI_IO_RANGE:
935
936         AcpiOsPrintf ("    Resource Type: Io Range\n");
937
938         switch (Address64Data->Attribute.Io.RangeAttribute)
939         {
940         case ACPI_NON_ISA_ONLY_RANGES:
941             AcpiOsPrintf ("    Type Specific: "
942                             "Non-ISA Io Addresses\n");
943             break;
944
945         case ACPI_ISA_ONLY_RANGES:
946             AcpiOsPrintf ("    Type Specific: "
947                             "ISA Io Addresses\n");
948             break;
949
950         case ACPI_ENTIRE_RANGE:
951             AcpiOsPrintf ("    Type Specific: "
952                             "ISA and non-ISA Io Addresses\n");
953             break;
954
955         default:
956             AcpiOsPrintf ("    Type Specific: "
957                             "Invalid Range attribute");
958             break;
959         }
960
961         AcpiOsPrintf ("  Type Specific: %s Translation\n",
962             ACPI_SPARSE_TRANSLATION ==
963             Address64Data->Attribute.Io.TranslationAttribute ?
964             "Sparse" : "Dense");
965         break;
966
967     case ACPI_BUS_NUMBER_RANGE:
968
969         AcpiOsPrintf ("    Resource Type: Bus Number Range\n");
970         break;
971
972     default:
973
974         AcpiOsPrintf ("    Invalid Resource Type..exiting.\n");
975         return;
976     }
977
978     AcpiOsPrintf ("    Resource %s\n",
979                 ACPI_CONSUMER == Address64Data->ProducerConsumer ?
980                 "Consumer" : "Producer");
981
982     AcpiOsPrintf ("    %s decode\n",
983                 ACPI_SUB_DECODE == Address64Data->Decode ?
984                 "Subtractive" : "Positive");
985
986     AcpiOsPrintf ("    Min address is %s fixed\n",
987                 ACPI_ADDRESS_FIXED == Address64Data->MinAddressFixed ?
988                 "" : "not ");
989
990     AcpiOsPrintf ("    Max address is %s fixed\n",
991                 ACPI_ADDRESS_FIXED == Address64Data->MaxAddressFixed ?
992                 "" : "not ");
993
994     AcpiOsPrintf ("    Granularity: %8.8X%8.8X\n",
995                 ACPI_FORMAT_UINT64 (Address64Data->Granularity));
996
997     AcpiOsPrintf ("    Address range min: %8.8X%8.8X\n",
998                 ACPI_FORMAT_UINT64 (Address64Data->MinAddressRange));
999
1000     AcpiOsPrintf ("    Address range max: %8.8X%8.8X\n",
1001                 ACPI_FORMAT_UINT64 (Address64Data->MaxAddressRange));
1002
1003     AcpiOsPrintf ("    Address translation offset: %8.8X%8.8X\n",
1004                 ACPI_FORMAT_UINT64 (Address64Data->AddressTranslationOffset));
1005
1006     AcpiOsPrintf ("    Address Length: %8.8X%8.8X\n",
1007                 ACPI_FORMAT_UINT64 (Address64Data->AddressLength));
1008
1009     if(0xFF != Address64Data->ResourceSource.Index)
1010     {
1011         AcpiOsPrintf ("    Resource Source Index: %X\n",
1012                     Address64Data->ResourceSource.Index);
1013         AcpiOsPrintf ("    Resource Source: %s\n",
1014                     Address64Data->ResourceSource.StringPtr);
1015     }
1016
1017     return;
1018 }
1019
1020
1021 /*******************************************************************************
1022  *
1023  * FUNCTION:    AcpiRsDumpExtendedIrq
1024  *
1025  * PARAMETERS:  Data            - pointer to the resource structure to dump.
1026  *
1027  * RETURN:      None
1028  *
1029  * DESCRIPTION: Prints out the various members of the Data structure type.
1030  *
1031  ******************************************************************************/
1032
1033 void
1034 AcpiRsDumpExtendedIrq (
1035     ACPI_RESOURCE_DATA      *Data)
1036 {
1037     ACPI_RESOURCE_EXT_IRQ   *ExtIrqData = (ACPI_RESOURCE_EXT_IRQ *) Data;
1038     UINT8                   Index = 0;
1039
1040
1041     ACPI_FUNCTION_ENTRY ();
1042
1043
1044     AcpiOsPrintf ("Extended IRQ Resource\n");
1045
1046     AcpiOsPrintf ("    Resource %s\n",
1047                 ACPI_CONSUMER == ExtIrqData->ProducerConsumer ?
1048                 "Consumer" : "Producer");
1049
1050     AcpiOsPrintf ("    %s\n",
1051                 ACPI_LEVEL_SENSITIVE == ExtIrqData->EdgeLevel ?
1052                 "Level" : "Edge");
1053
1054     AcpiOsPrintf ("    Active %s\n",
1055                 ACPI_ACTIVE_LOW == ExtIrqData->ActiveHighLow ?
1056                 "low" : "high");
1057
1058     AcpiOsPrintf ("    %s\n",
1059                 ACPI_SHARED == ExtIrqData->SharedExclusive ?
1060                 "Shared" : "Exclusive");
1061
1062     AcpiOsPrintf ("    Interrupts : %X ( ",
1063                 ExtIrqData->NumberOfInterrupts);
1064
1065     for (Index = 0; Index < ExtIrqData->NumberOfInterrupts; Index++)
1066     {
1067         AcpiOsPrintf ("%X ", ExtIrqData->Interrupts[Index]);
1068     }
1069
1070     AcpiOsPrintf (")\n");
1071
1072     if(0xFF != ExtIrqData->ResourceSource.Index)
1073     {
1074         AcpiOsPrintf ("    Resource Source Index: %X",
1075                     ExtIrqData->ResourceSource.Index);
1076         AcpiOsPrintf ("    Resource Source: %s",
1077                     ExtIrqData->ResourceSource.StringPtr);
1078     }
1079
1080     return;
1081 }
1082
1083
1084 /*******************************************************************************
1085  *
1086  * FUNCTION:    AcpiRsDumpResourceList
1087  *
1088  * PARAMETERS:  Data            - pointer to the resource structure to dump.
1089  *
1090  * RETURN:      None
1091  *
1092  * DESCRIPTION: Dispatches the structure to the correct dump routine.
1093  *
1094  ******************************************************************************/
1095
1096 void
1097 AcpiRsDumpResourceList (
1098     ACPI_RESOURCE       *Resource)
1099 {
1100     UINT8               Count = 0;
1101     BOOLEAN             Done = FALSE;
1102
1103
1104     ACPI_FUNCTION_ENTRY ();
1105
1106
1107     if (AcpiDbgLevel & ACPI_LV_RESOURCES && _COMPONENT & AcpiDbgLayer)
1108     {
1109         while (!Done)
1110         {
1111             AcpiOsPrintf ("Resource structure %X.\n", Count++);
1112
1113             switch (Resource->Id)
1114             {
1115             case ACPI_RSTYPE_IRQ:
1116                 AcpiRsDumpIrq (&Resource->Data);
1117                 break;
1118
1119             case ACPI_RSTYPE_DMA:
1120                 AcpiRsDumpDma (&Resource->Data);
1121                 break;
1122
1123             case ACPI_RSTYPE_START_DPF:
1124                 AcpiRsDumpStartDependFns (&Resource->Data);
1125                 break;
1126
1127             case ACPI_RSTYPE_END_DPF:
1128                 AcpiOsPrintf ("EndDependentFunctions Resource\n");
1129                 /* AcpiRsDumpEndDependentFunctions (Resource->Data);*/
1130                 break;
1131
1132             case ACPI_RSTYPE_IO:
1133                 AcpiRsDumpIo (&Resource->Data);
1134                 break;
1135
1136             case ACPI_RSTYPE_FIXED_IO:
1137                 AcpiRsDumpFixedIo (&Resource->Data);
1138                 break;
1139
1140             case ACPI_RSTYPE_VENDOR:
1141                 AcpiRsDumpVendorSpecific (&Resource->Data);
1142                 break;
1143
1144             case ACPI_RSTYPE_END_TAG:
1145                 /*RsDumpEndTag (Resource->Data);*/
1146                 AcpiOsPrintf ("EndTag Resource\n");
1147                 Done = TRUE;
1148                 break;
1149
1150             case ACPI_RSTYPE_MEM24:
1151                 AcpiRsDumpMemory24 (&Resource->Data);
1152                 break;
1153
1154             case ACPI_RSTYPE_MEM32:
1155                 AcpiRsDumpMemory32 (&Resource->Data);
1156                 break;
1157
1158             case ACPI_RSTYPE_FIXED_MEM32:
1159                 AcpiRsDumpFixedMemory32 (&Resource->Data);
1160                 break;
1161
1162             case ACPI_RSTYPE_ADDRESS16:
1163                 AcpiRsDumpAddress16 (&Resource->Data);
1164                 break;
1165
1166             case ACPI_RSTYPE_ADDRESS32:
1167                 AcpiRsDumpAddress32 (&Resource->Data);
1168                 break;
1169
1170             case ACPI_RSTYPE_ADDRESS64:
1171                 AcpiRsDumpAddress64 (&Resource->Data);
1172                 break;
1173
1174             case ACPI_RSTYPE_EXT_IRQ:
1175                 AcpiRsDumpExtendedIrq (&Resource->Data);
1176                 break;
1177
1178             default:
1179                 AcpiOsPrintf ("Invalid resource type\n");
1180                 break;
1181
1182             }
1183
1184             Resource = ACPI_PTR_ADD (ACPI_RESOURCE, Resource, Resource->Length);
1185         }
1186     }
1187
1188     return;
1189 }
1190
1191 /*******************************************************************************
1192  *
1193  * FUNCTION:    AcpiRsDumpIrqList
1194  *
1195  * PARAMETERS:  Data            - pointer to the routing table to dump.
1196  *
1197  * RETURN:      None
1198  *
1199  * DESCRIPTION: Dispatches the structures to the correct dump routine.
1200  *
1201  ******************************************************************************/
1202
1203 void
1204 AcpiRsDumpIrqList (
1205     UINT8                   *RouteTable)
1206 {
1207     UINT8                   *Buffer = RouteTable;
1208     UINT8                   Count = 0;
1209     BOOLEAN                 Done = FALSE;
1210     ACPI_PCI_ROUTING_TABLE  *PrtElement;
1211
1212
1213     ACPI_FUNCTION_ENTRY ();
1214
1215
1216     if (AcpiDbgLevel & ACPI_LV_RESOURCES && _COMPONENT & AcpiDbgLayer)
1217     {
1218         PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, Buffer);
1219
1220         while (!Done)
1221         {
1222             AcpiOsPrintf ("PCI IRQ Routing Table structure %X.\n", Count++);
1223
1224             AcpiOsPrintf ("    Address: %8.8X%8.8X\n",
1225                         ACPI_FORMAT_UINT64 (PrtElement->Address));
1226
1227             AcpiOsPrintf ("    Pin: %X\n", PrtElement->Pin);
1228
1229             AcpiOsPrintf ("    Source: %s\n", PrtElement->Source);
1230
1231             AcpiOsPrintf ("    SourceIndex: %X\n",
1232                         PrtElement->SourceIndex);
1233
1234             Buffer += PrtElement->Length;
1235
1236             PrtElement = ACPI_CAST_PTR (ACPI_PCI_ROUTING_TABLE, Buffer);
1237
1238             if(0 == PrtElement->Length)
1239             {
1240                 Done = TRUE;
1241             }
1242         }
1243     }
1244
1245     return;
1246 }
1247
1248 #endif
1249