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