[ACPI] ACPICA 20050729 from Bob Moore
[deliverable/linux.git] / drivers / acpi / executer / exdump.c
1 /******************************************************************************
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
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 * The following routines are used for debug output only
56 */
57 #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
58
59 /* Local prototypes */
60
61 #ifdef ACPI_FUTURE_USAGE
62 static void
63 acpi_ex_out_string (
64 char *title,
65 char *value);
66
67 static void
68 acpi_ex_out_pointer (
69 char *title,
70 void *value);
71
72 static void
73 acpi_ex_out_integer (
74 char *title,
75 u32 value);
76
77 static void
78 acpi_ex_out_address (
79 char *title,
80 acpi_physical_address value);
81
82 static void
83 acpi_ex_dump_reference (
84 union acpi_operand_object *obj_desc);
85
86 static void
87 acpi_ex_dump_package (
88 union acpi_operand_object *obj_desc,
89 u32 level,
90 u32 index);
91 #endif /* ACPI_FUTURE_USAGE */
92
93 /*******************************************************************************
94 *
95 * FUNCTION: acpi_ex_dump_operand
96 *
97 * PARAMETERS: *obj_desc - Pointer to entry to be dumped
98 * Depth - Current nesting depth
99 *
100 * RETURN: None
101 *
102 * DESCRIPTION: Dump an operand object
103 *
104 ******************************************************************************/
105
106 void
107 acpi_ex_dump_operand (
108 union acpi_operand_object *obj_desc,
109 u32 depth)
110 {
111 u32 length;
112 u32 index;
113
114
115 ACPI_FUNCTION_NAME ("ex_dump_operand")
116
117
118 if (!((ACPI_LV_EXEC & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer))) {
119 return;
120 }
121
122 if (!obj_desc) {
123 /* This could be a null element of a package */
124
125 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Null Object Descriptor\n"));
126 return;
127 }
128
129 if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) {
130 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p Namespace Node: ", obj_desc));
131 ACPI_DUMP_ENTRY (obj_desc, ACPI_LV_EXEC);
132 return;
133 }
134
135 if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) {
136 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
137 "%p is not a node or operand object: [%s]\n",
138 obj_desc, acpi_ut_get_descriptor_name (obj_desc)));
139 ACPI_DUMP_BUFFER (obj_desc, sizeof (union acpi_operand_object));
140 return;
141 }
142
143 /* obj_desc is a valid object */
144
145 if (depth > 0) {
146 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%*s[%u] %p ",
147 depth, " ", depth, obj_desc));
148 }
149 else {
150 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p ", obj_desc));
151 }
152
153 /* Decode object type */
154
155 switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
156 case ACPI_TYPE_LOCAL_REFERENCE:
157
158 switch (obj_desc->reference.opcode) {
159 case AML_DEBUG_OP:
160
161 acpi_os_printf ("Reference: Debug\n");
162 break;
163
164
165 case AML_NAME_OP:
166
167 ACPI_DUMP_PATHNAME (obj_desc->reference.object,
168 "Reference: Name: ", ACPI_LV_INFO, _COMPONENT);
169 ACPI_DUMP_ENTRY (obj_desc->reference.object, ACPI_LV_INFO);
170 break;
171
172
173 case AML_INDEX_OP:
174
175 acpi_os_printf ("Reference: Index %p\n",
176 obj_desc->reference.object);
177 break;
178
179
180 case AML_REF_OF_OP:
181
182 acpi_os_printf ("Reference: (ref_of) %p\n",
183 obj_desc->reference.object);
184 break;
185
186
187 case AML_ARG_OP:
188
189 acpi_os_printf ("Reference: Arg%d",
190 obj_desc->reference.offset);
191
192 if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) {
193 /* Value is an Integer */
194
195 acpi_os_printf (" value is [%8.8X%8.8x]",
196 ACPI_FORMAT_UINT64 (obj_desc->integer.value));
197 }
198
199 acpi_os_printf ("\n");
200 break;
201
202
203 case AML_LOCAL_OP:
204
205 acpi_os_printf ("Reference: Local%d",
206 obj_desc->reference.offset);
207
208 if (ACPI_GET_OBJECT_TYPE (obj_desc) == ACPI_TYPE_INTEGER) {
209
210 /* Value is an Integer */
211
212 acpi_os_printf (" value is [%8.8X%8.8x]",
213 ACPI_FORMAT_UINT64 (obj_desc->integer.value));
214 }
215
216 acpi_os_printf ("\n");
217 break;
218
219
220 case AML_INT_NAMEPATH_OP:
221
222 acpi_os_printf ("Reference.Node->Name %X\n",
223 obj_desc->reference.node->name.integer);
224 break;
225
226
227 default:
228
229 /* Unknown opcode */
230
231 acpi_os_printf ("Unknown Reference opcode=%X\n",
232 obj_desc->reference.opcode);
233 break;
234
235 }
236 break;
237
238
239 case ACPI_TYPE_BUFFER:
240
241 acpi_os_printf ("Buffer len %X @ %p \n",
242 obj_desc->buffer.length, obj_desc->buffer.pointer);
243
244 length = obj_desc->buffer.length;
245 if (length > 64) {
246 length = 64;
247 }
248
249 /* Debug only -- dump the buffer contents */
250
251 if (obj_desc->buffer.pointer) {
252 acpi_os_printf ("Buffer Contents: ");
253
254 for (index = 0; index < length; index++) {
255 acpi_os_printf (" %02x", obj_desc->buffer.pointer[index]);
256 }
257 acpi_os_printf ("\n");
258 }
259 break;
260
261
262 case ACPI_TYPE_INTEGER:
263
264 acpi_os_printf ("Integer %8.8X%8.8X\n",
265 ACPI_FORMAT_UINT64 (obj_desc->integer.value));
266 break;
267
268
269 case ACPI_TYPE_PACKAGE:
270
271 acpi_os_printf ("Package [Len %X] element_array %p\n",
272 obj_desc->package.count, obj_desc->package.elements);
273
274 /*
275 * If elements exist, package element pointer is valid,
276 * and debug_level exceeds 1, dump package's elements.
277 */
278 if (obj_desc->package.count &&
279 obj_desc->package.elements &&
280 acpi_dbg_level > 1) {
281 for (index = 0; index < obj_desc->package.count; index++) {
282 acpi_ex_dump_operand (obj_desc->package.elements[index], depth+1);
283 }
284 }
285 break;
286
287
288 case ACPI_TYPE_REGION:
289
290 acpi_os_printf ("Region %s (%X)",
291 acpi_ut_get_region_name (obj_desc->region.space_id),
292 obj_desc->region.space_id);
293
294 /*
295 * If the address and length have not been evaluated,
296 * don't print them.
297 */
298 if (!(obj_desc->region.flags & AOPOBJ_DATA_VALID)) {
299 acpi_os_printf ("\n");
300 }
301 else {
302 acpi_os_printf (" base %8.8X%8.8X Length %X\n",
303 ACPI_FORMAT_UINT64 (obj_desc->region.address),
304 obj_desc->region.length);
305 }
306 break;
307
308
309 case ACPI_TYPE_STRING:
310
311 acpi_os_printf ("String length %X @ %p ",
312 obj_desc->string.length,
313 obj_desc->string.pointer);
314
315 acpi_ut_print_string (obj_desc->string.pointer, ACPI_UINT8_MAX);
316 acpi_os_printf ("\n");
317 break;
318
319
320 case ACPI_TYPE_LOCAL_BANK_FIELD:
321
322 acpi_os_printf ("bank_field\n");
323 break;
324
325
326 case ACPI_TYPE_LOCAL_REGION_FIELD:
327
328 acpi_os_printf (
329 "region_field: Bits=%X acc_width=%X Lock=%X Update=%X at byte=%X bit=%X of below:\n",
330 obj_desc->field.bit_length,
331 obj_desc->field.access_byte_width,
332 obj_desc->field.field_flags & AML_FIELD_LOCK_RULE_MASK,
333 obj_desc->field.field_flags & AML_FIELD_UPDATE_RULE_MASK,
334 obj_desc->field.base_byte_offset,
335 obj_desc->field.start_field_bit_offset);
336
337 acpi_ex_dump_operand (obj_desc->field.region_obj, depth+1);
338 break;
339
340
341 case ACPI_TYPE_LOCAL_INDEX_FIELD:
342
343 acpi_os_printf ("index_field\n");
344 break;
345
346
347 case ACPI_TYPE_BUFFER_FIELD:
348
349 acpi_os_printf (
350 "buffer_field: %X bits at byte %X bit %X of \n",
351 obj_desc->buffer_field.bit_length,
352 obj_desc->buffer_field.base_byte_offset,
353 obj_desc->buffer_field.start_field_bit_offset);
354
355 if (!obj_desc->buffer_field.buffer_obj) {
356 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "*NULL* \n"));
357 }
358 else if (ACPI_GET_OBJECT_TYPE (obj_desc->buffer_field.buffer_obj) !=
359 ACPI_TYPE_BUFFER) {
360 acpi_os_printf ("*not a Buffer* \n");
361 }
362 else {
363 acpi_ex_dump_operand (obj_desc->buffer_field.buffer_obj, depth+1);
364 }
365 break;
366
367
368 case ACPI_TYPE_EVENT:
369
370 acpi_os_printf ("Event\n");
371 break;
372
373
374 case ACPI_TYPE_METHOD:
375
376 acpi_os_printf ("Method(%X) @ %p:%X\n",
377 obj_desc->method.param_count,
378 obj_desc->method.aml_start,
379 obj_desc->method.aml_length);
380 break;
381
382
383 case ACPI_TYPE_MUTEX:
384
385 acpi_os_printf ("Mutex\n");
386 break;
387
388
389 case ACPI_TYPE_DEVICE:
390
391 acpi_os_printf ("Device\n");
392 break;
393
394
395 case ACPI_TYPE_POWER:
396
397 acpi_os_printf ("Power\n");
398 break;
399
400
401 case ACPI_TYPE_PROCESSOR:
402
403 acpi_os_printf ("Processor\n");
404 break;
405
406
407 case ACPI_TYPE_THERMAL:
408
409 acpi_os_printf ("Thermal\n");
410 break;
411
412
413 default:
414 /* Unknown Type */
415
416 acpi_os_printf ("Unknown Type %X\n", ACPI_GET_OBJECT_TYPE (obj_desc));
417 break;
418 }
419
420 return;
421 }
422
423
424 /*******************************************************************************
425 *
426 * FUNCTION: acpi_ex_dump_operands
427 *
428 * PARAMETERS: Operands - Operand list
429 * interpreter_mode - Load or Exec
430 * Ident - Identification
431 * num_levels - # of stack entries to dump above line
432 * Note - Output notation
433 * module_name - Caller's module name
434 * line_number - Caller's invocation line number
435 *
436 * DESCRIPTION: Dump the object stack
437 *
438 ******************************************************************************/
439
440 void
441 acpi_ex_dump_operands (
442 union acpi_operand_object **operands,
443 acpi_interpreter_mode interpreter_mode,
444 char *ident,
445 u32 num_levels,
446 char *note,
447 char *module_name,
448 u32 line_number)
449 {
450 acpi_native_uint i;
451
452
453 ACPI_FUNCTION_NAME ("ex_dump_operands");
454
455
456 if (!ident) {
457 ident = "?";
458 }
459
460 if (!note) {
461 note = "?";
462 }
463
464 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
465 "************* Operand Stack Contents (Opcode [%s], %d Operands)\n",
466 ident, num_levels));
467
468 if (num_levels == 0) {
469 num_levels = 1;
470 }
471
472 /* Dump the operand stack starting at the top */
473
474 for (i = 0; num_levels > 0; i--, num_levels--) {
475 acpi_ex_dump_operand (operands[i], 0);
476 }
477
478 ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
479 "************* Operand Stack dump from %s(%d), %s\n",
480 module_name, line_number, note));
481 return;
482 }
483
484
485 #ifdef ACPI_FUTURE_USAGE
486 /*******************************************************************************
487 *
488 * FUNCTION: acpi_ex_out* functions
489 *
490 * PARAMETERS: Title - Descriptive text
491 * Value - Value to be displayed
492 *
493 * DESCRIPTION: Object dump output formatting functions. These functions
494 * reduce the number of format strings required and keeps them
495 * all in one place for easy modification.
496 *
497 ******************************************************************************/
498
499 static void
500 acpi_ex_out_string (
501 char *title,
502 char *value)
503 {
504 acpi_os_printf ("%20s : %s\n", title, value);
505 }
506
507 static void
508 acpi_ex_out_pointer (
509 char *title,
510 void *value)
511 {
512 acpi_os_printf ("%20s : %p\n", title, value);
513 }
514
515 static void
516 acpi_ex_out_integer (
517 char *title,
518 u32 value)
519 {
520 acpi_os_printf ("%20s : %.2X\n", title, value);
521 }
522
523 static void
524 acpi_ex_out_address (
525 char *title,
526 acpi_physical_address value)
527 {
528
529 #if ACPI_MACHINE_WIDTH == 16
530 acpi_os_printf ("%20s : %p\n", title, value);
531 #else
532 acpi_os_printf ("%20s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64 (value));
533 #endif
534 }
535
536
537 /*******************************************************************************
538 *
539 * FUNCTION: acpi_ex_dump_node
540 *
541 * PARAMETERS: *Node - Descriptor to dump
542 * Flags - Force display if TRUE
543 *
544 * DESCRIPTION: Dumps the members of the given.Node
545 *
546 ******************************************************************************/
547
548 void
549 acpi_ex_dump_node (
550 struct acpi_namespace_node *node,
551 u32 flags)
552 {
553
554 ACPI_FUNCTION_ENTRY ();
555
556
557 if (!flags) {
558 if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer))) {
559 return;
560 }
561 }
562
563 acpi_os_printf ("%20s : %4.4s\n", "Name", acpi_ut_get_node_name (node));
564 acpi_ex_out_string ("Type", acpi_ut_get_type_name (node->type));
565 acpi_ex_out_integer ("Flags", node->flags);
566 acpi_ex_out_integer ("Owner Id", node->owner_id);
567 acpi_ex_out_integer ("Reference Count", node->reference_count);
568 acpi_ex_out_pointer ("Attached Object", acpi_ns_get_attached_object (node));
569 acpi_ex_out_pointer ("child_list", node->child);
570 acpi_ex_out_pointer ("next_peer", node->peer);
571 acpi_ex_out_pointer ("Parent", acpi_ns_get_parent_node (node));
572 }
573
574
575 /*******************************************************************************
576 *
577 * FUNCTION: acpi_ex_dump_reference
578 *
579 * PARAMETERS: Object - Descriptor to dump
580 *
581 * DESCRIPTION: Dumps a reference object
582 *
583 ******************************************************************************/
584
585 static void
586 acpi_ex_dump_reference (
587 union acpi_operand_object *obj_desc)
588 {
589 struct acpi_buffer ret_buf;
590 acpi_status status;
591
592
593 if (obj_desc->reference.opcode == AML_INT_NAMEPATH_OP) {
594 acpi_os_printf ("Named Object %p ", obj_desc->reference.node);
595 ret_buf.length = ACPI_ALLOCATE_LOCAL_BUFFER;
596 status = acpi_ns_handle_to_pathname (obj_desc->reference.node, &ret_buf);
597 if (ACPI_FAILURE (status)) {
598 acpi_os_printf ("Could not convert name to pathname\n");
599 }
600 else {
601 acpi_os_printf ("%s\n", (char *) ret_buf.pointer);
602 ACPI_MEM_FREE (ret_buf.pointer);
603 }
604 }
605 else if (obj_desc->reference.object) {
606 acpi_os_printf ("\nReferenced Object: %p\n", obj_desc->reference.object);
607 }
608 }
609
610
611 /*******************************************************************************
612 *
613 * FUNCTION: acpi_ex_dump_package
614 *
615 * PARAMETERS: Object - Descriptor to dump
616 * Level - Indentation Level
617 * Index - Package index for this object
618 *
619 * DESCRIPTION: Dumps the elements of the package
620 *
621 ******************************************************************************/
622
623 static void
624 acpi_ex_dump_package (
625 union acpi_operand_object *obj_desc,
626 u32 level,
627 u32 index)
628 {
629 u32 i;
630
631
632 /* Indentation and index output */
633
634 if (level > 0) {
635 for (i = 0; i < level; i++) {
636 acpi_os_printf (" ");
637 }
638
639 acpi_os_printf ("[%.2d] ", index);
640 }
641
642 acpi_os_printf ("%p ", obj_desc);
643
644 /* Null package elements are allowed */
645
646 if (!obj_desc) {
647 acpi_os_printf ("[Null Object]\n");
648 return;
649 }
650
651 /* Packages may only contain a few object types */
652
653 switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
654 case ACPI_TYPE_INTEGER:
655
656 acpi_os_printf ("[Integer] = %8.8X%8.8X\n",
657 ACPI_FORMAT_UINT64 (obj_desc->integer.value));
658 break;
659
660
661 case ACPI_TYPE_STRING:
662
663 acpi_os_printf ("[String] Value: ");
664 for (i = 0; i < obj_desc->string.length; i++) {
665 acpi_os_printf ("%c", obj_desc->string.pointer[i]);
666 }
667 acpi_os_printf ("\n");
668 break;
669
670
671 case ACPI_TYPE_BUFFER:
672
673 acpi_os_printf ("[Buffer] Length %.2X = ", obj_desc->buffer.length);
674 if (obj_desc->buffer.length) {
675 acpi_ut_dump_buffer ((u8 *) obj_desc->buffer.pointer,
676 obj_desc->buffer.length, DB_DWORD_DISPLAY, _COMPONENT);
677 }
678 else {
679 acpi_os_printf ("\n");
680 }
681 break;
682
683
684 case ACPI_TYPE_PACKAGE:
685
686 acpi_os_printf ("[Package] Contains %d Elements: \n",
687 obj_desc->package.count);
688
689 for (i = 0; i < obj_desc->package.count; i++) {
690 acpi_ex_dump_package (obj_desc->package.elements[i], level+1, i);
691 }
692 break;
693
694
695 case ACPI_TYPE_LOCAL_REFERENCE:
696
697 acpi_os_printf ("[Object Reference] ");
698 acpi_ex_dump_reference (obj_desc);
699 break;
700
701
702 default:
703
704 acpi_os_printf ("[Unknown Type] %X\n", ACPI_GET_OBJECT_TYPE (obj_desc));
705 break;
706 }
707 }
708
709
710 /*******************************************************************************
711 *
712 * FUNCTION: acpi_ex_dump_object_descriptor
713 *
714 * PARAMETERS: Object - Descriptor to dump
715 * Flags - Force display if TRUE
716 *
717 * DESCRIPTION: Dumps the members of the object descriptor given.
718 *
719 ******************************************************************************/
720
721 void
722 acpi_ex_dump_object_descriptor (
723 union acpi_operand_object *obj_desc,
724 u32 flags)
725 {
726 ACPI_FUNCTION_TRACE ("ex_dump_object_descriptor");
727
728
729 if (!obj_desc) {
730 return_VOID;
731 }
732
733 if (!flags) {
734 if (!((ACPI_LV_OBJECTS & acpi_dbg_level) && (_COMPONENT & acpi_dbg_layer))) {
735 return_VOID;
736 }
737 }
738
739 if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) == ACPI_DESC_TYPE_NAMED) {
740 acpi_ex_dump_node ((struct acpi_namespace_node *) obj_desc, flags);
741 acpi_os_printf ("\nAttached Object (%p):\n",
742 ((struct acpi_namespace_node *) obj_desc)->object);
743 acpi_ex_dump_object_descriptor (
744 ((struct acpi_namespace_node *) obj_desc)->object, flags);
745 return_VOID;
746 }
747
748 if (ACPI_GET_DESCRIPTOR_TYPE (obj_desc) != ACPI_DESC_TYPE_OPERAND) {
749 acpi_os_printf (
750 "ex_dump_object_descriptor: %p is not an ACPI operand object: [%s]\n",
751 obj_desc, acpi_ut_get_descriptor_name (obj_desc));
752 return_VOID;
753 }
754
755 /* Common Fields */
756
757 acpi_ex_out_string ("Type", acpi_ut_get_object_type_name (obj_desc));
758 acpi_ex_out_integer ("Reference Count", obj_desc->common.reference_count);
759 acpi_ex_out_integer ("Flags", obj_desc->common.flags);
760
761 /* Object-specific Fields */
762
763 switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
764 case ACPI_TYPE_INTEGER:
765
766 acpi_os_printf ("%20s : %8.8X%8.8X\n", "Value",
767 ACPI_FORMAT_UINT64 (obj_desc->integer.value));
768 break;
769
770
771 case ACPI_TYPE_STRING:
772
773 acpi_ex_out_integer ("Length", obj_desc->string.length);
774
775 acpi_os_printf ("%20s : %p ", "Pointer", obj_desc->string.pointer);
776 acpi_ut_print_string (obj_desc->string.pointer, ACPI_UINT8_MAX);
777 acpi_os_printf ("\n");
778 break;
779
780
781 case ACPI_TYPE_BUFFER:
782
783 acpi_ex_out_integer ("Length", obj_desc->buffer.length);
784 acpi_ex_out_pointer ("Pointer", obj_desc->buffer.pointer);
785 ACPI_DUMP_BUFFER (obj_desc->buffer.pointer, obj_desc->buffer.length);
786 break;
787
788
789 case ACPI_TYPE_PACKAGE:
790
791 acpi_ex_out_integer ("Flags", obj_desc->package.flags);
792 acpi_ex_out_integer ("Elements", obj_desc->package.count);
793 acpi_ex_out_pointer ("Element List", obj_desc->package.elements);
794
795 /* Dump the package contents */
796
797 acpi_os_printf ("\nPackage Contents:\n");
798 acpi_ex_dump_package (obj_desc, 0, 0);
799 break;
800
801
802 case ACPI_TYPE_DEVICE:
803
804 acpi_ex_out_pointer ("Handler", obj_desc->device.handler);
805 acpi_ex_out_pointer ("system_notify", obj_desc->device.system_notify);
806 acpi_ex_out_pointer ("device_notify", obj_desc->device.device_notify);
807 break;
808
809
810 case ACPI_TYPE_EVENT:
811
812 acpi_ex_out_pointer ("Semaphore", obj_desc->event.semaphore);
813 break;
814
815
816 case ACPI_TYPE_METHOD:
817
818 acpi_ex_out_integer ("param_count", obj_desc->method.param_count);
819 acpi_ex_out_integer ("Concurrency", obj_desc->method.concurrency);
820 acpi_ex_out_pointer ("Semaphore", obj_desc->method.semaphore);
821 acpi_ex_out_integer ("owner_id", obj_desc->method.owner_id);
822 acpi_ex_out_integer ("aml_length", obj_desc->method.aml_length);
823 acpi_ex_out_pointer ("aml_start", obj_desc->method.aml_start);
824 break;
825
826
827 case ACPI_TYPE_MUTEX:
828
829 acpi_ex_out_integer ("sync_level", obj_desc->mutex.sync_level);
830 acpi_ex_out_pointer ("owner_thread", obj_desc->mutex.owner_thread);
831 acpi_ex_out_integer ("acquire_depth", obj_desc->mutex.acquisition_depth);
832 acpi_ex_out_pointer ("Semaphore", obj_desc->mutex.semaphore);
833 break;
834
835
836 case ACPI_TYPE_REGION:
837
838 acpi_ex_out_integer ("space_id", obj_desc->region.space_id);
839 acpi_ex_out_integer ("Flags", obj_desc->region.flags);
840 acpi_ex_out_address ("Address", obj_desc->region.address);
841 acpi_ex_out_integer ("Length", obj_desc->region.length);
842 acpi_ex_out_pointer ("Handler", obj_desc->region.handler);
843 acpi_ex_out_pointer ("Next", obj_desc->region.next);
844 break;
845
846
847 case ACPI_TYPE_POWER:
848
849 acpi_ex_out_integer ("system_level", obj_desc->power_resource.system_level);
850 acpi_ex_out_integer ("resource_order", obj_desc->power_resource.resource_order);
851 acpi_ex_out_pointer ("system_notify", obj_desc->power_resource.system_notify);
852 acpi_ex_out_pointer ("device_notify", obj_desc->power_resource.device_notify);
853 break;
854
855
856 case ACPI_TYPE_PROCESSOR:
857
858 acpi_ex_out_integer ("Processor ID", obj_desc->processor.proc_id);
859 acpi_ex_out_integer ("Length", obj_desc->processor.length);
860 acpi_ex_out_address ("Address", (acpi_physical_address) obj_desc->processor.address);
861 acpi_ex_out_pointer ("system_notify", obj_desc->processor.system_notify);
862 acpi_ex_out_pointer ("device_notify", obj_desc->processor.device_notify);
863 acpi_ex_out_pointer ("Handler", obj_desc->processor.handler);
864 break;
865
866
867 case ACPI_TYPE_THERMAL:
868
869 acpi_ex_out_pointer ("system_notify", obj_desc->thermal_zone.system_notify);
870 acpi_ex_out_pointer ("device_notify", obj_desc->thermal_zone.device_notify);
871 acpi_ex_out_pointer ("Handler", obj_desc->thermal_zone.handler);
872 break;
873
874
875 case ACPI_TYPE_BUFFER_FIELD:
876 case ACPI_TYPE_LOCAL_REGION_FIELD:
877 case ACPI_TYPE_LOCAL_BANK_FIELD:
878 case ACPI_TYPE_LOCAL_INDEX_FIELD:
879
880 acpi_ex_out_integer ("field_flags", obj_desc->common_field.field_flags);
881 acpi_ex_out_integer ("access_byte_width",obj_desc->common_field.access_byte_width);
882 acpi_ex_out_integer ("bit_length", obj_desc->common_field.bit_length);
883 acpi_ex_out_integer ("fld_bit_offset", obj_desc->common_field.start_field_bit_offset);
884 acpi_ex_out_integer ("base_byte_offset", obj_desc->common_field.base_byte_offset);
885 acpi_ex_out_pointer ("parent_node", obj_desc->common_field.node);
886
887 switch (ACPI_GET_OBJECT_TYPE (obj_desc)) {
888 case ACPI_TYPE_BUFFER_FIELD:
889 acpi_ex_out_pointer ("buffer_obj", obj_desc->buffer_field.buffer_obj);
890 break;
891
892 case ACPI_TYPE_LOCAL_REGION_FIELD:
893 acpi_ex_out_pointer ("region_obj", obj_desc->field.region_obj);
894 break;
895
896 case ACPI_TYPE_LOCAL_BANK_FIELD:
897 acpi_ex_out_integer ("Value", obj_desc->bank_field.value);
898 acpi_ex_out_pointer ("region_obj", obj_desc->bank_field.region_obj);
899 acpi_ex_out_pointer ("bank_obj", obj_desc->bank_field.bank_obj);
900 break;
901
902 case ACPI_TYPE_LOCAL_INDEX_FIELD:
903 acpi_ex_out_integer ("Value", obj_desc->index_field.value);
904 acpi_ex_out_pointer ("Index", obj_desc->index_field.index_obj);
905 acpi_ex_out_pointer ("Data", obj_desc->index_field.data_obj);
906 break;
907
908 default:
909 /* All object types covered above */
910 break;
911 }
912 break;
913
914
915 case ACPI_TYPE_LOCAL_REFERENCE:
916
917 acpi_ex_out_integer ("target_type", obj_desc->reference.target_type);
918 acpi_ex_out_string ("Opcode", (acpi_ps_get_opcode_info (
919 obj_desc->reference.opcode))->name);
920 acpi_ex_out_integer ("Offset", obj_desc->reference.offset);
921 acpi_ex_out_pointer ("obj_desc", obj_desc->reference.object);
922 acpi_ex_out_pointer ("Node", obj_desc->reference.node);
923 acpi_ex_out_pointer ("Where", obj_desc->reference.where);
924
925 acpi_ex_dump_reference (obj_desc);
926 break;
927
928
929 case ACPI_TYPE_LOCAL_ADDRESS_HANDLER:
930
931 acpi_ex_out_integer ("space_id", obj_desc->address_space.space_id);
932 acpi_ex_out_pointer ("Next", obj_desc->address_space.next);
933 acpi_ex_out_pointer ("region_list", obj_desc->address_space.region_list);
934 acpi_ex_out_pointer ("Node", obj_desc->address_space.node);
935 acpi_ex_out_pointer ("Context", obj_desc->address_space.context);
936 break;
937
938
939 case ACPI_TYPE_LOCAL_NOTIFY:
940
941 acpi_ex_out_pointer ("Node", obj_desc->notify.node);
942 acpi_ex_out_pointer ("Context", obj_desc->notify.context);
943 break;
944
945
946 case ACPI_TYPE_LOCAL_ALIAS:
947 case ACPI_TYPE_LOCAL_METHOD_ALIAS:
948 case ACPI_TYPE_LOCAL_EXTRA:
949 case ACPI_TYPE_LOCAL_DATA:
950 default:
951
952 acpi_os_printf (
953 "ex_dump_object_descriptor: Display not implemented for object type %s\n",
954 acpi_ut_get_object_type_name (obj_desc));
955 break;
956 }
957
958 return_VOID;
959 }
960
961 #endif /* ACPI_FUTURE_USAGE */
962 #endif
963
This page took 0.052756 seconds and 6 git commands to generate.