blob: 5ffdb5602d8db31d2c06776e4f5846252f1129da [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*******************************************************************************
2 *
Bob Moore39239fe2015-04-13 11:50:08 +08003 * Module Name: rsdump - AML debugger support for resource structures.
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 *
5 ******************************************************************************/
6
7/*
Bob Moorec8100dc2016-01-15 08:17:03 +08008 * Copyright (C) 2000 - 2016, Intel Corp.
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 * 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
Linus Torvalds1da177e2005-04-16 15:20:36 -070044#include <acpi/acpi.h>
Len Browne2f7a772009-01-09 00:30:03 -050045#include "accommon.h"
46#include "acresrc.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
48#define _COMPONENT ACPI_RESOURCES
Len Brown4be44fc2005-08-05 00:44:28 -040049ACPI_MODULE_NAME("rsdump")
Lv Zheng33348612014-02-08 09:42:46 +080050
Bob Moore39239fe2015-04-13 11:50:08 +080051/*
52 * All functions in this module are used by the AML Debugger only
53 */
Robert Moore44f6c012005-04-18 22:49:35 -040054/* Local prototypes */
Bob Moore0dfaaa32016-03-24 09:40:40 +080055static void acpi_rs_out_string(const char *title, const char *value);
Robert Moorebda663d2005-09-16 16:51:15 -040056
Bob Moore0dfaaa32016-03-24 09:40:40 +080057static void acpi_rs_out_integer8(const char *title, u8 value);
Robert Moorebda663d2005-09-16 16:51:15 -040058
Bob Moore0dfaaa32016-03-24 09:40:40 +080059static void acpi_rs_out_integer16(const char *title, u16 value);
Robert Moorebda663d2005-09-16 16:51:15 -040060
Bob Moore0dfaaa32016-03-24 09:40:40 +080061static void acpi_rs_out_integer32(const char *title, u32 value);
Robert Moorebda663d2005-09-16 16:51:15 -040062
Bob Moore0dfaaa32016-03-24 09:40:40 +080063static void acpi_rs_out_integer64(const char *title, u64 value);
Robert Moorebda663d2005-09-16 16:51:15 -040064
Bob Moore0dfaaa32016-03-24 09:40:40 +080065static void acpi_rs_out_title(const char *title);
Robert Moorebda663d2005-09-16 16:51:15 -040066
Lin Minge0fe0a82011-11-16 14:38:13 +080067static void acpi_rs_dump_byte_list(u16 length, u8 *data);
Robert Moorebda663d2005-09-16 16:51:15 -040068
Lin Minge0fe0a82011-11-16 14:38:13 +080069static void acpi_rs_dump_word_list(u16 length, u16 *data);
Robert Moorebda663d2005-09-16 16:51:15 -040070
Lin Minge0fe0a82011-11-16 14:38:13 +080071static void acpi_rs_dump_dword_list(u8 length, u32 *data);
72
73static void acpi_rs_dump_short_byte_list(u8 length, u8 *data);
Robert Moorebda663d2005-09-16 16:51:15 -040074
75static void
76acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source);
77
78static void acpi_rs_dump_address_common(union acpi_resource_data *resource);
79
Bob Moore08978312005-10-21 00:00:00 -040080static void
81acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table);
82
Bob Moore08978312005-10-21 00:00:00 -040083/*******************************************************************************
84 *
Bob Moore39239fe2015-04-13 11:50:08 +080085 * FUNCTION: acpi_rs_dump_resource_list
86 *
87 * PARAMETERS: resource_list - Pointer to a resource descriptor list
88 *
89 * RETURN: None
90 *
91 * DESCRIPTION: Dispatches the structure to the correct dump routine.
92 *
93 ******************************************************************************/
94
95void acpi_rs_dump_resource_list(struct acpi_resource *resource_list)
96{
97 u32 count = 0;
98 u32 type;
99
100 ACPI_FUNCTION_ENTRY();
101
102 /* Check if debug output enabled */
103
104 if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) {
105 return;
106 }
107
108 /* Walk list and dump all resource descriptors (END_TAG terminates) */
109
110 do {
111 acpi_os_printf("\n[%02X] ", count);
112 count++;
113
114 /* Validate Type before dispatch */
115
116 type = resource_list->type;
117 if (type > ACPI_RESOURCE_TYPE_MAX) {
118 acpi_os_printf
119 ("Invalid descriptor type (%X) in resource list\n",
120 resource_list->type);
121 return;
122 }
123
124 /* Sanity check the length. It must not be zero, or we loop forever */
125
126 if (!resource_list->length) {
127 acpi_os_printf
128 ("Invalid zero length descriptor in resource list\n");
129 return;
130 }
131
132 /* Dump the resource descriptor */
133
134 if (type == ACPI_RESOURCE_TYPE_SERIAL_BUS) {
135 acpi_rs_dump_descriptor(&resource_list->data,
136 acpi_gbl_dump_serial_bus_dispatch
137 [resource_list->data.
138 common_serial_bus.type]);
139 } else {
140 acpi_rs_dump_descriptor(&resource_list->data,
141 acpi_gbl_dump_resource_dispatch
142 [type]);
143 }
144
145 /* Point to the next resource structure */
146
147 resource_list = ACPI_NEXT_RESOURCE(resource_list);
148
149 /* Exit when END_TAG descriptor is reached */
150
151 } while (type != ACPI_RESOURCE_TYPE_END_TAG);
152}
153
154/*******************************************************************************
155 *
156 * FUNCTION: acpi_rs_dump_irq_list
157 *
158 * PARAMETERS: route_table - Pointer to the routing table to dump.
159 *
160 * RETURN: None
161 *
162 * DESCRIPTION: Print IRQ routing table
163 *
164 ******************************************************************************/
165
166void acpi_rs_dump_irq_list(u8 *route_table)
167{
168 struct acpi_pci_routing_table *prt_element;
169 u8 count;
170
171 ACPI_FUNCTION_ENTRY();
172
173 /* Check if debug output enabled */
174
175 if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) {
176 return;
177 }
178
179 prt_element = ACPI_CAST_PTR(struct acpi_pci_routing_table, route_table);
180
181 /* Dump all table elements, Exit on zero length element */
182
183 for (count = 0; prt_element->length; count++) {
184 acpi_os_printf("\n[%02X] PCI IRQ Routing Table Package\n",
185 count);
186 acpi_rs_dump_descriptor(prt_element, acpi_rs_dump_prt);
187
188 prt_element = ACPI_ADD_PTR(struct acpi_pci_routing_table,
189 prt_element, prt_element->length);
190 }
191}
192
193/*******************************************************************************
194 *
Bob Moore08978312005-10-21 00:00:00 -0400195 * FUNCTION: acpi_rs_dump_descriptor
196 *
Bob Moore42f8fb72013-01-11 13:08:51 +0100197 * PARAMETERS: resource - Buffer containing the resource
198 * table - Table entry to decode the resource
Bob Moore08978312005-10-21 00:00:00 -0400199 *
200 * RETURN: None
201 *
Bob Moore42f8fb72013-01-11 13:08:51 +0100202 * DESCRIPTION: Dump a resource descriptor based on a dump table entry.
Bob Moore08978312005-10-21 00:00:00 -0400203 *
204 ******************************************************************************/
205
206static void
207acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
208{
Bob Moore96db2552005-11-02 00:00:00 -0500209 u8 *target = NULL;
210 u8 *previous_target;
Bob Moore0dfaaa32016-03-24 09:40:40 +0800211 const char *name;
Bob Moore08978312005-10-21 00:00:00 -0400212 u8 count;
213
214 /* First table entry must contain the table length (# of table entries) */
215
216 count = table->offset;
217
218 while (count) {
219 previous_target = target;
Bob Moorec51a4de2005-11-17 13:07:00 -0500220 target = ACPI_ADD_PTR(u8, resource, table->offset);
Bob Moore08978312005-10-21 00:00:00 -0400221 name = table->name;
222
223 switch (table->opcode) {
224 case ACPI_RSD_TITLE:
225 /*
226 * Optional resource title
227 */
228 if (table->name) {
229 acpi_os_printf("%s Resource\n", name);
230 }
231 break;
232
233 /* Strings */
234
235 case ACPI_RSD_LITERAL:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000236
Bob Moore96db2552005-11-02 00:00:00 -0500237 acpi_rs_out_string(name,
238 ACPI_CAST_PTR(char, table->pointer));
Bob Moore08978312005-10-21 00:00:00 -0400239 break;
240
241 case ACPI_RSD_STRING:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000242
Bob Moore96db2552005-11-02 00:00:00 -0500243 acpi_rs_out_string(name, ACPI_CAST_PTR(char, target));
Bob Moore08978312005-10-21 00:00:00 -0400244 break;
245
246 /* Data items, 8/16/32/64 bit */
247
248 case ACPI_RSD_UINT8:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000249
Lin Minge0fe0a82011-11-16 14:38:13 +0800250 if (table->pointer) {
Bob Moore0dfaaa32016-03-24 09:40:40 +0800251 acpi_rs_out_string(name,
252 table->pointer[*target]);
Lin Minge0fe0a82011-11-16 14:38:13 +0800253 } else {
254 acpi_rs_out_integer8(name, ACPI_GET8(target));
255 }
Bob Moore08978312005-10-21 00:00:00 -0400256 break;
257
258 case ACPI_RSD_UINT16:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000259
Bob Moorec51a4de2005-11-17 13:07:00 -0500260 acpi_rs_out_integer16(name, ACPI_GET16(target));
Bob Moore08978312005-10-21 00:00:00 -0400261 break;
262
263 case ACPI_RSD_UINT32:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000264
Bob Moorec51a4de2005-11-17 13:07:00 -0500265 acpi_rs_out_integer32(name, ACPI_GET32(target));
Bob Moore08978312005-10-21 00:00:00 -0400266 break;
267
268 case ACPI_RSD_UINT64:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000269
Bob Moorec51a4de2005-11-17 13:07:00 -0500270 acpi_rs_out_integer64(name, ACPI_GET64(target));
Bob Moore08978312005-10-21 00:00:00 -0400271 break;
272
273 /* Flags: 1-bit and 2-bit flags supported */
274
275 case ACPI_RSD_1BITFLAG:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000276
Bob Moore0dfaaa32016-03-24 09:40:40 +0800277 acpi_rs_out_string(name,
278 table->pointer[*target & 0x01]);
Bob Moore08978312005-10-21 00:00:00 -0400279 break;
280
281 case ACPI_RSD_2BITFLAG:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000282
Bob Moore0dfaaa32016-03-24 09:40:40 +0800283 acpi_rs_out_string(name,
284 table->pointer[*target & 0x03]);
Bob Moore08978312005-10-21 00:00:00 -0400285 break;
286
Lin Minge0fe0a82011-11-16 14:38:13 +0800287 case ACPI_RSD_3BITFLAG:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000288
Bob Moore0dfaaa32016-03-24 09:40:40 +0800289 acpi_rs_out_string(name,
290 table->pointer[*target & 0x07]);
Lin Minge0fe0a82011-11-16 14:38:13 +0800291 break;
292
Bob Moore08978312005-10-21 00:00:00 -0400293 case ACPI_RSD_SHORTLIST:
294 /*
295 * Short byte list (single line output) for DMA and IRQ resources
296 * Note: The list length is obtained from the previous table entry
297 */
298 if (previous_target) {
299 acpi_rs_out_title(name);
Bob Moore96db2552005-11-02 00:00:00 -0500300 acpi_rs_dump_short_byte_list(*previous_target,
301 target);
Bob Moore08978312005-10-21 00:00:00 -0400302 }
303 break;
304
Lin Minge0fe0a82011-11-16 14:38:13 +0800305 case ACPI_RSD_SHORTLISTX:
306 /*
307 * Short byte list (single line output) for GPIO vendor data
308 * Note: The list length is obtained from the previous table entry
309 */
310 if (previous_target) {
311 acpi_rs_out_title(name);
312 acpi_rs_dump_short_byte_list(*previous_target,
313 *
314 (ACPI_CAST_INDIRECT_PTR
315 (u8, target)));
316 }
317 break;
318
Bob Moore08978312005-10-21 00:00:00 -0400319 case ACPI_RSD_LONGLIST:
320 /*
321 * Long byte list for Vendor resource data
322 * Note: The list length is obtained from the previous table entry
323 */
324 if (previous_target) {
Bob Moorec51a4de2005-11-17 13:07:00 -0500325 acpi_rs_dump_byte_list(ACPI_GET16
326 (previous_target),
Bob Moore96db2552005-11-02 00:00:00 -0500327 target);
Bob Moore08978312005-10-21 00:00:00 -0400328 }
329 break;
330
331 case ACPI_RSD_DWORDLIST:
332 /*
333 * Dword list for Extended Interrupt resources
334 * Note: The list length is obtained from the previous table entry
335 */
336 if (previous_target) {
Bob Moore96db2552005-11-02 00:00:00 -0500337 acpi_rs_dump_dword_list(*previous_target,
338 ACPI_CAST_PTR(u32,
339 target));
Bob Moore08978312005-10-21 00:00:00 -0400340 }
341 break;
342
Lin Minge0fe0a82011-11-16 14:38:13 +0800343 case ACPI_RSD_WORDLIST:
344 /*
345 * Word list for GPIO Pin Table
346 * Note: The list length is obtained from the previous table entry
347 */
348 if (previous_target) {
349 acpi_rs_dump_word_list(*previous_target,
350 *(ACPI_CAST_INDIRECT_PTR
351 (u16, target)));
352 }
353 break;
354
Bob Moore08978312005-10-21 00:00:00 -0400355 case ACPI_RSD_ADDRESS:
356 /*
357 * Common flags for all Address resources
358 */
Bob Moore96db2552005-11-02 00:00:00 -0500359 acpi_rs_dump_address_common(ACPI_CAST_PTR
360 (union acpi_resource_data,
361 target));
Bob Moore08978312005-10-21 00:00:00 -0400362 break;
363
364 case ACPI_RSD_SOURCE:
365 /*
366 * Optional resource_source for Address resources
367 */
Lv Zheng3e8214e2012-12-19 05:37:15 +0000368 acpi_rs_dump_resource_source(ACPI_CAST_PTR
369 (struct
Len Brownfd350942007-05-09 23:34:35 -0400370 acpi_resource_source,
371 target));
Bob Moore08978312005-10-21 00:00:00 -0400372 break;
373
374 default:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000375
Bob Moore08978312005-10-21 00:00:00 -0400376 acpi_os_printf("**** Invalid table opcode [%X] ****\n",
377 table->opcode);
378 return;
379 }
380
381 table++;
382 count--;
383 }
384}
385
386/*******************************************************************************
387 *
388 * FUNCTION: acpi_rs_dump_resource_source
389 *
390 * PARAMETERS: resource_source - Pointer to a Resource Source struct
391 *
392 * RETURN: None
393 *
394 * DESCRIPTION: Common routine for dumping the optional resource_source and the
395 * corresponding resource_source_index.
396 *
397 ******************************************************************************/
398
399static void
400acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source)
401{
402 ACPI_FUNCTION_ENTRY();
403
404 if (resource_source->index == 0xFF) {
405 return;
406 }
407
408 acpi_rs_out_integer8("Resource Source Index", resource_source->index);
409
410 acpi_rs_out_string("Resource Source",
411 resource_source->string_ptr ?
412 resource_source->string_ptr : "[Not Specified]");
413}
414
415/*******************************************************************************
416 *
417 * FUNCTION: acpi_rs_dump_address_common
418 *
Bob Mooreba494be2012-07-12 09:40:10 +0800419 * PARAMETERS: resource - Pointer to an internal resource descriptor
Bob Moore08978312005-10-21 00:00:00 -0400420 *
421 * RETURN: None
422 *
423 * DESCRIPTION: Dump the fields that are common to all Address resource
424 * descriptors
425 *
426 ******************************************************************************/
427
428static void acpi_rs_dump_address_common(union acpi_resource_data *resource)
429{
430 ACPI_FUNCTION_ENTRY();
431
432 /* Decode the type-specific flags */
433
434 switch (resource->address.resource_type) {
435 case ACPI_MEMORY_RANGE:
436
437 acpi_rs_dump_descriptor(resource, acpi_rs_dump_memory_flags);
438 break;
439
440 case ACPI_IO_RANGE:
441
442 acpi_rs_dump_descriptor(resource, acpi_rs_dump_io_flags);
443 break;
444
445 case ACPI_BUS_NUMBER_RANGE:
446
447 acpi_rs_out_string("Resource Type", "Bus Number Range");
448 break;
449
450 default:
451
452 acpi_rs_out_integer8("Resource Type",
453 (u8) resource->address.resource_type);
454 break;
455 }
456
457 /* Decode the general flags */
458
459 acpi_rs_dump_descriptor(resource, acpi_rs_dump_general_flags);
460}
461
Linus Torvalds1da177e2005-04-16 15:20:36 -0700462/*******************************************************************************
463 *
Robert Moorebda663d2005-09-16 16:51:15 -0400464 * FUNCTION: acpi_rs_out*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700465 *
Bob Mooreba494be2012-07-12 09:40:10 +0800466 * PARAMETERS: title - Name of the resource field
467 * value - Value of the resource field
Linus Torvalds1da177e2005-04-16 15:20:36 -0700468 *
469 * RETURN: None
470 *
Robert Moorebda663d2005-09-16 16:51:15 -0400471 * DESCRIPTION: Miscellaneous helper functions to consistently format the
472 * output of the resource dump routines
Linus Torvalds1da177e2005-04-16 15:20:36 -0700473 *
474 ******************************************************************************/
475
Bob Moore0dfaaa32016-03-24 09:40:40 +0800476static void acpi_rs_out_string(const char *title, const char *value)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700477{
Bob Moore1fad8732015-12-29 13:54:36 +0800478
Bob Mooreb8e4d892006-01-27 16:43:00 -0500479 acpi_os_printf("%27s : %s", title, value);
480 if (!*value) {
481 acpi_os_printf("[NULL NAMESTRING]");
482 }
483 acpi_os_printf("\n");
Robert Moorebda663d2005-09-16 16:51:15 -0400484}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700485
Bob Moore0dfaaa32016-03-24 09:40:40 +0800486static void acpi_rs_out_integer8(const char *title, u8 value)
Robert Moorebda663d2005-09-16 16:51:15 -0400487{
Bob Moore50eca3e2005-09-30 19:03:00 -0400488 acpi_os_printf("%27s : %2.2X\n", title, value);
Robert Moorebda663d2005-09-16 16:51:15 -0400489}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700490
Bob Moore0dfaaa32016-03-24 09:40:40 +0800491static void acpi_rs_out_integer16(const char *title, u16 value)
Robert Moorebda663d2005-09-16 16:51:15 -0400492{
Bob Moore1fad8732015-12-29 13:54:36 +0800493
Bob Moore50eca3e2005-09-30 19:03:00 -0400494 acpi_os_printf("%27s : %4.4X\n", title, value);
Robert Moorebda663d2005-09-16 16:51:15 -0400495}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700496
Bob Moore0dfaaa32016-03-24 09:40:40 +0800497static void acpi_rs_out_integer32(const char *title, u32 value)
Robert Moorebda663d2005-09-16 16:51:15 -0400498{
Bob Moore1fad8732015-12-29 13:54:36 +0800499
Bob Moore50eca3e2005-09-30 19:03:00 -0400500 acpi_os_printf("%27s : %8.8X\n", title, value);
Robert Moorebda663d2005-09-16 16:51:15 -0400501}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700502
Bob Moore0dfaaa32016-03-24 09:40:40 +0800503static void acpi_rs_out_integer64(const char *title, u64 value)
Robert Moorebda663d2005-09-16 16:51:15 -0400504{
Bob Moore1fad8732015-12-29 13:54:36 +0800505
Bob Moore50eca3e2005-09-30 19:03:00 -0400506 acpi_os_printf("%27s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value));
Robert Moorebda663d2005-09-16 16:51:15 -0400507}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700508
Bob Moore0dfaaa32016-03-24 09:40:40 +0800509static void acpi_rs_out_title(const char *title)
Robert Moorebda663d2005-09-16 16:51:15 -0400510{
Bob Moore1fad8732015-12-29 13:54:36 +0800511
Bob Moore50eca3e2005-09-30 19:03:00 -0400512 acpi_os_printf("%27s : ", title);
Robert Moorebda663d2005-09-16 16:51:15 -0400513}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700514
Robert Moorebda663d2005-09-16 16:51:15 -0400515/*******************************************************************************
516 *
517 * FUNCTION: acpi_rs_dump*List
518 *
Bob Mooreba494be2012-07-12 09:40:10 +0800519 * PARAMETERS: length - Number of elements in the list
520 * data - Start of the list
Robert Moorebda663d2005-09-16 16:51:15 -0400521 *
522 * RETURN: None
523 *
524 * DESCRIPTION: Miscellaneous functions to dump lists of raw data
525 *
526 ******************************************************************************/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700527
Bob Moore08978312005-10-21 00:00:00 -0400528static void acpi_rs_dump_byte_list(u16 length, u8 * data)
Robert Moorebda663d2005-09-16 16:51:15 -0400529{
Bob Moore08978312005-10-21 00:00:00 -0400530 u8 i;
Robert Moorebda663d2005-09-16 16:51:15 -0400531
532 for (i = 0; i < length; i++) {
Bob Moore50eca3e2005-09-30 19:03:00 -0400533 acpi_os_printf("%25s%2.2X : %2.2X\n", "Byte", i, data[i]);
Robert Moorebda663d2005-09-16 16:51:15 -0400534 }
535}
536
Bob Moore08978312005-10-21 00:00:00 -0400537static void acpi_rs_dump_short_byte_list(u8 length, u8 * data)
Robert Moorebda663d2005-09-16 16:51:15 -0400538{
Bob Moore08978312005-10-21 00:00:00 -0400539 u8 i;
Robert Moorebda663d2005-09-16 16:51:15 -0400540
541 for (i = 0; i < length; i++) {
542 acpi_os_printf("%X ", data[i]);
543 }
Bob Moore1fad8732015-12-29 13:54:36 +0800544
Robert Moorebda663d2005-09-16 16:51:15 -0400545 acpi_os_printf("\n");
546}
547
Bob Moore08978312005-10-21 00:00:00 -0400548static void acpi_rs_dump_dword_list(u8 length, u32 * data)
Bob Moore50eca3e2005-09-30 19:03:00 -0400549{
Bob Moore08978312005-10-21 00:00:00 -0400550 u8 i;
Bob Moore50eca3e2005-09-30 19:03:00 -0400551
Bob Moore08978312005-10-21 00:00:00 -0400552 for (i = 0; i < length; i++) {
553 acpi_os_printf("%25s%2.2X : %8.8X\n", "Dword", i, data[i]);
Robert Moorebda663d2005-09-16 16:51:15 -0400554 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700555}
556
Lin Minge0fe0a82011-11-16 14:38:13 +0800557static void acpi_rs_dump_word_list(u16 length, u16 *data)
558{
559 u16 i;
560
561 for (i = 0; i < length; i++) {
562 acpi_os_printf("%25s%2.2X : %4.4X\n", "Word", i, data[i]);
563 }
564}