diff options
Diffstat (limited to 'drivers/acpi/acpica')
-rw-r--r-- | drivers/acpi/acpica/acresrc.h | 4 | ||||
-rw-r--r-- | drivers/acpi/acpica/rsdump.c | 229 |
2 files changed, 117 insertions, 116 deletions
diff --git a/drivers/acpi/acpica/acresrc.h b/drivers/acpi/acpica/acresrc.h index ac20b9dcf7ea..6357efb01b93 100644 --- a/drivers/acpi/acpica/acresrc.h +++ b/drivers/acpi/acpica/acresrc.h | |||
@@ -299,9 +299,9 @@ acpi_rs_set_resource_length(acpi_rsdesc_size total_length, | |||
299 | union aml_resource *aml); | 299 | union aml_resource *aml); |
300 | 300 | ||
301 | /* | 301 | /* |
302 | * rsdump | 302 | * rsdump - Debugger support |
303 | */ | 303 | */ |
304 | #ifdef ACPI_EXEC_APP | 304 | #ifdef ACPI_DEBUGGER |
305 | void acpi_rs_dump_resource_list(struct acpi_resource *resource); | 305 | void acpi_rs_dump_resource_list(struct acpi_resource *resource); |
306 | 306 | ||
307 | void acpi_rs_dump_irq_list(u8 *route_table); | 307 | void acpi_rs_dump_irq_list(u8 *route_table); |
diff --git a/drivers/acpi/acpica/rsdump.c b/drivers/acpi/acpica/rsdump.c index 6d588d4bae9c..c428bb33204e 100644 --- a/drivers/acpi/acpica/rsdump.c +++ b/drivers/acpi/acpica/rsdump.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | * | 2 | * |
3 | * Module Name: rsdump - Functions to display the resource structures. | 3 | * Module Name: rsdump - AML debugger support for resource structures. |
4 | * | 4 | * |
5 | ******************************************************************************/ | 5 | ******************************************************************************/ |
6 | 6 | ||
@@ -48,7 +48,10 @@ | |||
48 | #define _COMPONENT ACPI_RESOURCES | 48 | #define _COMPONENT ACPI_RESOURCES |
49 | ACPI_MODULE_NAME("rsdump") | 49 | ACPI_MODULE_NAME("rsdump") |
50 | 50 | ||
51 | #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER) | 51 | /* |
52 | * All functions in this module are used by the AML Debugger only | ||
53 | */ | ||
54 | #if defined(ACPI_DEBUGGER) | ||
52 | /* Local prototypes */ | 55 | /* Local prototypes */ |
53 | static void acpi_rs_out_string(char *title, char *value); | 56 | static void acpi_rs_out_string(char *title, char *value); |
54 | 57 | ||
@@ -80,6 +83,116 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table); | |||
80 | 83 | ||
81 | /******************************************************************************* | 84 | /******************************************************************************* |
82 | * | 85 | * |
86 | * FUNCTION: acpi_rs_dump_resource_list | ||
87 | * | ||
88 | * PARAMETERS: resource_list - Pointer to a resource descriptor list | ||
89 | * | ||
90 | * RETURN: None | ||
91 | * | ||
92 | * DESCRIPTION: Dispatches the structure to the correct dump routine. | ||
93 | * | ||
94 | ******************************************************************************/ | ||
95 | |||
96 | void acpi_rs_dump_resource_list(struct acpi_resource *resource_list) | ||
97 | { | ||
98 | u32 count = 0; | ||
99 | u32 type; | ||
100 | |||
101 | ACPI_FUNCTION_ENTRY(); | ||
102 | |||
103 | /* Check if debug output enabled */ | ||
104 | |||
105 | if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) { | ||
106 | return; | ||
107 | } | ||
108 | |||
109 | /* Walk list and dump all resource descriptors (END_TAG terminates) */ | ||
110 | |||
111 | do { | ||
112 | acpi_os_printf("\n[%02X] ", count); | ||
113 | count++; | ||
114 | |||
115 | /* Validate Type before dispatch */ | ||
116 | |||
117 | type = resource_list->type; | ||
118 | if (type > ACPI_RESOURCE_TYPE_MAX) { | ||
119 | acpi_os_printf | ||
120 | ("Invalid descriptor type (%X) in resource list\n", | ||
121 | resource_list->type); | ||
122 | return; | ||
123 | } | ||
124 | |||
125 | /* Sanity check the length. It must not be zero, or we loop forever */ | ||
126 | |||
127 | if (!resource_list->length) { | ||
128 | acpi_os_printf | ||
129 | ("Invalid zero length descriptor in resource list\n"); | ||
130 | return; | ||
131 | } | ||
132 | |||
133 | /* Dump the resource descriptor */ | ||
134 | |||
135 | if (type == ACPI_RESOURCE_TYPE_SERIAL_BUS) { | ||
136 | acpi_rs_dump_descriptor(&resource_list->data, | ||
137 | acpi_gbl_dump_serial_bus_dispatch | ||
138 | [resource_list->data. | ||
139 | common_serial_bus.type]); | ||
140 | } else { | ||
141 | acpi_rs_dump_descriptor(&resource_list->data, | ||
142 | acpi_gbl_dump_resource_dispatch | ||
143 | [type]); | ||
144 | } | ||
145 | |||
146 | /* Point to the next resource structure */ | ||
147 | |||
148 | resource_list = ACPI_NEXT_RESOURCE(resource_list); | ||
149 | |||
150 | /* Exit when END_TAG descriptor is reached */ | ||
151 | |||
152 | } while (type != ACPI_RESOURCE_TYPE_END_TAG); | ||
153 | } | ||
154 | |||
155 | /******************************************************************************* | ||
156 | * | ||
157 | * FUNCTION: acpi_rs_dump_irq_list | ||
158 | * | ||
159 | * PARAMETERS: route_table - Pointer to the routing table to dump. | ||
160 | * | ||
161 | * RETURN: None | ||
162 | * | ||
163 | * DESCRIPTION: Print IRQ routing table | ||
164 | * | ||
165 | ******************************************************************************/ | ||
166 | |||
167 | void acpi_rs_dump_irq_list(u8 *route_table) | ||
168 | { | ||
169 | struct acpi_pci_routing_table *prt_element; | ||
170 | u8 count; | ||
171 | |||
172 | ACPI_FUNCTION_ENTRY(); | ||
173 | |||
174 | /* Check if debug output enabled */ | ||
175 | |||
176 | if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) { | ||
177 | return; | ||
178 | } | ||
179 | |||
180 | prt_element = ACPI_CAST_PTR(struct acpi_pci_routing_table, route_table); | ||
181 | |||
182 | /* Dump all table elements, Exit on zero length element */ | ||
183 | |||
184 | for (count = 0; prt_element->length; count++) { | ||
185 | acpi_os_printf("\n[%02X] PCI IRQ Routing Table Package\n", | ||
186 | count); | ||
187 | acpi_rs_dump_descriptor(prt_element, acpi_rs_dump_prt); | ||
188 | |||
189 | prt_element = ACPI_ADD_PTR(struct acpi_pci_routing_table, | ||
190 | prt_element, prt_element->length); | ||
191 | } | ||
192 | } | ||
193 | |||
194 | /******************************************************************************* | ||
195 | * | ||
83 | * FUNCTION: acpi_rs_dump_descriptor | 196 | * FUNCTION: acpi_rs_dump_descriptor |
84 | * | 197 | * |
85 | * PARAMETERS: resource - Buffer containing the resource | 198 | * PARAMETERS: resource - Buffer containing the resource |
@@ -355,118 +468,6 @@ static void acpi_rs_dump_address_common(union acpi_resource_data *resource) | |||
355 | acpi_rs_dump_descriptor(resource, acpi_rs_dump_general_flags); | 468 | acpi_rs_dump_descriptor(resource, acpi_rs_dump_general_flags); |
356 | } | 469 | } |
357 | 470 | ||
358 | #ifdef ACPI_EXEC_APP | ||
359 | /******************************************************************************* | ||
360 | * | ||
361 | * FUNCTION: acpi_rs_dump_resource_list | ||
362 | * | ||
363 | * PARAMETERS: resource_list - Pointer to a resource descriptor list | ||
364 | * | ||
365 | * RETURN: None | ||
366 | * | ||
367 | * DESCRIPTION: Dispatches the structure to the correct dump routine. | ||
368 | * | ||
369 | ******************************************************************************/ | ||
370 | |||
371 | void acpi_rs_dump_resource_list(struct acpi_resource *resource_list) | ||
372 | { | ||
373 | u32 count = 0; | ||
374 | u32 type; | ||
375 | |||
376 | ACPI_FUNCTION_ENTRY(); | ||
377 | |||
378 | /* Check if debug output enabled */ | ||
379 | |||
380 | if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) { | ||
381 | return; | ||
382 | } | ||
383 | |||
384 | /* Walk list and dump all resource descriptors (END_TAG terminates) */ | ||
385 | |||
386 | do { | ||
387 | acpi_os_printf("\n[%02X] ", count); | ||
388 | count++; | ||
389 | |||
390 | /* Validate Type before dispatch */ | ||
391 | |||
392 | type = resource_list->type; | ||
393 | if (type > ACPI_RESOURCE_TYPE_MAX) { | ||
394 | acpi_os_printf | ||
395 | ("Invalid descriptor type (%X) in resource list\n", | ||
396 | resource_list->type); | ||
397 | return; | ||
398 | } | ||
399 | |||
400 | /* Sanity check the length. It must not be zero, or we loop forever */ | ||
401 | |||
402 | if (!resource_list->length) { | ||
403 | acpi_os_printf | ||
404 | ("Invalid zero length descriptor in resource list\n"); | ||
405 | return; | ||
406 | } | ||
407 | |||
408 | /* Dump the resource descriptor */ | ||
409 | |||
410 | if (type == ACPI_RESOURCE_TYPE_SERIAL_BUS) { | ||
411 | acpi_rs_dump_descriptor(&resource_list->data, | ||
412 | acpi_gbl_dump_serial_bus_dispatch | ||
413 | [resource_list->data. | ||
414 | common_serial_bus.type]); | ||
415 | } else { | ||
416 | acpi_rs_dump_descriptor(&resource_list->data, | ||
417 | acpi_gbl_dump_resource_dispatch | ||
418 | [type]); | ||
419 | } | ||
420 | |||
421 | /* Point to the next resource structure */ | ||
422 | |||
423 | resource_list = ACPI_NEXT_RESOURCE(resource_list); | ||
424 | |||
425 | /* Exit when END_TAG descriptor is reached */ | ||
426 | |||
427 | } while (type != ACPI_RESOURCE_TYPE_END_TAG); | ||
428 | } | ||
429 | |||
430 | /******************************************************************************* | ||
431 | * | ||
432 | * FUNCTION: acpi_rs_dump_irq_list | ||
433 | * | ||
434 | * PARAMETERS: route_table - Pointer to the routing table to dump. | ||
435 | * | ||
436 | * RETURN: None | ||
437 | * | ||
438 | * DESCRIPTION: Print IRQ routing table | ||
439 | * | ||
440 | ******************************************************************************/ | ||
441 | |||
442 | void acpi_rs_dump_irq_list(u8 *route_table) | ||
443 | { | ||
444 | struct acpi_pci_routing_table *prt_element; | ||
445 | u8 count; | ||
446 | |||
447 | ACPI_FUNCTION_ENTRY(); | ||
448 | |||
449 | /* Check if debug output enabled */ | ||
450 | |||
451 | if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) { | ||
452 | return; | ||
453 | } | ||
454 | |||
455 | prt_element = ACPI_CAST_PTR(struct acpi_pci_routing_table, route_table); | ||
456 | |||
457 | /* Dump all table elements, Exit on zero length element */ | ||
458 | |||
459 | for (count = 0; prt_element->length; count++) { | ||
460 | acpi_os_printf("\n[%02X] PCI IRQ Routing Table Package\n", | ||
461 | count); | ||
462 | acpi_rs_dump_descriptor(prt_element, acpi_rs_dump_prt); | ||
463 | |||
464 | prt_element = ACPI_ADD_PTR(struct acpi_pci_routing_table, | ||
465 | prt_element, prt_element->length); | ||
466 | } | ||
467 | } | ||
468 | #endif | ||
469 | |||
470 | /******************************************************************************* | 471 | /******************************************************************************* |
471 | * | 472 | * |
472 | * FUNCTION: acpi_rs_out* | 473 | * FUNCTION: acpi_rs_out* |