blob: bc2fa996047ef6148ce26101e77fa2ef7a8468cd [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/******************************************************************************
2 *
3 * Module Name: exdump - Interpreter debug output routines
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
Linus Torvalds1da177e2005-04-16 15:20:36 -070044#include <acpi/acpi.h>
45#include <acpi/acinterp.h>
46#include <acpi/amlcode.h>
47#include <acpi/acnamesp.h>
48#include <acpi/acparser.h>
49
50#define _COMPONENT ACPI_EXECUTER
Len Brown4be44fc2005-08-05 00:44:28 -040051ACPI_MODULE_NAME("exdump")
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
Robert Moore6f42ccf2005-05-13 00:00:00 -040053/*
54 * The following routines are used for debug output only
55 */
56#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
Robert Moore44f6c012005-04-18 22:49:35 -040057/* Local prototypes */
Robert Moore44f6c012005-04-18 22:49:35 -040058#ifdef ACPI_FUTURE_USAGE
Len Brown4be44fc2005-08-05 00:44:28 -040059static void acpi_ex_out_string(char *title, char *value);
60
61static void acpi_ex_out_pointer(char *title, void *value);
62
63static void acpi_ex_out_integer(char *title, u32 value);
64
65static void acpi_ex_out_address(char *title, acpi_physical_address value);
66
67static void acpi_ex_dump_reference(union acpi_operand_object *obj_desc);
Robert Moore44f6c012005-04-18 22:49:35 -040068
69static void
Len Brown4be44fc2005-08-05 00:44:28 -040070acpi_ex_dump_package(union acpi_operand_object *obj_desc, u32 level, u32 index);
71#endif /* ACPI_FUTURE_USAGE */
Linus Torvalds1da177e2005-04-16 15:20:36 -070072
Robert Moore44f6c012005-04-18 22:49:35 -040073/*******************************************************************************
Linus Torvalds1da177e2005-04-16 15:20:36 -070074 *
75 * FUNCTION: acpi_ex_dump_operand
76 *
Robert Moore44f6c012005-04-18 22:49:35 -040077 * PARAMETERS: *obj_desc - Pointer to entry to be dumped
78 * Depth - Current nesting depth
Linus Torvalds1da177e2005-04-16 15:20:36 -070079 *
80 * RETURN: None
81 *
82 * DESCRIPTION: Dump an operand object
83 *
Robert Moore44f6c012005-04-18 22:49:35 -040084 ******************************************************************************/
Linus Torvalds1da177e2005-04-16 15:20:36 -070085
Len Brown4be44fc2005-08-05 00:44:28 -040086void acpi_ex_dump_operand(union acpi_operand_object *obj_desc, u32 depth)
Linus Torvalds1da177e2005-04-16 15:20:36 -070087{
Len Brown4be44fc2005-08-05 00:44:28 -040088 u32 length;
89 u32 index;
Linus Torvalds1da177e2005-04-16 15:20:36 -070090
Len Brown4be44fc2005-08-05 00:44:28 -040091 ACPI_FUNCTION_NAME("ex_dump_operand")
Linus Torvalds1da177e2005-04-16 15:20:36 -070092
Len Brown4be44fc2005-08-05 00:44:28 -040093 if (!
94 ((ACPI_LV_EXEC & acpi_dbg_level)
95 && (_COMPONENT & acpi_dbg_layer))) {
Linus Torvalds1da177e2005-04-16 15:20:36 -070096 return;
97 }
98
99 if (!obj_desc) {
Robert Moore44f6c012005-04-18 22:49:35 -0400100 /* This could be a null element of a package */
101
Len Brown4be44fc2005-08-05 00:44:28 -0400102 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Null Object Descriptor\n"));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700103 return;
104 }
105
Len Brown4be44fc2005-08-05 00:44:28 -0400106 if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == ACPI_DESC_TYPE_NAMED) {
107 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%p Namespace Node: ",
108 obj_desc));
109 ACPI_DUMP_ENTRY(obj_desc, ACPI_LV_EXEC);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110 return;
111 }
112
Len Brown4be44fc2005-08-05 00:44:28 -0400113 if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) {
114 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
115 "%p is not a node or operand object: [%s]\n",
116 obj_desc,
117 acpi_ut_get_descriptor_name(obj_desc)));
118 ACPI_DUMP_BUFFER(obj_desc, sizeof(union acpi_operand_object));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119 return;
120 }
121
122 /* obj_desc is a valid object */
123
124 if (depth > 0) {
Len Brown4be44fc2005-08-05 00:44:28 -0400125 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%*s[%u] %p ",
126 depth, " ", depth, obj_desc));
127 } else {
128 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%p ", obj_desc));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129 }
130
Robert Moore44f6c012005-04-18 22:49:35 -0400131 /* Decode object type */
132
Len Brown4be44fc2005-08-05 00:44:28 -0400133 switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134 case ACPI_TYPE_LOCAL_REFERENCE:
135
136 switch (obj_desc->reference.opcode) {
137 case AML_DEBUG_OP:
138
Len Brown4be44fc2005-08-05 00:44:28 -0400139 acpi_os_printf("Reference: Debug\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140 break;
141
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142 case AML_NAME_OP:
143
Len Brown4be44fc2005-08-05 00:44:28 -0400144 ACPI_DUMP_PATHNAME(obj_desc->reference.object,
145 "Reference: Name: ", ACPI_LV_INFO,
146 _COMPONENT);
147 ACPI_DUMP_ENTRY(obj_desc->reference.object,
148 ACPI_LV_INFO);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149 break;
150
Linus Torvalds1da177e2005-04-16 15:20:36 -0700151 case AML_INDEX_OP:
152
Len Brown4be44fc2005-08-05 00:44:28 -0400153 acpi_os_printf("Reference: Index %p\n",
154 obj_desc->reference.object);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700155 break;
156
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157 case AML_REF_OF_OP:
158
Len Brown4be44fc2005-08-05 00:44:28 -0400159 acpi_os_printf("Reference: (ref_of) %p\n",
160 obj_desc->reference.object);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161 break;
162
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163 case AML_ARG_OP:
164
Len Brown4be44fc2005-08-05 00:44:28 -0400165 acpi_os_printf("Reference: Arg%d",
166 obj_desc->reference.offset);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167
Len Brown4be44fc2005-08-05 00:44:28 -0400168 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700169 /* Value is an Integer */
170
Len Brown4be44fc2005-08-05 00:44:28 -0400171 acpi_os_printf(" value is [%8.8X%8.8x]",
172 ACPI_FORMAT_UINT64(obj_desc->
173 integer.
174 value));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700175 }
176
Len Brown4be44fc2005-08-05 00:44:28 -0400177 acpi_os_printf("\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178 break;
179
Linus Torvalds1da177e2005-04-16 15:20:36 -0700180 case AML_LOCAL_OP:
181
Len Brown4be44fc2005-08-05 00:44:28 -0400182 acpi_os_printf("Reference: Local%d",
183 obj_desc->reference.offset);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700184
Len Brown4be44fc2005-08-05 00:44:28 -0400185 if (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_INTEGER) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700186
187 /* Value is an Integer */
188
Len Brown4be44fc2005-08-05 00:44:28 -0400189 acpi_os_printf(" value is [%8.8X%8.8x]",
190 ACPI_FORMAT_UINT64(obj_desc->
191 integer.
192 value));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700193 }
194
Len Brown4be44fc2005-08-05 00:44:28 -0400195 acpi_os_printf("\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196 break;
197
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198 case AML_INT_NAMEPATH_OP:
199
Len Brown4be44fc2005-08-05 00:44:28 -0400200 acpi_os_printf("Reference.Node->Name %X\n",
201 obj_desc->reference.node->name.integer);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700202 break;
203
Linus Torvalds1da177e2005-04-16 15:20:36 -0700204 default:
205
206 /* Unknown opcode */
207
Len Brown4be44fc2005-08-05 00:44:28 -0400208 acpi_os_printf("Unknown Reference opcode=%X\n",
209 obj_desc->reference.opcode);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700210 break;
211
212 }
213 break;
214
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215 case ACPI_TYPE_BUFFER:
216
Len Brown4be44fc2005-08-05 00:44:28 -0400217 acpi_os_printf("Buffer len %X @ %p \n",
218 obj_desc->buffer.length,
219 obj_desc->buffer.pointer);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700220
221 length = obj_desc->buffer.length;
222 if (length > 64) {
223 length = 64;
224 }
225
226 /* Debug only -- dump the buffer contents */
227
228 if (obj_desc->buffer.pointer) {
Len Brown4be44fc2005-08-05 00:44:28 -0400229 acpi_os_printf("Buffer Contents: ");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700230
231 for (index = 0; index < length; index++) {
Len Brown4be44fc2005-08-05 00:44:28 -0400232 acpi_os_printf(" %02x",
233 obj_desc->buffer.pointer[index]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700234 }
Len Brown4be44fc2005-08-05 00:44:28 -0400235 acpi_os_printf("\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700236 }
237 break;
238
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239 case ACPI_TYPE_INTEGER:
240
Len Brown4be44fc2005-08-05 00:44:28 -0400241 acpi_os_printf("Integer %8.8X%8.8X\n",
242 ACPI_FORMAT_UINT64(obj_desc->integer.value));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700243 break;
244
Linus Torvalds1da177e2005-04-16 15:20:36 -0700245 case ACPI_TYPE_PACKAGE:
246
Len Brown4be44fc2005-08-05 00:44:28 -0400247 acpi_os_printf("Package [Len %X] element_array %p\n",
248 obj_desc->package.count,
249 obj_desc->package.elements);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700250
251 /*
252 * If elements exist, package element pointer is valid,
253 * and debug_level exceeds 1, dump package's elements.
254 */
255 if (obj_desc->package.count &&
Len Brown4be44fc2005-08-05 00:44:28 -0400256 obj_desc->package.elements && acpi_dbg_level > 1) {
257 for (index = 0; index < obj_desc->package.count;
258 index++) {
259 acpi_ex_dump_operand(obj_desc->package.
260 elements[index],
261 depth + 1);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700262 }
263 }
264 break;
265
Linus Torvalds1da177e2005-04-16 15:20:36 -0700266 case ACPI_TYPE_REGION:
267
Len Brown4be44fc2005-08-05 00:44:28 -0400268 acpi_os_printf("Region %s (%X)",
269 acpi_ut_get_region_name(obj_desc->region.
270 space_id),
271 obj_desc->region.space_id);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700272
273 /*
274 * If the address and length have not been evaluated,
275 * don't print them.
276 */
277 if (!(obj_desc->region.flags & AOPOBJ_DATA_VALID)) {
Len Brown4be44fc2005-08-05 00:44:28 -0400278 acpi_os_printf("\n");
279 } else {
280 acpi_os_printf(" base %8.8X%8.8X Length %X\n",
281 ACPI_FORMAT_UINT64(obj_desc->region.
282 address),
283 obj_desc->region.length);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700284 }
285 break;
286
Linus Torvalds1da177e2005-04-16 15:20:36 -0700287 case ACPI_TYPE_STRING:
288
Len Brown4be44fc2005-08-05 00:44:28 -0400289 acpi_os_printf("String length %X @ %p ",
290 obj_desc->string.length,
291 obj_desc->string.pointer);
Robert Moore44f6c012005-04-18 22:49:35 -0400292
Len Brown4be44fc2005-08-05 00:44:28 -0400293 acpi_ut_print_string(obj_desc->string.pointer, ACPI_UINT8_MAX);
294 acpi_os_printf("\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700295 break;
296
Linus Torvalds1da177e2005-04-16 15:20:36 -0700297 case ACPI_TYPE_LOCAL_BANK_FIELD:
298
Len Brown4be44fc2005-08-05 00:44:28 -0400299 acpi_os_printf("bank_field\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700300 break;
301
Linus Torvalds1da177e2005-04-16 15:20:36 -0700302 case ACPI_TYPE_LOCAL_REGION_FIELD:
303
Len Brown4be44fc2005-08-05 00:44:28 -0400304 acpi_os_printf
305 ("region_field: Bits=%X acc_width=%X Lock=%X Update=%X at byte=%X bit=%X of below:\n",
306 obj_desc->field.bit_length,
307 obj_desc->field.access_byte_width,
308 obj_desc->field.field_flags & AML_FIELD_LOCK_RULE_MASK,
309 obj_desc->field.field_flags & AML_FIELD_UPDATE_RULE_MASK,
310 obj_desc->field.base_byte_offset,
311 obj_desc->field.start_field_bit_offset);
Robert Moore44f6c012005-04-18 22:49:35 -0400312
Len Brown4be44fc2005-08-05 00:44:28 -0400313 acpi_ex_dump_operand(obj_desc->field.region_obj, depth + 1);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700314 break;
315
Linus Torvalds1da177e2005-04-16 15:20:36 -0700316 case ACPI_TYPE_LOCAL_INDEX_FIELD:
317
Len Brown4be44fc2005-08-05 00:44:28 -0400318 acpi_os_printf("index_field\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700319 break;
320
Linus Torvalds1da177e2005-04-16 15:20:36 -0700321 case ACPI_TYPE_BUFFER_FIELD:
322
Len Brown4be44fc2005-08-05 00:44:28 -0400323 acpi_os_printf("buffer_field: %X bits at byte %X bit %X of \n",
324 obj_desc->buffer_field.bit_length,
325 obj_desc->buffer_field.base_byte_offset,
326 obj_desc->buffer_field.start_field_bit_offset);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700327
328 if (!obj_desc->buffer_field.buffer_obj) {
Len Brown4be44fc2005-08-05 00:44:28 -0400329 ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "*NULL* \n"));
330 } else
331 if (ACPI_GET_OBJECT_TYPE(obj_desc->buffer_field.buffer_obj)
332 != ACPI_TYPE_BUFFER) {
333 acpi_os_printf("*not a Buffer* \n");
334 } else {
335 acpi_ex_dump_operand(obj_desc->buffer_field.buffer_obj,
336 depth + 1);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337 }
338 break;
339
Linus Torvalds1da177e2005-04-16 15:20:36 -0700340 case ACPI_TYPE_EVENT:
341
Len Brown4be44fc2005-08-05 00:44:28 -0400342 acpi_os_printf("Event\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700343 break;
344
Linus Torvalds1da177e2005-04-16 15:20:36 -0700345 case ACPI_TYPE_METHOD:
346
Len Brown4be44fc2005-08-05 00:44:28 -0400347 acpi_os_printf("Method(%X) @ %p:%X\n",
348 obj_desc->method.param_count,
349 obj_desc->method.aml_start,
350 obj_desc->method.aml_length);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700351 break;
352
Linus Torvalds1da177e2005-04-16 15:20:36 -0700353 case ACPI_TYPE_MUTEX:
354
Len Brown4be44fc2005-08-05 00:44:28 -0400355 acpi_os_printf("Mutex\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700356 break;
357
Linus Torvalds1da177e2005-04-16 15:20:36 -0700358 case ACPI_TYPE_DEVICE:
359
Len Brown4be44fc2005-08-05 00:44:28 -0400360 acpi_os_printf("Device\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700361 break;
362
Linus Torvalds1da177e2005-04-16 15:20:36 -0700363 case ACPI_TYPE_POWER:
364
Len Brown4be44fc2005-08-05 00:44:28 -0400365 acpi_os_printf("Power\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700366 break;
367
Linus Torvalds1da177e2005-04-16 15:20:36 -0700368 case ACPI_TYPE_PROCESSOR:
369
Len Brown4be44fc2005-08-05 00:44:28 -0400370 acpi_os_printf("Processor\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700371 break;
372
Linus Torvalds1da177e2005-04-16 15:20:36 -0700373 case ACPI_TYPE_THERMAL:
374
Len Brown4be44fc2005-08-05 00:44:28 -0400375 acpi_os_printf("Thermal\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700376 break;
377
Linus Torvalds1da177e2005-04-16 15:20:36 -0700378 default:
379 /* Unknown Type */
380
Len Brown4be44fc2005-08-05 00:44:28 -0400381 acpi_os_printf("Unknown Type %X\n",
382 ACPI_GET_OBJECT_TYPE(obj_desc));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700383 break;
384 }
385
386 return;
387}
388
Robert Moore44f6c012005-04-18 22:49:35 -0400389/*******************************************************************************
Linus Torvalds1da177e2005-04-16 15:20:36 -0700390 *
391 * FUNCTION: acpi_ex_dump_operands
392 *
393 * PARAMETERS: Operands - Operand list
394 * interpreter_mode - Load or Exec
395 * Ident - Identification
396 * num_levels - # of stack entries to dump above line
397 * Note - Output notation
398 * module_name - Caller's module name
399 * line_number - Caller's invocation line number
400 *
401 * DESCRIPTION: Dump the object stack
402 *
Robert Moore44f6c012005-04-18 22:49:35 -0400403 ******************************************************************************/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700404
405void
Len Brown4be44fc2005-08-05 00:44:28 -0400406acpi_ex_dump_operands(union acpi_operand_object **operands,
407 acpi_interpreter_mode interpreter_mode,
408 char *ident,
409 u32 num_levels,
410 char *note, char *module_name, u32 line_number)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411{
Len Brown4be44fc2005-08-05 00:44:28 -0400412 acpi_native_uint i;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700413
Len Brown4be44fc2005-08-05 00:44:28 -0400414 ACPI_FUNCTION_NAME("ex_dump_operands");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700415
416 if (!ident) {
417 ident = "?";
418 }
419
420 if (!note) {
421 note = "?";
422 }
423
Len Brown4be44fc2005-08-05 00:44:28 -0400424 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
425 "************* Operand Stack Contents (Opcode [%s], %d Operands)\n",
426 ident, num_levels));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700427
428 if (num_levels == 0) {
429 num_levels = 1;
430 }
431
432 /* Dump the operand stack starting at the top */
433
434 for (i = 0; num_levels > 0; i--, num_levels--) {
Len Brown4be44fc2005-08-05 00:44:28 -0400435 acpi_ex_dump_operand(operands[i], 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700436 }
437
Len Brown4be44fc2005-08-05 00:44:28 -0400438 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
439 "************* Operand Stack dump from %s(%d), %s\n",
440 module_name, line_number, note));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700441 return;
442}
443
Linus Torvalds1da177e2005-04-16 15:20:36 -0700444#ifdef ACPI_FUTURE_USAGE
Robert Moore44f6c012005-04-18 22:49:35 -0400445/*******************************************************************************
Linus Torvalds1da177e2005-04-16 15:20:36 -0700446 *
Robert Moore44f6c012005-04-18 22:49:35 -0400447 * FUNCTION: acpi_ex_out* functions
Linus Torvalds1da177e2005-04-16 15:20:36 -0700448 *
449 * PARAMETERS: Title - Descriptive text
450 * Value - Value to be displayed
451 *
452 * DESCRIPTION: Object dump output formatting functions. These functions
453 * reduce the number of format strings required and keeps them
454 * all in one place for easy modification.
455 *
Robert Moore44f6c012005-04-18 22:49:35 -0400456 ******************************************************************************/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700457
Len Brown4be44fc2005-08-05 00:44:28 -0400458static void acpi_ex_out_string(char *title, char *value)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700459{
Len Brown4be44fc2005-08-05 00:44:28 -0400460 acpi_os_printf("%20s : %s\n", title, value);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700461}
462
Len Brown4be44fc2005-08-05 00:44:28 -0400463static void acpi_ex_out_pointer(char *title, void *value)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700464{
Len Brown4be44fc2005-08-05 00:44:28 -0400465 acpi_os_printf("%20s : %p\n", title, value);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700466}
467
Len Brown4be44fc2005-08-05 00:44:28 -0400468static void acpi_ex_out_integer(char *title, u32 value)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700469{
Len Brown4be44fc2005-08-05 00:44:28 -0400470 acpi_os_printf("%20s : %.2X\n", title, value);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700471}
472
Len Brown4be44fc2005-08-05 00:44:28 -0400473static void acpi_ex_out_address(char *title, acpi_physical_address value)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700474{
475
476#if ACPI_MACHINE_WIDTH == 16
Len Brown4be44fc2005-08-05 00:44:28 -0400477 acpi_os_printf("%20s : %p\n", title, value);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700478#else
Len Brown4be44fc2005-08-05 00:44:28 -0400479 acpi_os_printf("%20s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700480#endif
481}
482
Robert Moore44f6c012005-04-18 22:49:35 -0400483/*******************************************************************************
Linus Torvalds1da177e2005-04-16 15:20:36 -0700484 *
485 * FUNCTION: acpi_ex_dump_node
486 *
487 * PARAMETERS: *Node - Descriptor to dump
Robert Moore44f6c012005-04-18 22:49:35 -0400488 * Flags - Force display if TRUE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700489 *
490 * DESCRIPTION: Dumps the members of the given.Node
491 *
Robert Moore44f6c012005-04-18 22:49:35 -0400492 ******************************************************************************/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700493
Len Brown4be44fc2005-08-05 00:44:28 -0400494void acpi_ex_dump_node(struct acpi_namespace_node *node, u32 flags)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700495{
496
Len Brown4be44fc2005-08-05 00:44:28 -0400497 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700498
499 if (!flags) {
Len Brown4be44fc2005-08-05 00:44:28 -0400500 if (!
501 ((ACPI_LV_OBJECTS & acpi_dbg_level)
502 && (_COMPONENT & acpi_dbg_layer))) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700503 return;
504 }
505 }
506
Len Brown4be44fc2005-08-05 00:44:28 -0400507 acpi_os_printf("%20s : %4.4s\n", "Name", acpi_ut_get_node_name(node));
508 acpi_ex_out_string("Type", acpi_ut_get_type_name(node->type));
509 acpi_ex_out_integer("Flags", node->flags);
510 acpi_ex_out_integer("Owner Id", node->owner_id);
511 acpi_ex_out_integer("Reference Count", node->reference_count);
512 acpi_ex_out_pointer("Attached Object",
513 acpi_ns_get_attached_object(node));
514 acpi_ex_out_pointer("child_list", node->child);
515 acpi_ex_out_pointer("next_peer", node->peer);
516 acpi_ex_out_pointer("Parent", acpi_ns_get_parent_node(node));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700517}
518
Robert Moore44f6c012005-04-18 22:49:35 -0400519/*******************************************************************************
Linus Torvalds1da177e2005-04-16 15:20:36 -0700520 *
Robert Moore73459f72005-06-24 00:00:00 -0400521 * FUNCTION: acpi_ex_dump_reference
522 *
523 * PARAMETERS: Object - Descriptor to dump
524 *
525 * DESCRIPTION: Dumps a reference object
526 *
527 ******************************************************************************/
528
Len Brown4be44fc2005-08-05 00:44:28 -0400529static void acpi_ex_dump_reference(union acpi_operand_object *obj_desc)
Robert Moore73459f72005-06-24 00:00:00 -0400530{
Len Brown4be44fc2005-08-05 00:44:28 -0400531 struct acpi_buffer ret_buf;
532 acpi_status status;
Robert Moore73459f72005-06-24 00:00:00 -0400533
534 if (obj_desc->reference.opcode == AML_INT_NAMEPATH_OP) {
Len Brown4be44fc2005-08-05 00:44:28 -0400535 acpi_os_printf("Named Object %p ", obj_desc->reference.node);
Robert Moore73459f72005-06-24 00:00:00 -0400536 ret_buf.length = ACPI_ALLOCATE_LOCAL_BUFFER;
Len Brown4be44fc2005-08-05 00:44:28 -0400537 status =
538 acpi_ns_handle_to_pathname(obj_desc->reference.node,
539 &ret_buf);
540 if (ACPI_FAILURE(status)) {
541 acpi_os_printf("Could not convert name to pathname\n");
542 } else {
543 acpi_os_printf("%s\n", (char *)ret_buf.pointer);
544 ACPI_MEM_FREE(ret_buf.pointer);
Robert Moore73459f72005-06-24 00:00:00 -0400545 }
Len Brown4be44fc2005-08-05 00:44:28 -0400546 } else if (obj_desc->reference.object) {
547 acpi_os_printf("\nReferenced Object: %p\n",
548 obj_desc->reference.object);
Robert Moore73459f72005-06-24 00:00:00 -0400549 }
550}
551
Robert Moore73459f72005-06-24 00:00:00 -0400552/*******************************************************************************
553 *
554 * FUNCTION: acpi_ex_dump_package
555 *
556 * PARAMETERS: Object - Descriptor to dump
557 * Level - Indentation Level
558 * Index - Package index for this object
559 *
560 * DESCRIPTION: Dumps the elements of the package
561 *
562 ******************************************************************************/
563
564static void
Len Brown4be44fc2005-08-05 00:44:28 -0400565acpi_ex_dump_package(union acpi_operand_object *obj_desc, u32 level, u32 index)
Robert Moore73459f72005-06-24 00:00:00 -0400566{
Len Brown4be44fc2005-08-05 00:44:28 -0400567 u32 i;
Robert Moore73459f72005-06-24 00:00:00 -0400568
569 /* Indentation and index output */
570
571 if (level > 0) {
572 for (i = 0; i < level; i++) {
Len Brown4be44fc2005-08-05 00:44:28 -0400573 acpi_os_printf(" ");
Robert Moore73459f72005-06-24 00:00:00 -0400574 }
575
Len Brown4be44fc2005-08-05 00:44:28 -0400576 acpi_os_printf("[%.2d] ", index);
Robert Moore73459f72005-06-24 00:00:00 -0400577 }
578
Len Brown4be44fc2005-08-05 00:44:28 -0400579 acpi_os_printf("%p ", obj_desc);
Robert Moore73459f72005-06-24 00:00:00 -0400580
581 /* Null package elements are allowed */
582
583 if (!obj_desc) {
Len Brown4be44fc2005-08-05 00:44:28 -0400584 acpi_os_printf("[Null Object]\n");
Robert Moore73459f72005-06-24 00:00:00 -0400585 return;
586 }
587
588 /* Packages may only contain a few object types */
589
Len Brown4be44fc2005-08-05 00:44:28 -0400590 switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
Robert Moore73459f72005-06-24 00:00:00 -0400591 case ACPI_TYPE_INTEGER:
592
Len Brown4be44fc2005-08-05 00:44:28 -0400593 acpi_os_printf("[Integer] = %8.8X%8.8X\n",
594 ACPI_FORMAT_UINT64(obj_desc->integer.value));
Robert Moore73459f72005-06-24 00:00:00 -0400595 break;
596
Robert Moore73459f72005-06-24 00:00:00 -0400597 case ACPI_TYPE_STRING:
598
Len Brown4be44fc2005-08-05 00:44:28 -0400599 acpi_os_printf("[String] Value: ");
Robert Moore73459f72005-06-24 00:00:00 -0400600 for (i = 0; i < obj_desc->string.length; i++) {
Len Brown4be44fc2005-08-05 00:44:28 -0400601 acpi_os_printf("%c", obj_desc->string.pointer[i]);
Robert Moore73459f72005-06-24 00:00:00 -0400602 }
Len Brown4be44fc2005-08-05 00:44:28 -0400603 acpi_os_printf("\n");
Robert Moore73459f72005-06-24 00:00:00 -0400604 break;
605
Robert Moore73459f72005-06-24 00:00:00 -0400606 case ACPI_TYPE_BUFFER:
607
Len Brown4be44fc2005-08-05 00:44:28 -0400608 acpi_os_printf("[Buffer] Length %.2X = ",
609 obj_desc->buffer.length);
Robert Moore73459f72005-06-24 00:00:00 -0400610 if (obj_desc->buffer.length) {
Len Brown4be44fc2005-08-05 00:44:28 -0400611 acpi_ut_dump_buffer((u8 *) obj_desc->buffer.pointer,
612 obj_desc->buffer.length,
613 DB_DWORD_DISPLAY, _COMPONENT);
614 } else {
615 acpi_os_printf("\n");
Robert Moore73459f72005-06-24 00:00:00 -0400616 }
617 break;
618
Robert Moore73459f72005-06-24 00:00:00 -0400619 case ACPI_TYPE_PACKAGE:
620
Len Brown4be44fc2005-08-05 00:44:28 -0400621 acpi_os_printf("[Package] Contains %d Elements: \n",
622 obj_desc->package.count);
Robert Moore73459f72005-06-24 00:00:00 -0400623
624 for (i = 0; i < obj_desc->package.count; i++) {
Len Brown4be44fc2005-08-05 00:44:28 -0400625 acpi_ex_dump_package(obj_desc->package.elements[i],
626 level + 1, i);
Robert Moore73459f72005-06-24 00:00:00 -0400627 }
628 break;
629
Robert Moore73459f72005-06-24 00:00:00 -0400630 case ACPI_TYPE_LOCAL_REFERENCE:
631
Len Brown4be44fc2005-08-05 00:44:28 -0400632 acpi_os_printf("[Object Reference] ");
633 acpi_ex_dump_reference(obj_desc);
Robert Moore73459f72005-06-24 00:00:00 -0400634 break;
635
Robert Moore73459f72005-06-24 00:00:00 -0400636 default:
637
Len Brown4be44fc2005-08-05 00:44:28 -0400638 acpi_os_printf("[Unknown Type] %X\n",
639 ACPI_GET_OBJECT_TYPE(obj_desc));
Robert Moore73459f72005-06-24 00:00:00 -0400640 break;
641 }
642}
643
Robert Moore73459f72005-06-24 00:00:00 -0400644/*******************************************************************************
645 *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700646 * FUNCTION: acpi_ex_dump_object_descriptor
647 *
Robert Moore73459f72005-06-24 00:00:00 -0400648 * PARAMETERS: Object - Descriptor to dump
Robert Moore44f6c012005-04-18 22:49:35 -0400649 * Flags - Force display if TRUE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700650 *
651 * DESCRIPTION: Dumps the members of the object descriptor given.
652 *
Robert Moore44f6c012005-04-18 22:49:35 -0400653 ******************************************************************************/
Linus Torvalds1da177e2005-04-16 15:20:36 -0700654
655void
Len Brown4be44fc2005-08-05 00:44:28 -0400656acpi_ex_dump_object_descriptor(union acpi_operand_object *obj_desc, u32 flags)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700657{
Len Brown4be44fc2005-08-05 00:44:28 -0400658 ACPI_FUNCTION_TRACE("ex_dump_object_descriptor");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700659
Robert Moore44f6c012005-04-18 22:49:35 -0400660 if (!obj_desc) {
661 return_VOID;
662 }
663
Linus Torvalds1da177e2005-04-16 15:20:36 -0700664 if (!flags) {
Len Brown4be44fc2005-08-05 00:44:28 -0400665 if (!
666 ((ACPI_LV_OBJECTS & acpi_dbg_level)
667 && (_COMPONENT & acpi_dbg_layer))) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700668 return_VOID;
669 }
670 }
671
Len Brown4be44fc2005-08-05 00:44:28 -0400672 if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == ACPI_DESC_TYPE_NAMED) {
673 acpi_ex_dump_node((struct acpi_namespace_node *)obj_desc,
674 flags);
675 acpi_os_printf("\nAttached Object (%p):\n",
676 ((struct acpi_namespace_node *)obj_desc)->
677 object);
678 acpi_ex_dump_object_descriptor(((struct acpi_namespace_node *)
679 obj_desc)->object, flags);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700680 return_VOID;
681 }
682
Len Brown4be44fc2005-08-05 00:44:28 -0400683 if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) {
684 acpi_os_printf
685 ("ex_dump_object_descriptor: %p is not an ACPI operand object: [%s]\n",
686 obj_desc, acpi_ut_get_descriptor_name(obj_desc));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700687 return_VOID;
688 }
689
690 /* Common Fields */
691
Len Brown4be44fc2005-08-05 00:44:28 -0400692 acpi_ex_out_string("Type", acpi_ut_get_object_type_name(obj_desc));
693 acpi_ex_out_integer("Reference Count",
694 obj_desc->common.reference_count);
695 acpi_ex_out_integer("Flags", obj_desc->common.flags);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700696
697 /* Object-specific Fields */
698
Len Brown4be44fc2005-08-05 00:44:28 -0400699 switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700700 case ACPI_TYPE_INTEGER:
701
Len Brown4be44fc2005-08-05 00:44:28 -0400702 acpi_os_printf("%20s : %8.8X%8.8X\n", "Value",
703 ACPI_FORMAT_UINT64(obj_desc->integer.value));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700704 break;
705
Linus Torvalds1da177e2005-04-16 15:20:36 -0700706 case ACPI_TYPE_STRING:
707
Len Brown4be44fc2005-08-05 00:44:28 -0400708 acpi_ex_out_integer("Length", obj_desc->string.length);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700709
Len Brown4be44fc2005-08-05 00:44:28 -0400710 acpi_os_printf("%20s : %p ", "Pointer",
711 obj_desc->string.pointer);
712 acpi_ut_print_string(obj_desc->string.pointer, ACPI_UINT8_MAX);
713 acpi_os_printf("\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700714 break;
715
Linus Torvalds1da177e2005-04-16 15:20:36 -0700716 case ACPI_TYPE_BUFFER:
717
Len Brown4be44fc2005-08-05 00:44:28 -0400718 acpi_ex_out_integer("Length", obj_desc->buffer.length);
719 acpi_ex_out_pointer("Pointer", obj_desc->buffer.pointer);
720 ACPI_DUMP_BUFFER(obj_desc->buffer.pointer,
721 obj_desc->buffer.length);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700722 break;
723
Linus Torvalds1da177e2005-04-16 15:20:36 -0700724 case ACPI_TYPE_PACKAGE:
725
Len Brown4be44fc2005-08-05 00:44:28 -0400726 acpi_ex_out_integer("Flags", obj_desc->package.flags);
727 acpi_ex_out_integer("Elements", obj_desc->package.count);
728 acpi_ex_out_pointer("Element List", obj_desc->package.elements);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700729
730 /* Dump the package contents */
731
Len Brown4be44fc2005-08-05 00:44:28 -0400732 acpi_os_printf("\nPackage Contents:\n");
733 acpi_ex_dump_package(obj_desc, 0, 0);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700734 break;
735
Linus Torvalds1da177e2005-04-16 15:20:36 -0700736 case ACPI_TYPE_DEVICE:
737
Len Brown4be44fc2005-08-05 00:44:28 -0400738 acpi_ex_out_pointer("Handler", obj_desc->device.handler);
739 acpi_ex_out_pointer("system_notify",
740 obj_desc->device.system_notify);
741 acpi_ex_out_pointer("device_notify",
742 obj_desc->device.device_notify);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700743 break;
744
Linus Torvalds1da177e2005-04-16 15:20:36 -0700745 case ACPI_TYPE_EVENT:
746
Len Brown4be44fc2005-08-05 00:44:28 -0400747 acpi_ex_out_pointer("Semaphore", obj_desc->event.semaphore);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700748 break;
749
Linus Torvalds1da177e2005-04-16 15:20:36 -0700750 case ACPI_TYPE_METHOD:
751
Len Brown4be44fc2005-08-05 00:44:28 -0400752 acpi_ex_out_integer("param_count",
753 obj_desc->method.param_count);
754 acpi_ex_out_integer("Concurrency",
755 obj_desc->method.concurrency);
756 acpi_ex_out_pointer("Semaphore", obj_desc->method.semaphore);
757 acpi_ex_out_integer("owner_id", obj_desc->method.owner_id);
758 acpi_ex_out_integer("aml_length", obj_desc->method.aml_length);
759 acpi_ex_out_pointer("aml_start", obj_desc->method.aml_start);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700760 break;
761
Linus Torvalds1da177e2005-04-16 15:20:36 -0700762 case ACPI_TYPE_MUTEX:
763
Len Brown4be44fc2005-08-05 00:44:28 -0400764 acpi_ex_out_integer("sync_level", obj_desc->mutex.sync_level);
765 acpi_ex_out_pointer("owner_thread",
766 obj_desc->mutex.owner_thread);
767 acpi_ex_out_integer("acquire_depth",
768 obj_desc->mutex.acquisition_depth);
769 acpi_ex_out_pointer("Semaphore", obj_desc->mutex.semaphore);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700770 break;
771
Linus Torvalds1da177e2005-04-16 15:20:36 -0700772 case ACPI_TYPE_REGION:
773
Len Brown4be44fc2005-08-05 00:44:28 -0400774 acpi_ex_out_integer("space_id", obj_desc->region.space_id);
775 acpi_ex_out_integer("Flags", obj_desc->region.flags);
776 acpi_ex_out_address("Address", obj_desc->region.address);
777 acpi_ex_out_integer("Length", obj_desc->region.length);
778 acpi_ex_out_pointer("Handler", obj_desc->region.handler);
779 acpi_ex_out_pointer("Next", obj_desc->region.next);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700780 break;
781
Linus Torvalds1da177e2005-04-16 15:20:36 -0700782 case ACPI_TYPE_POWER:
783
Len Brown4be44fc2005-08-05 00:44:28 -0400784 acpi_ex_out_integer("system_level",
785 obj_desc->power_resource.system_level);
786 acpi_ex_out_integer("resource_order",
787 obj_desc->power_resource.resource_order);
788 acpi_ex_out_pointer("system_notify",
789 obj_desc->power_resource.system_notify);
790 acpi_ex_out_pointer("device_notify",
791 obj_desc->power_resource.device_notify);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700792 break;
793
Linus Torvalds1da177e2005-04-16 15:20:36 -0700794 case ACPI_TYPE_PROCESSOR:
795
Len Brown4be44fc2005-08-05 00:44:28 -0400796 acpi_ex_out_integer("Processor ID",
797 obj_desc->processor.proc_id);
798 acpi_ex_out_integer("Length", obj_desc->processor.length);
799 acpi_ex_out_address("Address",
800 (acpi_physical_address) obj_desc->processor.
801 address);
802 acpi_ex_out_pointer("system_notify",
803 obj_desc->processor.system_notify);
804 acpi_ex_out_pointer("device_notify",
805 obj_desc->processor.device_notify);
806 acpi_ex_out_pointer("Handler", obj_desc->processor.handler);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700807 break;
808
Linus Torvalds1da177e2005-04-16 15:20:36 -0700809 case ACPI_TYPE_THERMAL:
810
Len Brown4be44fc2005-08-05 00:44:28 -0400811 acpi_ex_out_pointer("system_notify",
812 obj_desc->thermal_zone.system_notify);
813 acpi_ex_out_pointer("device_notify",
814 obj_desc->thermal_zone.device_notify);
815 acpi_ex_out_pointer("Handler", obj_desc->thermal_zone.handler);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700816 break;
817
Linus Torvalds1da177e2005-04-16 15:20:36 -0700818 case ACPI_TYPE_BUFFER_FIELD:
819 case ACPI_TYPE_LOCAL_REGION_FIELD:
820 case ACPI_TYPE_LOCAL_BANK_FIELD:
821 case ACPI_TYPE_LOCAL_INDEX_FIELD:
822
Len Brown4be44fc2005-08-05 00:44:28 -0400823 acpi_ex_out_integer("field_flags",
824 obj_desc->common_field.field_flags);
825 acpi_ex_out_integer("access_byte_width",
826 obj_desc->common_field.access_byte_width);
827 acpi_ex_out_integer("bit_length",
828 obj_desc->common_field.bit_length);
829 acpi_ex_out_integer("fld_bit_offset",
830 obj_desc->common_field.
831 start_field_bit_offset);
832 acpi_ex_out_integer("base_byte_offset",
833 obj_desc->common_field.base_byte_offset);
834 acpi_ex_out_pointer("parent_node", obj_desc->common_field.node);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700835
Len Brown4be44fc2005-08-05 00:44:28 -0400836 switch (ACPI_GET_OBJECT_TYPE(obj_desc)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700837 case ACPI_TYPE_BUFFER_FIELD:
Len Brown4be44fc2005-08-05 00:44:28 -0400838 acpi_ex_out_pointer("buffer_obj",
839 obj_desc->buffer_field.buffer_obj);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700840 break;
841
842 case ACPI_TYPE_LOCAL_REGION_FIELD:
Len Brown4be44fc2005-08-05 00:44:28 -0400843 acpi_ex_out_pointer("region_obj",
844 obj_desc->field.region_obj);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700845 break;
846
847 case ACPI_TYPE_LOCAL_BANK_FIELD:
Len Brown4be44fc2005-08-05 00:44:28 -0400848 acpi_ex_out_integer("Value",
849 obj_desc->bank_field.value);
850 acpi_ex_out_pointer("region_obj",
851 obj_desc->bank_field.region_obj);
852 acpi_ex_out_pointer("bank_obj",
853 obj_desc->bank_field.bank_obj);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700854 break;
855
856 case ACPI_TYPE_LOCAL_INDEX_FIELD:
Len Brown4be44fc2005-08-05 00:44:28 -0400857 acpi_ex_out_integer("Value",
858 obj_desc->index_field.value);
859 acpi_ex_out_pointer("Index",
860 obj_desc->index_field.index_obj);
861 acpi_ex_out_pointer("Data",
862 obj_desc->index_field.data_obj);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700863 break;
864
865 default:
866 /* All object types covered above */
867 break;
868 }
869 break;
870
Linus Torvalds1da177e2005-04-16 15:20:36 -0700871 case ACPI_TYPE_LOCAL_REFERENCE:
872
Len Brown4be44fc2005-08-05 00:44:28 -0400873 acpi_ex_out_integer("target_type",
874 obj_desc->reference.target_type);
875 acpi_ex_out_string("Opcode",
876 (acpi_ps_get_opcode_info
877 (obj_desc->reference.opcode))->name);
878 acpi_ex_out_integer("Offset", obj_desc->reference.offset);
879 acpi_ex_out_pointer("obj_desc", obj_desc->reference.object);
880 acpi_ex_out_pointer("Node", obj_desc->reference.node);
881 acpi_ex_out_pointer("Where", obj_desc->reference.where);
Robert Moore44f6c012005-04-18 22:49:35 -0400882
Len Brown4be44fc2005-08-05 00:44:28 -0400883 acpi_ex_dump_reference(obj_desc);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700884 break;
885
Linus Torvalds1da177e2005-04-16 15:20:36 -0700886 case ACPI_TYPE_LOCAL_ADDRESS_HANDLER:
887
Len Brown4be44fc2005-08-05 00:44:28 -0400888 acpi_ex_out_integer("space_id",
889 obj_desc->address_space.space_id);
890 acpi_ex_out_pointer("Next", obj_desc->address_space.next);
891 acpi_ex_out_pointer("region_list",
892 obj_desc->address_space.region_list);
893 acpi_ex_out_pointer("Node", obj_desc->address_space.node);
894 acpi_ex_out_pointer("Context", obj_desc->address_space.context);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700895 break;
896
Linus Torvalds1da177e2005-04-16 15:20:36 -0700897 case ACPI_TYPE_LOCAL_NOTIFY:
898
Len Brown4be44fc2005-08-05 00:44:28 -0400899 acpi_ex_out_pointer("Node", obj_desc->notify.node);
900 acpi_ex_out_pointer("Context", obj_desc->notify.context);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700901 break;
902
Linus Torvalds1da177e2005-04-16 15:20:36 -0700903 case ACPI_TYPE_LOCAL_ALIAS:
904 case ACPI_TYPE_LOCAL_METHOD_ALIAS:
905 case ACPI_TYPE_LOCAL_EXTRA:
906 case ACPI_TYPE_LOCAL_DATA:
907 default:
908
Len Brown4be44fc2005-08-05 00:44:28 -0400909 acpi_os_printf
910 ("ex_dump_object_descriptor: Display not implemented for object type %s\n",
911 acpi_ut_get_object_type_name(obj_desc));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700912 break;
913 }
914
915 return_VOID;
916}
917
Len Brown4be44fc2005-08-05 00:44:28 -0400918#endif /* ACPI_FUTURE_USAGE */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700919#endif