[ACPI] ACPICA 20050930
[linux-2.6.git] / drivers / acpi / resources / rsdump.c
1 /*******************************************************************************
2  *
3  * Module Name: rsdump - Functions to display the resource structures.
4  *
5  ******************************************************************************/
6
7 /*
8  * Copyright (C) 2000 - 2005, R. Byron Moore
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions, and the following disclaimer,
16  *    without modification.
17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18  *    substantially similar to the "NO WARRANTY" disclaimer below
19  *    ("Disclaimer") and any redistribution must be conditioned upon
20  *    including a substantially similar Disclaimer requirement for further
21  *    binary redistribution.
22  * 3. Neither the names of the above-listed copyright holders nor the names
23  *    of any contributors may be used to endorse or promote products derived
24  *    from this software without specific prior written permission.
25  *
26  * Alternatively, this software may be distributed under the terms of the
27  * GNU General Public License ("GPL") version 2 as published by the Free
28  * Software Foundation.
29  *
30  * NO WARRANTY
31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41  * POSSIBILITY OF SUCH DAMAGES.
42  */
43
44 #include <acpi/acpi.h>
45 #include <acpi/acresrc.h>
46
47 #define _COMPONENT          ACPI_RESOURCES
48 ACPI_MODULE_NAME("rsdump")
49
50 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
51 /* Local prototypes */
52 static void acpi_rs_out_string(char *title, char *value);
53
54 static void acpi_rs_out_integer8(char *title, u8 value);
55
56 static void acpi_rs_out_integer16(char *title, u16 value);
57
58 static void acpi_rs_out_integer32(char *title, u32 value);
59
60 static void acpi_rs_out_integer64(char *title, u64 value);
61
62 static void acpi_rs_out_title(char *title);
63
64 static void acpi_rs_dump_byte_list(u32 length, u8 * data);
65
66 static void acpi_rs_dump_dword_list(u32 length, u32 * data);
67
68 static void acpi_rs_dump_short_byte_list(u32 length, u32 * data);
69
70 static void
71 acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source);
72
73 static void acpi_rs_dump_address_common(union acpi_resource_data *resource);
74
75 /*******************************************************************************
76  *
77  * FUNCTION:    acpi_rs_out*
78  *
79  * PARAMETERS:  Title       - Name of the resource field
80  *              Value       - Value of the resource field
81  *
82  * RETURN:      None
83  *
84  * DESCRIPTION: Miscellaneous helper functions to consistently format the
85  *              output of the resource dump routines
86  *
87  ******************************************************************************/
88
89 static void acpi_rs_out_string(char *title, char *value)
90 {
91         acpi_os_printf("%27s : %s\n", title, value);
92 }
93
94 static void acpi_rs_out_integer8(char *title, u8 value)
95 {
96         acpi_os_printf("%27s : %2.2X\n", title, value);
97 }
98
99 static void acpi_rs_out_integer16(char *title, u16 value)
100 {
101         acpi_os_printf("%27s : %4.4X\n", title, value);
102 }
103
104 static void acpi_rs_out_integer32(char *title, u32 value)
105 {
106         acpi_os_printf("%27s : %8.8X\n", title, value);
107 }
108
109 static void acpi_rs_out_integer64(char *title, u64 value)
110 {
111         acpi_os_printf("%27s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value));
112 }
113
114 static void acpi_rs_out_title(char *title)
115 {
116         acpi_os_printf("%27s : ", title);
117 }
118
119 /*******************************************************************************
120  *
121  * FUNCTION:    acpi_rs_dump*List
122  *
123  * PARAMETERS:  Length      - Number of elements in the list
124  *              Data        - Start of the list
125  *
126  * RETURN:      None
127  *
128  * DESCRIPTION: Miscellaneous functions to dump lists of raw data
129  *
130  ******************************************************************************/
131
132 static void acpi_rs_dump_byte_list(u32 length, u8 * data)
133 {
134         u32 i;
135
136         for (i = 0; i < length; i++) {
137                 acpi_os_printf("%25s%2.2X : %2.2X\n", "Byte", i, data[i]);
138         }
139 }
140
141 static void acpi_rs_dump_dword_list(u32 length, u32 * data)
142 {
143         u32 i;
144
145         for (i = 0; i < length; i++) {
146                 acpi_os_printf("%25s%2.2X : %8.8X\n", "Dword", i, data[i]);
147         }
148 }
149
150 static void acpi_rs_dump_short_byte_list(u32 length, u32 * data)
151 {
152         u32 i;
153
154         for (i = 0; i < length; i++) {
155                 acpi_os_printf("%X ", data[i]);
156         }
157         acpi_os_printf("\n");
158 }
159
160 static void acpi_rs_dump_memory_attribute(u32 read_write_attribute)
161 {
162
163         acpi_rs_out_string("Read/Write Attribute",
164                            ACPI_READ_WRITE_MEMORY == read_write_attribute ?
165                            "Read/Write" : "Read-Only");
166 }
167
168 /*******************************************************************************
169  *
170  * FUNCTION:    acpi_rs_dump_resource_source
171  *
172  * PARAMETERS:  resource_source     - Pointer to a Resource Source struct
173  *
174  * RETURN:      None
175  *
176  * DESCRIPTION: Common routine for dumping the optional resource_source and the
177  *              corresponding resource_source_index.
178  *
179  ******************************************************************************/
180
181 static void
182 acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source)
183 {
184         ACPI_FUNCTION_ENTRY();
185
186         if (resource_source->index == 0xFF) {
187                 return;
188         }
189
190         acpi_rs_out_integer8("Resource Source Index",
191                              (u8) resource_source->index);
192
193         acpi_rs_out_string("Resource Source",
194                            resource_source->string_ptr ?
195                            resource_source->string_ptr : "[Not Specified]");
196 }
197
198 /*******************************************************************************
199  *
200  * FUNCTION:    acpi_rs_dump_address_common
201  *
202  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
203  *
204  * RETURN:      None
205  *
206  * DESCRIPTION: Dump the fields that are common to all Address resource
207  *              descriptors
208  *
209  ******************************************************************************/
210
211 static void acpi_rs_dump_address_common(union acpi_resource_data *resource)
212 {
213         ACPI_FUNCTION_ENTRY();
214
215         /* Decode the type-specific flags */
216
217         switch (resource->address.resource_type) {
218         case ACPI_MEMORY_RANGE:
219
220                 acpi_rs_out_string("Resource Type", "Memory Range");
221
222                 acpi_rs_out_title("Type-Specific Flags");
223
224                 switch (resource->address.attribute.memory.cache_attribute) {
225                 case ACPI_NON_CACHEABLE_MEMORY:
226                         acpi_os_printf("Noncacheable memory\n");
227                         break;
228
229                 case ACPI_CACHABLE_MEMORY:
230                         acpi_os_printf("Cacheable memory\n");
231                         break;
232
233                 case ACPI_WRITE_COMBINING_MEMORY:
234                         acpi_os_printf("Write-combining memory\n");
235                         break;
236
237                 case ACPI_PREFETCHABLE_MEMORY:
238                         acpi_os_printf("Prefetchable memory\n");
239                         break;
240
241                 default:
242                         acpi_os_printf("Invalid cache attribute\n");
243                         break;
244                 }
245
246                 acpi_rs_dump_memory_attribute(resource->address.attribute.
247                                               memory.read_write_attribute);
248                 break;
249
250         case ACPI_IO_RANGE:
251
252                 acpi_rs_out_string("Resource Type", "I/O Range");
253
254                 acpi_rs_out_title("Type-Specific Flags");
255
256                 switch (resource->address.attribute.io.range_attribute) {
257                 case ACPI_NON_ISA_ONLY_RANGES:
258                         acpi_os_printf("Non-ISA I/O Addresses\n");
259                         break;
260
261                 case ACPI_ISA_ONLY_RANGES:
262                         acpi_os_printf("ISA I/O Addresses\n");
263                         break;
264
265                 case ACPI_ENTIRE_RANGE:
266                         acpi_os_printf("ISA and non-ISA I/O Addresses\n");
267                         break;
268
269                 default:
270                         acpi_os_printf("Invalid range attribute\n");
271                         break;
272                 }
273
274                 acpi_rs_out_string("Translation Attribute",
275                                    ACPI_SPARSE_TRANSLATION ==
276                                    resource->address.attribute.io.
277                                    translation_attribute ? "Sparse Translation"
278                                    : "Dense Translation");
279                 break;
280
281         case ACPI_BUS_NUMBER_RANGE:
282
283                 acpi_rs_out_string("Resource Type", "Bus Number Range");
284                 break;
285
286         default:
287
288                 acpi_rs_out_integer8("Resource Type",
289                                      (u8) resource->address.resource_type);
290                 break;
291         }
292
293         /* Decode the general flags */
294
295         acpi_rs_out_string("Resource",
296                            ACPI_CONSUMER ==
297                            resource->address.
298                            producer_consumer ? "Consumer" : "Producer");
299
300         acpi_rs_out_string("Decode",
301                            ACPI_SUB_DECODE == resource->address.decode ?
302                            "Subtractive" : "Positive");
303
304         acpi_rs_out_string("Min Address",
305                            ACPI_ADDRESS_FIXED ==
306                            resource->address.
307                            min_address_fixed ? "Fixed" : "Not Fixed");
308
309         acpi_rs_out_string("Max Address",
310                            ACPI_ADDRESS_FIXED ==
311                            resource->address.
312                            max_address_fixed ? "Fixed" : "Not Fixed");
313 }
314
315 /*******************************************************************************
316  *
317  * FUNCTION:    acpi_rs_dump_resource_list
318  *
319  * PARAMETERS:  resource_list       - Pointer to a resource descriptor list
320  *
321  * RETURN:      None
322  *
323  * DESCRIPTION: Dispatches the structure to the correct dump routine.
324  *
325  ******************************************************************************/
326
327 void acpi_rs_dump_resource_list(struct acpi_resource *resource_list)
328 {
329         u32 count = 0;
330
331         ACPI_FUNCTION_ENTRY();
332
333         if (!(acpi_dbg_level & ACPI_LV_RESOURCES)
334             || !(_COMPONENT & acpi_dbg_layer)) {
335                 return;
336         }
337
338         /* Dump all resource descriptors in the list */
339
340         while (resource_list) {
341                 acpi_os_printf("\n[%02X] ", count);
342
343                 /* Validate Type before dispatch */
344
345                 if (resource_list->type > ACPI_RESOURCE_TYPE_MAX) {
346                         acpi_os_printf
347                             ("Invalid descriptor type (%X) in resource list\n",
348                              resource_list->type);
349                         return;
350                 }
351
352                 /* Dump the resource descriptor */
353
354                 acpi_gbl_dump_resource_dispatch[resource_list->
355                                                 type] (&resource_list->data);
356
357                 /* Exit on end tag */
358
359                 if (resource_list->type == ACPI_RESOURCE_TYPE_END_TAG) {
360                         return;
361                 }
362
363                 /* Get the next resource structure */
364
365                 resource_list =
366                     ACPI_PTR_ADD(struct acpi_resource, resource_list,
367                                  resource_list->length);
368                 count++;
369         }
370 }
371
372 /*******************************************************************************
373  *
374  * FUNCTION:    acpi_rs_dump_irq
375  *
376  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
377  *
378  * RETURN:      None
379  *
380  * DESCRIPTION: Dump the field names and values of the resource descriptor
381  *
382  ******************************************************************************/
383
384 void acpi_rs_dump_irq(union acpi_resource_data *resource)
385 {
386         ACPI_FUNCTION_ENTRY();
387
388         acpi_os_printf("IRQ Resource\n");
389
390         acpi_rs_out_string("Triggering",
391                            ACPI_LEVEL_SENSITIVE ==
392                            resource->irq.triggering ? "Level" : "Edge");
393
394         acpi_rs_out_string("Active",
395                            ACPI_ACTIVE_LOW ==
396                            resource->irq.polarity ? "Low" : "High");
397
398         acpi_rs_out_string("Sharing",
399                            ACPI_SHARED ==
400                            resource->irq.sharable ? "Shared" : "Exclusive");
401
402         acpi_rs_out_integer8("Interrupt Count",
403                              (u8) resource->irq.interrupt_count);
404
405         acpi_rs_out_title("Interrupt List");
406         acpi_rs_dump_short_byte_list(resource->irq.interrupt_count,
407                                      resource->irq.interrupts);
408 }
409
410 /*******************************************************************************
411  *
412  * FUNCTION:    acpi_rs_dump_dma
413  *
414  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
415  *
416  * RETURN:      None
417  *
418  * DESCRIPTION: Dump the field names and values of the resource descriptor
419  *
420  ******************************************************************************/
421
422 void acpi_rs_dump_dma(union acpi_resource_data *resource)
423 {
424         ACPI_FUNCTION_ENTRY();
425
426         acpi_os_printf("DMA Resource\n");
427
428         acpi_rs_out_title("DMA Type");
429         switch (resource->dma.type) {
430         case ACPI_COMPATIBILITY:
431                 acpi_os_printf("Compatibility mode\n");
432                 break;
433
434         case ACPI_TYPE_A:
435                 acpi_os_printf("Type A\n");
436                 break;
437
438         case ACPI_TYPE_B:
439                 acpi_os_printf("Type B\n");
440                 break;
441
442         case ACPI_TYPE_F:
443                 acpi_os_printf("Type F\n");
444                 break;
445
446         default:
447                 acpi_os_printf("**** Invalid DMA type\n");
448                 break;
449         }
450
451         acpi_rs_out_string("Bus Master",
452                            ACPI_BUS_MASTER ==
453                            resource->dma.bus_master ? "Yes" : "No");
454
455         acpi_rs_out_title("Transfer Type");
456         switch (resource->dma.transfer) {
457         case ACPI_TRANSFER_8:
458                 acpi_os_printf("8-bit transfers only\n");
459                 break;
460
461         case ACPI_TRANSFER_8_16:
462                 acpi_os_printf("8-bit and 16-bit transfers\n");
463                 break;
464
465         case ACPI_TRANSFER_16:
466                 acpi_os_printf("16-bit transfers only\n");
467                 break;
468
469         default:
470                 acpi_os_printf("**** Invalid transfer preference\n");
471                 break;
472         }
473
474         acpi_rs_out_integer8("DMA Channel Count",
475                              (u8) resource->dma.channel_count);
476
477         acpi_rs_out_title("Channel List");
478         acpi_rs_dump_short_byte_list(resource->dma.channel_count,
479                                      resource->dma.channels);
480 }
481
482 /*******************************************************************************
483  *
484  * FUNCTION:    acpi_rs_dump_start_dpf
485  *
486  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
487  *
488  * RETURN:      None
489  *
490  * DESCRIPTION: Dump the field names and values of the resource descriptor
491  *
492  ******************************************************************************/
493
494 void acpi_rs_dump_start_dpf(union acpi_resource_data *resource)
495 {
496         ACPI_FUNCTION_ENTRY();
497
498         acpi_os_printf("Start Dependent Functions Resource\n");
499
500         acpi_rs_out_title("Compatibility Priority");
501         switch (resource->start_dpf.compatibility_priority) {
502         case ACPI_GOOD_CONFIGURATION:
503                 acpi_os_printf("Good configuration\n");
504                 break;
505
506         case ACPI_ACCEPTABLE_CONFIGURATION:
507                 acpi_os_printf("Acceptable configuration\n");
508                 break;
509
510         case ACPI_SUB_OPTIMAL_CONFIGURATION:
511                 acpi_os_printf("Sub-optimal configuration\n");
512                 break;
513
514         default:
515                 acpi_os_printf("**** Invalid compatibility priority\n");
516                 break;
517         }
518
519         acpi_rs_out_title("Performance/Robustness");
520         switch (resource->start_dpf.performance_robustness) {
521         case ACPI_GOOD_CONFIGURATION:
522                 acpi_os_printf("Good configuration\n");
523                 break;
524
525         case ACPI_ACCEPTABLE_CONFIGURATION:
526                 acpi_os_printf("Acceptable configuration\n");
527                 break;
528
529         case ACPI_SUB_OPTIMAL_CONFIGURATION:
530                 acpi_os_printf("Sub-optimal configuration\n");
531                 break;
532
533         default:
534                 acpi_os_printf
535                     ("**** Invalid performance robustness preference\n");
536                 break;
537         }
538 }
539
540 /*******************************************************************************
541  *
542  * FUNCTION:    acpi_rs_dump_io
543  *
544  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
545  *
546  * RETURN:      None
547  *
548  * DESCRIPTION: Dump the field names and values of the resource descriptor
549  *
550  ******************************************************************************/
551
552 void acpi_rs_dump_io(union acpi_resource_data *resource)
553 {
554         ACPI_FUNCTION_ENTRY();
555
556         acpi_os_printf("I/O Resource\n");
557
558         acpi_rs_out_string("Decode",
559                            ACPI_DECODE_16 ==
560                            resource->io.io_decode ? "16-bit" : "10-bit");
561
562         acpi_rs_out_integer32("Address Minimum", resource->io.minimum);
563
564         acpi_rs_out_integer32("Address Maximum", resource->io.maximum);
565
566         acpi_rs_out_integer32("Alignment", resource->io.alignment);
567
568         acpi_rs_out_integer32("Address Length", resource->io.address_length);
569 }
570
571 /*******************************************************************************
572  *
573  * FUNCTION:    acpi_rs_dump_fixed_io
574  *
575  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
576  *
577  * RETURN:      None
578  *
579  * DESCRIPTION: Dump the field names and values of the resource descriptor
580  *
581  ******************************************************************************/
582
583 void acpi_rs_dump_fixed_io(union acpi_resource_data *resource)
584 {
585         ACPI_FUNCTION_ENTRY();
586
587         acpi_os_printf("Fixed I/O Resource\n");
588
589         acpi_rs_out_integer32("Address", resource->fixed_io.address);
590
591         acpi_rs_out_integer32("Address Length",
592                               resource->fixed_io.address_length);
593 }
594
595 /*******************************************************************************
596  *
597  * FUNCTION:    acpi_rs_dump_vendor
598  *
599  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
600  *
601  * RETURN:      None
602  *
603  * DESCRIPTION: Dump the field names and values of the resource descriptor
604  *
605  ******************************************************************************/
606
607 void acpi_rs_dump_vendor(union acpi_resource_data *resource)
608 {
609         ACPI_FUNCTION_ENTRY();
610
611         acpi_os_printf("Vendor Specific Resource\n");
612
613         acpi_rs_out_integer16("Length", (u16) resource->vendor.byte_length);
614
615         acpi_rs_dump_byte_list(resource->vendor.byte_length,
616                                resource->vendor.byte_data);
617 }
618
619 /*******************************************************************************
620  *
621  * FUNCTION:    acpi_rs_dump_memory24
622  *
623  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
624  *
625  * RETURN:      None
626  *
627  * DESCRIPTION: Dump the field names and values of the resource descriptor
628  *
629  ******************************************************************************/
630
631 void acpi_rs_dump_memory24(union acpi_resource_data *resource)
632 {
633         ACPI_FUNCTION_ENTRY();
634
635         acpi_os_printf("24-Bit Memory Range Resource\n");
636
637         acpi_rs_dump_memory_attribute(resource->memory24.read_write_attribute);
638
639         acpi_rs_out_integer16("Address Minimum",
640                               (u16) resource->memory24.minimum);
641
642         acpi_rs_out_integer16("Address Maximum",
643                               (u16) resource->memory24.maximum);
644
645         acpi_rs_out_integer16("Alignment", (u16) resource->memory24.alignment);
646
647         acpi_rs_out_integer16("Address Length",
648                               (u16) resource->memory24.address_length);
649 }
650
651 /*******************************************************************************
652  *
653  * FUNCTION:    acpi_rs_dump_memory32
654  *
655  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
656  *
657  * RETURN:      None
658  *
659  * DESCRIPTION: Dump the field names and values of the resource descriptor
660  *
661  ******************************************************************************/
662
663 void acpi_rs_dump_memory32(union acpi_resource_data *resource)
664 {
665         ACPI_FUNCTION_ENTRY();
666
667         acpi_os_printf("32-Bit Memory Range Resource\n");
668
669         acpi_rs_dump_memory_attribute(resource->memory32.read_write_attribute);
670
671         acpi_rs_out_integer32("Address Minimum", resource->memory32.minimum);
672
673         acpi_rs_out_integer32("Address Maximum", resource->memory32.maximum);
674
675         acpi_rs_out_integer32("Alignment", resource->memory32.alignment);
676
677         acpi_rs_out_integer32("Address Length",
678                               resource->memory32.address_length);
679 }
680
681 /*******************************************************************************
682  *
683  * FUNCTION:    acpi_rs_dump_fixed_memory32
684  *
685  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
686  *
687  * RETURN:
688  *
689  * DESCRIPTION: Dump the field names and values of the resource descriptor
690  *
691  ******************************************************************************/
692
693 void acpi_rs_dump_fixed_memory32(union acpi_resource_data *resource)
694 {
695         ACPI_FUNCTION_ENTRY();
696
697         acpi_os_printf("32-Bit Fixed Location Memory Range Resource\n");
698
699         acpi_rs_dump_memory_attribute(resource->fixed_memory32.
700                                       read_write_attribute);
701
702         acpi_rs_out_integer32("Address", resource->fixed_memory32.address);
703
704         acpi_rs_out_integer32("Address Length",
705                               resource->fixed_memory32.address_length);
706 }
707
708 /*******************************************************************************
709  *
710  * FUNCTION:    acpi_rs_dump_address16
711  *
712  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
713  *
714  * RETURN:      None
715  *
716  * DESCRIPTION: Dump the field names and values of the resource descriptor
717  *
718  ******************************************************************************/
719
720 void acpi_rs_dump_address16(union acpi_resource_data *resource)
721 {
722         ACPI_FUNCTION_ENTRY();
723
724         acpi_os_printf("16-Bit WORD Address Space Resource\n");
725
726         acpi_rs_dump_address_common(resource);
727
728         acpi_rs_out_integer16("Granularity",
729                               (u16) resource->address16.granularity);
730
731         acpi_rs_out_integer16("Address Minimum",
732                               (u16) resource->address16.minimum);
733
734         acpi_rs_out_integer16("Address Maximum",
735                               (u16) resource->address16.maximum);
736
737         acpi_rs_out_integer16("Translation Offset",
738                               (u16) resource->address16.translation_offset);
739
740         acpi_rs_out_integer16("Address Length",
741                               (u16) resource->address16.address_length);
742
743         acpi_rs_dump_resource_source(&resource->address16.resource_source);
744 }
745
746 /*******************************************************************************
747  *
748  * FUNCTION:    acpi_rs_dump_address32
749  *
750  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
751  *
752  * RETURN:      None
753  *
754  * DESCRIPTION: Dump the field names and values of the resource descriptor
755  *
756  ******************************************************************************/
757
758 void acpi_rs_dump_address32(union acpi_resource_data *resource)
759 {
760         ACPI_FUNCTION_ENTRY();
761
762         acpi_os_printf("32-Bit DWORD Address Space Resource\n");
763
764         acpi_rs_dump_address_common(resource);
765
766         acpi_rs_out_integer32("Granularity", resource->address32.granularity);
767
768         acpi_rs_out_integer32("Address Minimum", resource->address32.minimum);
769
770         acpi_rs_out_integer32("Address Maximum", resource->address32.maximum);
771
772         acpi_rs_out_integer32("Translation Offset",
773                               resource->address32.translation_offset);
774
775         acpi_rs_out_integer32("Address Length",
776                               resource->address32.address_length);
777
778         acpi_rs_dump_resource_source(&resource->address32.resource_source);
779 }
780
781 /*******************************************************************************
782  *
783  * FUNCTION:    acpi_rs_dump_address64
784  *
785  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
786  *
787  * RETURN:      None
788  *
789  * DESCRIPTION: Dump the field names and values of the resource descriptor
790  *
791  ******************************************************************************/
792
793 void acpi_rs_dump_address64(union acpi_resource_data *resource)
794 {
795         ACPI_FUNCTION_ENTRY();
796
797         acpi_os_printf("64-Bit QWORD Address Space Resource\n");
798
799         acpi_rs_dump_address_common(resource);
800
801         acpi_rs_out_integer64("Granularity", resource->address64.granularity);
802
803         acpi_rs_out_integer64("Address Minimum", resource->address64.minimum);
804
805         acpi_rs_out_integer64("Address Maximum", resource->address64.maximum);
806
807         acpi_rs_out_integer64("Translation Offset",
808                               resource->address64.translation_offset);
809
810         acpi_rs_out_integer64("Address Length",
811                               resource->address64.address_length);
812
813         acpi_rs_dump_resource_source(&resource->address64.resource_source);
814 }
815
816 /*******************************************************************************
817  *
818  * FUNCTION:    acpi_rs_dump_ext_address64
819  *
820  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
821  *
822  * RETURN:      None
823  *
824  * DESCRIPTION: Dump the field names and values of the resource descriptor
825  *
826  ******************************************************************************/
827
828 void acpi_rs_dump_ext_address64(union acpi_resource_data *resource)
829 {
830         ACPI_FUNCTION_ENTRY();
831
832         acpi_os_printf("64-Bit Extended Address Space Resource\n");
833
834         acpi_rs_dump_address_common(resource);
835
836         acpi_rs_out_integer64("Granularity",
837                               resource->ext_address64.granularity);
838
839         acpi_rs_out_integer64("Address Minimum",
840                               resource->ext_address64.minimum);
841
842         acpi_rs_out_integer64("Address Maximum",
843                               resource->ext_address64.maximum);
844
845         acpi_rs_out_integer64("Translation Offset",
846                               resource->ext_address64.translation_offset);
847
848         acpi_rs_out_integer64("Address Length",
849                               resource->ext_address64.address_length);
850
851         acpi_rs_out_integer64("Type-Specific Attribute",
852                               resource->ext_address64.type_specific_attributes);
853 }
854
855 /*******************************************************************************
856  *
857  * FUNCTION:    acpi_rs_dump_ext_irq
858  *
859  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
860  *
861  * RETURN:      None
862  *
863  * DESCRIPTION: Dump the field names and values of the resource descriptor
864  *
865  ******************************************************************************/
866
867 void acpi_rs_dump_ext_irq(union acpi_resource_data *resource)
868 {
869         ACPI_FUNCTION_ENTRY();
870
871         acpi_os_printf("Extended IRQ Resource\n");
872
873         acpi_rs_out_string("Resource",
874                            ACPI_CONSUMER ==
875                            resource->extended_irq.
876                            producer_consumer ? "Consumer" : "Producer");
877
878         acpi_rs_out_string("Triggering",
879                            ACPI_LEVEL_SENSITIVE ==
880                            resource->extended_irq.
881                            triggering ? "Level" : "Edge");
882
883         acpi_rs_out_string("Active",
884                            ACPI_ACTIVE_LOW == resource->extended_irq.polarity ?
885                            "Low" : "High");
886
887         acpi_rs_out_string("Sharing",
888                            ACPI_SHARED == resource->extended_irq.sharable ?
889                            "Shared" : "Exclusive");
890
891         acpi_rs_dump_resource_source(&resource->extended_irq.resource_source);
892
893         acpi_rs_out_integer8("Interrupts",
894                              (u8) resource->extended_irq.interrupt_count);
895
896         acpi_rs_dump_dword_list(resource->extended_irq.interrupt_count,
897                                 resource->extended_irq.interrupts);
898 }
899
900 /*******************************************************************************
901  *
902  * FUNCTION:    acpi_rs_dump_generic_reg
903  *
904  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
905  *
906  * RETURN:      None
907  *
908  * DESCRIPTION: Dump the field names and values of the resource descriptor
909  *
910  ******************************************************************************/
911
912 void acpi_rs_dump_generic_reg(union acpi_resource_data *resource)
913 {
914         ACPI_FUNCTION_ENTRY();
915
916         acpi_os_printf("Generic Register Resource\n");
917
918         acpi_rs_out_integer8("Space ID", (u8) resource->generic_reg.space_id);
919
920         acpi_rs_out_integer8("Bit Width", (u8) resource->generic_reg.bit_width);
921
922         acpi_rs_out_integer8("Bit Offset",
923                              (u8) resource->generic_reg.bit_offset);
924
925         acpi_rs_out_integer8("Access Size",
926                              (u8) resource->generic_reg.access_size);
927
928         acpi_rs_out_integer64("Address", resource->generic_reg.address);
929 }
930
931 /*******************************************************************************
932  *
933  * FUNCTION:    acpi_rs_dump_end_dpf
934  *
935  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
936  *
937  * RETURN:      None
938  *
939  * DESCRIPTION: Print type, no data.
940  *
941  ******************************************************************************/
942
943 void acpi_rs_dump_end_dpf(union acpi_resource_data *resource)
944 {
945         ACPI_FUNCTION_ENTRY();
946
947         acpi_os_printf("end_dependent_functions Resource\n");
948 }
949
950 /*******************************************************************************
951  *
952  * FUNCTION:    acpi_rs_dump_end_tag
953  *
954  * PARAMETERS:  Resource        - Pointer to an internal resource descriptor
955  *
956  * RETURN:      None
957  *
958  * DESCRIPTION: Print type, no data.
959  *
960  ******************************************************************************/
961
962 void acpi_rs_dump_end_tag(union acpi_resource_data *resource)
963 {
964         ACPI_FUNCTION_ENTRY();
965
966         acpi_os_printf("end_tag Resource\n");
967 }
968
969 /*******************************************************************************
970  *
971  * FUNCTION:    acpi_rs_dump_irq_list
972  *
973  * PARAMETERS:  route_table     - Pointer to the routing table to dump.
974  *
975  * RETURN:      None
976  *
977  * DESCRIPTION: Print IRQ routing table
978  *
979  ******************************************************************************/
980
981 void acpi_rs_dump_irq_list(u8 * route_table)
982 {
983         u8 *buffer = route_table;
984         u8 count = 0;
985         struct acpi_pci_routing_table *prt_element;
986
987         ACPI_FUNCTION_ENTRY();
988
989         if (!(acpi_dbg_level & ACPI_LV_RESOURCES)
990             || !(_COMPONENT & acpi_dbg_layer)) {
991                 return;
992         }
993
994         prt_element = ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer);
995
996         /* Dump all table elements, Exit on null length element */
997
998         while (prt_element->length) {
999                 acpi_os_printf("\n[%02X] PCI IRQ Routing Table Package\n",
1000                                count);
1001
1002                 acpi_rs_out_integer64("Address", prt_element->address);
1003
1004                 acpi_rs_out_integer32("Pin", prt_element->pin);
1005                 acpi_rs_out_string("Source", prt_element->source);
1006                 acpi_rs_out_integer32("Source Index",
1007                                       prt_element->source_index);
1008
1009                 buffer += prt_element->length;
1010                 prt_element =
1011                     ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer);
1012                 count++;
1013         }
1014 }
1015
1016 #endif