1 /*******************************************************************************
3 * Module Name: rsdump - Functions to display the resource structures.
5 ******************************************************************************/
8 * Copyright (C) 2000 - 2006, R. Byron Moore
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
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.
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_out_string(char *title
, char *value
);
54 static void acpi_rs_out_integer8(char *title
, u8 value
);
56 static void acpi_rs_out_integer16(char *title
, u16 value
);
58 static void acpi_rs_out_integer32(char *title
, u32 value
);
60 static void acpi_rs_out_integer64(char *title
, u64 value
);
62 static void acpi_rs_out_title(char *title
);
64 static void acpi_rs_dump_byte_list(u16 length
, u8
* data
);
66 static void acpi_rs_dump_dword_list(u8 length
, u32
* data
);
68 static void acpi_rs_dump_short_byte_list(u8 length
, u8
* data
);
71 acpi_rs_dump_resource_source(struct acpi_resource_source
*resource_source
);
73 static void acpi_rs_dump_address_common(union acpi_resource_data
*resource
);
76 acpi_rs_dump_descriptor(void *resource
, struct acpi_rsdump_info
*table
);
78 #define ACPI_RSD_OFFSET(f) (u8) ACPI_OFFSET (union acpi_resource_data,f)
79 #define ACPI_PRT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_pci_routing_table,f)
80 #define ACPI_RSD_TABLE_SIZE(name) (sizeof(name) / sizeof (struct acpi_rsdump_info))
82 /*******************************************************************************
84 * Resource Descriptor info tables
86 * Note: The first table entry must be a Title or Literal and must contain
87 * the table length (number of table entries)
89 ******************************************************************************/
91 struct acpi_rsdump_info acpi_rs_dump_irq
[6] = {
92 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_irq
), "IRQ", NULL
},
93 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(irq
.triggering
), "Triggering",
95 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(irq
.polarity
), "Polarity",
97 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(irq
.sharable
), "Sharing",
99 {ACPI_RSD_UINT8
, ACPI_RSD_OFFSET(irq
.interrupt_count
),
100 "Interrupt Count", NULL
},
101 {ACPI_RSD_SHORTLIST
, ACPI_RSD_OFFSET(irq
.interrupts
[0]),
102 "Interrupt List", NULL
}
105 struct acpi_rsdump_info acpi_rs_dump_dma
[6] = {
106 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_dma
), "DMA", NULL
},
107 {ACPI_RSD_2BITFLAG
, ACPI_RSD_OFFSET(dma
.type
), "Speed",
108 acpi_gbl_typ_decode
},
109 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(dma
.bus_master
), "Mastering",
111 {ACPI_RSD_2BITFLAG
, ACPI_RSD_OFFSET(dma
.transfer
), "Transfer Type",
112 acpi_gbl_siz_decode
},
113 {ACPI_RSD_UINT8
, ACPI_RSD_OFFSET(dma
.channel_count
), "Channel Count",
115 {ACPI_RSD_SHORTLIST
, ACPI_RSD_OFFSET(dma
.channels
[0]), "Channel List",
119 struct acpi_rsdump_info acpi_rs_dump_start_dpf
[3] = {
120 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_start_dpf
),
121 "Start-Dependent-Functions", NULL
},
122 {ACPI_RSD_2BITFLAG
, ACPI_RSD_OFFSET(start_dpf
.compatibility_priority
),
123 "Compatibility Priority", acpi_gbl_config_decode
},
124 {ACPI_RSD_2BITFLAG
, ACPI_RSD_OFFSET(start_dpf
.performance_robustness
),
125 "Performance/Robustness", acpi_gbl_config_decode
}
128 struct acpi_rsdump_info acpi_rs_dump_end_dpf
[1] = {
129 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_end_dpf
),
130 "End-Dependent-Functions", NULL
}
133 struct acpi_rsdump_info acpi_rs_dump_io
[6] = {
134 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_io
), "I/O", NULL
},
135 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(io
.io_decode
), "Address Decoding",
137 {ACPI_RSD_UINT16
, ACPI_RSD_OFFSET(io
.minimum
), "Address Minimum", NULL
},
138 {ACPI_RSD_UINT16
, ACPI_RSD_OFFSET(io
.maximum
), "Address Maximum", NULL
},
139 {ACPI_RSD_UINT8
, ACPI_RSD_OFFSET(io
.alignment
), "Alignment", NULL
},
140 {ACPI_RSD_UINT8
, ACPI_RSD_OFFSET(io
.address_length
), "Address Length",
144 struct acpi_rsdump_info acpi_rs_dump_fixed_io
[3] = {
145 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_fixed_io
),
147 {ACPI_RSD_UINT16
, ACPI_RSD_OFFSET(fixed_io
.address
), "Address", NULL
},
148 {ACPI_RSD_UINT8
, ACPI_RSD_OFFSET(fixed_io
.address_length
),
149 "Address Length", NULL
}
152 struct acpi_rsdump_info acpi_rs_dump_vendor
[3] = {
153 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_vendor
),
154 "Vendor Specific", NULL
},
155 {ACPI_RSD_UINT16
, ACPI_RSD_OFFSET(vendor
.byte_length
), "Length", NULL
},
156 {ACPI_RSD_LONGLIST
, ACPI_RSD_OFFSET(vendor
.byte_data
[0]), "Vendor Data",
160 struct acpi_rsdump_info acpi_rs_dump_end_tag
[1] = {
161 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_end_tag
), "EndTag",
165 struct acpi_rsdump_info acpi_rs_dump_memory24
[6] = {
166 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_memory24
),
167 "24-Bit Memory Range", NULL
},
168 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(memory24
.write_protect
),
169 "Write Protect", acpi_gbl_rw_decode
},
170 {ACPI_RSD_UINT16
, ACPI_RSD_OFFSET(memory24
.minimum
), "Address Minimum",
172 {ACPI_RSD_UINT16
, ACPI_RSD_OFFSET(memory24
.maximum
), "Address Maximum",
174 {ACPI_RSD_UINT16
, ACPI_RSD_OFFSET(memory24
.alignment
), "Alignment",
176 {ACPI_RSD_UINT16
, ACPI_RSD_OFFSET(memory24
.address_length
),
177 "Address Length", NULL
}
180 struct acpi_rsdump_info acpi_rs_dump_memory32
[6] = {
181 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_memory32
),
182 "32-Bit Memory Range", NULL
},
183 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(memory32
.write_protect
),
184 "Write Protect", acpi_gbl_rw_decode
},
185 {ACPI_RSD_UINT32
, ACPI_RSD_OFFSET(memory32
.minimum
), "Address Minimum",
187 {ACPI_RSD_UINT32
, ACPI_RSD_OFFSET(memory32
.maximum
), "Address Maximum",
189 {ACPI_RSD_UINT32
, ACPI_RSD_OFFSET(memory32
.alignment
), "Alignment",
191 {ACPI_RSD_UINT32
, ACPI_RSD_OFFSET(memory32
.address_length
),
192 "Address Length", NULL
}
195 struct acpi_rsdump_info acpi_rs_dump_fixed_memory32
[4] = {
196 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_fixed_memory32
),
197 "32-Bit Fixed Memory Range", NULL
},
198 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(fixed_memory32
.write_protect
),
199 "Write Protect", acpi_gbl_rw_decode
},
200 {ACPI_RSD_UINT32
, ACPI_RSD_OFFSET(fixed_memory32
.address
), "Address",
202 {ACPI_RSD_UINT32
, ACPI_RSD_OFFSET(fixed_memory32
.address_length
),
203 "Address Length", NULL
}
206 struct acpi_rsdump_info acpi_rs_dump_address16
[8] = {
207 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_address16
),
208 "16-Bit WORD Address Space", NULL
},
209 {ACPI_RSD_ADDRESS
, 0, NULL
, NULL
},
210 {ACPI_RSD_UINT16
, ACPI_RSD_OFFSET(address16
.granularity
), "Granularity",
212 {ACPI_RSD_UINT16
, ACPI_RSD_OFFSET(address16
.minimum
), "Address Minimum",
214 {ACPI_RSD_UINT16
, ACPI_RSD_OFFSET(address16
.maximum
), "Address Maximum",
216 {ACPI_RSD_UINT16
, ACPI_RSD_OFFSET(address16
.translation_offset
),
217 "Translation Offset", NULL
},
218 {ACPI_RSD_UINT16
, ACPI_RSD_OFFSET(address16
.address_length
),
219 "Address Length", NULL
},
220 {ACPI_RSD_SOURCE
, ACPI_RSD_OFFSET(address16
.resource_source
), NULL
, NULL
}
223 struct acpi_rsdump_info acpi_rs_dump_address32
[8] = {
224 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_address32
),
225 "32-Bit DWORD Address Space", NULL
},
226 {ACPI_RSD_ADDRESS
, 0, NULL
, NULL
},
227 {ACPI_RSD_UINT32
, ACPI_RSD_OFFSET(address32
.granularity
), "Granularity",
229 {ACPI_RSD_UINT32
, ACPI_RSD_OFFSET(address32
.minimum
), "Address Minimum",
231 {ACPI_RSD_UINT32
, ACPI_RSD_OFFSET(address32
.maximum
), "Address Maximum",
233 {ACPI_RSD_UINT32
, ACPI_RSD_OFFSET(address32
.translation_offset
),
234 "Translation Offset", NULL
},
235 {ACPI_RSD_UINT32
, ACPI_RSD_OFFSET(address32
.address_length
),
236 "Address Length", NULL
},
237 {ACPI_RSD_SOURCE
, ACPI_RSD_OFFSET(address32
.resource_source
), NULL
, NULL
}
240 struct acpi_rsdump_info acpi_rs_dump_address64
[8] = {
241 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_address64
),
242 "64-Bit QWORD Address Space", NULL
},
243 {ACPI_RSD_ADDRESS
, 0, NULL
, NULL
},
244 {ACPI_RSD_UINT64
, ACPI_RSD_OFFSET(address64
.granularity
), "Granularity",
246 {ACPI_RSD_UINT64
, ACPI_RSD_OFFSET(address64
.minimum
), "Address Minimum",
248 {ACPI_RSD_UINT64
, ACPI_RSD_OFFSET(address64
.maximum
), "Address Maximum",
250 {ACPI_RSD_UINT64
, ACPI_RSD_OFFSET(address64
.translation_offset
),
251 "Translation Offset", NULL
},
252 {ACPI_RSD_UINT64
, ACPI_RSD_OFFSET(address64
.address_length
),
253 "Address Length", NULL
},
254 {ACPI_RSD_SOURCE
, ACPI_RSD_OFFSET(address64
.resource_source
), NULL
, NULL
}
257 struct acpi_rsdump_info acpi_rs_dump_ext_address64
[8] = {
258 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_ext_address64
),
259 "64-Bit Extended Address Space", NULL
},
260 {ACPI_RSD_ADDRESS
, 0, NULL
, NULL
},
261 {ACPI_RSD_UINT64
, ACPI_RSD_OFFSET(ext_address64
.granularity
),
262 "Granularity", NULL
},
263 {ACPI_RSD_UINT64
, ACPI_RSD_OFFSET(ext_address64
.minimum
),
264 "Address Minimum", NULL
},
265 {ACPI_RSD_UINT64
, ACPI_RSD_OFFSET(ext_address64
.maximum
),
266 "Address Maximum", NULL
},
267 {ACPI_RSD_UINT64
, ACPI_RSD_OFFSET(ext_address64
.translation_offset
),
268 "Translation Offset", NULL
},
269 {ACPI_RSD_UINT64
, ACPI_RSD_OFFSET(ext_address64
.address_length
),
270 "Address Length", NULL
},
271 {ACPI_RSD_UINT64
, ACPI_RSD_OFFSET(ext_address64
.type_specific
),
272 "Type-Specific Attribute", NULL
}
275 struct acpi_rsdump_info acpi_rs_dump_ext_irq
[8] = {
276 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_ext_irq
),
277 "Extended IRQ", NULL
},
278 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(extended_irq
.producer_consumer
),
279 "Type", acpi_gbl_consume_decode
},
280 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(extended_irq
.triggering
),
281 "Triggering", acpi_gbl_he_decode
},
282 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(extended_irq
.polarity
), "Polarity",
284 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(extended_irq
.sharable
), "Sharing",
285 acpi_gbl_shr_decode
},
286 {ACPI_RSD_SOURCE
, ACPI_RSD_OFFSET(extended_irq
.resource_source
), NULL
,
288 {ACPI_RSD_UINT8
, ACPI_RSD_OFFSET(extended_irq
.interrupt_count
),
289 "Interrupt Count", NULL
},
290 {ACPI_RSD_DWORDLIST
, ACPI_RSD_OFFSET(extended_irq
.interrupts
[0]),
291 "Interrupt List", NULL
}
294 struct acpi_rsdump_info acpi_rs_dump_generic_reg
[6] = {
295 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_generic_reg
),
296 "Generic Register", NULL
},
297 {ACPI_RSD_UINT8
, ACPI_RSD_OFFSET(generic_reg
.space_id
), "Space ID",
299 {ACPI_RSD_UINT8
, ACPI_RSD_OFFSET(generic_reg
.bit_width
), "Bit Width",
301 {ACPI_RSD_UINT8
, ACPI_RSD_OFFSET(generic_reg
.bit_offset
), "Bit Offset",
303 {ACPI_RSD_UINT8
, ACPI_RSD_OFFSET(generic_reg
.access_size
),
304 "Access Size", NULL
},
305 {ACPI_RSD_UINT64
, ACPI_RSD_OFFSET(generic_reg
.address
), "Address", NULL
}
309 * Tables used for common address descriptor flag fields
311 static struct acpi_rsdump_info acpi_rs_dump_general_flags
[5] = {
312 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_general_flags
), NULL
,
314 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(address
.producer_consumer
),
315 "Consumer/Producer", acpi_gbl_consume_decode
},
316 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(address
.decode
), "Address Decode",
317 acpi_gbl_dec_decode
},
318 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(address
.min_address_fixed
),
319 "Min Relocatability", acpi_gbl_min_decode
},
320 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(address
.max_address_fixed
),
321 "Max Relocatability", acpi_gbl_max_decode
}
324 static struct acpi_rsdump_info acpi_rs_dump_memory_flags
[5] = {
325 {ACPI_RSD_LITERAL
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_memory_flags
),
326 "Resource Type", (void *)"Memory Range"},
327 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(address
.info
.mem
.write_protect
),
328 "Write Protect", acpi_gbl_rw_decode
},
329 {ACPI_RSD_2BITFLAG
, ACPI_RSD_OFFSET(address
.info
.mem
.caching
),
330 "Caching", acpi_gbl_mem_decode
},
331 {ACPI_RSD_2BITFLAG
, ACPI_RSD_OFFSET(address
.info
.mem
.range_type
),
332 "Range Type", acpi_gbl_mtp_decode
},
333 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(address
.info
.mem
.translation
),
334 "Translation", acpi_gbl_ttp_decode
}
337 static struct acpi_rsdump_info acpi_rs_dump_io_flags
[4] = {
338 {ACPI_RSD_LITERAL
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_io_flags
),
339 "Resource Type", (void *)"I/O Range"},
340 {ACPI_RSD_2BITFLAG
, ACPI_RSD_OFFSET(address
.info
.io
.range_type
),
341 "Range Type", acpi_gbl_rng_decode
},
342 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(address
.info
.io
.translation
),
343 "Translation", acpi_gbl_ttp_decode
},
344 {ACPI_RSD_1BITFLAG
, ACPI_RSD_OFFSET(address
.info
.io
.translation_type
),
345 "Translation Type", acpi_gbl_trs_decode
}
349 * Table used to dump _PRT contents
351 static struct acpi_rsdump_info acpi_rs_dump_prt
[5] = {
352 {ACPI_RSD_TITLE
, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_prt
), NULL
, NULL
},
353 {ACPI_RSD_UINT64
, ACPI_PRT_OFFSET(address
), "Address", NULL
},
354 {ACPI_RSD_UINT32
, ACPI_PRT_OFFSET(pin
), "Pin", NULL
},
355 {ACPI_RSD_STRING
, ACPI_PRT_OFFSET(source
[0]), "Source", NULL
},
356 {ACPI_RSD_UINT32
, ACPI_PRT_OFFSET(source_index
), "Source Index", NULL
}
359 /*******************************************************************************
361 * FUNCTION: acpi_rs_dump_descriptor
363 * PARAMETERS: Resource
369 ******************************************************************************/
372 acpi_rs_dump_descriptor(void *resource
, struct acpi_rsdump_info
*table
)
379 /* First table entry must contain the table length (# of table entries) */
381 count
= table
->offset
;
384 previous_target
= target
;
385 target
= ACPI_ADD_PTR(u8
, resource
, table
->offset
);
388 switch (table
->opcode
) {
391 * Optional resource title
394 acpi_os_printf("%s Resource\n", name
);
400 case ACPI_RSD_LITERAL
:
401 acpi_rs_out_string(name
,
402 ACPI_CAST_PTR(char, table
->pointer
));
405 case ACPI_RSD_STRING
:
406 acpi_rs_out_string(name
, ACPI_CAST_PTR(char, target
));
409 /* Data items, 8/16/32/64 bit */
412 acpi_rs_out_integer8(name
, ACPI_GET8(target
));
415 case ACPI_RSD_UINT16
:
416 acpi_rs_out_integer16(name
, ACPI_GET16(target
));
419 case ACPI_RSD_UINT32
:
420 acpi_rs_out_integer32(name
, ACPI_GET32(target
));
423 case ACPI_RSD_UINT64
:
424 acpi_rs_out_integer64(name
, ACPI_GET64(target
));
427 /* Flags: 1-bit and 2-bit flags supported */
429 case ACPI_RSD_1BITFLAG
:
430 acpi_rs_out_string(name
, ACPI_CAST_PTR(char,
436 case ACPI_RSD_2BITFLAG
:
437 acpi_rs_out_string(name
, ACPI_CAST_PTR(char,
443 case ACPI_RSD_SHORTLIST
:
445 * Short byte list (single line output) for DMA and IRQ resources
446 * Note: The list length is obtained from the previous table entry
448 if (previous_target
) {
449 acpi_rs_out_title(name
);
450 acpi_rs_dump_short_byte_list(*previous_target
,
455 case ACPI_RSD_LONGLIST
:
457 * Long byte list for Vendor resource data
458 * Note: The list length is obtained from the previous table entry
460 if (previous_target
) {
461 acpi_rs_dump_byte_list(ACPI_GET16
467 case ACPI_RSD_DWORDLIST
:
469 * Dword list for Extended Interrupt resources
470 * Note: The list length is obtained from the previous table entry
472 if (previous_target
) {
473 acpi_rs_dump_dword_list(*previous_target
,
479 case ACPI_RSD_ADDRESS
:
481 * Common flags for all Address resources
483 acpi_rs_dump_address_common(ACPI_CAST_PTR
484 (union acpi_resource_data
,
488 case ACPI_RSD_SOURCE
:
490 * Optional resource_source for Address resources
492 acpi_rs_dump_resource_source(ACPI_CAST_PTR
494 acpi_resource_source
,
499 acpi_os_printf("**** Invalid table opcode [%X] ****\n",
509 /*******************************************************************************
511 * FUNCTION: acpi_rs_dump_resource_source
513 * PARAMETERS: resource_source - Pointer to a Resource Source struct
517 * DESCRIPTION: Common routine for dumping the optional resource_source and the
518 * corresponding resource_source_index.
520 ******************************************************************************/
523 acpi_rs_dump_resource_source(struct acpi_resource_source
*resource_source
)
525 ACPI_FUNCTION_ENTRY();
527 if (resource_source
->index
== 0xFF) {
531 acpi_rs_out_integer8("Resource Source Index", resource_source
->index
);
533 acpi_rs_out_string("Resource Source",
534 resource_source
->string_ptr
?
535 resource_source
->string_ptr
: "[Not Specified]");
538 /*******************************************************************************
540 * FUNCTION: acpi_rs_dump_address_common
542 * PARAMETERS: Resource - Pointer to an internal resource descriptor
546 * DESCRIPTION: Dump the fields that are common to all Address resource
549 ******************************************************************************/
551 static void acpi_rs_dump_address_common(union acpi_resource_data
*resource
)
553 ACPI_FUNCTION_ENTRY();
555 /* Decode the type-specific flags */
557 switch (resource
->address
.resource_type
) {
558 case ACPI_MEMORY_RANGE
:
560 acpi_rs_dump_descriptor(resource
, acpi_rs_dump_memory_flags
);
565 acpi_rs_dump_descriptor(resource
, acpi_rs_dump_io_flags
);
568 case ACPI_BUS_NUMBER_RANGE
:
570 acpi_rs_out_string("Resource Type", "Bus Number Range");
575 acpi_rs_out_integer8("Resource Type",
576 (u8
) resource
->address
.resource_type
);
580 /* Decode the general flags */
582 acpi_rs_dump_descriptor(resource
, acpi_rs_dump_general_flags
);
585 /*******************************************************************************
587 * FUNCTION: acpi_rs_dump_resource_list
589 * PARAMETERS: resource_list - Pointer to a resource descriptor list
593 * DESCRIPTION: Dispatches the structure to the correct dump routine.
595 ******************************************************************************/
597 void acpi_rs_dump_resource_list(struct acpi_resource
*resource_list
)
602 ACPI_FUNCTION_ENTRY();
604 if (!(acpi_dbg_level
& ACPI_LV_RESOURCES
)
605 || !(_COMPONENT
& acpi_dbg_layer
)) {
609 /* Walk list and dump all resource descriptors (END_TAG terminates) */
612 acpi_os_printf("\n[%02X] ", count
);
615 /* Validate Type before dispatch */
617 type
= resource_list
->type
;
618 if (type
> ACPI_RESOURCE_TYPE_MAX
) {
620 ("Invalid descriptor type (%X) in resource list\n",
621 resource_list
->type
);
625 /* Dump the resource descriptor */
627 acpi_rs_dump_descriptor(&resource_list
->data
,
628 acpi_gbl_dump_resource_dispatch
[type
]);
630 /* Point to the next resource structure */
633 ACPI_ADD_PTR(struct acpi_resource
, resource_list
,
634 resource_list
->length
);
636 /* Exit when END_TAG descriptor is reached */
638 } while (type
!= ACPI_RESOURCE_TYPE_END_TAG
);
641 /*******************************************************************************
643 * FUNCTION: acpi_rs_dump_irq_list
645 * PARAMETERS: route_table - Pointer to the routing table to dump.
649 * DESCRIPTION: Print IRQ routing table
651 ******************************************************************************/
653 void acpi_rs_dump_irq_list(u8
* route_table
)
655 struct acpi_pci_routing_table
*prt_element
;
658 ACPI_FUNCTION_ENTRY();
660 if (!(acpi_dbg_level
& ACPI_LV_RESOURCES
)
661 || !(_COMPONENT
& acpi_dbg_layer
)) {
665 prt_element
= ACPI_CAST_PTR(struct acpi_pci_routing_table
, route_table
);
667 /* Dump all table elements, Exit on zero length element */
669 for (count
= 0; prt_element
->length
; count
++) {
670 acpi_os_printf("\n[%02X] PCI IRQ Routing Table Package\n",
672 acpi_rs_dump_descriptor(prt_element
, acpi_rs_dump_prt
);
674 prt_element
= ACPI_ADD_PTR(struct acpi_pci_routing_table
,
675 prt_element
, prt_element
->length
);
679 /*******************************************************************************
681 * FUNCTION: acpi_rs_out*
683 * PARAMETERS: Title - Name of the resource field
684 * Value - Value of the resource field
688 * DESCRIPTION: Miscellaneous helper functions to consistently format the
689 * output of the resource dump routines
691 ******************************************************************************/
693 static void acpi_rs_out_string(char *title
, char *value
)
695 acpi_os_printf("%27s : %s", title
, value
);
697 acpi_os_printf("[NULL NAMESTRING]");
699 acpi_os_printf("\n");
702 static void acpi_rs_out_integer8(char *title
, u8 value
)
704 acpi_os_printf("%27s : %2.2X\n", title
, value
);
707 static void acpi_rs_out_integer16(char *title
, u16 value
)
709 acpi_os_printf("%27s : %4.4X\n", title
, value
);
712 static void acpi_rs_out_integer32(char *title
, u32 value
)
714 acpi_os_printf("%27s : %8.8X\n", title
, value
);
717 static void acpi_rs_out_integer64(char *title
, u64 value
)
719 acpi_os_printf("%27s : %8.8X%8.8X\n", title
, ACPI_FORMAT_UINT64(value
));
722 static void acpi_rs_out_title(char *title
)
724 acpi_os_printf("%27s : ", title
);
727 /*******************************************************************************
729 * FUNCTION: acpi_rs_dump*List
731 * PARAMETERS: Length - Number of elements in the list
732 * Data - Start of the list
736 * DESCRIPTION: Miscellaneous functions to dump lists of raw data
738 ******************************************************************************/
740 static void acpi_rs_dump_byte_list(u16 length
, u8
* data
)
744 for (i
= 0; i
< length
; i
++) {
745 acpi_os_printf("%25s%2.2X : %2.2X\n", "Byte", i
, data
[i
]);
749 static void acpi_rs_dump_short_byte_list(u8 length
, u8
* data
)
753 for (i
= 0; i
< length
; i
++) {
754 acpi_os_printf("%X ", data
[i
]);
756 acpi_os_printf("\n");
759 static void acpi_rs_dump_dword_list(u8 length
, u32
* data
)
763 for (i
= 0; i
< length
; i
++) {
764 acpi_os_printf("%25s%2.2X : %8.8X\n", "Dword", i
, data
[i
]);