blob: b12a0b1cd9ceda6717eddf6c1e00c1f426ef831e [file] [log] [blame]
Erik Schmauss95857632018-03-14 16:13:07 -07001// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
Linus Torvalds1da177e2005-04-16 15:20:36 -07002/*******************************************************************************
3 *
Bob Moore39239fe2015-04-13 11:50:08 +08004 * Module Name: rsdump - AML debugger support for resource structures.
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 *
6 ******************************************************************************/
7
Linus Torvalds1da177e2005-04-16 15:20:36 -07008#include <acpi/acpi.h>
Len Browne2f7a772009-01-09 00:30:03 -05009#include "accommon.h"
10#include "acresrc.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
12#define _COMPONENT ACPI_RESOURCES
Len Brown4be44fc2005-08-05 00:44:28 -040013ACPI_MODULE_NAME("rsdump")
Lv Zheng33348612014-02-08 09:42:46 +080014
Bob Moore39239fe2015-04-13 11:50:08 +080015/*
16 * All functions in this module are used by the AML Debugger only
17 */
Robert Moore44f6c012005-04-18 22:49:35 -040018/* Local prototypes */
Bob Moore0dfaaa32016-03-24 09:40:40 +080019static void acpi_rs_out_string(const char *title, const char *value);
Robert Moorebda663d2005-09-16 16:51:15 -040020
Bob Moore0dfaaa32016-03-24 09:40:40 +080021static void acpi_rs_out_integer8(const char *title, u8 value);
Robert Moorebda663d2005-09-16 16:51:15 -040022
Bob Moore0dfaaa32016-03-24 09:40:40 +080023static void acpi_rs_out_integer16(const char *title, u16 value);
Robert Moorebda663d2005-09-16 16:51:15 -040024
Bob Moore0dfaaa32016-03-24 09:40:40 +080025static void acpi_rs_out_integer32(const char *title, u32 value);
Robert Moorebda663d2005-09-16 16:51:15 -040026
Bob Moore0dfaaa32016-03-24 09:40:40 +080027static void acpi_rs_out_integer64(const char *title, u64 value);
Robert Moorebda663d2005-09-16 16:51:15 -040028
Bob Moore0dfaaa32016-03-24 09:40:40 +080029static void acpi_rs_out_title(const char *title);
Robert Moorebda663d2005-09-16 16:51:15 -040030
Lin Minge0fe0a82011-11-16 14:38:13 +080031static void acpi_rs_dump_byte_list(u16 length, u8 *data);
Robert Moorebda663d2005-09-16 16:51:15 -040032
Lin Minge0fe0a82011-11-16 14:38:13 +080033static void acpi_rs_dump_word_list(u16 length, u16 *data);
Robert Moorebda663d2005-09-16 16:51:15 -040034
Lin Minge0fe0a82011-11-16 14:38:13 +080035static void acpi_rs_dump_dword_list(u8 length, u32 *data);
36
37static void acpi_rs_dump_short_byte_list(u8 length, u8 *data);
Robert Moorebda663d2005-09-16 16:51:15 -040038
39static void
40acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source);
41
Mika Westerbergfdaa0982017-06-05 16:39:25 +080042static void
43acpi_rs_dump_resource_label(char *title,
44 struct acpi_resource_label *resource_label);
45
Robert Moorebda663d2005-09-16 16:51:15 -040046static void acpi_rs_dump_address_common(union acpi_resource_data *resource);
47
Bob Moore08978312005-10-21 00:00:00 -040048static void
49acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table);
50
Bob Moore08978312005-10-21 00:00:00 -040051/*******************************************************************************
52 *
Bob Moore39239fe2015-04-13 11:50:08 +080053 * FUNCTION: acpi_rs_dump_resource_list
54 *
55 * PARAMETERS: resource_list - Pointer to a resource descriptor list
56 *
57 * RETURN: None
58 *
59 * DESCRIPTION: Dispatches the structure to the correct dump routine.
60 *
61 ******************************************************************************/
62
63void acpi_rs_dump_resource_list(struct acpi_resource *resource_list)
64{
65 u32 count = 0;
66 u32 type;
67
68 ACPI_FUNCTION_ENTRY();
69
70 /* Check if debug output enabled */
71
72 if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) {
73 return;
74 }
75
76 /* Walk list and dump all resource descriptors (END_TAG terminates) */
77
78 do {
79 acpi_os_printf("\n[%02X] ", count);
80 count++;
81
82 /* Validate Type before dispatch */
83
84 type = resource_list->type;
85 if (type > ACPI_RESOURCE_TYPE_MAX) {
86 acpi_os_printf
87 ("Invalid descriptor type (%X) in resource list\n",
88 resource_list->type);
89 return;
90 }
91
92 /* Sanity check the length. It must not be zero, or we loop forever */
93
94 if (!resource_list->length) {
95 acpi_os_printf
96 ("Invalid zero length descriptor in resource list\n");
97 return;
98 }
99
100 /* Dump the resource descriptor */
101
102 if (type == ACPI_RESOURCE_TYPE_SERIAL_BUS) {
103 acpi_rs_dump_descriptor(&resource_list->data,
104 acpi_gbl_dump_serial_bus_dispatch
105 [resource_list->data.
106 common_serial_bus.type]);
107 } else {
108 acpi_rs_dump_descriptor(&resource_list->data,
109 acpi_gbl_dump_resource_dispatch
110 [type]);
111 }
112
113 /* Point to the next resource structure */
114
115 resource_list = ACPI_NEXT_RESOURCE(resource_list);
116
117 /* Exit when END_TAG descriptor is reached */
118
119 } while (type != ACPI_RESOURCE_TYPE_END_TAG);
120}
121
122/*******************************************************************************
123 *
124 * FUNCTION: acpi_rs_dump_irq_list
125 *
126 * PARAMETERS: route_table - Pointer to the routing table to dump.
127 *
128 * RETURN: None
129 *
130 * DESCRIPTION: Print IRQ routing table
131 *
132 ******************************************************************************/
133
134void acpi_rs_dump_irq_list(u8 *route_table)
135{
136 struct acpi_pci_routing_table *prt_element;
137 u8 count;
138
139 ACPI_FUNCTION_ENTRY();
140
141 /* Check if debug output enabled */
142
143 if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) {
144 return;
145 }
146
147 prt_element = ACPI_CAST_PTR(struct acpi_pci_routing_table, route_table);
148
149 /* Dump all table elements, Exit on zero length element */
150
151 for (count = 0; prt_element->length; count++) {
152 acpi_os_printf("\n[%02X] PCI IRQ Routing Table Package\n",
153 count);
154 acpi_rs_dump_descriptor(prt_element, acpi_rs_dump_prt);
155
156 prt_element = ACPI_ADD_PTR(struct acpi_pci_routing_table,
157 prt_element, prt_element->length);
158 }
159}
160
161/*******************************************************************************
162 *
Bob Moore08978312005-10-21 00:00:00 -0400163 * FUNCTION: acpi_rs_dump_descriptor
164 *
Bob Moore42f8fb72013-01-11 13:08:51 +0100165 * PARAMETERS: resource - Buffer containing the resource
166 * table - Table entry to decode the resource
Bob Moore08978312005-10-21 00:00:00 -0400167 *
168 * RETURN: None
169 *
Bob Moore42f8fb72013-01-11 13:08:51 +0100170 * DESCRIPTION: Dump a resource descriptor based on a dump table entry.
Bob Moore08978312005-10-21 00:00:00 -0400171 *
172 ******************************************************************************/
173
174static void
175acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
176{
Bob Moore96db2552005-11-02 00:00:00 -0500177 u8 *target = NULL;
178 u8 *previous_target;
Bob Moore0dfaaa32016-03-24 09:40:40 +0800179 const char *name;
Bob Moore08978312005-10-21 00:00:00 -0400180 u8 count;
181
182 /* First table entry must contain the table length (# of table entries) */
183
184 count = table->offset;
185
186 while (count) {
187 previous_target = target;
Bob Moorec51a4de2005-11-17 13:07:00 -0500188 target = ACPI_ADD_PTR(u8, resource, table->offset);
Bob Moore08978312005-10-21 00:00:00 -0400189 name = table->name;
190
191 switch (table->opcode) {
192 case ACPI_RSD_TITLE:
193 /*
194 * Optional resource title
195 */
196 if (table->name) {
197 acpi_os_printf("%s Resource\n", name);
198 }
199 break;
200
201 /* Strings */
202
203 case ACPI_RSD_LITERAL:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000204
Bob Moore96db2552005-11-02 00:00:00 -0500205 acpi_rs_out_string(name,
206 ACPI_CAST_PTR(char, table->pointer));
Bob Moore08978312005-10-21 00:00:00 -0400207 break;
208
209 case ACPI_RSD_STRING:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000210
Bob Moore96db2552005-11-02 00:00:00 -0500211 acpi_rs_out_string(name, ACPI_CAST_PTR(char, target));
Bob Moore08978312005-10-21 00:00:00 -0400212 break;
213
214 /* Data items, 8/16/32/64 bit */
215
216 case ACPI_RSD_UINT8:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000217
Lin Minge0fe0a82011-11-16 14:38:13 +0800218 if (table->pointer) {
Bob Moore0dfaaa32016-03-24 09:40:40 +0800219 acpi_rs_out_string(name,
220 table->pointer[*target]);
Lin Minge0fe0a82011-11-16 14:38:13 +0800221 } else {
222 acpi_rs_out_integer8(name, ACPI_GET8(target));
223 }
Bob Moore08978312005-10-21 00:00:00 -0400224 break;
225
226 case ACPI_RSD_UINT16:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000227
Bob Moorec51a4de2005-11-17 13:07:00 -0500228 acpi_rs_out_integer16(name, ACPI_GET16(target));
Bob Moore08978312005-10-21 00:00:00 -0400229 break;
230
231 case ACPI_RSD_UINT32:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000232
Bob Moorec51a4de2005-11-17 13:07:00 -0500233 acpi_rs_out_integer32(name, ACPI_GET32(target));
Bob Moore08978312005-10-21 00:00:00 -0400234 break;
235
236 case ACPI_RSD_UINT64:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000237
Bob Moorec51a4de2005-11-17 13:07:00 -0500238 acpi_rs_out_integer64(name, ACPI_GET64(target));
Bob Moore08978312005-10-21 00:00:00 -0400239 break;
240
241 /* Flags: 1-bit and 2-bit flags supported */
242
243 case ACPI_RSD_1BITFLAG:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000244
Bob Moore0dfaaa32016-03-24 09:40:40 +0800245 acpi_rs_out_string(name,
246 table->pointer[*target & 0x01]);
Bob Moore08978312005-10-21 00:00:00 -0400247 break;
248
249 case ACPI_RSD_2BITFLAG:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000250
Bob Moore0dfaaa32016-03-24 09:40:40 +0800251 acpi_rs_out_string(name,
252 table->pointer[*target & 0x03]);
Bob Moore08978312005-10-21 00:00:00 -0400253 break;
254
Lin Minge0fe0a82011-11-16 14:38:13 +0800255 case ACPI_RSD_3BITFLAG:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000256
Bob Moore0dfaaa32016-03-24 09:40:40 +0800257 acpi_rs_out_string(name,
258 table->pointer[*target & 0x07]);
Lin Minge0fe0a82011-11-16 14:38:13 +0800259 break;
260
Bob Moore08978312005-10-21 00:00:00 -0400261 case ACPI_RSD_SHORTLIST:
262 /*
263 * Short byte list (single line output) for DMA and IRQ resources
264 * Note: The list length is obtained from the previous table entry
265 */
266 if (previous_target) {
267 acpi_rs_out_title(name);
Bob Moore96db2552005-11-02 00:00:00 -0500268 acpi_rs_dump_short_byte_list(*previous_target,
269 target);
Bob Moore08978312005-10-21 00:00:00 -0400270 }
271 break;
272
Lin Minge0fe0a82011-11-16 14:38:13 +0800273 case ACPI_RSD_SHORTLISTX:
274 /*
275 * Short byte list (single line output) for GPIO vendor data
276 * Note: The list length is obtained from the previous table entry
277 */
278 if (previous_target) {
279 acpi_rs_out_title(name);
280 acpi_rs_dump_short_byte_list(*previous_target,
281 *
282 (ACPI_CAST_INDIRECT_PTR
283 (u8, target)));
284 }
285 break;
286
Bob Moore08978312005-10-21 00:00:00 -0400287 case ACPI_RSD_LONGLIST:
288 /*
289 * Long byte list for Vendor resource data
290 * Note: The list length is obtained from the previous table entry
291 */
292 if (previous_target) {
Bob Moorec51a4de2005-11-17 13:07:00 -0500293 acpi_rs_dump_byte_list(ACPI_GET16
294 (previous_target),
Bob Moore96db2552005-11-02 00:00:00 -0500295 target);
Bob Moore08978312005-10-21 00:00:00 -0400296 }
297 break;
298
299 case ACPI_RSD_DWORDLIST:
300 /*
301 * Dword list for Extended Interrupt resources
302 * Note: The list length is obtained from the previous table entry
303 */
304 if (previous_target) {
Bob Moore96db2552005-11-02 00:00:00 -0500305 acpi_rs_dump_dword_list(*previous_target,
306 ACPI_CAST_PTR(u32,
307 target));
Bob Moore08978312005-10-21 00:00:00 -0400308 }
309 break;
310
Lin Minge0fe0a82011-11-16 14:38:13 +0800311 case ACPI_RSD_WORDLIST:
312 /*
313 * Word list for GPIO Pin Table
314 * Note: The list length is obtained from the previous table entry
315 */
316 if (previous_target) {
317 acpi_rs_dump_word_list(*previous_target,
318 *(ACPI_CAST_INDIRECT_PTR
319 (u16, target)));
320 }
321 break;
322
Bob Moore08978312005-10-21 00:00:00 -0400323 case ACPI_RSD_ADDRESS:
324 /*
325 * Common flags for all Address resources
326 */
Bob Moore96db2552005-11-02 00:00:00 -0500327 acpi_rs_dump_address_common(ACPI_CAST_PTR
328 (union acpi_resource_data,
329 target));
Bob Moore08978312005-10-21 00:00:00 -0400330 break;
331
332 case ACPI_RSD_SOURCE:
333 /*
334 * Optional resource_source for Address resources
335 */
Lv Zheng3e8214e2012-12-19 05:37:15 +0000336 acpi_rs_dump_resource_source(ACPI_CAST_PTR
337 (struct
Len Brownfd350942007-05-09 23:34:35 -0400338 acpi_resource_source,
339 target));
Bob Moore08978312005-10-21 00:00:00 -0400340 break;
341
Mika Westerbergfdaa0982017-06-05 16:39:25 +0800342 case ACPI_RSD_LABEL:
343 /*
344 * resource_label
345 */
346 acpi_rs_dump_resource_label("Resource Label",
347 ACPI_CAST_PTR(struct
348 acpi_resource_label,
349 target));
350 break;
351
Mika Westerbergf8a6c862017-06-05 16:39:31 +0800352 case ACPI_RSD_SOURCE_LABEL:
353 /*
354 * resource_source_label
355 */
356 acpi_rs_dump_resource_label("Resource Source Label",
357 ACPI_CAST_PTR(struct
358 acpi_resource_label,
359 target));
360 break;
361
Bob Moore08978312005-10-21 00:00:00 -0400362 default:
Chao Guan1d1ea1b2013-06-08 00:58:14 +0000363
Bob Moore08978312005-10-21 00:00:00 -0400364 acpi_os_printf("**** Invalid table opcode [%X] ****\n",
365 table->opcode);
366 return;
367 }
368
369 table++;
370 count--;
371 }
372}
373
374/*******************************************************************************
375 *
376 * FUNCTION: acpi_rs_dump_resource_source
377 *
378 * PARAMETERS: resource_source - Pointer to a Resource Source struct
379 *
380 * RETURN: None
381 *
382 * DESCRIPTION: Common routine for dumping the optional resource_source and the
383 * corresponding resource_source_index.
384 *
385 ******************************************************************************/
386
387static void
388acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source)
389{
390 ACPI_FUNCTION_ENTRY();
391
392 if (resource_source->index == 0xFF) {
393 return;
394 }
395
396 acpi_rs_out_integer8("Resource Source Index", resource_source->index);
397
398 acpi_rs_out_string("Resource Source",
399 resource_source->string_ptr ?
400 resource_source->string_ptr : "[Not Specified]");
401}
402
403/*******************************************************************************
404 *
Mika Westerbergfdaa0982017-06-05 16:39:25 +0800405 * FUNCTION: acpi_rs_dump_resource_label
406 *
407 * PARAMETERS: title - Title of the dumped resource field
408 * resource_label - Pointer to a Resource Label struct
409 *
410 * RETURN: None
411 *
412 * DESCRIPTION: Common routine for dumping the resource_label
413 *
414 ******************************************************************************/
415
416static void
417acpi_rs_dump_resource_label(char *title,
418 struct acpi_resource_label *resource_label)
419{
420 ACPI_FUNCTION_ENTRY();
421
422 acpi_rs_out_string(title,
423 resource_label->string_ptr ?
424 resource_label->string_ptr : "[Not Specified]");
425}
426
427/*******************************************************************************
428 *
Bob Moore08978312005-10-21 00:00:00 -0400429 * FUNCTION: acpi_rs_dump_address_common
430 *
Bob Mooreba494be2012-07-12 09:40:10 +0800431 * PARAMETERS: resource - Pointer to an internal resource descriptor
Bob Moore08978312005-10-21 00:00:00 -0400432 *
433 * RETURN: None
434 *
435 * DESCRIPTION: Dump the fields that are common to all Address resource
436 * descriptors
437 *
438 ******************************************************************************/
439
440static void acpi_rs_dump_address_common(union acpi_resource_data *resource)
441{
442 ACPI_FUNCTION_ENTRY();
443
444 /* Decode the type-specific flags */
445
446 switch (resource->address.resource_type) {
447 case ACPI_MEMORY_RANGE:
448
449 acpi_rs_dump_descriptor(resource, acpi_rs_dump_memory_flags);
450 break;
451
452 case ACPI_IO_RANGE:
453
454 acpi_rs_dump_descriptor(resource, acpi_rs_dump_io_flags);
455 break;
456
457 case ACPI_BUS_NUMBER_RANGE:
458
459 acpi_rs_out_string("Resource Type", "Bus Number Range");
460 break;
461
462 default:
463
464 acpi_rs_out_integer8("Resource Type",
465 (u8) resource->address.resource_type);
466 break;
467 }
468
469 /* Decode the general flags */
470
471 acpi_rs_dump_descriptor(resource, acpi_rs_dump_general_flags);
472}
473
Linus Torvalds1da177e2005-04-16 15:20:36 -0700474/*******************************************************************************
475 *
Robert Moorebda663d2005-09-16 16:51:15 -0400476 * FUNCTION: acpi_rs_out*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700477 *
Bob Mooreba494be2012-07-12 09:40:10 +0800478 * PARAMETERS: title - Name of the resource field
479 * value - Value of the resource field
Linus Torvalds1da177e2005-04-16 15:20:36 -0700480 *
481 * RETURN: None
482 *
Robert Moorebda663d2005-09-16 16:51:15 -0400483 * DESCRIPTION: Miscellaneous helper functions to consistently format the
484 * output of the resource dump routines
Linus Torvalds1da177e2005-04-16 15:20:36 -0700485 *
486 ******************************************************************************/
487
Bob Moore0dfaaa32016-03-24 09:40:40 +0800488static void acpi_rs_out_string(const char *title, const char *value)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700489{
Bob Moore1fad8732015-12-29 13:54:36 +0800490
Bob Mooreb8e4d892006-01-27 16:43:00 -0500491 acpi_os_printf("%27s : %s", title, value);
492 if (!*value) {
493 acpi_os_printf("[NULL NAMESTRING]");
494 }
495 acpi_os_printf("\n");
Robert Moorebda663d2005-09-16 16:51:15 -0400496}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700497
Bob Moore0dfaaa32016-03-24 09:40:40 +0800498static void acpi_rs_out_integer8(const char *title, u8 value)
Robert Moorebda663d2005-09-16 16:51:15 -0400499{
Bob Moore50eca3e2005-09-30 19:03:00 -0400500 acpi_os_printf("%27s : %2.2X\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_integer16(const char *title, u16 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 : %4.4X\n", title, 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_integer32(const char *title, u32 value)
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 : %8.8X\n", title, value);
Robert Moorebda663d2005-09-16 16:51:15 -0400513}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700514
Bob Moore0dfaaa32016-03-24 09:40:40 +0800515static void acpi_rs_out_integer64(const char *title, u64 value)
Robert Moorebda663d2005-09-16 16:51:15 -0400516{
Bob Moore1fad8732015-12-29 13:54:36 +0800517
Bob Moore50eca3e2005-09-30 19:03:00 -0400518 acpi_os_printf("%27s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value));
Robert Moorebda663d2005-09-16 16:51:15 -0400519}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700520
Bob Moore0dfaaa32016-03-24 09:40:40 +0800521static void acpi_rs_out_title(const char *title)
Robert Moorebda663d2005-09-16 16:51:15 -0400522{
Bob Moore1fad8732015-12-29 13:54:36 +0800523
Bob Moore50eca3e2005-09-30 19:03:00 -0400524 acpi_os_printf("%27s : ", title);
Robert Moorebda663d2005-09-16 16:51:15 -0400525}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700526
Robert Moorebda663d2005-09-16 16:51:15 -0400527/*******************************************************************************
528 *
529 * FUNCTION: acpi_rs_dump*List
530 *
Bob Mooreba494be2012-07-12 09:40:10 +0800531 * PARAMETERS: length - Number of elements in the list
532 * data - Start of the list
Robert Moorebda663d2005-09-16 16:51:15 -0400533 *
534 * RETURN: None
535 *
536 * DESCRIPTION: Miscellaneous functions to dump lists of raw data
537 *
538 ******************************************************************************/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700539
Bob Moore08978312005-10-21 00:00:00 -0400540static void acpi_rs_dump_byte_list(u16 length, u8 * data)
Robert Moorebda663d2005-09-16 16:51:15 -0400541{
Bob Moore08978312005-10-21 00:00:00 -0400542 u8 i;
Robert Moorebda663d2005-09-16 16:51:15 -0400543
544 for (i = 0; i < length; i++) {
Bob Moore50eca3e2005-09-30 19:03:00 -0400545 acpi_os_printf("%25s%2.2X : %2.2X\n", "Byte", i, data[i]);
Robert Moorebda663d2005-09-16 16:51:15 -0400546 }
547}
548
Bob Moore08978312005-10-21 00:00:00 -0400549static void acpi_rs_dump_short_byte_list(u8 length, u8 * data)
Robert Moorebda663d2005-09-16 16:51:15 -0400550{
Bob Moore08978312005-10-21 00:00:00 -0400551 u8 i;
Robert Moorebda663d2005-09-16 16:51:15 -0400552
553 for (i = 0; i < length; i++) {
554 acpi_os_printf("%X ", data[i]);
555 }
Bob Moore1fad8732015-12-29 13:54:36 +0800556
Robert Moorebda663d2005-09-16 16:51:15 -0400557 acpi_os_printf("\n");
558}
559
Bob Moore08978312005-10-21 00:00:00 -0400560static void acpi_rs_dump_dword_list(u8 length, u32 * data)
Bob Moore50eca3e2005-09-30 19:03:00 -0400561{
Bob Moore08978312005-10-21 00:00:00 -0400562 u8 i;
Bob Moore50eca3e2005-09-30 19:03:00 -0400563
Bob Moore08978312005-10-21 00:00:00 -0400564 for (i = 0; i < length; i++) {
565 acpi_os_printf("%25s%2.2X : %8.8X\n", "Dword", i, data[i]);
Robert Moorebda663d2005-09-16 16:51:15 -0400566 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700567}
568
Lin Minge0fe0a82011-11-16 14:38:13 +0800569static void acpi_rs_dump_word_list(u16 length, u16 *data)
570{
571 u16 i;
572
573 for (i = 0; i < length; i++) {
574 acpi_os_printf("%25s%2.2X : %4.4X\n", "Word", i, data[i]);
575 }
576}