]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/contrib/dev/acpica/dbdisply.c
This commit was generated by cvs2svn to compensate for changes in r159952,
[FreeBSD/FreeBSD.git] / sys / contrib / dev / acpica / dbdisply.c
1 /*******************************************************************************
2  *
3  * Module Name: dbdisply - debug display commands
4  *              $Revision: 1.112 $
5  *
6  ******************************************************************************/
7
8 /******************************************************************************
9  *
10  * 1. Copyright Notice
11  *
12  * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
13  * All rights reserved.
14  *
15  * 2. License
16  *
17  * 2.1. This is your license from Intel Corp. under its intellectual property
18  * rights.  You may have additional license terms from the party that provided
19  * you this software, covering your right to use that party's intellectual
20  * property rights.
21  *
22  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23  * copy of the source code appearing in this file ("Covered Code") an
24  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25  * base code distributed originally by Intel ("Original Intel Code") to copy,
26  * make derivatives, distribute, use and display any portion of the Covered
27  * Code in any form, with the right to sublicense such rights; and
28  *
29  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30  * license (with the right to sublicense), under only those claims of Intel
31  * patents that are infringed by the Original Intel Code, to make, use, sell,
32  * offer to sell, and import the Covered Code and derivative works thereof
33  * solely to the minimum extent necessary to exercise the above copyright
34  * license, and in no event shall the patent license extend to any additions
35  * to or modifications of the Original Intel Code.  No other license or right
36  * is granted directly or by implication, estoppel or otherwise;
37  *
38  * The above copyright and patent license is granted only if the following
39  * conditions are met:
40  *
41  * 3. Conditions
42  *
43  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44  * Redistribution of source code of any substantial portion of the Covered
45  * Code or modification with rights to further distribute source must include
46  * the above Copyright Notice, the above License, this list of Conditions,
47  * and the following Disclaimer and Export Compliance provision.  In addition,
48  * Licensee must cause all Covered Code to which Licensee contributes to
49  * contain a file documenting the changes Licensee made to create that Covered
50  * Code and the date of any change.  Licensee must include in that file the
51  * documentation of any changes made by any predecessor Licensee.  Licensee
52  * must include a prominent statement that the modification is derived,
53  * directly or indirectly, from Original Intel Code.
54  *
55  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56  * Redistribution of source code of any substantial portion of the Covered
57  * Code or modification without rights to further distribute source must
58  * include the following Disclaimer and Export Compliance provision in the
59  * documentation and/or other materials provided with distribution.  In
60  * addition, Licensee may not authorize further sublicense of source of any
61  * portion of the Covered Code, and must include terms to the effect that the
62  * license from Licensee to its licensee is limited to the intellectual
63  * property embodied in the software Licensee provides to its licensee, and
64  * not to intellectual property embodied in modifications its licensee may
65  * make.
66  *
67  * 3.3. Redistribution of Executable. Redistribution in executable form of any
68  * substantial portion of the Covered Code or modification must reproduce the
69  * above Copyright Notice, and the following Disclaimer and Export Compliance
70  * provision in the documentation and/or other materials provided with the
71  * distribution.
72  *
73  * 3.4. Intel retains all right, title, and interest in and to the Original
74  * Intel Code.
75  *
76  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77  * Intel shall be used in advertising or otherwise to promote the sale, use or
78  * other dealings in products derived from or relating to the Covered Code
79  * without prior written authorization from Intel.
80  *
81  * 4. Disclaimer and Export Compliance
82  *
83  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89  * PARTICULAR PURPOSE.
90  *
91  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98  * LIMITED REMEDY.
99  *
100  * 4.3. Licensee shall not export, either directly or indirectly, any of this
101  * software or system incorporating such software without first obtaining any
102  * required license or other approval from the U. S. Department of Commerce or
103  * any other agency or department of the United States Government.  In the
104  * event Licensee exports any such software from the United States or
105  * re-exports any such software from a foreign destination, Licensee shall
106  * ensure that the distribution and export/re-export of the software is in
107  * compliance with all laws, regulations, orders, or other restrictions of the
108  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109  * any of its subsidiaries will export/re-export any technical data, process,
110  * software, or service, directly or indirectly, to any country for which the
111  * United States government or any agency thereof requires an export license,
112  * other governmental approval, or letter of assurance, without first obtaining
113  * such license, approval or letter.
114  *
115  *****************************************************************************/
116
117
118 #include <contrib/dev/acpica/acpi.h>
119 #include <contrib/dev/acpica/amlcode.h>
120 #include <contrib/dev/acpica/acdispat.h>
121 #include <contrib/dev/acpica/acnamesp.h>
122 #include <contrib/dev/acpica/acparser.h>
123 #include <contrib/dev/acpica/acinterp.h>
124 #include <contrib/dev/acpica/acdebug.h>
125 #include <contrib/dev/acpica/acdisasm.h>
126
127
128 #ifdef ACPI_DEBUGGER
129
130 #define _COMPONENT          ACPI_CA_DEBUGGER
131         ACPI_MODULE_NAME    ("dbdisply")
132
133 /* Local prototypes */
134
135 static void
136 AcpiDbDumpParserDescriptor (
137     ACPI_PARSE_OBJECT       *Op);
138
139 static void *
140 AcpiDbGetPointer (
141     void                    *Target);
142
143
144 /*******************************************************************************
145  *
146  * FUNCTION:    AcpiDbGetPointer
147  *
148  * PARAMETERS:  Target          - Pointer to string to be converted
149  *
150  * RETURN:      Converted pointer
151  *
152  * DESCRIPTION: Convert an ascii pointer value to a real value
153  *
154  ******************************************************************************/
155
156 static void *
157 AcpiDbGetPointer (
158     void                    *Target)
159 {
160     void                    *ObjPtr;
161
162
163 #if ACPI_MACHINE_WIDTH == 16
164 #include <stdio.h>
165
166     /* Have to handle 16-bit pointers of the form segment:offset */
167
168     if (!sscanf (Target, "%p", &ObjPtr))
169     {
170         AcpiOsPrintf ("Invalid pointer: %s\n", Target);
171         return (NULL);
172     }
173
174 #else
175
176     /* Simple flat pointer */
177
178     ObjPtr = ACPI_TO_POINTER (ACPI_STRTOUL (Target, NULL, 16));
179 #endif
180
181     return (ObjPtr);
182 }
183
184
185 /*******************************************************************************
186  *
187  * FUNCTION:    AcpiDbDumpParserDescriptor
188  *
189  * PARAMETERS:  Op              - A parser Op descriptor
190  *
191  * RETURN:      None
192  *
193  * DESCRIPTION: Display a formatted parser object
194  *
195  ******************************************************************************/
196
197 static void
198 AcpiDbDumpParserDescriptor (
199     ACPI_PARSE_OBJECT       *Op)
200 {
201     const ACPI_OPCODE_INFO  *Info;
202
203
204     Info = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
205
206     AcpiOsPrintf ("Parser Op Descriptor:\n");
207     AcpiOsPrintf ("%20.20s : %4.4X\n", "Opcode", Op->Common.AmlOpcode);
208
209     ACPI_DEBUG_ONLY_MEMBERS (AcpiOsPrintf ("%20.20s : %s\n", "Opcode Name",
210         Info->Name));
211
212     AcpiOsPrintf ("%20.20s : %p\n", "Value/ArgList", Op->Common.Value.Arg);
213     AcpiOsPrintf ("%20.20s : %p\n", "Parent", Op->Common.Parent);
214     AcpiOsPrintf ("%20.20s : %p\n", "NextOp", Op->Common.Next);
215 }
216
217
218 /*******************************************************************************
219  *
220  * FUNCTION:    AcpiDbDecodeAndDisplayObject
221  *
222  * PARAMETERS:  Target          - String with object to be displayed.  Names
223  *                                and hex pointers are supported.
224  *              OutputType      - Byte, Word, Dword, or Qword (B|W|D|Q)
225  *
226  * RETURN:      None
227  *
228  * DESCRIPTION: Display a formatted ACPI object
229  *
230  ******************************************************************************/
231
232 void
233 AcpiDbDecodeAndDisplayObject (
234     char                    *Target,
235     char                    *OutputType)
236 {
237     void                    *ObjPtr;
238     ACPI_NAMESPACE_NODE     *Node;
239     ACPI_OPERAND_OBJECT     *ObjDesc;
240     UINT32                  Display = DB_BYTE_DISPLAY;
241     char                    Buffer[80];
242     ACPI_BUFFER             RetBuf;
243     ACPI_STATUS             Status;
244     UINT32                  Size;
245
246
247     if (!Target)
248     {
249         return;
250     }
251
252     /* Decode the output type */
253
254     if (OutputType)
255     {
256         AcpiUtStrupr (OutputType);
257         if (OutputType[0] == 'W')
258         {
259             Display = DB_WORD_DISPLAY;
260         }
261         else if (OutputType[0] == 'D')
262         {
263             Display = DB_DWORD_DISPLAY;
264         }
265         else if (OutputType[0] == 'Q')
266         {
267             Display = DB_QWORD_DISPLAY;
268         }
269     }
270
271     RetBuf.Length = sizeof (Buffer);
272     RetBuf.Pointer = Buffer;
273
274     /* Differentiate between a number and a name */
275
276     if ((Target[0] >= 0x30) && (Target[0] <= 0x39))
277     {
278         ObjPtr = AcpiDbGetPointer (Target);
279         if (!AcpiOsReadable (ObjPtr, 16))
280         {
281             AcpiOsPrintf ("Address %p is invalid in this address space\n",
282                 ObjPtr);
283             return;
284         }
285
286         /* Decode the object type */
287
288         switch (ACPI_GET_DESCRIPTOR_TYPE (ObjPtr))
289         {
290         case ACPI_DESC_TYPE_NAMED:
291
292             /* This is a namespace Node */
293
294             if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_NAMESPACE_NODE)))
295             {
296                 AcpiOsPrintf (
297                     "Cannot read entire Named object at address %p\n", ObjPtr);
298                 return;
299             }
300
301             Node = ObjPtr;
302             goto DumpNode;
303
304
305         case ACPI_DESC_TYPE_OPERAND:
306
307             /* This is a ACPI OPERAND OBJECT */
308
309             if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_OPERAND_OBJECT)))
310             {
311                 AcpiOsPrintf ("Cannot read entire ACPI object at address %p\n",
312                     ObjPtr);
313                 return;
314             }
315
316             AcpiUtDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT), Display,
317                 ACPI_UINT32_MAX);
318             AcpiExDumpObjectDescriptor (ObjPtr, 1);
319             break;
320
321
322         case ACPI_DESC_TYPE_PARSER:
323
324             /* This is a Parser Op object */
325
326             if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_PARSE_OBJECT)))
327             {
328                 AcpiOsPrintf (
329                     "Cannot read entire Parser object at address %p\n", ObjPtr);
330                 return;
331             }
332
333             AcpiUtDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), Display,
334                 ACPI_UINT32_MAX);
335             AcpiDbDumpParserDescriptor ((ACPI_PARSE_OBJECT *) ObjPtr);
336             break;
337
338
339         default:
340
341             /* Is not a recognizeable object */
342
343             Size = 16;
344             if (AcpiOsReadable (ObjPtr, 64))
345             {
346                 Size = 64;
347             }
348
349             /* Just dump some memory */
350
351             AcpiUtDumpBuffer (ObjPtr, Size, Display, ACPI_UINT32_MAX);
352             break;
353         }
354
355         return;
356     }
357
358     /* The parameter is a name string that must be resolved to a Named obj */
359
360     Node = AcpiDbLocalNsLookup (Target);
361     if (!Node)
362     {
363         return;
364     }
365
366
367 DumpNode:
368     /* Now dump the NS node */
369
370     Status = AcpiGetName (Node, ACPI_FULL_PATHNAME, &RetBuf);
371     if (ACPI_FAILURE (Status))
372     {
373         AcpiOsPrintf ("Could not convert name to pathname\n");
374     }
375
376     else
377     {
378         AcpiOsPrintf ("Object (%p) Pathname:  %s\n",
379             Node, (char *) RetBuf.Pointer);
380     }
381
382     if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
383     {
384         AcpiOsPrintf ("Invalid Named object at address %p\n", Node);
385         return;
386     }
387
388     AcpiUtDumpBuffer ((void *) Node, sizeof (ACPI_NAMESPACE_NODE),
389         Display, ACPI_UINT32_MAX);
390     AcpiExDumpNode (Node, 1);
391
392     ObjDesc = AcpiNsGetAttachedObject (Node);
393     if (ObjDesc)
394     {
395         AcpiOsPrintf ("\nAttached Object (%p):\n", ObjDesc);
396         if (!AcpiOsReadable (ObjDesc, sizeof (ACPI_OPERAND_OBJECT)))
397         {
398             AcpiOsPrintf ("Invalid internal ACPI Object at address %p\n",
399                 ObjDesc);
400             return;
401         }
402
403         AcpiUtDumpBuffer ((void *) ObjDesc, sizeof (ACPI_OPERAND_OBJECT),
404             Display, ACPI_UINT32_MAX);
405         AcpiExDumpObjectDescriptor (ObjDesc, 1);
406     }
407 }
408
409
410 /*******************************************************************************
411  *
412  * FUNCTION:    AcpiDbDisplayMethodInfo
413  *
414  * PARAMETERS:  StartOp         - Root of the control method parse tree
415  *
416  * RETURN:      None
417  *
418  * DESCRIPTION: Display information about the current method
419  *
420  ******************************************************************************/
421
422 void
423 AcpiDbDisplayMethodInfo (
424     ACPI_PARSE_OBJECT       *StartOp)
425 {
426     ACPI_WALK_STATE         *WalkState;
427     ACPI_OPERAND_OBJECT     *ObjDesc;
428     ACPI_NAMESPACE_NODE     *Node;
429     ACPI_PARSE_OBJECT       *RootOp;
430     ACPI_PARSE_OBJECT       *Op;
431     const ACPI_OPCODE_INFO  *OpInfo;
432     UINT32                  NumOps = 0;
433     UINT32                  NumOperands = 0;
434     UINT32                  NumOperators = 0;
435     UINT32                  NumRemainingOps = 0;
436     UINT32                  NumRemainingOperands = 0;
437     UINT32                  NumRemainingOperators = 0;
438     UINT32                  NumArgs;
439     UINT32                  Concurrency;
440     BOOLEAN                 CountRemaining = FALSE;
441
442
443     WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
444     if (!WalkState)
445     {
446         AcpiOsPrintf ("There is no method currently executing\n");
447         return;
448     }
449
450     ObjDesc = WalkState->MethodDesc;
451     Node    = WalkState->MethodNode;
452
453     NumArgs     = ObjDesc->Method.ParamCount;
454     Concurrency = ObjDesc->Method.Concurrency;
455
456     AcpiOsPrintf ("Currently executing control method is [%4.4s]\n",
457             AcpiUtGetNodeName (Node));
458     AcpiOsPrintf ("%X arguments, max concurrency = %X\n",
459             NumArgs, Concurrency);
460
461
462     RootOp = StartOp;
463     while (RootOp->Common.Parent)
464     {
465         RootOp = RootOp->Common.Parent;
466     }
467
468     Op = RootOp;
469
470     while (Op)
471     {
472         if (Op == StartOp)
473         {
474             CountRemaining = TRUE;
475         }
476
477         NumOps++;
478         if (CountRemaining)
479         {
480             NumRemainingOps++;
481         }
482
483         /* Decode the opcode */
484
485         OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
486         switch (OpInfo->Class)
487         {
488         case AML_CLASS_ARGUMENT:
489             if (CountRemaining)
490             {
491                 NumRemainingOperands++;
492             }
493
494             NumOperands++;
495             break;
496
497         case AML_CLASS_UNKNOWN:
498             /* Bad opcode or ASCII character */
499
500             continue;
501
502         default:
503             if (CountRemaining)
504             {
505                 NumRemainingOperators++;
506             }
507
508             NumOperators++;
509             break;
510         }
511
512         Op = AcpiPsGetDepthNext (StartOp, Op);
513     }
514
515     AcpiOsPrintf (
516         "Method contains:       %X AML Opcodes - %X Operators, %X Operands\n",
517         NumOps, NumOperators, NumOperands);
518
519     AcpiOsPrintf (
520         "Remaining to execute:  %X AML Opcodes - %X Operators, %X Operands\n",
521         NumRemainingOps, NumRemainingOperators, NumRemainingOperands);
522 }
523
524
525 /*******************************************************************************
526  *
527  * FUNCTION:    AcpiDbDisplayLocals
528  *
529  * PARAMETERS:  None
530  *
531  * RETURN:      None
532  *
533  * DESCRIPTION: Display all locals for the currently running control method
534  *
535  ******************************************************************************/
536
537 void
538 AcpiDbDisplayLocals (
539     void)
540 {
541     ACPI_WALK_STATE         *WalkState;
542
543
544     WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
545     if (!WalkState)
546     {
547         AcpiOsPrintf ("There is no method currently executing\n");
548         return;
549     }
550
551     AcpiDmDisplayLocals (WalkState);
552 }
553
554
555 /*******************************************************************************
556  *
557  * FUNCTION:    AcpiDbDisplayArguments
558  *
559  * PARAMETERS:  None
560  *
561  * RETURN:      None
562  *
563  * DESCRIPTION: Display all arguments for the currently running control method
564  *
565  ******************************************************************************/
566
567 void
568 AcpiDbDisplayArguments (
569     void)
570 {
571     ACPI_WALK_STATE         *WalkState;
572
573
574     WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
575     if (!WalkState)
576     {
577         AcpiOsPrintf ("There is no method currently executing\n");
578         return;
579     }
580
581     AcpiDmDisplayArguments (WalkState);
582 }
583
584
585 /*******************************************************************************
586  *
587  * FUNCTION:    AcpiDbDisplayResults
588  *
589  * PARAMETERS:  None
590  *
591  * RETURN:      None
592  *
593  * DESCRIPTION: Display current contents of a method result stack
594  *
595  ******************************************************************************/
596
597 void
598 AcpiDbDisplayResults (
599     void)
600 {
601     UINT32                  i;
602     ACPI_WALK_STATE         *WalkState;
603     ACPI_OPERAND_OBJECT     *ObjDesc;
604     UINT32                  NumResults = 0;
605     ACPI_NAMESPACE_NODE     *Node;
606
607
608     WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
609     if (!WalkState)
610     {
611         AcpiOsPrintf ("There is no method currently executing\n");
612         return;
613     }
614
615     ObjDesc = WalkState->MethodDesc;
616     Node    = WalkState->MethodNode;
617
618     if (WalkState->Results)
619     {
620         NumResults = WalkState->Results->Results.NumResults;
621     }
622
623     AcpiOsPrintf ("Method [%4.4s] has %X stacked result objects\n",
624             AcpiUtGetNodeName (Node), NumResults);
625
626     for (i = 0; i < NumResults; i++)
627     {
628         ObjDesc = WalkState->Results->Results.ObjDesc[i];
629         AcpiOsPrintf ("Result%d: ", i);
630         AcpiDmDisplayInternalObject (ObjDesc, WalkState);
631     }
632 }
633
634
635 /*******************************************************************************
636  *
637  * FUNCTION:    AcpiDbDisplayCallingTree
638  *
639  * PARAMETERS:  None
640  *
641  * RETURN:      None
642  *
643  * DESCRIPTION: Display current calling tree of nested control methods
644  *
645  ******************************************************************************/
646
647 void
648 AcpiDbDisplayCallingTree (
649     void)
650 {
651     ACPI_WALK_STATE         *WalkState;
652     ACPI_NAMESPACE_NODE     *Node;
653
654
655     WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
656     if (!WalkState)
657     {
658         AcpiOsPrintf ("There is no method currently executing\n");
659         return;
660     }
661
662     Node = WalkState->MethodNode;
663     AcpiOsPrintf ("Current Control Method Call Tree\n");
664
665     while (WalkState)
666     {
667         Node = WalkState->MethodNode;
668
669         AcpiOsPrintf ("    [%4.4s]\n", AcpiUtGetNodeName (Node));
670
671         WalkState = WalkState->Next;
672     }
673 }
674
675
676 /*******************************************************************************
677  *
678  * FUNCTION:    AcpiDbDisplayObjectType
679  *
680  * PARAMETERS:  ObjectArg       - User entered NS node handle
681  *
682  * RETURN:      None
683  *
684  * DESCRIPTION: Display type of an arbitrary NS node
685  *
686  ******************************************************************************/
687
688 void
689 AcpiDbDisplayObjectType (
690     char                    *ObjectArg)
691 {
692     ACPI_HANDLE             Handle;
693     ACPI_BUFFER             Buffer;
694     ACPI_DEVICE_INFO        *Info;
695     ACPI_STATUS             Status;
696     ACPI_NATIVE_UINT        i;
697
698
699     Handle = ACPI_TO_POINTER (ACPI_STRTOUL (ObjectArg, NULL, 16));
700     Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
701
702     Status = AcpiGetObjectInfo (Handle, &Buffer);
703     if (ACPI_SUCCESS (Status))
704     {
705         Info = Buffer.Pointer;
706         AcpiOsPrintf (
707             "S1D-%2.2X S2D-%2.2X S3D-%2.2X S4D-%2.2X    HID: %s, ADR: %8.8X%8.8X, Status %8.8X\n",
708             Info->HighestDstates[0], Info->HighestDstates[1],
709             Info->HighestDstates[2], Info->HighestDstates[3],
710             Info->HardwareId.Value,
711             ACPI_FORMAT_UINT64 (Info->Address),
712             Info->CurrentStatus);
713
714         if (Info->Valid & ACPI_VALID_CID)
715         {
716             for (i = 0; i < Info->CompatibilityId.Count; i++)
717             {
718                 AcpiOsPrintf ("CID #%d: %s\n", (UINT32) i,
719                     Info->CompatibilityId.Id[i].Value);
720             }
721         }
722
723         ACPI_MEM_FREE (Info);
724     }
725     else
726     {
727         AcpiOsPrintf ("%s\n", AcpiFormatException (Status));
728     }
729 }
730
731
732 /*******************************************************************************
733  *
734  * FUNCTION:    AcpiDbDisplayResultObject
735  *
736  * PARAMETERS:  ObjDesc         - Object to be displayed
737  *              WalkState       - Current walk state
738  *
739  * RETURN:      None
740  *
741  * DESCRIPTION: Display the result of an AML opcode
742  *
743  * Note: Curently only displays the result object if we are single stepping.
744  * However, this output may be useful in other contexts and could be enabled
745  * to do so if needed.
746  *
747  ******************************************************************************/
748
749 void
750 AcpiDbDisplayResultObject (
751     ACPI_OPERAND_OBJECT     *ObjDesc,
752     ACPI_WALK_STATE         *WalkState)
753 {
754
755     /* Only display if single stepping */
756
757     if (!AcpiGbl_CmSingleStep)
758     {
759         return;
760     }
761
762     AcpiOsPrintf ("ResultObj: ");
763     AcpiDmDisplayInternalObject (ObjDesc, WalkState);
764     AcpiOsPrintf ("\n");
765 }
766
767
768 /*******************************************************************************
769  *
770  * FUNCTION:    AcpiDbDisplayArgumentObject
771  *
772  * PARAMETERS:  ObjDesc         - Object to be displayed
773  *              WalkState       - Current walk state
774  *
775  * RETURN:      None
776  *
777  * DESCRIPTION: Display the result of an AML opcode
778  *
779  ******************************************************************************/
780
781 void
782 AcpiDbDisplayArgumentObject (
783     ACPI_OPERAND_OBJECT     *ObjDesc,
784     ACPI_WALK_STATE         *WalkState)
785 {
786
787     if (!AcpiGbl_CmSingleStep)
788     {
789         return;
790     }
791
792     AcpiOsPrintf ("ArgObj:    ");
793     AcpiDmDisplayInternalObject (ObjDesc, WalkState);
794 }
795
796
797 /*******************************************************************************
798  *
799  * FUNCTION:    AcpiDbDisplayGpes
800  *
801  * PARAMETERS:  None
802  *
803  * RETURN:      None
804  *
805  * DESCRIPTION: Display the current GPE structures
806  *
807  ******************************************************************************/
808
809 void
810 AcpiDbDisplayGpes (
811     void)
812 {
813     ACPI_GPE_BLOCK_INFO     *GpeBlock;
814     ACPI_GPE_XRUPT_INFO     *GpeXruptInfo;
815     ACPI_GPE_EVENT_INFO     *GpeEventInfo;
816     ACPI_GPE_REGISTER_INFO  *GpeRegisterInfo;
817     UINT32                  GpeIndex;
818     UINT32                  Block = 0;
819     UINT32                  i;
820     UINT32                  j;
821     char                    Buffer[80];
822     ACPI_BUFFER             RetBuf;
823     ACPI_STATUS             Status;
824
825
826     RetBuf.Length = sizeof (Buffer);
827     RetBuf.Pointer = Buffer;
828
829     Block = 0;
830
831     /* Walk the GPE lists */
832
833     GpeXruptInfo = AcpiGbl_GpeXruptListHead;
834     while (GpeXruptInfo)
835     {
836         GpeBlock = GpeXruptInfo->GpeBlockListHead;
837         while (GpeBlock)
838         {
839             Status = AcpiGetName (GpeBlock->Node, ACPI_FULL_PATHNAME, &RetBuf);
840             if (ACPI_FAILURE (Status))
841             {
842                 AcpiOsPrintf ("Could not convert name to pathname\n");
843             }
844
845             AcpiOsPrintf ("\nBlock %d - Info %p  DeviceNode %p [%s]\n",
846                 Block, GpeBlock, GpeBlock->Node, Buffer);
847
848             AcpiOsPrintf ("    Registers:    %u (%u GPEs)\n",
849                 GpeBlock->RegisterCount,
850                 ACPI_MUL_8 (GpeBlock->RegisterCount));
851
852             AcpiOsPrintf ("    GPE range:    0x%X to 0x%X\n",
853                 GpeBlock->BlockBaseNumber,
854                 GpeBlock->BlockBaseNumber +
855                     (GpeBlock->RegisterCount * 8) -1);
856
857             AcpiOsPrintf (
858                 "    RegisterInfo: %p  Status %8.8X%8.8X Enable %8.8X%8.8X\n",
859                 GpeBlock->RegisterInfo,
860                 ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (GpeBlock->RegisterInfo->StatusAddress.Address)),
861                 ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (GpeBlock->RegisterInfo->EnableAddress.Address)));
862
863             AcpiOsPrintf ("    EventInfo:    %p\n", GpeBlock->EventInfo);
864
865             /* Examine each GPE Register within the block */
866
867             for (i = 0; i < GpeBlock->RegisterCount; i++)
868             {
869                 GpeRegisterInfo = &GpeBlock->RegisterInfo[i];
870
871                 AcpiOsPrintf (
872                     "    Reg %u:  WakeEnable %2.2X, RunEnable %2.2X  Status %8.8X%8.8X Enable %8.8X%8.8X\n",
873                     i, GpeRegisterInfo->EnableForWake,
874                     GpeRegisterInfo->EnableForRun,
875                     ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (GpeRegisterInfo->StatusAddress.Address)),
876                     ACPI_FORMAT_UINT64 (ACPI_GET_ADDRESS (GpeRegisterInfo->EnableAddress.Address)));
877
878                 /* Now look at the individual GPEs in this byte register */
879
880                 for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++)
881                 {
882                     GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j;
883                     GpeEventInfo = &GpeBlock->EventInfo[GpeIndex];
884
885                     if (!(GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK))
886                     {
887                         /* This GPE is not used (no method or handler) */
888
889                         continue;
890                     }
891
892                     AcpiOsPrintf (
893                         "        GPE %.3X: %p  Bit %2.2X  Flags %2.2X: ",
894                         GpeBlock->BlockBaseNumber + GpeIndex,
895                         GpeEventInfo, GpeEventInfo->RegisterBit,
896                         GpeEventInfo->Flags);
897
898                     if (GpeEventInfo->Flags & ACPI_GPE_LEVEL_TRIGGERED)
899                     {
900                         AcpiOsPrintf ("Level, ");
901                     }
902                     else
903                     {
904                         AcpiOsPrintf ("Edge,  ");
905                     }
906
907                     switch (GpeEventInfo->Flags & ACPI_GPE_TYPE_MASK)
908                     {
909                     case ACPI_GPE_TYPE_WAKE:
910                         AcpiOsPrintf ("WakeOnly: ");
911                         break;
912                     case ACPI_GPE_TYPE_RUNTIME:
913                         AcpiOsPrintf (" RunOnly: ");
914                         break;
915                     case ACPI_GPE_TYPE_WAKE_RUN:
916                         AcpiOsPrintf (" WakeRun: ");
917                         break;
918                     default:
919                         AcpiOsPrintf (" NotUsed: ");
920                         break;
921                     }
922
923                     if (GpeEventInfo->Flags & ACPI_GPE_WAKE_ENABLED)
924                     {
925                         AcpiOsPrintf ("[Wake 1 ");
926                     }
927                     else
928                     {
929                         AcpiOsPrintf ("[Wake 0 ");
930                     }
931
932                     if (GpeEventInfo->Flags & ACPI_GPE_RUN_ENABLED)
933                     {
934                         AcpiOsPrintf ("Run 1], ");
935                     }
936                     else
937                     {
938                         AcpiOsPrintf ("Run 0], ");
939                     }
940
941                     switch (GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK)
942                     {
943                     case ACPI_GPE_DISPATCH_NOT_USED:
944                         AcpiOsPrintf ("NotUsed");
945                         break;
946                     case ACPI_GPE_DISPATCH_HANDLER:
947                         AcpiOsPrintf ("Handler");
948                         break;
949                     case ACPI_GPE_DISPATCH_METHOD:
950                         AcpiOsPrintf ("Method");
951                         break;
952                     default:
953                         AcpiOsPrintf ("UNKNOWN: %X",
954                             GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK);
955                         break;
956                     }
957
958                     AcpiOsPrintf ("\n");
959                 }
960             }
961             Block++;
962             GpeBlock = GpeBlock->Next;
963         }
964         GpeXruptInfo = GpeXruptInfo->Next;
965     }
966 }
967
968 #endif /* ACPI_DEBUGGER */
969