aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/resources/rsdump.c
diff options
context:
space:
mode:
authorRobert Moore <Robert.Moore@intel.com>2005-09-16 16:51:15 -0400
committerLen Brown <len.brown@intel.com>2005-09-21 23:51:39 -0400
commitbda663d36b94c723153246a4231bbc0f1cd1836e (patch)
treecc9f75c1d010d1b99d29f13acd600b21eda5eec5 /drivers/acpi/resources/rsdump.c
parentefb0372bbaf5b829ff8c39db372779928af542a7 (diff)
[ACPI] ACPICA 20050916
Fixed a problem within the Resource Manager where support for the Generic Register descriptor was not fully implemented. This descriptor is now fully recognized, parsed, disassembled, and displayed. Restructured the Resource Manager code to utilize table-driven dispatch and lookup, eliminating many of the large switch() statements. This reduces overall subsystem code size and code complexity. Affects the resource parsing and construction, disassembly, and debug dump output. Cleaned up and restructured the debug dump output for all resource descriptors. Improved readability of the output and reduced code size. Fixed a problem where changes to internal data structures caused the optional ACPI_MUTEX_DEBUG code to fail compilation if specified. Signed-off-by: Robert Moore <Robert.Moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/resources/rsdump.c')
-rw-r--r--drivers/acpi/resources/rsdump.c1284
1 files changed, 612 insertions, 672 deletions
diff --git a/drivers/acpi/resources/rsdump.c b/drivers/acpi/resources/rsdump.c
index 75bd34d1783f..9d93ee5f0060 100644
--- a/drivers/acpi/resources/rsdump.c
+++ b/drivers/acpi/resources/rsdump.c
@@ -49,1021 +49,967 @@ ACPI_MODULE_NAME("rsdump")
49 49
50#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) 50#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
51/* Local prototypes */ 51/* Local prototypes */
52static void acpi_rs_dump_irq(union acpi_resource_data *data); 52static void acpi_rs_dump_irq(union acpi_resource_data *resource);
53 53
54static void acpi_rs_dump_address16(union acpi_resource_data *data); 54static void acpi_rs_dump_address16(union acpi_resource_data *resource);
55 55
56static void acpi_rs_dump_address32(union acpi_resource_data *data); 56static void acpi_rs_dump_address32(union acpi_resource_data *resource);
57 57
58static void acpi_rs_dump_address64(union acpi_resource_data *data); 58static void acpi_rs_dump_address64(union acpi_resource_data *resource);
59 59
60static void acpi_rs_dump_dma(union acpi_resource_data *data); 60static void acpi_rs_dump_dma(union acpi_resource_data *resource);
61 61
62static void acpi_rs_dump_io(union acpi_resource_data *data); 62static void acpi_rs_dump_io(union acpi_resource_data *resource);
63 63
64static void acpi_rs_dump_extended_irq(union acpi_resource_data *data); 64static void acpi_rs_dump_extended_irq(union acpi_resource_data *resource);
65 65
66static void acpi_rs_dump_fixed_io(union acpi_resource_data *data); 66static void acpi_rs_dump_fixed_io(union acpi_resource_data *resource);
67 67
68static void acpi_rs_dump_fixed_memory32(union acpi_resource_data *data); 68static void acpi_rs_dump_fixed_memory32(union acpi_resource_data *resource);
69 69
70static void acpi_rs_dump_memory24(union acpi_resource_data *data); 70static void acpi_rs_dump_memory24(union acpi_resource_data *resource);
71 71
72static void acpi_rs_dump_memory32(union acpi_resource_data *data); 72static void acpi_rs_dump_memory32(union acpi_resource_data *resource);
73 73
74static void acpi_rs_dump_start_depend_fns(union acpi_resource_data *data); 74static void acpi_rs_dump_start_depend_fns(union acpi_resource_data *resource);
75 75
76static void acpi_rs_dump_vendor_specific(union acpi_resource_data *data); 76static void acpi_rs_dump_vendor_specific(union acpi_resource_data *resource);
77
78static void acpi_rs_dump_generic_reg(union acpi_resource_data *resource);
79
80static void acpi_rs_dump_end_depend_fns(union acpi_resource_data *resource);
81
82static void acpi_rs_dump_end_tag(union acpi_resource_data *resource);
83
84static void acpi_rs_out_string(char *title, char *value);
85
86static void acpi_rs_out_integer8(char *title, u8 value);
87
88static void acpi_rs_out_integer16(char *title, u16 value);
89
90static void acpi_rs_out_integer32(char *title, u32 value);
91
92static void acpi_rs_out_integer64(char *title, u64 value);
93
94static void acpi_rs_out_title(char *title);
95
96static void acpi_rs_dump_byte_list(u32 length, u8 * data);
97
98static void acpi_rs_dump_dword_list(u32 length, u32 * data);
99
100static void acpi_rs_dump_short_byte_list(u32 length, u32 * data);
101
102static void
103acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source);
104
105static void acpi_rs_dump_address_common(union acpi_resource_data *resource);
106
107/* Dispatch table for resource dump functions */
108
109typedef
110void (*ACPI_DUMP_RESOURCE) (union acpi_resource_data * data);
111
112static ACPI_DUMP_RESOURCE acpi_gbl_dump_resource_dispatch[] = {
113 acpi_rs_dump_irq, /* ACPI_RSTYPE_IRQ */
114 acpi_rs_dump_dma, /* ACPI_RSTYPE_DMA */
115 acpi_rs_dump_start_depend_fns, /* ACPI_RSTYPE_START_DPF */
116 acpi_rs_dump_end_depend_fns, /* ACPI_RSTYPE_END_DPF */
117 acpi_rs_dump_io, /* ACPI_RSTYPE_IO */
118 acpi_rs_dump_fixed_io, /* ACPI_RSTYPE_FIXED_IO */
119 acpi_rs_dump_vendor_specific, /* ACPI_RSTYPE_VENDOR */
120 acpi_rs_dump_end_tag, /* ACPI_RSTYPE_END_TAG */
121 acpi_rs_dump_memory24, /* ACPI_RSTYPE_MEM24 */
122 acpi_rs_dump_memory32, /* ACPI_RSTYPE_MEM32 */
123 acpi_rs_dump_fixed_memory32, /* ACPI_RSTYPE_FIXED_MEM32 */
124 acpi_rs_dump_address16, /* ACPI_RSTYPE_ADDRESS16 */
125 acpi_rs_dump_address32, /* ACPI_RSTYPE_ADDRESS32 */
126 acpi_rs_dump_address64, /* ACPI_RSTYPE_ADDRESS64 */
127 acpi_rs_dump_extended_irq, /* ACPI_RSTYPE_EXT_IRQ */
128 acpi_rs_dump_generic_reg /* ACPI_RSTYPE_GENERIC_REG */
129};
77 130
78/******************************************************************************* 131/*******************************************************************************
79 * 132 *
80 * FUNCTION: acpi_rs_dump_irq 133 * FUNCTION: acpi_rs_out*
134 *
135 * PARAMETERS: Title - Name of the resource field
136 * Value - Value of the resource field
137 *
138 * RETURN: None
139 *
140 * DESCRIPTION: Miscellaneous helper functions to consistently format the
141 * output of the resource dump routines
142 *
143 ******************************************************************************/
144
145static void acpi_rs_out_string(char *title, char *value)
146{
147 acpi_os_printf("%30s : %s\n", title, value);
148}
149
150static void acpi_rs_out_integer8(char *title, u8 value)
151{
152 acpi_os_printf("%30s : %2.2X\n", title, value);
153}
154
155static void acpi_rs_out_integer16(char *title, u16 value)
156{
157 acpi_os_printf("%30s : %4.4X\n", title, value);
158}
159
160static void acpi_rs_out_integer32(char *title, u32 value)
161{
162 acpi_os_printf("%30s : %8.8X\n", title, value);
163}
164
165static void acpi_rs_out_integer64(char *title, u64 value)
166{
167 acpi_os_printf("%30s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value));
168}
169
170static void acpi_rs_out_title(char *title)
171{
172 acpi_os_printf("%30s : ", title);
173}
174
175/*******************************************************************************
176 *
177 * FUNCTION: acpi_rs_dump*List
178 *
179 * PARAMETERS: Length - Number of elements in the list
180 * Data - Start of the list
181 *
182 * RETURN: None
183 *
184 * DESCRIPTION: Miscellaneous functions to dump lists of raw data
185 *
186 ******************************************************************************/
187
188static void acpi_rs_dump_byte_list(u32 length, u8 * data)
189{
190 u32 i;
191
192 for (i = 0; i < length; i++) {
193 acpi_os_printf("%28s%2.2X : %2.2X\n", "Byte", i, data[i]);
194 }
195}
196
197static void acpi_rs_dump_dword_list(u32 length, u32 * data)
198{
199 u32 i;
200
201 for (i = 0; i < length; i++) {
202 acpi_os_printf("%28s%2.2X : %8.8X\n", "Dword", i, data[i]);
203 }
204}
205
206static void acpi_rs_dump_short_byte_list(u32 length, u32 * data)
207{
208 u32 i;
209
210 for (i = 0; i < length; i++) {
211 acpi_os_printf("%X ", data[i]);
212 }
213 acpi_os_printf("\n");
214}
215
216/*******************************************************************************
217 *
218 * FUNCTION: acpi_rs_dump_resource_source
81 * 219 *
82 * PARAMETERS: Data - pointer to the resource structure to dump. 220 * PARAMETERS: resource_source - Pointer to a Resource Source struct
83 * 221 *
84 * RETURN: None 222 * RETURN: None
85 * 223 *
86 * DESCRIPTION: Prints out the various members of the Data structure type. 224 * DESCRIPTION: Common routine for dumping the optional resource_source and the
225 * corresponding resource_source_index.
87 * 226 *
88 ******************************************************************************/ 227 ******************************************************************************/
89 228
90static void acpi_rs_dump_irq(union acpi_resource_data *data) 229static void
230acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source)
91{ 231{
92 struct acpi_resource_irq *irq_data = (struct acpi_resource_irq *)data;
93 u8 index = 0;
94 232
233 if (resource_source->index == 0xFF) {
234 return;
235 }
236
237 acpi_rs_out_integer8("Resource Source Index",
238 (u8) resource_source->index);
239
240 acpi_rs_out_string("Resource Source",
241 resource_source->string_ptr ?
242 resource_source->string_ptr : "[Not Specified]");
243}
244
245/*******************************************************************************
246 *
247 * FUNCTION: acpi_rs_dump_address_common
248 *
249 * PARAMETERS: Resource - Pointer to an internal resource descriptor
250 *
251 * RETURN: None
252 *
253 * DESCRIPTION: Dump the fields that are common to all Address resource
254 * descriptors
255 *
256 ******************************************************************************/
257
258static void acpi_rs_dump_address_common(union acpi_resource_data *resource)
259{
95 ACPI_FUNCTION_ENTRY(); 260 ACPI_FUNCTION_ENTRY();
96 261
97 acpi_os_printf("IRQ Resource\n"); 262 /* Decode the type-specific flags */
263
264 switch (resource->address.resource_type) {
265 case ACPI_MEMORY_RANGE:
98 266
99 acpi_os_printf(" %s Triggered\n", 267 acpi_rs_out_string("Resource Type", "Memory Range");
100 ACPI_LEVEL_SENSITIVE == 268
101 irq_data->edge_level ? "Level" : "Edge"); 269 acpi_rs_out_title("Type-Specific Flags");
270
271 switch (resource->address.attribute.memory.cache_attribute) {
272 case ACPI_NON_CACHEABLE_MEMORY:
273 acpi_os_printf("Noncacheable memory\n");
274 break;
102 275
103 acpi_os_printf(" Active %s\n", 276 case ACPI_CACHABLE_MEMORY:
104 ACPI_ACTIVE_LOW == 277 acpi_os_printf("Cacheable memory\n");
105 irq_data->active_high_low ? "Low" : "High"); 278 break;
106 279
107 acpi_os_printf(" %s\n", 280 case ACPI_WRITE_COMBINING_MEMORY:
108 ACPI_SHARED == 281 acpi_os_printf("Write-combining memory\n");
109 irq_data->shared_exclusive ? "Shared" : "Exclusive"); 282 break;
110 283
111 acpi_os_printf(" %X Interrupts ( ", irq_data->number_of_interrupts); 284 case ACPI_PREFETCHABLE_MEMORY:
285 acpi_os_printf("Prefetchable memory\n");
286 break;
287
288 default:
289 acpi_os_printf("Invalid cache attribute\n");
290 break;
291 }
292
293 acpi_rs_out_string("Read/Write Attribute",
294 ACPI_READ_WRITE_MEMORY ==
295 resource->address.attribute.memory.
296 read_write_attribute ? "Read/Write" :
297 "Read Only");
298 break;
299
300 case ACPI_IO_RANGE:
301
302 acpi_rs_out_string("Resource Type", "I/O Range");
303
304 acpi_rs_out_title("Type-Specific Flags");
305
306 switch (resource->address.attribute.io.range_attribute) {
307 case ACPI_NON_ISA_ONLY_RANGES:
308 acpi_os_printf("Non-ISA I/O Addresses\n");
309 break;
112 310
113 for (index = 0; index < irq_data->number_of_interrupts; index++) { 311 case ACPI_ISA_ONLY_RANGES:
114 acpi_os_printf("%X ", irq_data->interrupts[index]); 312 acpi_os_printf("ISA I/O Addresses\n");
313 break;
314
315 case ACPI_ENTIRE_RANGE:
316 acpi_os_printf("ISA and non-ISA I/O Addresses\n");
317 break;
318
319 default:
320 acpi_os_printf("Invalid range attribute\n");
321 break;
322 }
323
324 acpi_rs_out_string("Translation Attribute",
325 ACPI_SPARSE_TRANSLATION ==
326 resource->address.attribute.io.
327 translation_attribute ? "Sparse Translation"
328 : "Dense Translation");
329 break;
330
331 case ACPI_BUS_NUMBER_RANGE:
332
333 acpi_rs_out_string("Resource Type", "Bus Number Range");
334 break;
335
336 default:
337
338 acpi_rs_out_integer8("Resource Type",
339 (u8) resource->address.resource_type);
340 break;
115 } 341 }
116 342
117 acpi_os_printf(")\n"); 343 /* Decode the general flags */
118 return; 344
345 acpi_rs_out_string("Resource",
346 ACPI_CONSUMER ==
347 resource->address.
348 producer_consumer ? "Consumer" : "Producer");
349
350 acpi_rs_out_string("Decode",
351 ACPI_SUB_DECODE == resource->address.decode ?
352 "Subtractive" : "Positive");
353
354 acpi_rs_out_string("Min Address",
355 ACPI_ADDRESS_FIXED ==
356 resource->address.
357 min_address_fixed ? "Fixed" : "Not Fixed");
358
359 acpi_rs_out_string("Max Address",
360 ACPI_ADDRESS_FIXED ==
361 resource->address.
362 max_address_fixed ? "Fixed" : "Not Fixed");
119} 363}
120 364
121/******************************************************************************* 365/*******************************************************************************
122 * 366 *
123 * FUNCTION: acpi_rs_dump_dma 367 * FUNCTION: acpi_rs_dump_resource_list
124 * 368 *
125 * PARAMETERS: Data - pointer to the resource structure to dump. 369 * PARAMETERS: resource_list - Pointer to a resource descriptor list
126 * 370 *
127 * RETURN: None 371 * RETURN: None
128 * 372 *
129 * DESCRIPTION: Prints out the various members of the Data structure type. 373 * DESCRIPTION: Dispatches the structure to the correct dump routine.
130 * 374 *
131 ******************************************************************************/ 375 ******************************************************************************/
132 376
133static void acpi_rs_dump_dma(union acpi_resource_data *data) 377void acpi_rs_dump_resource_list(struct acpi_resource *resource_list)
134{ 378{
135 struct acpi_resource_dma *dma_data = (struct acpi_resource_dma *)data; 379 u32 count = 0;
136 u8 index = 0;
137 380
138 ACPI_FUNCTION_ENTRY(); 381 ACPI_FUNCTION_ENTRY();
139 382
383 if (!(acpi_dbg_level & ACPI_LV_RESOURCES)
384 || !(_COMPONENT & acpi_dbg_layer)) {
385 return;
386 }
387
388 /* Dump all resource descriptors in the list */
389
390 while (resource_list) {
391 acpi_os_printf("\n[%02X] ", count);
392
393 /* Validate Type before dispatch */
394
395 if (resource_list->type > ACPI_RSTYPE_MAX) {
396 acpi_os_printf
397 ("Invalid descriptor type (%X) in resource list\n",
398 resource_list->type);
399 return;
400 }
401
402 /* Dump the resource descriptor */
403
404 acpi_gbl_dump_resource_dispatch[resource_list->
405 type] (&resource_list->data);
406
407 /* Exit on end tag */
408
409 if (resource_list->type == ACPI_RSTYPE_END_TAG) {
410 return;
411 }
412
413 /* Get the next resource structure */
414
415 resource_list =
416 ACPI_PTR_ADD(struct acpi_resource, resource_list,
417 resource_list->length);
418 count++;
419 }
420}
421
422/*******************************************************************************
423 *
424 * FUNCTION: acpi_rs_dump_irq
425 *
426 * PARAMETERS: Resource - Pointer to an internal resource descriptor
427 *
428 * RETURN: None
429 *
430 * DESCRIPTION: Dump the field names and values of the resource descriptor
431 *
432 ******************************************************************************/
433
434static void acpi_rs_dump_irq(union acpi_resource_data *resource)
435{
436 ACPI_FUNCTION_ENTRY();
437
438 acpi_os_printf("IRQ Resource\n");
439
440 acpi_rs_out_string("Triggering",
441 ACPI_LEVEL_SENSITIVE ==
442 resource->irq.edge_level ? "Level" : "Edge");
443
444 acpi_rs_out_string("Active",
445 ACPI_ACTIVE_LOW ==
446 resource->irq.active_high_low ? "Low" : "High");
447
448 acpi_rs_out_string("Sharing",
449 ACPI_SHARED ==
450 resource->irq.
451 shared_exclusive ? "Shared" : "Exclusive");
452
453 acpi_rs_out_integer8("Interrupt Count",
454 (u8) resource->irq.number_of_interrupts);
455
456 acpi_rs_out_title("Interrupt List");
457 acpi_rs_dump_short_byte_list(resource->irq.number_of_interrupts,
458 resource->irq.interrupts);
459}
460
461/*******************************************************************************
462 *
463 * FUNCTION: acpi_rs_dump_dma
464 *
465 * PARAMETERS: Resource - Pointer to an internal resource descriptor
466 *
467 * RETURN: None
468 *
469 * DESCRIPTION: Dump the field names and values of the resource descriptor
470 *
471 ******************************************************************************/
472
473static void acpi_rs_dump_dma(union acpi_resource_data *resource)
474{
475 ACPI_FUNCTION_ENTRY();
476
140 acpi_os_printf("DMA Resource\n"); 477 acpi_os_printf("DMA Resource\n");
141 478
142 switch (dma_data->type) { 479 acpi_rs_out_title("DMA Type");
480 switch (resource->dma.type) {
143 case ACPI_COMPATIBILITY: 481 case ACPI_COMPATIBILITY:
144 acpi_os_printf(" Compatibility mode\n"); 482 acpi_os_printf("Compatibility mode\n");
145 break; 483 break;
146 484
147 case ACPI_TYPE_A: 485 case ACPI_TYPE_A:
148 acpi_os_printf(" Type A\n"); 486 acpi_os_printf("Type A\n");
149 break; 487 break;
150 488
151 case ACPI_TYPE_B: 489 case ACPI_TYPE_B:
152 acpi_os_printf(" Type B\n"); 490 acpi_os_printf("Type B\n");
153 break; 491 break;
154 492
155 case ACPI_TYPE_F: 493 case ACPI_TYPE_F:
156 acpi_os_printf(" Type F\n"); 494 acpi_os_printf("Type F\n");
157 break; 495 break;
158 496
159 default: 497 default:
160 acpi_os_printf(" Invalid DMA type\n"); 498 acpi_os_printf("**** Invalid DMA type\n");
161 break; 499 break;
162 } 500 }
163 501
164 acpi_os_printf(" %sBus Master\n", 502 acpi_rs_out_string("Bus Master",
165 ACPI_BUS_MASTER == dma_data->bus_master ? "" : "Not a "); 503 ACPI_BUS_MASTER ==
504 resource->dma.bus_master ? "Yes" : "No");
166 505
167 switch (dma_data->transfer) { 506 acpi_rs_out_title("Transfer Type");
507 switch (resource->dma.transfer) {
168 case ACPI_TRANSFER_8: 508 case ACPI_TRANSFER_8:
169 acpi_os_printf(" 8-bit only transfer\n"); 509 acpi_os_printf("8-bit transfers only\n");
170 break; 510 break;
171 511
172 case ACPI_TRANSFER_8_16: 512 case ACPI_TRANSFER_8_16:
173 acpi_os_printf(" 8 and 16-bit transfer\n"); 513 acpi_os_printf("8-bit and 16-bit transfers\n");
174 break; 514 break;
175 515
176 case ACPI_TRANSFER_16: 516 case ACPI_TRANSFER_16:
177 acpi_os_printf(" 16 bit only transfer\n"); 517 acpi_os_printf("16-bit transfers only\n");
178 break; 518 break;
179 519
180 default: 520 default:
181 acpi_os_printf(" Invalid transfer preference\n"); 521 acpi_os_printf("**** Invalid transfer preference\n");
182 break; 522 break;
183 } 523 }
184 524
185 acpi_os_printf(" Number of Channels: %X ( ", 525 acpi_rs_out_integer8("DMA Channel Count",
186 dma_data->number_of_channels); 526 (u8) resource->dma.number_of_channels);
187
188 for (index = 0; index < dma_data->number_of_channels; index++) {
189 acpi_os_printf("%X ", dma_data->channels[index]);
190 }
191 527
192 acpi_os_printf(")\n"); 528 acpi_rs_out_title("Channel List");
193 return; 529 acpi_rs_dump_short_byte_list(resource->dma.number_of_channels,
530 resource->dma.channels);
194} 531}
195 532
196/******************************************************************************* 533/*******************************************************************************
197 * 534 *
198 * FUNCTION: acpi_rs_dump_start_depend_fns 535 * FUNCTION: acpi_rs_dump_start_depend_fns
199 * 536 *
200 * PARAMETERS: Data - pointer to the resource structure to dump. 537 * PARAMETERS: Resource - Pointer to an internal resource descriptor
201 * 538 *
202 * RETURN: None 539 * RETURN: None
203 * 540 *
204 * DESCRIPTION: Prints out the various members of the Data structure type. 541 * DESCRIPTION: Dump the field names and values of the resource descriptor
205 * 542 *
206 ******************************************************************************/ 543 ******************************************************************************/
207 544
208static void acpi_rs_dump_start_depend_fns(union acpi_resource_data *data) 545static void acpi_rs_dump_start_depend_fns(union acpi_resource_data *resource)
209{ 546{
210 struct acpi_resource_start_dpf *sdf_data =
211 (struct acpi_resource_start_dpf *)data;
212
213 ACPI_FUNCTION_ENTRY(); 547 ACPI_FUNCTION_ENTRY();
214 548
215 acpi_os_printf("Start Dependent Functions Resource\n"); 549 acpi_os_printf("Start Dependent Functions Resource\n");
216 550
217 switch (sdf_data->compatibility_priority) { 551 acpi_rs_out_title("Compatibility Priority");
552 switch (resource->start_dpf.compatibility_priority) {
218 case ACPI_GOOD_CONFIGURATION: 553 case ACPI_GOOD_CONFIGURATION:
219 acpi_os_printf(" Good configuration\n"); 554 acpi_os_printf("Good configuration\n");
220 break; 555 break;
221 556
222 case ACPI_ACCEPTABLE_CONFIGURATION: 557 case ACPI_ACCEPTABLE_CONFIGURATION:
223 acpi_os_printf(" Acceptable configuration\n"); 558 acpi_os_printf("Acceptable configuration\n");
224 break; 559 break;
225 560
226 case ACPI_SUB_OPTIMAL_CONFIGURATION: 561 case ACPI_SUB_OPTIMAL_CONFIGURATION:
227 acpi_os_printf(" Sub-optimal configuration\n"); 562 acpi_os_printf("Sub-optimal configuration\n");
228 break; 563 break;
229 564
230 default: 565 default:
231 acpi_os_printf(" Invalid compatibility priority\n"); 566 acpi_os_printf("**** Invalid compatibility priority\n");
232 break; 567 break;
233 } 568 }
234 569
235 switch (sdf_data->performance_robustness) { 570 acpi_rs_out_title("Performance/Robustness");
571 switch (resource->start_dpf.performance_robustness) {
236 case ACPI_GOOD_CONFIGURATION: 572 case ACPI_GOOD_CONFIGURATION:
237 acpi_os_printf(" Good configuration\n"); 573 acpi_os_printf("Good configuration\n");
238 break; 574 break;
239 575
240 case ACPI_ACCEPTABLE_CONFIGURATION: 576 case ACPI_ACCEPTABLE_CONFIGURATION:
241 acpi_os_printf(" Acceptable configuration\n"); 577 acpi_os_printf("Acceptable configuration\n");
242 break; 578 break;
243 579
244 case ACPI_SUB_OPTIMAL_CONFIGURATION: 580 case ACPI_SUB_OPTIMAL_CONFIGURATION:
245 acpi_os_printf(" Sub-optimal configuration\n"); 581 acpi_os_printf("Sub-optimal configuration\n");
246 break; 582 break;
247 583
248 default: 584 default:
249 acpi_os_printf(" Invalid performance robustness preference\n"); 585 acpi_os_printf
586 ("**** Invalid performance robustness preference\n");
250 break; 587 break;
251 } 588 }
252
253 return;
254} 589}
255 590
256/******************************************************************************* 591/*******************************************************************************
257 * 592 *
258 * FUNCTION: acpi_rs_dump_io 593 * FUNCTION: acpi_rs_dump_io
259 * 594 *
260 * PARAMETERS: Data - pointer to the resource structure to dump. 595 * PARAMETERS: Resource - Pointer to an internal resource descriptor
261 * 596 *
262 * RETURN: None 597 * RETURN: None
263 * 598 *
264 * DESCRIPTION: Prints out the various members of the Data structure type. 599 * DESCRIPTION: Dump the field names and values of the resource descriptor
265 * 600 *
266 ******************************************************************************/ 601 ******************************************************************************/
267 602
268static void acpi_rs_dump_io(union acpi_resource_data *data) 603static void acpi_rs_dump_io(union acpi_resource_data *resource)
269{ 604{
270 struct acpi_resource_io *io_data = (struct acpi_resource_io *)data;
271
272 ACPI_FUNCTION_ENTRY(); 605 ACPI_FUNCTION_ENTRY();
273 606
274 acpi_os_printf("Io Resource\n"); 607 acpi_os_printf("I/O Resource\n");
275 608
276 acpi_os_printf(" %d bit decode\n", 609 acpi_rs_out_string("Decode",
277 ACPI_DECODE_16 == io_data->io_decode ? 16 : 10); 610 ACPI_DECODE_16 ==
611 resource->io.io_decode ? "16-bit" : "10-bit");
278 612
279 acpi_os_printf(" Range minimum base: %08X\n", 613 acpi_rs_out_integer32("Range Minimum Base",
280 io_data->min_base_address); 614 resource->io.min_base_address);
281 615
282 acpi_os_printf(" Range maximum base: %08X\n", 616 acpi_rs_out_integer32("Range Maximum Base",
283 io_data->max_base_address); 617 resource->io.max_base_address);
284 618
285 acpi_os_printf(" Alignment: %08X\n", io_data->alignment); 619 acpi_rs_out_integer32("Alignment", resource->io.alignment);
286 620
287 acpi_os_printf(" Range Length: %08X\n", io_data->range_length); 621 acpi_rs_out_integer32("Range Length", resource->io.range_length);
288
289 return;
290} 622}
291 623
292/******************************************************************************* 624/*******************************************************************************
293 * 625 *
294 * FUNCTION: acpi_rs_dump_fixed_io 626 * FUNCTION: acpi_rs_dump_fixed_io
295 * 627 *
296 * PARAMETERS: Data - pointer to the resource structure to dump. 628 * PARAMETERS: Resource - Pointer to an internal resource descriptor
297 * 629 *
298 * RETURN: None 630 * RETURN: None
299 * 631 *
300 * DESCRIPTION: Prints out the various members of the Data structure type. 632 * DESCRIPTION: Dump the field names and values of the resource descriptor
301 * 633 *
302 ******************************************************************************/ 634 ******************************************************************************/
303 635
304static void acpi_rs_dump_fixed_io(union acpi_resource_data *data) 636static void acpi_rs_dump_fixed_io(union acpi_resource_data *resource)
305{ 637{
306 struct acpi_resource_fixed_io *fixed_io_data =
307 (struct acpi_resource_fixed_io *)data;
308
309 ACPI_FUNCTION_ENTRY(); 638 ACPI_FUNCTION_ENTRY();
310 639
311 acpi_os_printf("Fixed Io Resource\n"); 640 acpi_os_printf("Fixed I/O Resource\n");
312 acpi_os_printf(" Range base address: %08X",
313 fixed_io_data->base_address);
314 641
315 acpi_os_printf(" Range length: %08X", fixed_io_data->range_length); 642 acpi_rs_out_integer32("Range Base Address",
643 resource->fixed_io.base_address);
316 644
317 return; 645 acpi_rs_out_integer32("Range Length", resource->fixed_io.range_length);
318} 646}
319 647
320/******************************************************************************* 648/*******************************************************************************
321 * 649 *
322 * FUNCTION: acpi_rs_dump_vendor_specific 650 * FUNCTION: acpi_rs_dump_vendor_specific
323 * 651 *
324 * PARAMETERS: Data - pointer to the resource structure to dump. 652 * PARAMETERS: Resource - Pointer to an internal resource descriptor
325 * 653 *
326 * RETURN: None 654 * RETURN: None
327 * 655 *
328 * DESCRIPTION: Prints out the various members of the Data structure type. 656 * DESCRIPTION: Dump the field names and values of the resource descriptor
329 * 657 *
330 ******************************************************************************/ 658 ******************************************************************************/
331 659
332static void acpi_rs_dump_vendor_specific(union acpi_resource_data *data) 660static void acpi_rs_dump_vendor_specific(union acpi_resource_data *resource)
333{ 661{
334 struct acpi_resource_vendor *vendor_data =
335 (struct acpi_resource_vendor *)data;
336 u16 index = 0;
337
338 ACPI_FUNCTION_ENTRY(); 662 ACPI_FUNCTION_ENTRY();
339 663
340 acpi_os_printf("Vendor Specific Resource\n"); 664 acpi_os_printf("Vendor Specific Resource\n");
341 665
342 acpi_os_printf(" Length: %08X\n", vendor_data->length); 666 acpi_rs_out_integer16("Length", (u16) resource->vendor_specific.length);
343 667
344 for (index = 0; index < vendor_data->length; index++) { 668 acpi_rs_dump_byte_list(resource->vendor_specific.length,
345 acpi_os_printf(" Byte %X: %08X\n", 669 resource->vendor_specific.reserved);
346 index, vendor_data->reserved[index]);
347 }
348
349 return;
350} 670}
351 671
352/******************************************************************************* 672/*******************************************************************************
353 * 673 *
354 * FUNCTION: acpi_rs_dump_memory24 674 * FUNCTION: acpi_rs_dump_memory24
355 * 675 *
356 * PARAMETERS: Data - pointer to the resource structure to dump. 676 * PARAMETERS: Resource - Pointer to an internal resource descriptor
357 * 677 *
358 * RETURN: None 678 * RETURN: None
359 * 679 *
360 * DESCRIPTION: Prints out the various members of the Data structure type. 680 * DESCRIPTION: Dump the field names and values of the resource descriptor
361 * 681 *
362 ******************************************************************************/ 682 ******************************************************************************/
363 683
364static void acpi_rs_dump_memory24(union acpi_resource_data *data) 684static void acpi_rs_dump_memory24(union acpi_resource_data *resource)
365{ 685{
366 struct acpi_resource_mem24 *memory24_data =
367 (struct acpi_resource_mem24 *)data;
368
369 ACPI_FUNCTION_ENTRY(); 686 ACPI_FUNCTION_ENTRY();
370 687
371 acpi_os_printf("24-Bit Memory Range Resource\n"); 688 acpi_os_printf("24-Bit Memory Range Resource\n");
372 689
373 acpi_os_printf(" Read%s\n", 690 acpi_rs_out_string("Attribute",
374 ACPI_READ_WRITE_MEMORY == 691 ACPI_READ_WRITE_MEMORY ==
375 memory24_data->read_write_attribute ? 692 resource->memory24.read_write_attribute ?
376 "/Write" : " only"); 693 "Read/Write" : "Read Only");
377
378 acpi_os_printf(" Range minimum base: %08X\n",
379 memory24_data->min_base_address);
380 694
381 acpi_os_printf(" Range maximum base: %08X\n", 695 acpi_rs_out_integer16("Range Minimum Base",
382 memory24_data->max_base_address); 696 (u16) resource->memory24.min_base_address);
383 697
384 acpi_os_printf(" Alignment: %08X\n", memory24_data->alignment); 698 acpi_rs_out_integer16("Range Maximum Base",
699 (u16) resource->memory24.max_base_address);
385 700
386 acpi_os_printf(" Range length: %08X\n", memory24_data->range_length); 701 acpi_rs_out_integer16("Alignment", (u16) resource->memory24.alignment);
387 702
388 return; 703 acpi_rs_out_integer16("Range Length",
704 (u16) resource->memory24.range_length);
389} 705}
390 706
391/******************************************************************************* 707/*******************************************************************************
392 * 708 *
393 * FUNCTION: acpi_rs_dump_memory32 709 * FUNCTION: acpi_rs_dump_memory32
394 * 710 *
395 * PARAMETERS: Data - pointer to the resource structure to dump. 711 * PARAMETERS: Resource - Pointer to an internal resource descriptor
396 * 712 *
397 * RETURN: None 713 * RETURN: None
398 * 714 *
399 * DESCRIPTION: Prints out the various members of the Data structure type. 715 * DESCRIPTION: Dump the field names and values of the resource descriptor
400 * 716 *
401 ******************************************************************************/ 717 ******************************************************************************/
402 718
403static void acpi_rs_dump_memory32(union acpi_resource_data *data) 719static void acpi_rs_dump_memory32(union acpi_resource_data *resource)
404{ 720{
405 struct acpi_resource_mem32 *memory32_data =
406 (struct acpi_resource_mem32 *)data;
407
408 ACPI_FUNCTION_ENTRY(); 721 ACPI_FUNCTION_ENTRY();
409 722
410 acpi_os_printf("32-Bit Memory Range Resource\n"); 723 acpi_os_printf("32-Bit Memory Range Resource\n");
411 724
412 acpi_os_printf(" Read%s\n", 725 acpi_rs_out_string("Attribute",
413 ACPI_READ_WRITE_MEMORY == 726 ACPI_READ_WRITE_MEMORY ==
414 memory32_data->read_write_attribute ? 727 resource->memory32.read_write_attribute ?
415 "/Write" : " only"); 728 "Read/Write" : "Read Only");
416
417 acpi_os_printf(" Range minimum base: %08X\n",
418 memory32_data->min_base_address);
419 729
420 acpi_os_printf(" Range maximum base: %08X\n", 730 acpi_rs_out_integer32("Range Minimum Base",
421 memory32_data->max_base_address); 731 resource->memory32.min_base_address);
422 732
423 acpi_os_printf(" Alignment: %08X\n", memory32_data->alignment); 733 acpi_rs_out_integer32("Range Maximum Base",
734 resource->memory32.max_base_address);
424 735
425 acpi_os_printf(" Range length: %08X\n", memory32_data->range_length); 736 acpi_rs_out_integer32("Alignment", resource->memory32.alignment);
426 737
427 return; 738 acpi_rs_out_integer32("Range Length", resource->memory32.range_length);
428} 739}
429 740
430/******************************************************************************* 741/*******************************************************************************
431 * 742 *
432 * FUNCTION: acpi_rs_dump_fixed_memory32 743 * FUNCTION: acpi_rs_dump_fixed_memory32
433 * 744 *
434 * PARAMETERS: Data - pointer to the resource structure to dump. 745 * PARAMETERS: Resource - Pointer to an internal resource descriptor
435 * 746 *
436 * RETURN: 747 * RETURN:
437 * 748 *
438 * DESCRIPTION: Prints out the various members of the Data structure type. 749 * DESCRIPTION: Dump the field names and values of the resource descriptor
439 * 750 *
440 ******************************************************************************/ 751 ******************************************************************************/
441 752
442static void acpi_rs_dump_fixed_memory32(union acpi_resource_data *data) 753static void acpi_rs_dump_fixed_memory32(union acpi_resource_data *resource)
443{ 754{
444 struct acpi_resource_fixed_mem32 *fixed_memory32_data =
445 (struct acpi_resource_fixed_mem32 *)data;
446
447 ACPI_FUNCTION_ENTRY(); 755 ACPI_FUNCTION_ENTRY();
448 756
449 acpi_os_printf("32-Bit Fixed Location Memory Range Resource\n"); 757 acpi_os_printf("32-Bit Fixed Location Memory Range Resource\n");
450 758
451 acpi_os_printf(" Read%s\n", 759 acpi_rs_out_string("Attribute",
452 ACPI_READ_WRITE_MEMORY == 760 ACPI_READ_WRITE_MEMORY ==
453 fixed_memory32_data-> 761 resource->fixed_memory32.read_write_attribute ?
454 read_write_attribute ? "/Write" : " Only"); 762 "Read/Write" : "Read Only");
455
456 acpi_os_printf(" Range base address: %08X\n",
457 fixed_memory32_data->range_base_address);
458 763
459 acpi_os_printf(" Range length: %08X\n", 764 acpi_rs_out_integer32("Range Base Address",
460 fixed_memory32_data->range_length); 765 resource->fixed_memory32.range_base_address);
461 766
462 return; 767 acpi_rs_out_integer32("Range Length",
768 resource->fixed_memory32.range_length);
463} 769}
464 770
465/******************************************************************************* 771/*******************************************************************************
466 * 772 *
467 * FUNCTION: acpi_rs_dump_address16 773 * FUNCTION: acpi_rs_dump_address16
468 * 774 *
469 * PARAMETERS: Data - pointer to the resource structure to dump. 775 * PARAMETERS: Resource - Pointer to an internal resource descriptor
470 * 776 *
471 * RETURN: None 777 * RETURN: None
472 * 778 *
473 * DESCRIPTION: Prints out the various members of the Data structure type. 779 * DESCRIPTION: Dump the field names and values of the resource descriptor
474 * 780 *
475 ******************************************************************************/ 781 ******************************************************************************/
476 782
477static void acpi_rs_dump_address16(union acpi_resource_data *data) 783static void acpi_rs_dump_address16(union acpi_resource_data *resource)
478{ 784{
479 struct acpi_resource_address16 *address16_data =
480 (struct acpi_resource_address16 *)data;
481
482 ACPI_FUNCTION_ENTRY(); 785 ACPI_FUNCTION_ENTRY();
483 786
484 acpi_os_printf("16-Bit Address Space Resource\n"); 787 acpi_os_printf("16-Bit Address Space Resource\n");
485 acpi_os_printf(" Resource Type: ");
486 788
487 switch (address16_data->resource_type) { 789 acpi_rs_dump_address_common(resource);
488 case ACPI_MEMORY_RANGE:
489 790
490 acpi_os_printf("Memory Range\n"); 791 acpi_rs_out_integer16("Granularity",
792 (u16) resource->address16.granularity);
491 793
492 switch (address16_data->attribute.memory.cache_attribute) { 794 acpi_rs_out_integer16("Address Range Min",
493 case ACPI_NON_CACHEABLE_MEMORY: 795 (u16) resource->address16.min_address_range);
494 acpi_os_printf
495 (" Type Specific: Noncacheable memory\n");
496 break;
497 796
498 case ACPI_CACHABLE_MEMORY: 797 acpi_rs_out_integer16("Address Range Max",
499 acpi_os_printf(" Type Specific: Cacheable memory\n"); 798 (u16) resource->address16.max_address_range);
500 break;
501 799
502 case ACPI_WRITE_COMBINING_MEMORY: 800 acpi_rs_out_integer16("Address Translation Offset",
503 acpi_os_printf 801 (u16) resource->address16.
504 (" Type Specific: Write-combining memory\n"); 802 address_translation_offset);
505 break;
506 803
507 case ACPI_PREFETCHABLE_MEMORY: 804 acpi_rs_out_integer16("Address Length",
508 acpi_os_printf 805 (u16) resource->address16.address_length);
509 (" Type Specific: Prefetchable memory\n");
510 break;
511 806
512 default: 807 acpi_rs_dump_resource_source(&resource->address16.resource_source);
513 acpi_os_printf
514 (" Type Specific: Invalid cache attribute\n");
515 break;
516 }
517
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;
523
524 case ACPI_IO_RANGE:
525
526 acpi_os_printf("I/O Range\n");
527
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;
533
534 case ACPI_ISA_ONLY_RANGES:
535 acpi_os_printf(" Type Specific: ISA Io Addresses\n");
536 break;
537
538 case ACPI_ENTIRE_RANGE:
539 acpi_os_printf
540 (" Type Specific: ISA and non-ISA Io Addresses\n");
541 break;
542
543 default:
544 acpi_os_printf
545 (" Type Specific: Invalid range attribute\n");
546 break;
547 }
548
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;
554
555 case ACPI_BUS_NUMBER_RANGE:
556
557 acpi_os_printf("Bus Number Range\n");
558 break;
559
560 default:
561
562 acpi_os_printf("0x%2.2X\n", address16_data->resource_type);
563 break;
564 }
565
566 acpi_os_printf(" Resource %s\n",
567 ACPI_CONSUMER == address16_data->producer_consumer ?
568 "Consumer" : "Producer");
569
570 acpi_os_printf(" %s decode\n",
571 ACPI_SUB_DECODE == address16_data->decode ?
572 "Subtractive" : "Positive");
573
574 acpi_os_printf(" Min address is %s fixed\n",
575 ACPI_ADDRESS_FIXED == address16_data->min_address_fixed ?
576 "" : "not");
577
578 acpi_os_printf(" Max address is %s fixed\n",
579 ACPI_ADDRESS_FIXED == address16_data->max_address_fixed ?
580 "" : "not");
581
582 acpi_os_printf(" Granularity: %08X\n", address16_data->granularity);
583
584 acpi_os_printf(" Address range min: %08X\n",
585 address16_data->min_address_range);
586
587 acpi_os_printf(" Address range max: %08X\n",
588 address16_data->max_address_range);
589
590 acpi_os_printf(" Address translation offset: %08X\n",
591 address16_data->address_translation_offset);
592
593 acpi_os_printf(" Address Length: %08X\n",
594 address16_data->address_length);
595
596 if (0xFF != address16_data->resource_source.index) {
597 acpi_os_printf(" Resource Source Index: %X\n",
598 address16_data->resource_source.index);
599
600 acpi_os_printf(" Resource Source: %s\n",
601 address16_data->resource_source.string_ptr);
602 }
603
604 return;
605} 808}
606 809
607/******************************************************************************* 810/*******************************************************************************
608 * 811 *
609 * FUNCTION: acpi_rs_dump_address32 812 * FUNCTION: acpi_rs_dump_address32
610 * 813 *
611 * PARAMETERS: Data - pointer to the resource structure to dump. 814 * PARAMETERS: Resource - Pointer to an internal resource descriptor
612 * 815 *
613 * RETURN: None 816 * RETURN: None
614 * 817 *
615 * DESCRIPTION: Prints out the various members of the Data structure type. 818 * DESCRIPTION: Dump the field names and values of the resource descriptor
616 * 819 *
617 ******************************************************************************/ 820 ******************************************************************************/
618 821
619static void acpi_rs_dump_address32(union acpi_resource_data *data) 822static void acpi_rs_dump_address32(union acpi_resource_data *resource)
620{ 823{
621 struct acpi_resource_address32 *address32_data =
622 (struct acpi_resource_address32 *)data;
623
624 ACPI_FUNCTION_ENTRY(); 824 ACPI_FUNCTION_ENTRY();
625 825
626 acpi_os_printf("32-Bit Address Space Resource\n"); 826 acpi_os_printf("32-Bit Address Space Resource\n");
627 827
628 switch (address32_data->resource_type) { 828 acpi_rs_dump_address_common(resource);
629 case ACPI_MEMORY_RANGE:
630 829
631 acpi_os_printf(" Resource Type: Memory Range\n"); 830 acpi_rs_out_integer32("Granularity", resource->address32.granularity);
632 831
633 switch (address32_data->attribute.memory.cache_attribute) { 832 acpi_rs_out_integer32("Address Range Min",
634 case ACPI_NON_CACHEABLE_MEMORY: 833 resource->address32.min_address_range);
635 acpi_os_printf
636 (" Type Specific: Noncacheable memory\n");
637 break;
638 834
639 case ACPI_CACHABLE_MEMORY: 835 acpi_rs_out_integer32("Address Range Max",
640 acpi_os_printf(" Type Specific: Cacheable memory\n"); 836 resource->address32.max_address_range);
641 break;
642 837
643 case ACPI_WRITE_COMBINING_MEMORY: 838 acpi_rs_out_integer32("Address Translation Offset",
644 acpi_os_printf 839 resource->address32.address_translation_offset);
645 (" Type Specific: Write-combining memory\n");
646 break;
647
648 case ACPI_PREFETCHABLE_MEMORY:
649 acpi_os_printf
650 (" Type Specific: Prefetchable memory\n");
651 break;
652
653 default:
654 acpi_os_printf
655 (" Type Specific: Invalid cache attribute\n");
656 break;
657 }
658
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;
664
665 case ACPI_IO_RANGE:
666
667 acpi_os_printf(" Resource Type: Io Range\n");
668
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;
674
675 case ACPI_ISA_ONLY_RANGES:
676 acpi_os_printf(" Type Specific: ISA Io Addresses\n");
677 break;
678
679 case ACPI_ENTIRE_RANGE:
680 acpi_os_printf
681 (" Type Specific: ISA and non-ISA Io Addresses\n");
682 break;
683
684 default:
685 acpi_os_printf
686 (" Type Specific: Invalid Range attribute");
687 break;
688 }
689
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;
695
696 case ACPI_BUS_NUMBER_RANGE:
697
698 acpi_os_printf(" Resource Type: Bus Number Range\n");
699 break;
700 840
701 default: 841 acpi_rs_out_integer32("Address Length",
702 842 resource->address32.address_length);
703 acpi_os_printf(" Resource Type: 0x%2.2X\n",
704 address32_data->resource_type);
705 break;
706 }
707 843
708 acpi_os_printf(" Resource %s\n", 844 acpi_rs_dump_resource_source(&resource->address32.resource_source);
709 ACPI_CONSUMER == address32_data->producer_consumer ?
710 "Consumer" : "Producer");
711
712 acpi_os_printf(" %s decode\n",
713 ACPI_SUB_DECODE == address32_data->decode ?
714 "Subtractive" : "Positive");
715
716 acpi_os_printf(" Min address is %s fixed\n",
717 ACPI_ADDRESS_FIXED == address32_data->min_address_fixed ?
718 "" : "not ");
719
720 acpi_os_printf(" Max address is %s fixed\n",
721 ACPI_ADDRESS_FIXED == address32_data->max_address_fixed ?
722 "" : "not ");
723
724 acpi_os_printf(" Granularity: %08X\n", address32_data->granularity);
725
726 acpi_os_printf(" Address range min: %08X\n",
727 address32_data->min_address_range);
728
729 acpi_os_printf(" Address range max: %08X\n",
730 address32_data->max_address_range);
731
732 acpi_os_printf(" Address translation offset: %08X\n",
733 address32_data->address_translation_offset);
734
735 acpi_os_printf(" Address Length: %08X\n",
736 address32_data->address_length);
737
738 if (0xFF != address32_data->resource_source.index) {
739 acpi_os_printf(" Resource Source Index: %X\n",
740 address32_data->resource_source.index);
741
742 acpi_os_printf(" Resource Source: %s\n",
743 address32_data->resource_source.string_ptr);
744 }
745
746 return;
747} 845}
748 846
749/******************************************************************************* 847/*******************************************************************************
750 * 848 *
751 * FUNCTION: acpi_rs_dump_address64 849 * FUNCTION: acpi_rs_dump_address64
752 * 850 *
753 * PARAMETERS: Data - pointer to the resource structure to dump. 851 * PARAMETERS: Resource - Pointer to an internal resource descriptor
754 * 852 *
755 * RETURN: None 853 * RETURN: None
756 * 854 *
757 * DESCRIPTION: Prints out the various members of the Data structure type. 855 * DESCRIPTION: Dump the field names and values of the resource descriptor
758 * 856 *
759 ******************************************************************************/ 857 ******************************************************************************/
760 858
761static void acpi_rs_dump_address64(union acpi_resource_data *data) 859static void acpi_rs_dump_address64(union acpi_resource_data *resource)
762{ 860{
763 struct acpi_resource_address64 *address64_data =
764 (struct acpi_resource_address64 *)data;
765
766 ACPI_FUNCTION_ENTRY(); 861 ACPI_FUNCTION_ENTRY();
767 862
768 acpi_os_printf("64-Bit Address Space Resource\n"); 863 acpi_os_printf("64-Bit Address Space Resource\n");
769 864
770 switch (address64_data->resource_type) { 865 acpi_rs_dump_address_common(resource);
771 case ACPI_MEMORY_RANGE:
772
773 acpi_os_printf(" Resource Type: Memory Range\n");
774
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;
780
781 case ACPI_CACHABLE_MEMORY:
782 acpi_os_printf(" Type Specific: Cacheable memory\n");
783 break;
784
785 case ACPI_WRITE_COMBINING_MEMORY:
786 acpi_os_printf
787 (" Type Specific: Write-combining memory\n");
788 break;
789
790 case ACPI_PREFETCHABLE_MEMORY:
791 acpi_os_printf
792 (" Type Specific: Prefetchable memory\n");
793 break;
794
795 default:
796 acpi_os_printf
797 (" Type Specific: Invalid cache attribute\n");
798 break;
799 }
800
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;
806
807 case ACPI_IO_RANGE:
808
809 acpi_os_printf(" Resource Type: Io Range\n");
810
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;
816
817 case ACPI_ISA_ONLY_RANGES:
818 acpi_os_printf(" Type Specific: ISA Io Addresses\n");
819 break;
820
821 case ACPI_ENTIRE_RANGE:
822 acpi_os_printf
823 (" Type Specific: ISA and non-ISA Io Addresses\n");
824 break;
825
826 default:
827 acpi_os_printf
828 (" Type Specific: Invalid Range attribute");
829 break;
830 }
831
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;
837
838 case ACPI_BUS_NUMBER_RANGE:
839
840 acpi_os_printf(" Resource Type: Bus Number Range\n");
841 break;
842
843 default:
844
845 acpi_os_printf(" Resource Type: 0x%2.2X\n",
846 address64_data->resource_type);
847 break;
848 }
849
850 acpi_os_printf(" Resource %s\n",
851 ACPI_CONSUMER == address64_data->producer_consumer ?
852 "Consumer" : "Producer");
853 866
854 acpi_os_printf(" %s decode\n", 867 acpi_rs_out_integer64("Granularity", resource->address64.granularity);
855 ACPI_SUB_DECODE == address64_data->decode ?
856 "Subtractive" : "Positive");
857 868
858 acpi_os_printf(" Min address is %s fixed\n", 869 acpi_rs_out_integer64("Address Range Min",
859 ACPI_ADDRESS_FIXED == address64_data->min_address_fixed ? 870 resource->address64.min_address_range);
860 "" : "not ");
861 871
862 acpi_os_printf(" Max address is %s fixed\n", 872 acpi_rs_out_integer64("Address Range Max",
863 ACPI_ADDRESS_FIXED == address64_data->max_address_fixed ? 873 resource->address64.max_address_range);
864 "" : "not ");
865 874
866 acpi_os_printf(" Granularity: %8.8X%8.8X\n", 875 acpi_rs_out_integer64("Address Translation Offset",
867 ACPI_FORMAT_UINT64(address64_data->granularity)); 876 resource->address64.address_translation_offset);
868 877
869 acpi_os_printf(" Address range min: %8.8X%8.8X\n", 878 acpi_rs_out_integer64("Address Length",
870 ACPI_FORMAT_UINT64(address64_data->min_address_range)); 879 resource->address64.address_length);
871 880
872 acpi_os_printf(" Address range max: %8.8X%8.8X\n", 881 acpi_rs_out_integer64("Type Specific Attributes",
873 ACPI_FORMAT_UINT64(address64_data->max_address_range)); 882 resource->address64.type_specific_attributes);
874 883
875 acpi_os_printf(" Address translation offset: %8.8X%8.8X\n", 884 acpi_rs_dump_resource_source(&resource->address64.resource_source);
876 ACPI_FORMAT_UINT64(address64_data->
877 address_translation_offset));
878
879 acpi_os_printf(" Address Length: %8.8X%8.8X\n",
880 ACPI_FORMAT_UINT64(address64_data->address_length));
881
882 acpi_os_printf(" Type Specific Attributes: %8.8X%8.8X\n",
883 ACPI_FORMAT_UINT64(address64_data->
884 type_specific_attributes));
885
886 if (0xFF != address64_data->resource_source.index) {
887 acpi_os_printf(" Resource Source Index: %X\n",
888 address64_data->resource_source.index);
889
890 acpi_os_printf(" Resource Source: %s\n",
891 address64_data->resource_source.string_ptr);
892 }
893
894 return;
895} 885}
896 886
897/******************************************************************************* 887/*******************************************************************************
898 * 888 *
899 * FUNCTION: acpi_rs_dump_extended_irq 889 * FUNCTION: acpi_rs_dump_extended_irq
900 * 890 *
901 * PARAMETERS: Data - pointer to the resource structure to dump. 891 * PARAMETERS: Resource - Pointer to an internal resource descriptor
902 * 892 *
903 * RETURN: None 893 * RETURN: None
904 * 894 *
905 * DESCRIPTION: Prints out the various members of the Data structure type. 895 * DESCRIPTION: Dump the field names and values of the resource descriptor
906 * 896 *
907 ******************************************************************************/ 897 ******************************************************************************/
908 898
909static void acpi_rs_dump_extended_irq(union acpi_resource_data *data) 899static void acpi_rs_dump_extended_irq(union acpi_resource_data *resource)
910{ 900{
911 struct acpi_resource_ext_irq *ext_irq_data =
912 (struct acpi_resource_ext_irq *)data;
913 u8 index = 0;
914
915 ACPI_FUNCTION_ENTRY(); 901 ACPI_FUNCTION_ENTRY();
916 902
917 acpi_os_printf("Extended IRQ Resource\n"); 903 acpi_os_printf("Extended IRQ Resource\n");
918 904
919 acpi_os_printf(" Resource %s\n", 905 acpi_rs_out_string("Resource",
920 ACPI_CONSUMER == ext_irq_data->producer_consumer ? 906 ACPI_CONSUMER ==
921 "Consumer" : "Producer"); 907 resource->extended_irq.
908 producer_consumer ? "Consumer" : "Producer");
922 909
923 acpi_os_printf(" %s\n", 910 acpi_rs_out_string("Triggering",
924 ACPI_LEVEL_SENSITIVE == ext_irq_data->edge_level ? 911 ACPI_LEVEL_SENSITIVE ==
925 "Level" : "Edge"); 912 resource->extended_irq.
913 edge_level ? "Level" : "Edge");
926 914
927 acpi_os_printf(" Active %s\n", 915 acpi_rs_out_string("Active",
928 ACPI_ACTIVE_LOW == ext_irq_data->active_high_low ? 916 ACPI_ACTIVE_LOW ==
929 "low" : "high"); 917 resource->extended_irq.
918 active_high_low ? "Low" : "High");
930 919
931 acpi_os_printf(" %s\n", 920 acpi_rs_out_string("Sharing",
932 ACPI_SHARED == ext_irq_data->shared_exclusive ? 921 ACPI_SHARED ==
933 "Shared" : "Exclusive"); 922 resource->extended_irq.
923 shared_exclusive ? "Shared" : "Exclusive");
934 924
935 acpi_os_printf(" Interrupts : %X ( ", 925 acpi_rs_dump_resource_source(&resource->extended_irq.resource_source);
936 ext_irq_data->number_of_interrupts);
937 926
938 for (index = 0; index < ext_irq_data->number_of_interrupts; index++) { 927 acpi_rs_out_integer8("Interrupts",
939 acpi_os_printf("%X ", ext_irq_data->interrupts[index]); 928 (u8) resource->extended_irq.number_of_interrupts);
940 }
941
942 acpi_os_printf(")\n");
943 929
944 if (0xFF != ext_irq_data->resource_source.index) { 930 acpi_rs_dump_dword_list(resource->extended_irq.number_of_interrupts,
945 acpi_os_printf(" Resource Source Index: %X", 931 resource->extended_irq.interrupts);
946 ext_irq_data->resource_source.index);
947
948 acpi_os_printf(" Resource Source: %s",
949 ext_irq_data->resource_source.string_ptr);
950 }
951
952 return;
953} 932}
954 933
955/******************************************************************************* 934/*******************************************************************************
956 * 935 *
957 * FUNCTION: acpi_rs_dump_resource_list 936 * FUNCTION: acpi_rs_dump_generic_reg
958 * 937 *
959 * PARAMETERS: Resource - pointer to the resource structure to dump. 938 * PARAMETERS: Resource - Pointer to an internal resource descriptor
960 * 939 *
961 * RETURN: None 940 * RETURN: None
962 * 941 *
963 * DESCRIPTION: Dispatches the structure to the correct dump routine. 942 * DESCRIPTION: Dump the field names and values of the resource descriptor
964 * 943 *
965 ******************************************************************************/ 944 ******************************************************************************/
966 945
967void acpi_rs_dump_resource_list(struct acpi_resource *resource) 946static void acpi_rs_dump_generic_reg(union acpi_resource_data *resource)
968{ 947{
969 u8 count = 0;
970 u8 done = FALSE;
971 948
972 ACPI_FUNCTION_ENTRY(); 949 ACPI_FUNCTION_ENTRY();
973 950
974 if (acpi_dbg_level & ACPI_LV_RESOURCES && _COMPONENT & acpi_dbg_layer) { 951 acpi_os_printf("Generic Register Resource\n");
975 while (!done) {
976 acpi_os_printf("Resource structure %X.\n", count++);
977
978 switch (resource->id) {
979 case ACPI_RSTYPE_IRQ:
980 acpi_rs_dump_irq(&resource->data);
981 break;
982
983 case ACPI_RSTYPE_DMA:
984 acpi_rs_dump_dma(&resource->data);
985 break;
986
987 case ACPI_RSTYPE_START_DPF:
988 acpi_rs_dump_start_depend_fns(&resource->data);
989 break;
990
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;
996
997 case ACPI_RSTYPE_IO:
998 acpi_rs_dump_io(&resource->data);
999 break;
1000
1001 case ACPI_RSTYPE_FIXED_IO:
1002 acpi_rs_dump_fixed_io(&resource->data);
1003 break;
1004 952
1005 case ACPI_RSTYPE_VENDOR: 953 acpi_rs_out_integer8("Space ID", (u8) resource->generic_reg.space_id);
1006 acpi_rs_dump_vendor_specific(&resource->data);
1007 break;
1008 954
1009 case ACPI_RSTYPE_END_TAG: 955 acpi_rs_out_integer8("Bit Width", (u8) resource->generic_reg.bit_width);
1010 /*rs_dump_end_tag (Resource->Data); */
1011 acpi_os_printf("end_tag Resource\n");
1012 done = TRUE;
1013 break;
1014 956
1015 case ACPI_RSTYPE_MEM24: 957 acpi_rs_out_integer8("Bit Offset",
1016 acpi_rs_dump_memory24(&resource->data); 958 (u8) resource->generic_reg.bit_offset);
1017 break;
1018 959
1019 case ACPI_RSTYPE_MEM32: 960 acpi_rs_out_integer8("Address Size",
1020 acpi_rs_dump_memory32(&resource->data); 961 (u8) resource->generic_reg.address_size);
1021 break;
1022 962
1023 case ACPI_RSTYPE_FIXED_MEM32: 963 acpi_rs_out_integer64("Address", resource->generic_reg.address);
1024 acpi_rs_dump_fixed_memory32(&resource->data); 964}
1025 break;
1026
1027 case ACPI_RSTYPE_ADDRESS16:
1028 acpi_rs_dump_address16(&resource->data);
1029 break;
1030
1031 case ACPI_RSTYPE_ADDRESS32:
1032 acpi_rs_dump_address32(&resource->data);
1033 break;
1034 965
1035 case ACPI_RSTYPE_ADDRESS64: 966/*******************************************************************************
1036 acpi_rs_dump_address64(&resource->data); 967 *
1037 break; 968 * FUNCTION: acpi_rs_dump_end_depend_fns
969 *
970 * PARAMETERS: Resource - Pointer to an internal resource descriptor
971 *
972 * RETURN: None
973 *
974 * DESCRIPTION: Print type, no data.
975 *
976 ******************************************************************************/
1038 977
1039 case ACPI_RSTYPE_EXT_IRQ: 978static void acpi_rs_dump_end_depend_fns(union acpi_resource_data *resource)
1040 acpi_rs_dump_extended_irq(&resource->data); 979{
1041 break; 980 ACPI_FUNCTION_ENTRY();
1042 981
1043 default: 982 acpi_os_printf("end_dependent_functions Resource\n");
1044 acpi_os_printf("Invalid resource type\n"); 983}
1045 break;
1046 984
1047 } 985/*******************************************************************************
986 *
987 * FUNCTION: acpi_rs_dump_end_tag
988 *
989 * PARAMETERS: Resource - Pointer to an internal resource descriptor
990 *
991 * RETURN: None
992 *
993 * DESCRIPTION: Print type, no data.
994 *
995 ******************************************************************************/
1048 996
1049 resource = 997static void acpi_rs_dump_end_tag(union acpi_resource_data *resource)
1050 ACPI_PTR_ADD(struct acpi_resource, resource, 998{
1051 resource->length); 999 ACPI_FUNCTION_ENTRY();
1052 }
1053 }
1054 1000
1055 return; 1001 acpi_os_printf("end_tag Resource\n");
1056} 1002}
1057 1003
1058/******************************************************************************* 1004/*******************************************************************************
1059 * 1005 *
1060 * FUNCTION: acpi_rs_dump_irq_list 1006 * FUNCTION: acpi_rs_dump_irq_list
1061 * 1007 *
1062 * PARAMETERS: route_table - pointer to the routing table to dump. 1008 * PARAMETERS: route_table - Pointer to the routing table to dump.
1063 * 1009 *
1064 * RETURN: None 1010 * RETURN: None
1065 * 1011 *
1066 * DESCRIPTION: Dispatches the structures to the correct dump routine. 1012 * DESCRIPTION: Print IRQ routing table
1067 * 1013 *
1068 ******************************************************************************/ 1014 ******************************************************************************/
1069 1015
@@ -1071,41 +1017,35 @@ void acpi_rs_dump_irq_list(u8 * route_table)
1071{ 1017{
1072 u8 *buffer = route_table; 1018 u8 *buffer = route_table;
1073 u8 count = 0; 1019 u8 count = 0;
1074 u8 done = FALSE;
1075 struct acpi_pci_routing_table *prt_element; 1020 struct acpi_pci_routing_table *prt_element;
1076 1021
1077 ACPI_FUNCTION_ENTRY(); 1022 ACPI_FUNCTION_ENTRY();
1078 1023
1079 if (acpi_dbg_level & ACPI_LV_RESOURCES && _COMPONENT & acpi_dbg_layer) { 1024 if (!(acpi_dbg_level & ACPI_LV_RESOURCES)
1080 prt_element = 1025 || !(_COMPONENT & acpi_dbg_layer)) {
1081 ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer); 1026 return;
1027 }
1082 1028
1083 while (!done) { 1029 prt_element = ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer);
1084 acpi_os_printf("PCI IRQ Routing Table structure %X.\n",
1085 count++);
1086 1030
1087 acpi_os_printf(" Address: %8.8X%8.8X\n", 1031 /* Dump all table elements, Exit on null length element */
1088 ACPI_FORMAT_UINT64(prt_element->
1089 address));
1090 1032
1091 acpi_os_printf(" Pin: %X\n", prt_element->pin); 1033 while (prt_element->length) {
1034 acpi_os_printf("\n[%02X] PCI IRQ Routing Table Package\n",
1035 count);
1092 1036
1093 acpi_os_printf(" Source: %s\n", prt_element->source); 1037 acpi_rs_out_integer64("Address", prt_element->address);
1094 1038
1095 acpi_os_printf(" source_index: %X\n", 1039 acpi_rs_out_integer32("Pin", prt_element->pin);
1096 prt_element->source_index); 1040 acpi_rs_out_string("Source", prt_element->source);
1041 acpi_rs_out_integer32("Source Index",
1042 prt_element->source_index);
1097 1043
1098 buffer += prt_element->length; 1044 buffer += prt_element->length;
1099 prt_element = 1045 prt_element =
1100 ACPI_CAST_PTR(struct acpi_pci_routing_table, 1046 ACPI_CAST_PTR(struct acpi_pci_routing_table, buffer);
1101 buffer); 1047 count++;
1102 if (0 == prt_element->length) {
1103 done = TRUE;
1104 }
1105 }
1106 } 1048 }
1107
1108 return;
1109} 1049}
1110 1050
1111#endif 1051#endif