1 |
1275 |
phoenix |
/******************************************************************************
|
2 |
|
|
*
|
3 |
|
|
* Module Name: exdump - Interpreter debug output routines
|
4 |
|
|
*
|
5 |
|
|
*****************************************************************************/
|
6 |
|
|
|
7 |
|
|
/*
|
8 |
|
|
* Copyright (C) 2000 - 2004, 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 |
|
|
|
44 |
|
|
|
45 |
|
|
#include <acpi/acpi.h>
|
46 |
|
|
#include <acpi/acinterp.h>
|
47 |
|
|
#include <acpi/amlcode.h>
|
48 |
|
|
#include <acpi/acnamesp.h>
|
49 |
|
|
#include <acpi/acparser.h>
|
50 |
|
|
|
51 |
|
|
#define _COMPONENT ACPI_EXECUTER
|
52 |
|
|
ACPI_MODULE_NAME ("exdump")
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
/*
|
56 |
|
|
* The following routines are used for debug output only
|
57 |
|
|
*/
|
58 |
|
|
|
59 |
|
|
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
|
60 |
|
|
|
61 |
|
|
/*****************************************************************************
|
62 |
|
|
*
|
63 |
|
|
* FUNCTION: acpi_ex_dump_operand
|
64 |
|
|
*
|
65 |
|
|
* PARAMETERS: *obj_desc - Pointer to entry to be dumped
|
66 |
|
|
*
|
67 |
|
|
* RETURN: Status
|
68 |
|
|
*
|
69 |
|
|
* DESCRIPTION: Dump an operand object
|
70 |
|
|
*
|
71 |
|
|
****************************************************************************/
|
72 |
|
|
|
73 |
|
|
void
|
74 |
|
|
acpi_ex_dump_operand (
|
75 |
|
|
union acpi_operand_object *obj_desc)
|
76 |
|
|
{
|
77 |
|
|
u8 *buf = NULL;
|
78 |
|
|
u32 length;
|
79 |
|
|
union acpi_operand_object **element;
|
80 |
|
|
u16 element_index;
|
81 |
|
|
|
82 |
|
|
|
83 |
|
|
ACPI_FUNCTION_NAME ("ex_dump_operand")
|
84 |
|
|
|
85 |
|
|
|
86 |
|
|
if (!((ACPI_LV_EXEC & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer))) {
|
87 |
|
|
return;
|
88 |
|
|
}
|
89 |
|
|
|
90 |
|
|
if (!obj_desc) {
|
91 |
|
|
/*
|
92 |
|
|
* This usually indicates that something serious is wrong
|
93 |
|
|
*/
|
94 |
|
|
acpi_os_printf ("Null Object Descriptor\n");
|
95 |
|
|
return;
|
96 |
|
|
}
|
97 |
|
|
|
98 |
|
|
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) {
|
99 |
|
|
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p is a NS Node: ", obj_desc));
|
100 |
|
|
ACPI_DUMP_ENTRY (obj_desc, ACPI_LV_EXEC);
|
101 |
|
|
return;
|
102 |
|
|
}
|
103 |
|
|
|
104 |
|
|
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) {
|
105 |
|
|
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
106 |
|
|
"%p is not a node or operand object: [%s]\n",
|
107 |
|
|
obj_desc, acpi_ut_get_descriptor_name (obj_desc)));
|
108 |
|
|
ACPI_DUMP_BUFFER (obj_desc, sizeof (union acpi_operand_object));
|
109 |
|
|
return;
|
110 |
|
|
}
|
111 |
|
|
|
112 |
|
|
/* obj_desc is a valid object */
|
113 |
|
|
|
114 |
|
|
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc));
|
115 |
|
|
|
116 |
|
|
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
|
117 |
|
|
case ACPI_TYPE_LOCAL_REFERENCE:
|
118 |
|
|
|
119 |
|
|
switch (obj_desc->reference.opcode) {
|
120 |
|
|
case AML_DEBUG_OP:
|
121 |
|
|
|
122 |
|
|
acpi_os_printf ("Reference: Debug\n");
|
123 |
|
|
break;
|
124 |
|
|
|
125 |
|
|
|
126 |
|
|
case AML_NAME_OP:
|
127 |
|
|
|
128 |
|
|
ACPI_DUMP_PATHNAME (obj_desc->reference.object, "Reference: Name: ",
|
129 |
|
|
ACPI_LV_INFO, _COMPONENT);
|
130 |
|
|
ACPI_DUMP_ENTRY (obj_desc->reference.object, ACPI_LV_INFO);
|
131 |
|
|
break;
|
132 |
|
|
|
133 |
|
|
|
134 |
|
|
case AML_INDEX_OP:
|
135 |
|
|
|
136 |
|
|
acpi_os_printf ("Reference: Index %p\n",
|
137 |
|
|
obj_desc->reference.object);
|
138 |
|
|
break;
|
139 |
|
|
|
140 |
|
|
|
141 |
|
|
case AML_REF_OF_OP:
|
142 |
|
|
|
143 |
|
|
acpi_os_printf ("Reference: (ref_of) %p\n",
|
144 |
|
|
obj_desc->reference.object);
|
145 |
|
|
break;
|
146 |
|
|
|
147 |
|
|
|
148 |
|
|
case AML_ARG_OP:
|
149 |
|
|
|
150 |
|
|
acpi_os_printf ("Reference: Arg%d",
|
151 |
|
|
obj_desc->reference.offset);
|
152 |
|
|
|
153 |
|
|
if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) {
|
154 |
|
|
/* Value is an Integer */
|
155 |
|
|
|
156 |
|
|
acpi_os_printf (" value is [%8.8X%8.8x]",
|
157 |
|
|
ACPI_FORMAT_UINT64 (obj_desc->integer.value));
|
158 |
|
|
}
|
159 |
|
|
|
160 |
|
|
acpi_os_printf ("\n");
|
161 |
|
|
break;
|
162 |
|
|
|
163 |
|
|
|
164 |
|
|
case AML_LOCAL_OP:
|
165 |
|
|
|
166 |
|
|
acpi_os_printf ("Reference: Local%d",
|
167 |
|
|
obj_desc->reference.offset);
|
168 |
|
|
|
169 |
|
|
if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) {
|
170 |
|
|
|
171 |
|
|
/* Value is an Integer */
|
172 |
|
|
|
173 |
|
|
acpi_os_printf (" value is [%8.8X%8.8x]",
|
174 |
|
|
ACPI_FORMAT_UINT64 (obj_desc->integer.value));
|
175 |
|
|
}
|
176 |
|
|
|
177 |
|
|
acpi_os_printf ("\n");
|
178 |
|
|
break;
|
179 |
|
|
|
180 |
|
|
|
181 |
|
|
case AML_INT_NAMEPATH_OP:
|
182 |
|
|
|
183 |
|
|
acpi_os_printf ("Reference.Node->Name %X\n",
|
184 |
|
|
obj_desc->reference.node->name.integer);
|
185 |
|
|
break;
|
186 |
|
|
|
187 |
|
|
|
188 |
|
|
default:
|
189 |
|
|
|
190 |
|
|
/* Unknown opcode */
|
191 |
|
|
|
192 |
|
|
acpi_os_printf ("Unknown Reference opcode=%X\n",
|
193 |
|
|
obj_desc->reference.opcode);
|
194 |
|
|
break;
|
195 |
|
|
|
196 |
|
|
}
|
197 |
|
|
|
198 |
|
|
break;
|
199 |
|
|
|
200 |
|
|
|
201 |
|
|
case ACPI_TYPE_BUFFER:
|
202 |
|
|
|
203 |
|
|
acpi_os_printf ("Buffer len %X @ %p \n",
|
204 |
|
|
obj_desc->buffer.length,
|
205 |
|
|
obj_desc->buffer.pointer);
|
206 |
|
|
|
207 |
|
|
length = obj_desc->buffer.length;
|
208 |
|
|
|
209 |
|
|
if (length > 64) {
|
210 |
|
|
length = 64;
|
211 |
|
|
}
|
212 |
|
|
|
213 |
|
|
/* Debug only -- dump the buffer contents */
|
214 |
|
|
|
215 |
|
|
if (obj_desc->buffer.pointer) {
|
216 |
|
|
acpi_os_printf ("Buffer Contents: ");
|
217 |
|
|
|
218 |
|
|
for (buf = obj_desc->buffer.pointer; length--; ++buf) {
|
219 |
|
|
acpi_os_printf (" %02x", *buf);
|
220 |
|
|
}
|
221 |
|
|
acpi_os_printf ("\n");
|
222 |
|
|
}
|
223 |
|
|
|
224 |
|
|
break;
|
225 |
|
|
|
226 |
|
|
|
227 |
|
|
case ACPI_TYPE_INTEGER:
|
228 |
|
|
|
229 |
|
|
acpi_os_printf ("Integer %8.8X%8.8X\n",
|
230 |
|
|
ACPI_FORMAT_UINT64 (obj_desc->integer.value));
|
231 |
|
|
break;
|
232 |
|
|
|
233 |
|
|
|
234 |
|
|
case ACPI_TYPE_PACKAGE:
|
235 |
|
|
|
236 |
|
|
acpi_os_printf ("Package count %X @ %p\n",
|
237 |
|
|
obj_desc->package.count, obj_desc->package.elements);
|
238 |
|
|
|
239 |
|
|
/*
|
240 |
|
|
* If elements exist, package vector pointer is valid,
|
241 |
|
|
* and debug_level exceeds 1, dump package's elements.
|
242 |
|
|
*/
|
243 |
|
|
if (obj_desc->package.count &&
|
244 |
|
|
obj_desc->package.elements &&
|
245 |
|
|
acpi_dbg_level > 1) {
|
246 |
|
|
for (element_index = 0, element = obj_desc->package.elements;
|
247 |
|
|
element_index < obj_desc->package.count;
|
248 |
|
|
++element_index, ++element) {
|
249 |
|
|
acpi_ex_dump_operand (*element);
|
250 |
|
|
}
|
251 |
|
|
}
|
252 |
|
|
acpi_os_printf ("\n");
|
253 |
|
|
break;
|
254 |
|
|
|
255 |
|
|
|
256 |
|
|
case ACPI_TYPE_REGION:
|
257 |
|
|
|
258 |
|
|
acpi_os_printf ("Region %s (%X)",
|
259 |
|
|
acpi_ut_get_region_name (obj_desc->region.space_id),
|
260 |
|
|
obj_desc->region.space_id);
|
261 |
|
|
|
262 |
|
|
/*
|
263 |
|
|
* If the address and length have not been evaluated,
|
264 |
|
|
* don't print them.
|
265 |
|
|
*/
|
266 |
|
|
if (!(obj_desc->region.flags & AOPOBJ_DATA_VALID)) {
|
267 |
|
|
acpi_os_printf ("\n");
|
268 |
|
|
}
|
269 |
|
|
else {
|
270 |
|
|
acpi_os_printf (" base %8.8X%8.8X Length %X\n",
|
271 |
|
|
ACPI_FORMAT_UINT64 (obj_desc->region.address),
|
272 |
|
|
obj_desc->region.length);
|
273 |
|
|
}
|
274 |
|
|
break;
|
275 |
|
|
|
276 |
|
|
|
277 |
|
|
case ACPI_TYPE_STRING:
|
278 |
|
|
|
279 |
|
|
acpi_os_printf ("String length %X @ %p ",
|
280 |
|
|
obj_desc->string.length, obj_desc->string.pointer);
|
281 |
|
|
acpi_ut_print_string (obj_desc->string.pointer, ACPI_UINT8_MAX);
|
282 |
|
|
acpi_os_printf ("\n");
|
283 |
|
|
break;
|
284 |
|
|
|
285 |
|
|
|
286 |
|
|
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
287 |
|
|
|
288 |
|
|
acpi_os_printf ("bank_field\n");
|
289 |
|
|
break;
|
290 |
|
|
|
291 |
|
|
|
292 |
|
|
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
293 |
|
|
|
294 |
|
|
acpi_os_printf (
|
295 |
|
|
"region_field: Bits=%X acc_width=%X Lock=%X Update=%X at byte=%X bit=%X of below:\n",
|
296 |
|
|
obj_desc->field.bit_length, obj_desc->field.access_byte_width,
|
297 |
|
|
obj_desc->field.field_flags & AML_FIELD_LOCK_RULE_MASK,
|
298 |
|
|
obj_desc->field.field_flags & AML_FIELD_UPDATE_RULE_MASK,
|
299 |
|
|
obj_desc->field.base_byte_offset, obj_desc->field.start_field_bit_offset);
|
300 |
|
|
ACPI_DUMP_STACK_ENTRY (obj_desc->field.region_obj);
|
301 |
|
|
break;
|
302 |
|
|
|
303 |
|
|
|
304 |
|
|
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
305 |
|
|
|
306 |
|
|
acpi_os_printf ("index_field\n");
|
307 |
|
|
break;
|
308 |
|
|
|
309 |
|
|
|
310 |
|
|
case ACPI_TYPE_BUFFER_FIELD:
|
311 |
|
|
|
312 |
|
|
acpi_os_printf (
|
313 |
|
|
"buffer_field: %X bits at byte %X bit %X of \n",
|
314 |
|
|
obj_desc->buffer_field.bit_length, obj_desc->buffer_field.base_byte_offset,
|
315 |
|
|
obj_desc->buffer_field.start_field_bit_offset);
|
316 |
|
|
|
317 |
|
|
if (!obj_desc->buffer_field.buffer_obj) {
|
318 |
|
|
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL* \n"));
|
319 |
|
|
}
|
320 |
|
|
else if (ACPI_GET_OBJECT_TYPE (obj_desc->buffer_field.buffer_obj) != ACPI_TYPE_BUFFER) {
|
321 |
|
|
acpi_os_printf ("*not a Buffer* \n");
|
322 |
|
|
}
|
323 |
|
|
else {
|
324 |
|
|
ACPI_DUMP_STACK_ENTRY (obj_desc->buffer_field.buffer_obj);
|
325 |
|
|
}
|
326 |
|
|
|
327 |
|
|
break;
|
328 |
|
|
|
329 |
|
|
|
330 |
|
|
case ACPI_TYPE_EVENT:
|
331 |
|
|
|
332 |
|
|
acpi_os_printf ("Event\n");
|
333 |
|
|
break;
|
334 |
|
|
|
335 |
|
|
|
336 |
|
|
case ACPI_TYPE_METHOD:
|
337 |
|
|
|
338 |
|
|
acpi_os_printf (
|
339 |
|
|
"Method(%X) @ %p:%X\n",
|
340 |
|
|
obj_desc->method.param_count,
|
341 |
|
|
obj_desc->method.aml_start, obj_desc->method.aml_length);
|
342 |
|
|
break;
|
343 |
|
|
|
344 |
|
|
|
345 |
|
|
case ACPI_TYPE_MUTEX:
|
346 |
|
|
|
347 |
|
|
acpi_os_printf ("Mutex\n");
|
348 |
|
|
break;
|
349 |
|
|
|
350 |
|
|
|
351 |
|
|
case ACPI_TYPE_DEVICE:
|
352 |
|
|
|
353 |
|
|
acpi_os_printf ("Device\n");
|
354 |
|
|
break;
|
355 |
|
|
|
356 |
|
|
|
357 |
|
|
case ACPI_TYPE_POWER:
|
358 |
|
|
|
359 |
|
|
acpi_os_printf ("Power\n");
|
360 |
|
|
break;
|
361 |
|
|
|
362 |
|
|
|
363 |
|
|
case ACPI_TYPE_PROCESSOR:
|
364 |
|
|
|
365 |
|
|
acpi_os_printf ("Processor\n");
|
366 |
|
|
break;
|
367 |
|
|
|
368 |
|
|
|
369 |
|
|
case ACPI_TYPE_THERMAL:
|
370 |
|
|
|
371 |
|
|
acpi_os_printf ("Thermal\n");
|
372 |
|
|
break;
|
373 |
|
|
|
374 |
|
|
|
375 |
|
|
default:
|
376 |
|
|
/* Unknown Type */
|
377 |
|
|
|
378 |
|
|
acpi_os_printf ("Unknown Type %X\n", ACPI_GET_OBJECT_TYPE (obj_desc));
|
379 |
|
|
break;
|
380 |
|
|
}
|
381 |
|
|
|
382 |
|
|
return;
|
383 |
|
|
}
|
384 |
|
|
|
385 |
|
|
|
386 |
|
|
/*****************************************************************************
|
387 |
|
|
*
|
388 |
|
|
* FUNCTION: acpi_ex_dump_operands
|
389 |
|
|
*
|
390 |
|
|
* PARAMETERS: interpreter_mode - Load or Exec
|
391 |
|
|
* *Ident - Identification
|
392 |
|
|
* num_levels - # of stack entries to dump above line
|
393 |
|
|
* *Note - Output notation
|
394 |
|
|
*
|
395 |
|
|
* DESCRIPTION: Dump the object stack
|
396 |
|
|
*
|
397 |
|
|
****************************************************************************/
|
398 |
|
|
|
399 |
|
|
void
|
400 |
|
|
acpi_ex_dump_operands (
|
401 |
|
|
union acpi_operand_object **operands,
|
402 |
|
|
acpi_interpreter_mode interpreter_mode,
|
403 |
|
|
char *ident,
|
404 |
|
|
u32 num_levels,
|
405 |
|
|
char *note,
|
406 |
|
|
char *module_name,
|
407 |
|
|
u32 line_number)
|
408 |
|
|
{
|
409 |
|
|
acpi_native_uint i;
|
410 |
|
|
union acpi_operand_object **obj_desc;
|
411 |
|
|
|
412 |
|
|
|
413 |
|
|
ACPI_FUNCTION_NAME ("ex_dump_operands");
|
414 |
|
|
|
415 |
|
|
|
416 |
|
|
if (!ident) {
|
417 |
|
|
ident = "?";
|
418 |
|
|
}
|
419 |
|
|
|
420 |
|
|
if (!note) {
|
421 |
|
|
note = "?";
|
422 |
|
|
}
|
423 |
|
|
|
424 |
|
|
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
425 |
|
|
"************* Operand Stack Contents (Opcode [%s], %d Operands)\n",
|
426 |
|
|
ident, num_levels));
|
427 |
|
|
|
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--) {
|
435 |
|
|
obj_desc = &operands[i];
|
436 |
|
|
acpi_ex_dump_operand (*obj_desc);
|
437 |
|
|
}
|
438 |
|
|
|
439 |
|
|
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
440 |
|
|
"************* Stack dump from %s(%d), %s\n",
|
441 |
|
|
module_name, line_number, note));
|
442 |
|
|
return;
|
443 |
|
|
}
|
444 |
|
|
|
445 |
|
|
|
446 |
|
|
/*****************************************************************************
|
447 |
|
|
*
|
448 |
|
|
* FUNCTION: acpi_ex_out*
|
449 |
|
|
*
|
450 |
|
|
* PARAMETERS: Title - Descriptive text
|
451 |
|
|
* Value - Value to be displayed
|
452 |
|
|
*
|
453 |
|
|
* DESCRIPTION: Object dump output formatting functions. These functions
|
454 |
|
|
* reduce the number of format strings required and keeps them
|
455 |
|
|
* all in one place for easy modification.
|
456 |
|
|
*
|
457 |
|
|
****************************************************************************/
|
458 |
|
|
|
459 |
|
|
void
|
460 |
|
|
acpi_ex_out_string (
|
461 |
|
|
char *title,
|
462 |
|
|
char *value)
|
463 |
|
|
{
|
464 |
|
|
acpi_os_printf ("%20s : %s\n", title, value);
|
465 |
|
|
}
|
466 |
|
|
|
467 |
|
|
void
|
468 |
|
|
acpi_ex_out_pointer (
|
469 |
|
|
char *title,
|
470 |
|
|
void *value)
|
471 |
|
|
{
|
472 |
|
|
acpi_os_printf ("%20s : %p\n", title, value);
|
473 |
|
|
}
|
474 |
|
|
|
475 |
|
|
void
|
476 |
|
|
acpi_ex_out_integer (
|
477 |
|
|
char *title,
|
478 |
|
|
u32 value)
|
479 |
|
|
{
|
480 |
|
|
acpi_os_printf ("%20s : %X\n", title, value);
|
481 |
|
|
}
|
482 |
|
|
|
483 |
|
|
void
|
484 |
|
|
acpi_ex_out_address (
|
485 |
|
|
char *title,
|
486 |
|
|
acpi_physical_address value)
|
487 |
|
|
{
|
488 |
|
|
|
489 |
|
|
#if ACPI_MACHINE_WIDTH == 16
|
490 |
|
|
acpi_os_printf ("%20s : %p\n", title, value);
|
491 |
|
|
#else
|
492 |
|
|
acpi_os_printf ("%20s : %8.8X%8.8X\n", title,
|
493 |
|
|
ACPI_FORMAT_UINT64 (value));
|
494 |
|
|
#endif
|
495 |
|
|
}
|
496 |
|
|
|
497 |
|
|
|
498 |
|
|
/*****************************************************************************
|
499 |
|
|
*
|
500 |
|
|
* FUNCTION: acpi_ex_dump_node
|
501 |
|
|
*
|
502 |
|
|
* PARAMETERS: *Node - Descriptor to dump
|
503 |
|
|
* Flags - Force display
|
504 |
|
|
*
|
505 |
|
|
* DESCRIPTION: Dumps the members of the given.Node
|
506 |
|
|
*
|
507 |
|
|
****************************************************************************/
|
508 |
|
|
|
509 |
|
|
void
|
510 |
|
|
acpi_ex_dump_node (
|
511 |
|
|
struct acpi_namespace_node *node,
|
512 |
|
|
u32 flags)
|
513 |
|
|
{
|
514 |
|
|
|
515 |
|
|
ACPI_FUNCTION_ENTRY ();
|
516 |
|
|
|
517 |
|
|
|
518 |
|
|
if (!flags) {
|
519 |
|
|
if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer))) {
|
520 |
|
|
return;
|
521 |
|
|
}
|
522 |
|
|
}
|
523 |
|
|
|
524 |
|
|
acpi_os_printf ("%20s : %4.4s\n", "Name", acpi_ut_get_node_name (node));
|
525 |
|
|
acpi_ex_out_string ("Type", acpi_ut_get_type_name (node->type));
|
526 |
|
|
acpi_ex_out_integer ("Flags", node->flags);
|
527 |
|
|
acpi_ex_out_integer ("Owner Id", node->owner_id);
|
528 |
|
|
acpi_ex_out_integer ("Reference Count", node->reference_count);
|
529 |
|
|
acpi_ex_out_pointer ("Attached Object", acpi_ns_get_attached_object (node));
|
530 |
|
|
acpi_ex_out_pointer ("child_list", node->child);
|
531 |
|
|
acpi_ex_out_pointer ("next_peer", node->peer);
|
532 |
|
|
acpi_ex_out_pointer ("Parent", acpi_ns_get_parent_node (node));
|
533 |
|
|
}
|
534 |
|
|
|
535 |
|
|
|
536 |
|
|
/*****************************************************************************
|
537 |
|
|
*
|
538 |
|
|
* FUNCTION: acpi_ex_dump_object_descriptor
|
539 |
|
|
*
|
540 |
|
|
* PARAMETERS: *Object - Descriptor to dump
|
541 |
|
|
* Flags - Force display
|
542 |
|
|
*
|
543 |
|
|
* DESCRIPTION: Dumps the members of the object descriptor given.
|
544 |
|
|
*
|
545 |
|
|
****************************************************************************/
|
546 |
|
|
|
547 |
|
|
void
|
548 |
|
|
acpi_ex_dump_object_descriptor (
|
549 |
|
|
union acpi_operand_object *obj_desc,
|
550 |
|
|
u32 flags)
|
551 |
|
|
{
|
552 |
|
|
u32 i;
|
553 |
|
|
|
554 |
|
|
|
555 |
|
|
ACPI_FUNCTION_TRACE ("ex_dump_object_descriptor");
|
556 |
|
|
|
557 |
|
|
|
558 |
|
|
if (!flags) {
|
559 |
|
|
if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer))) {
|
560 |
|
|
return_VOID;
|
561 |
|
|
}
|
562 |
|
|
}
|
563 |
|
|
|
564 |
|
|
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) {
|
565 |
|
|
acpi_ex_dump_node ((struct acpi_namespace_node *) obj_desc, flags);
|
566 |
|
|
acpi_os_printf ("\nAttached Object (%p):\n", ((struct acpi_namespace_node *) obj_desc)->object);
|
567 |
|
|
acpi_ex_dump_object_descriptor (((struct acpi_namespace_node *) obj_desc)->object, flags);
|
568 |
|
|
return;
|
569 |
|
|
}
|
570 |
|
|
|
571 |
|
|
if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) {
|
572 |
|
|
acpi_os_printf ("ex_dump_object_descriptor: %p is not an ACPI operand object: [%s]\n",
|
573 |
|
|
obj_desc, acpi_ut_get_descriptor_name (obj_desc));
|
574 |
|
|
return_VOID;
|
575 |
|
|
}
|
576 |
|
|
|
577 |
|
|
/* Common Fields */
|
578 |
|
|
|
579 |
|
|
acpi_ex_out_string ("Type", acpi_ut_get_object_type_name (obj_desc));
|
580 |
|
|
acpi_ex_out_integer ("Reference Count", obj_desc->common.reference_count);
|
581 |
|
|
acpi_ex_out_integer ("Flags", obj_desc->common.flags);
|
582 |
|
|
|
583 |
|
|
/* Object-specific Fields */
|
584 |
|
|
|
585 |
|
|
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
|
586 |
|
|
case ACPI_TYPE_INTEGER:
|
587 |
|
|
|
588 |
|
|
acpi_os_printf ("%20s : %8.8X%8.8X\n", "Value",
|
589 |
|
|
ACPI_FORMAT_UINT64 (obj_desc->integer.value));
|
590 |
|
|
break;
|
591 |
|
|
|
592 |
|
|
|
593 |
|
|
case ACPI_TYPE_STRING:
|
594 |
|
|
|
595 |
|
|
acpi_ex_out_integer ("Length", obj_desc->string.length);
|
596 |
|
|
|
597 |
|
|
acpi_os_printf ("%20s : %p ", "Pointer", obj_desc->string.pointer);
|
598 |
|
|
acpi_ut_print_string (obj_desc->string.pointer, ACPI_UINT8_MAX);
|
599 |
|
|
acpi_os_printf ("\n");
|
600 |
|
|
break;
|
601 |
|
|
|
602 |
|
|
|
603 |
|
|
case ACPI_TYPE_BUFFER:
|
604 |
|
|
|
605 |
|
|
acpi_ex_out_integer ("Length", obj_desc->buffer.length);
|
606 |
|
|
acpi_ex_out_pointer ("Pointer", obj_desc->buffer.pointer);
|
607 |
|
|
ACPI_DUMP_BUFFER (obj_desc->buffer.pointer, obj_desc->buffer.length);
|
608 |
|
|
break;
|
609 |
|
|
|
610 |
|
|
|
611 |
|
|
case ACPI_TYPE_PACKAGE:
|
612 |
|
|
|
613 |
|
|
acpi_ex_out_integer ("Flags", obj_desc->package.flags);
|
614 |
|
|
acpi_ex_out_integer ("Count", obj_desc->package.count);
|
615 |
|
|
acpi_ex_out_pointer ("Elements", obj_desc->package.elements);
|
616 |
|
|
|
617 |
|
|
/* Dump the package contents */
|
618 |
|
|
|
619 |
|
|
if (obj_desc->package.count > 0) {
|
620 |
|
|
acpi_os_printf ("\nPackage Contents:\n");
|
621 |
|
|
for (i = 0; i < obj_desc->package.count; i++) {
|
622 |
|
|
acpi_os_printf ("[%.3d] %p", i, obj_desc->package.elements[i]);
|
623 |
|
|
if (obj_desc->package.elements[i]) {
|
624 |
|
|
acpi_os_printf (" %s", acpi_ut_get_object_type_name (obj_desc->package.elements[i]));
|
625 |
|
|
}
|
626 |
|
|
acpi_os_printf ("\n");
|
627 |
|
|
}
|
628 |
|
|
}
|
629 |
|
|
break;
|
630 |
|
|
|
631 |
|
|
|
632 |
|
|
case ACPI_TYPE_DEVICE:
|
633 |
|
|
|
634 |
|
|
acpi_ex_out_pointer ("Handler", obj_desc->device.handler);
|
635 |
|
|
acpi_ex_out_pointer ("system_notify", obj_desc->device.system_notify);
|
636 |
|
|
acpi_ex_out_pointer ("device_notify", obj_desc->device.device_notify);
|
637 |
|
|
break;
|
638 |
|
|
|
639 |
|
|
|
640 |
|
|
case ACPI_TYPE_EVENT:
|
641 |
|
|
|
642 |
|
|
acpi_ex_out_pointer ("Semaphore", obj_desc->event.semaphore);
|
643 |
|
|
break;
|
644 |
|
|
|
645 |
|
|
|
646 |
|
|
case ACPI_TYPE_METHOD:
|
647 |
|
|
|
648 |
|
|
acpi_ex_out_integer ("param_count", obj_desc->method.param_count);
|
649 |
|
|
acpi_ex_out_integer ("Concurrency", obj_desc->method.concurrency);
|
650 |
|
|
acpi_ex_out_pointer ("Semaphore", obj_desc->method.semaphore);
|
651 |
|
|
acpi_ex_out_integer ("owning_id", obj_desc->method.owning_id);
|
652 |
|
|
acpi_ex_out_integer ("aml_length", obj_desc->method.aml_length);
|
653 |
|
|
acpi_ex_out_pointer ("aml_start", obj_desc->method.aml_start);
|
654 |
|
|
break;
|
655 |
|
|
|
656 |
|
|
|
657 |
|
|
case ACPI_TYPE_MUTEX:
|
658 |
|
|
|
659 |
|
|
acpi_ex_out_integer ("sync_level", obj_desc->mutex.sync_level);
|
660 |
|
|
acpi_ex_out_pointer ("owner_thread", obj_desc->mutex.owner_thread);
|
661 |
|
|
acpi_ex_out_integer ("acquisition_depth",obj_desc->mutex.acquisition_depth);
|
662 |
|
|
acpi_ex_out_pointer ("Semaphore", obj_desc->mutex.semaphore);
|
663 |
|
|
break;
|
664 |
|
|
|
665 |
|
|
|
666 |
|
|
case ACPI_TYPE_REGION:
|
667 |
|
|
|
668 |
|
|
acpi_ex_out_integer ("space_id", obj_desc->region.space_id);
|
669 |
|
|
acpi_ex_out_integer ("Flags", obj_desc->region.flags);
|
670 |
|
|
acpi_ex_out_address ("Address", obj_desc->region.address);
|
671 |
|
|
acpi_ex_out_integer ("Length", obj_desc->region.length);
|
672 |
|
|
acpi_ex_out_pointer ("Handler", obj_desc->region.handler);
|
673 |
|
|
acpi_ex_out_pointer ("Next", obj_desc->region.next);
|
674 |
|
|
break;
|
675 |
|
|
|
676 |
|
|
|
677 |
|
|
case ACPI_TYPE_POWER:
|
678 |
|
|
|
679 |
|
|
acpi_ex_out_integer ("system_level", obj_desc->power_resource.system_level);
|
680 |
|
|
acpi_ex_out_integer ("resource_order", obj_desc->power_resource.resource_order);
|
681 |
|
|
acpi_ex_out_pointer ("system_notify", obj_desc->power_resource.system_notify);
|
682 |
|
|
acpi_ex_out_pointer ("device_notify", obj_desc->power_resource.device_notify);
|
683 |
|
|
break;
|
684 |
|
|
|
685 |
|
|
|
686 |
|
|
case ACPI_TYPE_PROCESSOR:
|
687 |
|
|
|
688 |
|
|
acpi_ex_out_integer ("Processor ID", obj_desc->processor.proc_id);
|
689 |
|
|
acpi_ex_out_integer ("Length", obj_desc->processor.length);
|
690 |
|
|
acpi_ex_out_address ("Address", (acpi_physical_address) obj_desc->processor.address);
|
691 |
|
|
acpi_ex_out_pointer ("system_notify", obj_desc->processor.system_notify);
|
692 |
|
|
acpi_ex_out_pointer ("device_notify", obj_desc->processor.device_notify);
|
693 |
|
|
acpi_ex_out_pointer ("Handler", obj_desc->processor.handler);
|
694 |
|
|
break;
|
695 |
|
|
|
696 |
|
|
|
697 |
|
|
case ACPI_TYPE_THERMAL:
|
698 |
|
|
|
699 |
|
|
acpi_ex_out_pointer ("system_notify", obj_desc->thermal_zone.system_notify);
|
700 |
|
|
acpi_ex_out_pointer ("device_notify", obj_desc->thermal_zone.device_notify);
|
701 |
|
|
acpi_ex_out_pointer ("Handler", obj_desc->thermal_zone.handler);
|
702 |
|
|
break;
|
703 |
|
|
|
704 |
|
|
|
705 |
|
|
case ACPI_TYPE_BUFFER_FIELD:
|
706 |
|
|
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
707 |
|
|
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
708 |
|
|
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
709 |
|
|
|
710 |
|
|
acpi_ex_out_integer ("field_flags", obj_desc->common_field.field_flags);
|
711 |
|
|
acpi_ex_out_integer ("access_byte_width", obj_desc->common_field.access_byte_width);
|
712 |
|
|
acpi_ex_out_integer ("bit_length", obj_desc->common_field.bit_length);
|
713 |
|
|
acpi_ex_out_integer ("fld_bit_offset", obj_desc->common_field.start_field_bit_offset);
|
714 |
|
|
acpi_ex_out_integer ("base_byte_offset", obj_desc->common_field.base_byte_offset);
|
715 |
|
|
acpi_ex_out_integer ("datum_valid_bits", obj_desc->common_field.datum_valid_bits);
|
716 |
|
|
acpi_ex_out_integer ("end_fld_valid_bits", obj_desc->common_field.end_field_valid_bits);
|
717 |
|
|
acpi_ex_out_integer ("end_buf_valid_bits", obj_desc->common_field.end_buffer_valid_bits);
|
718 |
|
|
acpi_ex_out_pointer ("parent_node", obj_desc->common_field.node);
|
719 |
|
|
|
720 |
|
|
switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
|
721 |
|
|
case ACPI_TYPE_BUFFER_FIELD:
|
722 |
|
|
acpi_ex_out_pointer ("buffer_obj", obj_desc->buffer_field.buffer_obj);
|
723 |
|
|
break;
|
724 |
|
|
|
725 |
|
|
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
726 |
|
|
acpi_ex_out_pointer ("region_obj", obj_desc->field.region_obj);
|
727 |
|
|
break;
|
728 |
|
|
|
729 |
|
|
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
730 |
|
|
acpi_ex_out_integer ("Value", obj_desc->bank_field.value);
|
731 |
|
|
acpi_ex_out_pointer ("region_obj", obj_desc->bank_field.region_obj);
|
732 |
|
|
acpi_ex_out_pointer ("bank_obj", obj_desc->bank_field.bank_obj);
|
733 |
|
|
break;
|
734 |
|
|
|
735 |
|
|
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
736 |
|
|
acpi_ex_out_integer ("Value", obj_desc->index_field.value);
|
737 |
|
|
acpi_ex_out_pointer ("Index", obj_desc->index_field.index_obj);
|
738 |
|
|
acpi_ex_out_pointer ("Data", obj_desc->index_field.data_obj);
|
739 |
|
|
break;
|
740 |
|
|
|
741 |
|
|
default:
|
742 |
|
|
/* All object types covered above */
|
743 |
|
|
break;
|
744 |
|
|
}
|
745 |
|
|
break;
|
746 |
|
|
|
747 |
|
|
|
748 |
|
|
case ACPI_TYPE_LOCAL_REFERENCE:
|
749 |
|
|
|
750 |
|
|
acpi_ex_out_integer ("target_type", obj_desc->reference.target_type);
|
751 |
|
|
acpi_ex_out_string ("Opcode", (acpi_ps_get_opcode_info (obj_desc->reference.opcode))->name);
|
752 |
|
|
acpi_ex_out_integer ("Offset", obj_desc->reference.offset);
|
753 |
|
|
acpi_ex_out_pointer ("obj_desc", obj_desc->reference.object);
|
754 |
|
|
acpi_ex_out_pointer ("Node", obj_desc->reference.node);
|
755 |
|
|
acpi_ex_out_pointer ("Where", obj_desc->reference.where);
|
756 |
|
|
break;
|
757 |
|
|
|
758 |
|
|
|
759 |
|
|
case ACPI_TYPE_LOCAL_ADDRESS_HANDLER:
|
760 |
|
|
|
761 |
|
|
acpi_ex_out_integer ("space_id", obj_desc->address_space.space_id);
|
762 |
|
|
acpi_ex_out_pointer ("Next", obj_desc->address_space.next);
|
763 |
|
|
acpi_ex_out_pointer ("region_list", obj_desc->address_space.region_list);
|
764 |
|
|
acpi_ex_out_pointer ("Node", obj_desc->address_space.node);
|
765 |
|
|
acpi_ex_out_pointer ("Context", obj_desc->address_space.context);
|
766 |
|
|
break;
|
767 |
|
|
|
768 |
|
|
|
769 |
|
|
case ACPI_TYPE_LOCAL_NOTIFY:
|
770 |
|
|
|
771 |
|
|
acpi_ex_out_pointer ("Node", obj_desc->notify.node);
|
772 |
|
|
acpi_ex_out_pointer ("Context", obj_desc->notify.context);
|
773 |
|
|
break;
|
774 |
|
|
|
775 |
|
|
|
776 |
|
|
case ACPI_TYPE_LOCAL_ALIAS:
|
777 |
|
|
case ACPI_TYPE_LOCAL_METHOD_ALIAS:
|
778 |
|
|
case ACPI_TYPE_LOCAL_EXTRA:
|
779 |
|
|
case ACPI_TYPE_LOCAL_DATA:
|
780 |
|
|
default:
|
781 |
|
|
|
782 |
|
|
acpi_os_printf ("ex_dump_object_descriptor: Display not implemented for object type %s\n",
|
783 |
|
|
acpi_ut_get_object_type_name (obj_desc));
|
784 |
|
|
break;
|
785 |
|
|
}
|
786 |
|
|
|
787 |
|
|
return_VOID;
|
788 |
|
|
}
|
789 |
|
|
|
790 |
|
|
#endif
|
791 |
|
|
|