[PATCH] W1: w1_netlink: New init/fini netlink callbacks.
[linux-2.6/verdex.git] / drivers / acpi / resources / rsdump.c
blob75bd34d1783f6495660d6d595c2ca2f24d6ead51
1 /*******************************************************************************
3 * Module Name: rsdump - Functions to display the resource structures.
5 ******************************************************************************/
7 /*
8 * Copyright (C) 2000 - 2005, R. Byron Moore
9 * All rights reserved.
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.
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.
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.
44 #include <acpi/acpi.h>
45 #include <acpi/acresrc.h>
47 #define _COMPONENT ACPI_RESOURCES
48 ACPI_MODULE_NAME("rsdump")
50 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
51 /* Local prototypes */
52 static void acpi_rs_dump_irq(union acpi_resource_data *data);
54 static void acpi_rs_dump_address16(union acpi_resource_data *data);
56 static void acpi_rs_dump_address32(union acpi_resource_data *data);
58 static void acpi_rs_dump_address64(union acpi_resource_data *data);
60 static void acpi_rs_dump_dma(union acpi_resource_data *data);
62 static void acpi_rs_dump_io(union acpi_resource_data *data);
64 static void acpi_rs_dump_extended_irq(union acpi_resource_data *data);
66 static void acpi_rs_dump_fixed_io(union acpi_resource_data *data);
68 static void acpi_rs_dump_fixed_memory32(union acpi_resource_data *data);
70 static void acpi_rs_dump_memory24(union acpi_resource_data *data);
72 static void acpi_rs_dump_memory32(union acpi_resource_data *data);
74 static void acpi_rs_dump_start_depend_fns(union acpi_resource_data *data);
76 static void acpi_rs_dump_vendor_specific(union acpi_resource_data *data);
78 /*******************************************************************************
80 * FUNCTION: acpi_rs_dump_irq
82 * PARAMETERS: Data - pointer to the resource structure to dump.
84 * RETURN: None
86 * DESCRIPTION: Prints out the various members of the Data structure type.
88 ******************************************************************************/
90 static void acpi_rs_dump_irq(union acpi_resource_data *data)
92 struct acpi_resource_irq *irq_data = (struct acpi_resource_irq *)data;
93 u8 index = 0;
95 ACPI_FUNCTION_ENTRY();
97 acpi_os_printf("IRQ Resource\n");
99 acpi_os_printf(" %s Triggered\n",
100 ACPI_LEVEL_SENSITIVE ==
101 irq_data->edge_level ? "Level" : "Edge");
103 acpi_os_printf(" Active %s\n",
104 ACPI_ACTIVE_LOW ==
105 irq_data->active_high_low ? "Low" : "High");
107 acpi_os_printf(" %s\n",
108 ACPI_SHARED ==
109 irq_data->shared_exclusive ? "Shared" : "Exclusive");
111 acpi_os_printf(" %X Interrupts ( ", irq_data->number_of_interrupts);
113 for (index = 0; index < irq_data->number_of_interrupts; index++) {
114 acpi_os_printf("%X ", irq_data->interrupts[index]);
117 acpi_os_printf(")\n");
118 return;
121 /*******************************************************************************
123 * FUNCTION: acpi_rs_dump_dma
125 * PARAMETERS: Data - pointer to the resource structure to dump.
127 * RETURN: None
129 * DESCRIPTION: Prints out the various members of the Data structure type.
131 ******************************************************************************/
133 static void acpi_rs_dump_dma(union acpi_resource_data *data)
135 struct acpi_resource_dma *dma_data = (struct acpi_resource_dma *)data;
136 u8 index = 0;
138 ACPI_FUNCTION_ENTRY();
140 acpi_os_printf("DMA Resource\n");
142 switch (dma_data->type) {
143 case ACPI_COMPATIBILITY:
144 acpi_os_printf(" Compatibility mode\n");
145 break;
147 case ACPI_TYPE_A:
148 acpi_os_printf(" Type A\n");
149 break;
151 case ACPI_TYPE_B:
152 acpi_os_printf(" Type B\n");
153 break;
155 case ACPI_TYPE_F:
156 acpi_os_printf(" Type F\n");
157 break;
159 default:
160 acpi_os_printf(" Invalid DMA type\n");
161 break;
164 acpi_os_printf(" %sBus Master\n",
165 ACPI_BUS_MASTER == dma_data->bus_master ? "" : "Not a ");
167 switch (dma_data->transfer) {
168 case ACPI_TRANSFER_8:
169 acpi_os_printf(" 8-bit only transfer\n");
170 break;
172 case ACPI_TRANSFER_8_16:
173 acpi_os_printf(" 8 and 16-bit transfer\n");
174 break;
176 case ACPI_TRANSFER_16:
177 acpi_os_printf(" 16 bit only transfer\n");
178 break;
180 default:
181 acpi_os_printf(" Invalid transfer preference\n");
182 break;
185 acpi_os_printf(" Number of Channels: %X ( ",
186 dma_data->number_of_channels);
188 for (index = 0; index < dma_data->number_of_channels; index++) {
189 acpi_os_printf("%X ", dma_data->channels[index]);
192 acpi_os_printf(")\n");
193 return;
196 /*******************************************************************************
198 * FUNCTION: acpi_rs_dump_start_depend_fns
200 * PARAMETERS: Data - pointer to the resource structure to dump.
202 * RETURN: None
204 * DESCRIPTION: Prints out the various members of the Data structure type.
206 ******************************************************************************/
208 static void acpi_rs_dump_start_depend_fns(union acpi_resource_data *data)
210 struct acpi_resource_start_dpf *sdf_data =
211 (struct acpi_resource_start_dpf *)data;
213 ACPI_FUNCTION_ENTRY();
215 acpi_os_printf("Start Dependent Functions Resource\n");
217 switch (sdf_data->compatibility_priority) {
218 case ACPI_GOOD_CONFIGURATION:
219 acpi_os_printf(" Good configuration\n");
220 break;
222 case ACPI_ACCEPTABLE_CONFIGURATION:
223 acpi_os_printf(" Acceptable configuration\n");
224 break;
226 case ACPI_SUB_OPTIMAL_CONFIGURATION:
227 acpi_os_printf(" Sub-optimal configuration\n");
228 break;
230 default:
231 acpi_os_printf(" Invalid compatibility priority\n");
232 break;
235 switch (sdf_data->performance_robustness) {
236 case ACPI_GOOD_CONFIGURATION:
237 acpi_os_printf(" Good configuration\n");
238 break;
240 case ACPI_ACCEPTABLE_CONFIGURATION:
241 acpi_os_printf(" Acceptable configuration\n");
242 break;
244 case ACPI_SUB_OPTIMAL_CONFIGURATION:
245 acpi_os_printf(" Sub-optimal configuration\n");
246 break;
248 default:
249 acpi_os_printf(" Invalid performance robustness preference\n");
250 break;
253 return;
256 /*******************************************************************************
258 * FUNCTION: acpi_rs_dump_io
260 * PARAMETERS: Data - pointer to the resource structure to dump.
262 * RETURN: None
264 * DESCRIPTION: Prints out the various members of the Data structure type.
266 ******************************************************************************/
268 static void acpi_rs_dump_io(union acpi_resource_data *data)
270 struct acpi_resource_io *io_data = (struct acpi_resource_io *)data;
272 ACPI_FUNCTION_ENTRY();
274 acpi_os_printf("Io Resource\n");
276 acpi_os_printf(" %d bit decode\n",
277 ACPI_DECODE_16 == io_data->io_decode ? 16 : 10);
279 acpi_os_printf(" Range minimum base: %08X\n",
280 io_data->min_base_address);
282 acpi_os_printf(" Range maximum base: %08X\n",
283 io_data->max_base_address);
285 acpi_os_printf(" Alignment: %08X\n", io_data->alignment);
287 acpi_os_printf(" Range Length: %08X\n", io_data->range_length);
289 return;
292 /*******************************************************************************
294 * FUNCTION: acpi_rs_dump_fixed_io
296 * PARAMETERS: Data - pointer to the resource structure to dump.
298 * RETURN: None
300 * DESCRIPTION: Prints out the various members of the Data structure type.
302 ******************************************************************************/
304 static void acpi_rs_dump_fixed_io(union acpi_resource_data *data)
306 struct acpi_resource_fixed_io *fixed_io_data =
307 (struct acpi_resource_fixed_io *)data;
309 ACPI_FUNCTION_ENTRY();
311 acpi_os_printf("Fixed Io Resource\n");
312 acpi_os_printf(" Range base address: %08X",
313 fixed_io_data->base_address);
315 acpi_os_printf(" Range length: %08X", fixed_io_data->range_length);
317 return;
320 /*******************************************************************************
322 * FUNCTION: acpi_rs_dump_vendor_specific
324 * PARAMETERS: Data - pointer to the resource structure to dump.
326 * RETURN: None
328 * DESCRIPTION: Prints out the various members of the Data structure type.
330 ******************************************************************************/
332 static void acpi_rs_dump_vendor_specific(union acpi_resource_data *data)
334 struct acpi_resource_vendor *vendor_data =
335 (struct acpi_resource_vendor *)data;
336 u16 index = 0;
338 ACPI_FUNCTION_ENTRY();
340 acpi_os_printf("Vendor Specific Resource\n");
342 acpi_os_printf(" Length: %08X\n", vendor_data->length);
344 for (index = 0; index < vendor_data->length; index++) {
345 acpi_os_printf(" Byte %X: %08X\n",
346 index, vendor_data->reserved[index]);
349 return;
352 /*******************************************************************************
354 * FUNCTION: acpi_rs_dump_memory24
356 * PARAMETERS: Data - pointer to the resource structure to dump.
358 * RETURN: None
360 * DESCRIPTION: Prints out the various members of the Data structure type.
362 ******************************************************************************/
364 static void acpi_rs_dump_memory24(union acpi_resource_data *data)
366 struct acpi_resource_mem24 *memory24_data =
367 (struct acpi_resource_mem24 *)data;
369 ACPI_FUNCTION_ENTRY();
371 acpi_os_printf("24-Bit Memory Range Resource\n");
373 acpi_os_printf(" Read%s\n",
374 ACPI_READ_WRITE_MEMORY ==
375 memory24_data->read_write_attribute ?
376 "/Write" : " only");
378 acpi_os_printf(" Range minimum base: %08X\n",
379 memory24_data->min_base_address);
381 acpi_os_printf(" Range maximum base: %08X\n",
382 memory24_data->max_base_address);
384 acpi_os_printf(" Alignment: %08X\n", memory24_data->alignment);
386 acpi_os_printf(" Range length: %08X\n", memory24_data->range_length);
388 return;
391 /*******************************************************************************
393 * FUNCTION: acpi_rs_dump_memory32
395 * PARAMETERS: Data - pointer to the resource structure to dump.
397 * RETURN: None
399 * DESCRIPTION: Prints out the various members of the Data structure type.
401 ******************************************************************************/
403 static void acpi_rs_dump_memory32(union acpi_resource_data *data)
405 struct acpi_resource_mem32 *memory32_data =
406 (struct acpi_resource_mem32 *)data;
408 ACPI_FUNCTION_ENTRY();
410 acpi_os_printf("32-Bit Memory Range Resource\n");
412 acpi_os_printf(" Read%s\n",
413 ACPI_READ_WRITE_MEMORY ==
414 memory32_data->read_write_attribute ?
415 "/Write" : " only");
417 acpi_os_printf(" Range minimum base: %08X\n",
418 memory32_data->min_base_address);
420 acpi_os_printf(" Range maximum base: %08X\n",
421 memory32_data->max_base_address);
423 acpi_os_printf(" Alignment: %08X\n", memory32_data->alignment);
425 acpi_os_printf(" Range length: %08X\n", memory32_data->range_length);
427 return;
430 /*******************************************************************************
432 * FUNCTION: acpi_rs_dump_fixed_memory32
434 * PARAMETERS: Data - pointer to the resource structure to dump.
436 * RETURN:
438 * DESCRIPTION: Prints out the various members of the Data structure type.
440 ******************************************************************************/
442 static void acpi_rs_dump_fixed_memory32(union acpi_resource_data *data)
444 struct acpi_resource_fixed_mem32 *fixed_memory32_data =
445 (struct acpi_resource_fixed_mem32 *)data;
447 ACPI_FUNCTION_ENTRY();
449 acpi_os_printf("32-Bit Fixed Location Memory Range Resource\n");
451 acpi_os_printf(" Read%s\n",
452 ACPI_READ_WRITE_MEMORY ==
453 fixed_memory32_data->
454 read_write_attribute ? "/Write" : " Only");
456 acpi_os_printf(" Range base address: %08X\n",
457 fixed_memory32_data->range_base_address);
459 acpi_os_printf(" Range length: %08X\n",
460 fixed_memory32_data->range_length);
462 return;
465 /*******************************************************************************
467 * FUNCTION: acpi_rs_dump_address16
469 * PARAMETERS: Data - pointer to the resource structure to dump.
471 * RETURN: None
473 * DESCRIPTION: Prints out the various members of the Data structure type.
475 ******************************************************************************/
477 static void acpi_rs_dump_address16(union acpi_resource_data *data)
479 struct acpi_resource_address16 *address16_data =
480 (struct acpi_resource_address16 *)data;
482 ACPI_FUNCTION_ENTRY();
484 acpi_os_printf("16-Bit Address Space Resource\n");
485 acpi_os_printf(" Resource Type: ");
487 switch (address16_data->resource_type) {
488 case ACPI_MEMORY_RANGE:
490 acpi_os_printf("Memory Range\n");
492 switch (address16_data->attribute.memory.cache_attribute) {
493 case ACPI_NON_CACHEABLE_MEMORY:
494 acpi_os_printf
495 (" Type Specific: Noncacheable memory\n");
496 break;
498 case ACPI_CACHABLE_MEMORY:
499 acpi_os_printf(" Type Specific: Cacheable memory\n");
500 break;
502 case ACPI_WRITE_COMBINING_MEMORY:
503 acpi_os_printf
504 (" Type Specific: Write-combining memory\n");
505 break;
507 case ACPI_PREFETCHABLE_MEMORY:
508 acpi_os_printf
509 (" Type Specific: Prefetchable memory\n");
510 break;
512 default:
513 acpi_os_printf
514 (" Type Specific: Invalid cache attribute\n");
515 break;
518 acpi_os_printf(" Type Specific: Read%s\n",
519 ACPI_READ_WRITE_MEMORY ==
520 address16_data->attribute.memory.
521 read_write_attribute ? "/Write" : " Only");
522 break;
524 case ACPI_IO_RANGE:
526 acpi_os_printf("I/O Range\n");
528 switch (address16_data->attribute.io.range_attribute) {
529 case ACPI_NON_ISA_ONLY_RANGES:
530 acpi_os_printf
531 (" Type Specific: Non-ISA Io Addresses\n");
532 break;
534 case ACPI_ISA_ONLY_RANGES:
535 acpi_os_printf(" Type Specific: ISA Io Addresses\n");
536 break;
538 case ACPI_ENTIRE_RANGE:
539 acpi_os_printf
540 (" Type Specific: ISA and non-ISA Io Addresses\n");
541 break;
543 default:
544 acpi_os_printf
545 (" Type Specific: Invalid range attribute\n");
546 break;
549 acpi_os_printf(" Type Specific: %s Translation\n",
550 ACPI_SPARSE_TRANSLATION ==
551 address16_data->attribute.io.
552 translation_attribute ? "Sparse" : "Dense");
553 break;
555 case ACPI_BUS_NUMBER_RANGE:
557 acpi_os_printf("Bus Number Range\n");
558 break;
560 default:
562 acpi_os_printf("0x%2.2X\n", address16_data->resource_type);
563 break;
566 acpi_os_printf(" Resource %s\n",
567 ACPI_CONSUMER == address16_data->producer_consumer ?
568 "Consumer" : "Producer");
570 acpi_os_printf(" %s decode\n",
571 ACPI_SUB_DECODE == address16_data->decode ?
572 "Subtractive" : "Positive");
574 acpi_os_printf(" Min address is %s fixed\n",
575 ACPI_ADDRESS_FIXED == address16_data->min_address_fixed ?
576 "" : "not");
578 acpi_os_printf(" Max address is %s fixed\n",
579 ACPI_ADDRESS_FIXED == address16_data->max_address_fixed ?
580 "" : "not");
582 acpi_os_printf(" Granularity: %08X\n", address16_data->granularity);
584 acpi_os_printf(" Address range min: %08X\n",
585 address16_data->min_address_range);
587 acpi_os_printf(" Address range max: %08X\n",
588 address16_data->max_address_range);
590 acpi_os_printf(" Address translation offset: %08X\n",
591 address16_data->address_translation_offset);
593 acpi_os_printf(" Address Length: %08X\n",
594 address16_data->address_length);
596 if (0xFF != address16_data->resource_source.index) {
597 acpi_os_printf(" Resource Source Index: %X\n",
598 address16_data->resource_source.index);
600 acpi_os_printf(" Resource Source: %s\n",
601 address16_data->resource_source.string_ptr);
604 return;
607 /*******************************************************************************
609 * FUNCTION: acpi_rs_dump_address32
611 * PARAMETERS: Data - pointer to the resource structure to dump.
613 * RETURN: None
615 * DESCRIPTION: Prints out the various members of the Data structure type.
617 ******************************************************************************/
619 static void acpi_rs_dump_address32(union acpi_resource_data *data)
621 struct acpi_resource_address32 *address32_data =
622 (struct acpi_resource_address32 *)data;
624 ACPI_FUNCTION_ENTRY();
626 acpi_os_printf("32-Bit Address Space Resource\n");
628 switch (address32_data->resource_type) {
629 case ACPI_MEMORY_RANGE:
631 acpi_os_printf(" Resource Type: Memory Range\n");
633 switch (address32_data->attribute.memory.cache_attribute) {
634 case ACPI_NON_CACHEABLE_MEMORY:
635 acpi_os_printf
636 (" Type Specific: Noncacheable memory\n");
637 break;
639 case ACPI_CACHABLE_MEMORY:
640 acpi_os_printf(" Type Specific: Cacheable memory\n");
641 break;
643 case ACPI_WRITE_COMBINING_MEMORY:
644 acpi_os_printf
645 (" Type Specific: Write-combining memory\n");
646 break;
648 case ACPI_PREFETCHABLE_MEMORY:
649 acpi_os_printf
650 (" Type Specific: Prefetchable memory\n");
651 break;
653 default:
654 acpi_os_printf
655 (" Type Specific: Invalid cache attribute\n");
656 break;
659 acpi_os_printf(" Type Specific: Read%s\n",
660 ACPI_READ_WRITE_MEMORY ==
661 address32_data->attribute.memory.
662 read_write_attribute ? "/Write" : " Only");
663 break;
665 case ACPI_IO_RANGE:
667 acpi_os_printf(" Resource Type: Io Range\n");
669 switch (address32_data->attribute.io.range_attribute) {
670 case ACPI_NON_ISA_ONLY_RANGES:
671 acpi_os_printf
672 (" Type Specific: Non-ISA Io Addresses\n");
673 break;
675 case ACPI_ISA_ONLY_RANGES:
676 acpi_os_printf(" Type Specific: ISA Io Addresses\n");
677 break;
679 case ACPI_ENTIRE_RANGE:
680 acpi_os_printf
681 (" Type Specific: ISA and non-ISA Io Addresses\n");
682 break;
684 default:
685 acpi_os_printf
686 (" Type Specific: Invalid Range attribute");
687 break;
690 acpi_os_printf(" Type Specific: %s Translation\n",
691 ACPI_SPARSE_TRANSLATION ==
692 address32_data->attribute.io.
693 translation_attribute ? "Sparse" : "Dense");
694 break;
696 case ACPI_BUS_NUMBER_RANGE:
698 acpi_os_printf(" Resource Type: Bus Number Range\n");
699 break;
701 default:
703 acpi_os_printf(" Resource Type: 0x%2.2X\n",
704 address32_data->resource_type);
705 break;
708 acpi_os_printf(" Resource %s\n",
709 ACPI_CONSUMER == address32_data->producer_consumer ?
710 "Consumer" : "Producer");
712 acpi_os_printf(" %s decode\n",
713 ACPI_SUB_DECODE == address32_data->decode ?
714 "Subtractive" : "Positive");
716 acpi_os_printf(" Min address is %s fixed\n",
717 ACPI_ADDRESS_FIXED == address32_data->min_address_fixed ?
718 "" : "not ");
720 acpi_os_printf(" Max address is %s fixed\n",
721 ACPI_ADDRESS_FIXED == address32_data->max_address_fixed ?
722 "" : "not ");
724 acpi_os_printf(" Granularity: %08X\n", address32_data->granularity);
726 acpi_os_printf(" Address range min: %08X\n",
727 address32_data->min_address_range);
729 acpi_os_printf(" Address range max: %08X\n",
730 address32_data->max_address_range);
732 acpi_os_printf(" Address translation offset: %08X\n",
733 address32_data->address_translation_offset);
735 acpi_os_printf(" Address Length: %08X\n",
736 address32_data->address_length);
738 if (0xFF != address32_data->resource_source.index) {
739 acpi_os_printf(" Resource Source Index: %X\n",
740 address32_data->resource_source.index);
742 acpi_os_printf(" Resource Source: %s\n",
743 address32_data->resource_source.string_ptr);
746 return;
749 /*******************************************************************************
751 * FUNCTION: acpi_rs_dump_address64
753 * PARAMETERS: Data - pointer to the resource structure to dump.
755 * RETURN: None
757 * DESCRIPTION: Prints out the various members of the Data structure type.
759 ******************************************************************************/
761 static void acpi_rs_dump_address64(union acpi_resource_data *data)
763 struct acpi_resource_address64 *address64_data =
764 (struct acpi_resource_address64 *)data;
766 ACPI_FUNCTION_ENTRY();
768 acpi_os_printf("64-Bit Address Space Resource\n");
770 switch (address64_data->resource_type) {
771 case ACPI_MEMORY_RANGE:
773 acpi_os_printf(" Resource Type: Memory Range\n");
775 switch (address64_data->attribute.memory.cache_attribute) {
776 case ACPI_NON_CACHEABLE_MEMORY:
777 acpi_os_printf
778 (" Type Specific: Noncacheable memory\n");
779 break;
781 case ACPI_CACHABLE_MEMORY:
782 acpi_os_printf(" Type Specific: Cacheable memory\n");
783 break;
785 case ACPI_WRITE_COMBINING_MEMORY:
786 acpi_os_printf
787 (" Type Specific: Write-combining memory\n");
788 break;
790 case ACPI_PREFETCHABLE_MEMORY:
791 acpi_os_printf
792 (" Type Specific: Prefetchable memory\n");
793 break;
795 default:
796 acpi_os_printf
797 (" Type Specific: Invalid cache attribute\n");
798 break;
801 acpi_os_printf(" Type Specific: Read%s\n",
802 ACPI_READ_WRITE_MEMORY ==
803 address64_data->attribute.memory.
804 read_write_attribute ? "/Write" : " Only");
805 break;
807 case ACPI_IO_RANGE:
809 acpi_os_printf(" Resource Type: Io Range\n");
811 switch (address64_data->attribute.io.range_attribute) {
812 case ACPI_NON_ISA_ONLY_RANGES:
813 acpi_os_printf
814 (" Type Specific: Non-ISA Io Addresses\n");
815 break;
817 case ACPI_ISA_ONLY_RANGES:
818 acpi_os_printf(" Type Specific: ISA Io Addresses\n");
819 break;
821 case ACPI_ENTIRE_RANGE:
822 acpi_os_printf
823 (" Type Specific: ISA and non-ISA Io Addresses\n");
824 break;
826 default:
827 acpi_os_printf
828 (" Type Specific: Invalid Range attribute");
829 break;
832 acpi_os_printf(" Type Specific: %s Translation\n",
833 ACPI_SPARSE_TRANSLATION ==
834 address64_data->attribute.io.
835 translation_attribute ? "Sparse" : "Dense");
836 break;
838 case ACPI_BUS_NUMBER_RANGE:
840 acpi_os_printf(" Resource Type: Bus Number Range\n");
841 break;
843 default:
845 acpi_os_printf(" Resource Type: 0x%2.2X\n",
846 address64_data->resource_type);
847 break;
850 acpi_os_printf(" Resource %s\n",
851 ACPI_CONSUMER == address64_data->producer_consumer ?
852 "Consumer" : "Producer");
854 acpi_os_printf(" %s decode\n",
855 ACPI_SUB_DECODE == address64_data->decode ?
856 "Subtractive" : "Positive");
858 acpi_os_printf(" Min address is %s fixed\n",
859 ACPI_ADDRESS_FIXED == address64_data->min_address_fixed ?
860 "" : "not ");
862 acpi_os_printf(" Max address is %s fixed\n",
863 ACPI_ADDRESS_FIXED == address64_data->max_address_fixed ?
864 "" : "not ");
866 acpi_os_printf(" Granularity: %8.8X%8.8X\n",
867 ACPI_FORMAT_UINT64(address64_data->granularity));
869 acpi_os_printf(" Address range min: %8.8X%8.8X\n",
870 ACPI_FORMAT_UINT64(address64_data->min_address_range));
872 acpi_os_printf(" Address range max: %8.8X%8.8X\n",
873 ACPI_FORMAT_UINT64(address64_data->max_address_range));
875 acpi_os_printf(" Address translation offset: %8.8X%8.8X\n",
876 ACPI_FORMAT_UINT64(address64_data->
877 address_translation_offset));
879 acpi_os_printf(" Address Length: %8.8X%8.8X\n",
880 ACPI_FORMAT_UINT64(address64_data->address_length));
882 acpi_os_printf(" Type Specific Attributes: %8.8X%8.8X\n",
883 ACPI_FORMAT_UINT64(address64_data->
884 type_specific_attributes));
886 if (0xFF != address64_data->resource_source.index) {
887 acpi_os_printf(" Resource Source Index: %X\n",
888 address64_data->resource_source.index);
890 acpi_os_printf(" Resource Source: %s\n",
891 address64_data->resource_source.string_ptr);
894 return;
897 /*******************************************************************************
899 * FUNCTION: acpi_rs_dump_extended_irq
901 * PARAMETERS: Data - pointer to the resource structure to dump.
903 * RETURN: None
905 * DESCRIPTION: Prints out the various members of the Data structure type.
907 ******************************************************************************/
909 static void acpi_rs_dump_extended_irq(union acpi_resource_data *data)
911 struct acpi_resource_ext_irq *ext_irq_data =
912 (struct acpi_resource_ext_irq *)data;
913 u8 index = 0;
915 ACPI_FUNCTION_ENTRY();
917 acpi_os_printf("Extended IRQ Resource\n");
919 acpi_os_printf(" Resource %s\n",
920 ACPI_CONSUMER == ext_irq_data->producer_consumer ?
921 "Consumer" : "Producer");
923 acpi_os_printf(" %s\n",
924 ACPI_LEVEL_SENSITIVE == ext_irq_data->edge_level ?
925 "Level" : "Edge");
927 acpi_os_printf(" Active %s\n",
928 ACPI_ACTIVE_LOW == ext_irq_data->active_high_low ?
929 "low" : "high");
931 acpi_os_printf(" %s\n",
932 ACPI_SHARED == ext_irq_data->shared_exclusive ?
933 "Shared" : "Exclusive");
935 acpi_os_printf(" Interrupts : %X ( ",
936 ext_irq_data->number_of_interrupts);
938 for (index = 0; index < ext_irq_data->number_of_interrupts; index++) {
939 acpi_os_printf("%X ", ext_irq_data->interrupts[index]);
942 acpi_os_printf(")\n");
944 if (0xFF != ext_irq_data->resource_source.index) {
945 acpi_os_printf(" Resource Source Index: %X",
946 ext_irq_data->resource_source.index);
948 acpi_os_printf(" Resource Source: %s",
949 ext_irq_data->resource_source.string_ptr);
952 return;
955 /*******************************************************************************
957 * FUNCTION: acpi_rs_dump_resource_list
959 * PARAMETERS: Resource - pointer to the resource structure to dump.
961 * RETURN: None
963 * DESCRIPTION: Dispatches the structure to the correct dump routine.
965 ******************************************************************************/
967 void acpi_rs_dump_resource_list(struct acpi_resource *resource)
969 u8 count = 0;
970 u8 done = FALSE;
972 ACPI_FUNCTION_ENTRY();
974 if (acpi_dbg_level & ACPI_LV_RESOURCES && _COMPONENT & acpi_dbg_layer) {
975 while (!done) {
976 acpi_os_printf("Resource structure %X.\n", count++);
978 switch (resource->id) {
979 case ACPI_RSTYPE_IRQ:
980 acpi_rs_dump_irq(&resource->data);
981 break;
983 case ACPI_RSTYPE_DMA:
984 acpi_rs_dump_dma(&resource->data);
985 break;
987 case ACPI_RSTYPE_START_DPF:
988 acpi_rs_dump_start_depend_fns(&resource->data);
989 break;
991 case ACPI_RSTYPE_END_DPF:
992 acpi_os_printf
993 ("end_dependent_functions Resource\n");
994 /* acpi_rs_dump_end_dependent_functions (Resource->Data); */
995 break;
997 case ACPI_RSTYPE_IO:
998 acpi_rs_dump_io(&resource->data);
999 break;
1001 case ACPI_RSTYPE_FIXED_IO:
1002 acpi_rs_dump_fixed_io(&resource->data);
1003 break;
1005 case ACPI_RSTYPE_VENDOR:
1006 acpi_rs_dump_vendor_specific(&resource->data);
1007 break;
1009 case ACPI_RSTYPE_END_TAG:
1010 /*rs_dump_end_tag (Resource->Data); */
1011 acpi_os_printf("end_tag Resource\n");
1012 done = TRUE;
1013 break;
1015 case ACPI_RSTYPE_MEM24:
1016 acpi_rs_dump_memory24(&resource->data);
1017 break;
1019 case ACPI_RSTYPE_MEM32:
1020 acpi_rs_dump_memory32(&resource->data);
1021 break;
1023 case ACPI_RSTYPE_FIXED_MEM32:
1024 acpi_rs_dump_fixed_memory32(&resource->data);
1025 break;
1027 case ACPI_RSTYPE_ADDRESS16:
1028 acpi_rs_dump_address16(&resource->data);
1029 break;
1031 case ACPI_RSTYPE_ADDRESS32:
1032 acpi_rs_dump_address32(&resource->data);
1033 break;
1035 case ACPI_RSTYPE_ADDRESS64:
1036 acpi_rs_dump_address64(&resource->data);
1037 break;
1039 case ACPI_RSTYPE_EXT_IRQ:
1040 acpi_rs_dump_extended_irq(&resource->data);
1041 break;
1043 default:
1044 acpi_os_printf("Invalid resource type\n");
1045 break;
1049 resource =
1050 ACPI_PTR_ADD(struct acpi_resource, resource,
1051 resource->length);
1055 return;
1058 /*******************************************************************************
1060 * FUNCTION: acpi_rs_dump_irq_list
1062 * PARAMETERS: route_table - pointer to the routing table to dump.
1064 * RETURN: None
1066 * DESCRIPTION: Dispatches the structures to the correct dump routine.
1068 ******************************************************************************/
1070 void acpi_rs_dump_irq_list(u8 * route_table)
1072 u8 *buffer = route_table;
1073 u8 count = 0;
1074 u8 done = FALSE;
1075 struct acpi_pci_routing_table *prt_element;
1077 ACPI_FUNCTION_ENTRY();
1079 if (acpi_dbg_level & ACPI_LV_RESOURCES && _COMPONENT & acpi_dbg_layer) {
1080 prt_element =
1081 ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer);
1083 while (!done) {
1084 acpi_os_printf("PCI IRQ Routing Table structure %X.\n",
1085 count++);
1087 acpi_os_printf(" Address: %8.8X%8.8X\n",
1088 ACPI_FORMAT_UINT64(prt_element->
1089 address));
1091 acpi_os_printf(" Pin: %X\n", prt_element->pin);
1093 acpi_os_printf(" Source: %s\n", prt_element->source);
1095 acpi_os_printf(" source_index: %X\n",
1096 prt_element->source_index);
1098 buffer += prt_element->length;
1099 prt_element =
1100 ACPI_CAST_PTR(struct acpi_pci_routing_table,
1101 buffer);
1102 if (0 == prt_element->length) {
1103 done = TRUE;
1108 return;
1111 #endif