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