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