dbdisply.c revision 114237
167754Smsmith/*******************************************************************************
267754Smsmith *
367754Smsmith * Module Name: dbdisply - debug display commands
4114237Snjl *              $Revision: 89 $
567754Smsmith *
667754Smsmith ******************************************************************************/
767754Smsmith
867754Smsmith/******************************************************************************
967754Smsmith *
1067754Smsmith * 1. Copyright Notice
1167754Smsmith *
12114237Snjl * Some or all of this work - Copyright (c) 1999 - 2003, Intel Corp.
1370243Smsmith * All rights reserved.
1467754Smsmith *
1567754Smsmith * 2. License
1667754Smsmith *
1767754Smsmith * 2.1. This is your license from Intel Corp. under its intellectual property
1867754Smsmith * rights.  You may have additional license terms from the party that provided
1967754Smsmith * you this software, covering your right to use that party's intellectual
2067754Smsmith * property rights.
2167754Smsmith *
2267754Smsmith * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
2367754Smsmith * copy of the source code appearing in this file ("Covered Code") an
2467754Smsmith * irrevocable, perpetual, worldwide license under Intel's copyrights in the
2567754Smsmith * base code distributed originally by Intel ("Original Intel Code") to copy,
2667754Smsmith * make derivatives, distribute, use and display any portion of the Covered
2767754Smsmith * Code in any form, with the right to sublicense such rights; and
2867754Smsmith *
2967754Smsmith * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
3067754Smsmith * license (with the right to sublicense), under only those claims of Intel
3167754Smsmith * patents that are infringed by the Original Intel Code, to make, use, sell,
3267754Smsmith * offer to sell, and import the Covered Code and derivative works thereof
3367754Smsmith * solely to the minimum extent necessary to exercise the above copyright
3467754Smsmith * license, and in no event shall the patent license extend to any additions
3567754Smsmith * to or modifications of the Original Intel Code.  No other license or right
3667754Smsmith * is granted directly or by implication, estoppel or otherwise;
3767754Smsmith *
3867754Smsmith * The above copyright and patent license is granted only if the following
3967754Smsmith * conditions are met:
4067754Smsmith *
4167754Smsmith * 3. Conditions
4267754Smsmith *
4367754Smsmith * 3.1. Redistribution of Source with Rights to Further Distribute Source.
4467754Smsmith * Redistribution of source code of any substantial portion of the Covered
4567754Smsmith * Code or modification with rights to further distribute source must include
4667754Smsmith * the above Copyright Notice, the above License, this list of Conditions,
4767754Smsmith * and the following Disclaimer and Export Compliance provision.  In addition,
4867754Smsmith * Licensee must cause all Covered Code to which Licensee contributes to
4967754Smsmith * contain a file documenting the changes Licensee made to create that Covered
5067754Smsmith * Code and the date of any change.  Licensee must include in that file the
5167754Smsmith * documentation of any changes made by any predecessor Licensee.  Licensee
5267754Smsmith * must include a prominent statement that the modification is derived,
5367754Smsmith * directly or indirectly, from Original Intel Code.
5467754Smsmith *
5567754Smsmith * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
5667754Smsmith * Redistribution of source code of any substantial portion of the Covered
5767754Smsmith * Code or modification without rights to further distribute source must
5867754Smsmith * include the following Disclaimer and Export Compliance provision in the
5967754Smsmith * documentation and/or other materials provided with distribution.  In
6067754Smsmith * addition, Licensee may not authorize further sublicense of source of any
6167754Smsmith * portion of the Covered Code, and must include terms to the effect that the
6267754Smsmith * license from Licensee to its licensee is limited to the intellectual
6367754Smsmith * property embodied in the software Licensee provides to its licensee, and
6467754Smsmith * not to intellectual property embodied in modifications its licensee may
6567754Smsmith * make.
6667754Smsmith *
6767754Smsmith * 3.3. Redistribution of Executable. Redistribution in executable form of any
6867754Smsmith * substantial portion of the Covered Code or modification must reproduce the
6967754Smsmith * above Copyright Notice, and the following Disclaimer and Export Compliance
7067754Smsmith * provision in the documentation and/or other materials provided with the
7167754Smsmith * distribution.
7267754Smsmith *
7367754Smsmith * 3.4. Intel retains all right, title, and interest in and to the Original
7467754Smsmith * Intel Code.
7567754Smsmith *
7667754Smsmith * 3.5. Neither the name Intel nor any other trademark owned or controlled by
7767754Smsmith * Intel shall be used in advertising or otherwise to promote the sale, use or
7867754Smsmith * other dealings in products derived from or relating to the Covered Code
7967754Smsmith * without prior written authorization from Intel.
8067754Smsmith *
8167754Smsmith * 4. Disclaimer and Export Compliance
8267754Smsmith *
8367754Smsmith * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
8467754Smsmith * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
8567754Smsmith * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
8667754Smsmith * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
8767754Smsmith * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
8867754Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
8967754Smsmith * PARTICULAR PURPOSE.
9067754Smsmith *
9167754Smsmith * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
9267754Smsmith * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
9367754Smsmith * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
9467754Smsmith * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
9567754Smsmith * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
9667754Smsmith * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
9767754Smsmith * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
9867754Smsmith * LIMITED REMEDY.
9967754Smsmith *
10067754Smsmith * 4.3. Licensee shall not export, either directly or indirectly, any of this
10167754Smsmith * software or system incorporating such software without first obtaining any
10267754Smsmith * required license or other approval from the U. S. Department of Commerce or
10367754Smsmith * any other agency or department of the United States Government.  In the
10467754Smsmith * event Licensee exports any such software from the United States or
10567754Smsmith * re-exports any such software from a foreign destination, Licensee shall
10667754Smsmith * ensure that the distribution and export/re-export of the software is in
10767754Smsmith * compliance with all laws, regulations, orders, or other restrictions of the
10867754Smsmith * U.S. Export Administration Regulations. Licensee agrees that neither it nor
10967754Smsmith * any of its subsidiaries will export/re-export any technical data, process,
11067754Smsmith * software, or service, directly or indirectly, to any country for which the
11167754Smsmith * United States government or any agency thereof requires an export license,
11267754Smsmith * other governmental approval, or letter of assurance, without first obtaining
11367754Smsmith * such license, approval or letter.
11467754Smsmith *
11567754Smsmith *****************************************************************************/
11667754Smsmith
11767754Smsmith
11867754Smsmith#include "acpi.h"
11967754Smsmith#include "amlcode.h"
12067754Smsmith#include "acdispat.h"
12167754Smsmith#include "acnamesp.h"
12267754Smsmith#include "acparser.h"
12367754Smsmith#include "acinterp.h"
12467754Smsmith#include "acdebug.h"
12567754Smsmith
12667754Smsmith
127102550Siwasaki#ifdef ACPI_DEBUGGER
12867754Smsmith
12967754Smsmith
130102550Siwasaki#define _COMPONENT          ACPI_CA_DEBUGGER
13191116Smsmith        ACPI_MODULE_NAME    ("dbdisply")
13267754Smsmith
13367754Smsmith
13467754Smsmith/******************************************************************************
13567754Smsmith *
13667754Smsmith * FUNCTION:    AcpiDbGetPointer
13767754Smsmith *
13867754Smsmith * PARAMETERS:  Target          - Pointer to string to be converted
13967754Smsmith *
14067754Smsmith * RETURN:      Converted pointer
14167754Smsmith *
14267754Smsmith * DESCRIPTION: Convert an ascii pointer value to a real value
14367754Smsmith *
14467754Smsmith *****************************************************************************/
14567754Smsmith
14667754Smsmithvoid *
14767754SmsmithAcpiDbGetPointer (
14867754Smsmith    void                    *Target)
14967754Smsmith{
15067754Smsmith    void                    *ObjPtr;
15167754Smsmith
15267754Smsmith
15399679Siwasaki#if ACPI_MACHINE_WIDTH == 16
15467754Smsmith#include <stdio.h>
15567754Smsmith
15667754Smsmith    /* Have to handle 16-bit pointers of the form segment:offset */
15767754Smsmith
15867754Smsmith    if (!sscanf (Target, "%p", &ObjPtr))
15967754Smsmith    {
16067754Smsmith        AcpiOsPrintf ("Invalid pointer: %s\n", Target);
16167754Smsmith        return (NULL);
16267754Smsmith    }
16367754Smsmith
16467754Smsmith#else
16567754Smsmith
16667754Smsmith    /* Simple flat pointer */
16767754Smsmith
16891116Smsmith    ObjPtr = ACPI_TO_POINTER (ACPI_STRTOUL (Target, NULL, 16));
16967754Smsmith#endif
17067754Smsmith
17167754Smsmith    return (ObjPtr);
17267754Smsmith}
17367754Smsmith
17467754Smsmith
17567754Smsmith/*******************************************************************************
17667754Smsmith *
17767754Smsmith * FUNCTION:    AcpiDbDumpParserDescriptor
17867754Smsmith *
17967754Smsmith * PARAMETERS:  Op              - A parser Op descriptor
18067754Smsmith *
18167754Smsmith * RETURN:      None
18267754Smsmith *
18367754Smsmith * DESCRIPTION: Display a formatted parser object
18467754Smsmith *
18567754Smsmith ******************************************************************************/
18667754Smsmith
18767754Smsmithvoid
18867754SmsmithAcpiDbDumpParserDescriptor (
18967754Smsmith    ACPI_PARSE_OBJECT       *Op)
19067754Smsmith{
19183174Smsmith    const ACPI_OPCODE_INFO  *Info;
19267754Smsmith
19367754Smsmith
19499679Siwasaki    Info = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
19567754Smsmith
19667754Smsmith    AcpiOsPrintf ("Parser Op Descriptor:\n");
19799679Siwasaki    AcpiOsPrintf ("%20.20s : %4.4X\n", "Opcode", Op->Common.AmlOpcode);
19867754Smsmith
19991116Smsmith    ACPI_DEBUG_ONLY_MEMBERS (AcpiOsPrintf ("%20.20s : %s\n", "Opcode Name", Info->Name));
20067754Smsmith
20199679Siwasaki    AcpiOsPrintf ("%20.20s : %p\n", "Value/ArgList", Op->Common.Value.Arg);
20299679Siwasaki    AcpiOsPrintf ("%20.20s : %p\n", "Parent", Op->Common.Parent);
20399679Siwasaki    AcpiOsPrintf ("%20.20s : %p\n", "NextOp", Op->Common.Next);
20467754Smsmith}
20567754Smsmith
20667754Smsmith
20767754Smsmith/*******************************************************************************
20867754Smsmith *
20967754Smsmith * FUNCTION:    AcpiDbDecodeAndDisplayObject
21067754Smsmith *
21167754Smsmith * PARAMETERS:  Target          - String with object to be displayed.  Names
21267754Smsmith *                                and hex pointers are supported.
21367754Smsmith *              OutputType      - Byte, Word, Dword, or Qword (B|W|D|Q)
21467754Smsmith *
21567754Smsmith * RETURN:      None
21667754Smsmith *
21767754Smsmith * DESCRIPTION: Display a formatted ACPI object
21867754Smsmith *
21967754Smsmith ******************************************************************************/
22067754Smsmith
22167754Smsmithvoid
22267754SmsmithAcpiDbDecodeAndDisplayObject (
223114237Snjl    char                    *Target,
224114237Snjl    char                    *OutputType)
22567754Smsmith{
22667754Smsmith    void                    *ObjPtr;
22767754Smsmith    ACPI_NAMESPACE_NODE     *Node;
22887031Smsmith    ACPI_OPERAND_OBJECT     *ObjDesc;
22967754Smsmith    UINT32                  Display = DB_BYTE_DISPLAY;
230114237Snjl    char                    Buffer[80];
23167754Smsmith    ACPI_BUFFER             RetBuf;
23267754Smsmith    ACPI_STATUS             Status;
23367754Smsmith    UINT32                  Size;
23467754Smsmith
23567754Smsmith
23667754Smsmith    if (!Target)
23767754Smsmith    {
23867754Smsmith        return;
23967754Smsmith    }
24067754Smsmith
24167754Smsmith    /* Decode the output type */
24267754Smsmith
24367754Smsmith    if (OutputType)
24467754Smsmith    {
24591116Smsmith        ACPI_STRUPR (OutputType);
24667754Smsmith        if (OutputType[0] == 'W')
24767754Smsmith        {
24867754Smsmith            Display = DB_WORD_DISPLAY;
24967754Smsmith        }
25067754Smsmith        else if (OutputType[0] == 'D')
25167754Smsmith        {
25267754Smsmith            Display = DB_DWORD_DISPLAY;
25367754Smsmith        }
25467754Smsmith        else if (OutputType[0] == 'Q')
25567754Smsmith        {
25667754Smsmith            Display = DB_QWORD_DISPLAY;
25767754Smsmith        }
25867754Smsmith    }
25967754Smsmith
26067754Smsmith    RetBuf.Length = sizeof (Buffer);
26167754Smsmith    RetBuf.Pointer = Buffer;
26267754Smsmith
26367754Smsmith    /* Differentiate between a number and a name */
26467754Smsmith
26567754Smsmith    if ((Target[0] >= 0x30) && (Target[0] <= 0x39))
26667754Smsmith    {
26767754Smsmith        ObjPtr = AcpiDbGetPointer (Target);
26867754Smsmith        if (!AcpiOsReadable (ObjPtr, 16))
26967754Smsmith        {
27067754Smsmith            AcpiOsPrintf ("Address %p is invalid in this address space\n", ObjPtr);
27167754Smsmith            return;
27267754Smsmith        }
27367754Smsmith
27467754Smsmith        /* Decode the object type */
27567754Smsmith
27691116Smsmith        switch (ACPI_GET_DESCRIPTOR_TYPE (ObjPtr))
27767754Smsmith        {
27891116Smsmith        case ACPI_DESC_TYPE_NAMED:
27967754Smsmith
28091116Smsmith            /* This is a namespace Node */
28191116Smsmith
28267754Smsmith            if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_NAMESPACE_NODE)))
28367754Smsmith            {
28467754Smsmith                AcpiOsPrintf ("Cannot read entire Named object at address %p\n", ObjPtr);
28567754Smsmith                return;
28667754Smsmith            }
28767754Smsmith
28867754Smsmith            Node = ObjPtr;
28967754Smsmith            goto DumpNte;
29067754Smsmith
29167754Smsmith
29299679Siwasaki        case ACPI_DESC_TYPE_OPERAND:
29391116Smsmith
29491116Smsmith            /* This is a ACPI OPERAND OBJECT */
29591116Smsmith
29667754Smsmith            if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_OPERAND_OBJECT)))
29767754Smsmith            {
29867754Smsmith                AcpiOsPrintf ("Cannot read entire ACPI object at address %p\n", ObjPtr);
29967754Smsmith                return;
30067754Smsmith            }
30167754Smsmith
30277424Smsmith            AcpiUtDumpBuffer (ObjPtr, sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX);
30377424Smsmith            AcpiExDumpObjectDescriptor (ObjPtr, 1);
30491116Smsmith            break;
30567754Smsmith
30667754Smsmith
30791116Smsmith        case ACPI_DESC_TYPE_PARSER:
30891116Smsmith
30991116Smsmith            /* This is a Parser Op object */
31091116Smsmith
31167754Smsmith            if (!AcpiOsReadable (ObjPtr, sizeof (ACPI_PARSE_OBJECT)))
31267754Smsmith            {
31367754Smsmith                AcpiOsPrintf ("Cannot read entire Parser object at address %p\n", ObjPtr);
31467754Smsmith                return;
31567754Smsmith            }
31667754Smsmith
31777424Smsmith            AcpiUtDumpBuffer (ObjPtr, sizeof (ACPI_PARSE_OBJECT), Display, ACPI_UINT32_MAX);
31867754Smsmith            AcpiDbDumpParserDescriptor ((ACPI_PARSE_OBJECT *) ObjPtr);
31991116Smsmith            break;
32067754Smsmith
32191116Smsmith
32291116Smsmith        default:
32391116Smsmith
32491116Smsmith            /* Is not a recognizeable object */
32591116Smsmith
32667754Smsmith            Size = 16;
32767754Smsmith            if (AcpiOsReadable (ObjPtr, 64))
32867754Smsmith            {
32967754Smsmith                Size = 64;
33067754Smsmith            }
33167754Smsmith
33267754Smsmith            /* Just dump some memory */
33367754Smsmith
33477424Smsmith            AcpiUtDumpBuffer (ObjPtr, Size, Display, ACPI_UINT32_MAX);
33591116Smsmith            break;
33667754Smsmith        }
33767754Smsmith
33867754Smsmith        return;
33967754Smsmith    }
34067754Smsmith
34167754Smsmith    /* The parameter is a name string that must be resolved to a Named obj */
34267754Smsmith
34367754Smsmith    Node = AcpiDbLocalNsLookup (Target);
34467754Smsmith    if (!Node)
34567754Smsmith    {
34667754Smsmith        return;
34767754Smsmith    }
34867754Smsmith
34967754Smsmith
35067754SmsmithDumpNte:
35167754Smsmith    /* Now dump the Named obj */
35267754Smsmith
35367754Smsmith    Status = AcpiGetName (Node, ACPI_FULL_PATHNAME, &RetBuf);
35467754Smsmith    if (ACPI_FAILURE (Status))
35567754Smsmith    {
35667754Smsmith        AcpiOsPrintf ("Could not convert name to pathname\n");
35767754Smsmith    }
35867754Smsmith
35969746Smsmith    else
36069746Smsmith    {
361104470Siwasaki        AcpiOsPrintf ("Object (%p) Pathname:  %s\n", Node, (char *) RetBuf.Pointer);
36269746Smsmith    }
36369746Smsmith
36467754Smsmith    if (!AcpiOsReadable (Node, sizeof (ACPI_NAMESPACE_NODE)))
36567754Smsmith    {
36667754Smsmith        AcpiOsPrintf ("Invalid Named object at address %p\n", Node);
36767754Smsmith        return;
36867754Smsmith    }
36967754Smsmith
37077424Smsmith    AcpiUtDumpBuffer ((void *) Node, sizeof (ACPI_NAMESPACE_NODE), Display, ACPI_UINT32_MAX);
37177424Smsmith    AcpiExDumpNode (Node, 1);
37267754Smsmith
37387031Smsmith    ObjDesc = AcpiNsGetAttachedObject (Node);
37487031Smsmith    if (ObjDesc)
37567754Smsmith    {
37687031Smsmith        AcpiOsPrintf ("\nAttached Object (%p):\n", ObjDesc);
37787031Smsmith        if (!AcpiOsReadable (ObjDesc, sizeof (ACPI_OPERAND_OBJECT)))
37867754Smsmith        {
37987031Smsmith            AcpiOsPrintf ("Invalid internal ACPI Object at address %p\n", ObjDesc);
38067754Smsmith            return;
38167754Smsmith        }
38267754Smsmith
38387031Smsmith        AcpiUtDumpBuffer ((void *) ObjDesc, sizeof (ACPI_OPERAND_OBJECT), Display, ACPI_UINT32_MAX);
38487031Smsmith        AcpiExDumpObjectDescriptor (ObjDesc, 1);
38567754Smsmith    }
38667754Smsmith}
38767754Smsmith
38867754Smsmith
38967754Smsmith/*******************************************************************************
39067754Smsmith *
39167754Smsmith * FUNCTION:    AcpiDbDecodeInternalObject
39267754Smsmith *
39367754Smsmith * PARAMETERS:  ObjDesc         - Object to be displayed
39467754Smsmith *
39567754Smsmith * RETURN:      None
39667754Smsmith *
39767754Smsmith * DESCRIPTION: Short display of an internal object.  Numbers and Strings.
39867754Smsmith *
39967754Smsmith ******************************************************************************/
40067754Smsmith
40167754Smsmithvoid
40267754SmsmithAcpiDbDecodeInternalObject (
40367754Smsmith    ACPI_OPERAND_OBJECT     *ObjDesc)
40467754Smsmith{
40571867Smsmith    UINT32                  i;
40667754Smsmith
40771867Smsmith
40867754Smsmith    if (!ObjDesc)
40967754Smsmith    {
410104470Siwasaki        AcpiOsPrintf (" Uninitialized");
41167754Smsmith        return;
41267754Smsmith    }
41367754Smsmith
414100966Siwasaki    if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)
415100966Siwasaki    {
416107325Siwasaki        AcpiOsPrintf (" %p", ObjDesc);
417100966Siwasaki        return;
418100966Siwasaki    }
419100966Siwasaki
42099679Siwasaki    AcpiOsPrintf (" %s", AcpiUtGetObjectTypeName (ObjDesc));
42167754Smsmith
42299679Siwasaki    switch (ACPI_GET_OBJECT_TYPE (ObjDesc))
42367754Smsmith    {
42471867Smsmith    case ACPI_TYPE_INTEGER:
42582367Smsmith
42699679Siwasaki        AcpiOsPrintf (" %8.8X%8.8X", ACPI_HIDWORD (ObjDesc->Integer.Value),
42799679Siwasaki                                     ACPI_LODWORD (ObjDesc->Integer.Value));
42867754Smsmith        break;
42967754Smsmith
43082367Smsmith
43167754Smsmith    case ACPI_TYPE_STRING:
43282367Smsmith
43380062Smsmith        AcpiOsPrintf ("(%d) \"%.24s",
43471867Smsmith                ObjDesc->String.Length, ObjDesc->String.Pointer);
43580062Smsmith
43680062Smsmith        if (ObjDesc->String.Length > 24)
43780062Smsmith        {
43883174Smsmith            AcpiOsPrintf ("...");
43980062Smsmith        }
44080062Smsmith        else
44180062Smsmith        {
44280062Smsmith            AcpiOsPrintf ("\"");
44380062Smsmith        }
44467754Smsmith        break;
44571867Smsmith
44682367Smsmith
44771867Smsmith    case ACPI_TYPE_BUFFER:
44882367Smsmith
44971867Smsmith        AcpiOsPrintf ("(%d)", ObjDesc->Buffer.Length);
45071867Smsmith        for (i = 0; (i < 8) && (i < ObjDesc->Buffer.Length); i++)
45171867Smsmith        {
45271867Smsmith            AcpiOsPrintf (" %2.2X", ObjDesc->Buffer.Pointer[i]);
45371867Smsmith        }
45471867Smsmith        break;
45599679Siwasaki
456102550Siwasaki
45799679Siwasaki    default:
458102550Siwasaki
459107325Siwasaki        AcpiOsPrintf (" %p", ObjDesc);
46099679Siwasaki        break;
46167754Smsmith    }
46267754Smsmith}
46367754Smsmith
46467754Smsmith
46567754Smsmith/*******************************************************************************
46667754Smsmith *
467100966Siwasaki * FUNCTION:    AcpiDbDecodeNode
468100966Siwasaki *
469100966Siwasaki * PARAMETERS:  Node        - Object to be displayed
470100966Siwasaki *
471100966Siwasaki * RETURN:      None
472100966Siwasaki *
473100966Siwasaki * DESCRIPTION: Short display of a namespace node
474100966Siwasaki *
475100966Siwasaki ******************************************************************************/
476100966Siwasaki
477100966Siwasakivoid
478100966SiwasakiAcpiDbDecodeNode (
479100966Siwasaki    ACPI_NAMESPACE_NODE     *Node)
480100966Siwasaki{
481100966Siwasaki
482100966Siwasaki
483107325Siwasaki    AcpiOsPrintf ("<Node>            Name %4.4s",
484107325Siwasaki        Node->Name.Ascii);
485100966Siwasaki
486100966Siwasaki    if (Node->Flags & ANOBJ_METHOD_ARG)
487100966Siwasaki    {
488100966Siwasaki        AcpiOsPrintf (" [Method Arg]");
489100966Siwasaki    }
490100966Siwasaki    if (Node->Flags & ANOBJ_METHOD_LOCAL)
491100966Siwasaki    {
492100966Siwasaki        AcpiOsPrintf (" [Method Local]");
493100966Siwasaki    }
494100966Siwasaki
495100966Siwasaki    AcpiDbDecodeInternalObject (AcpiNsGetAttachedObject (Node));
496100966Siwasaki}
497100966Siwasaki
498100966Siwasaki
499100966Siwasaki/*******************************************************************************
500100966Siwasaki *
50167754Smsmith * FUNCTION:    AcpiDbDisplayInternalObject
50267754Smsmith *
50367754Smsmith * PARAMETERS:  ObjDesc         - Object to be displayed
50467754Smsmith *              WalkState       - Current walk state
50567754Smsmith *
50667754Smsmith * RETURN:      None
50767754Smsmith *
50867754Smsmith * DESCRIPTION: Short display of an internal object
50967754Smsmith *
51067754Smsmith ******************************************************************************/
51167754Smsmith
51267754Smsmithvoid
51367754SmsmithAcpiDbDisplayInternalObject (
51467754Smsmith    ACPI_OPERAND_OBJECT     *ObjDesc,
51567754Smsmith    ACPI_WALK_STATE         *WalkState)
51667754Smsmith{
51767754Smsmith    UINT8                   Type;
51867754Smsmith
51967754Smsmith
52067754Smsmith    AcpiOsPrintf ("%p ", ObjDesc);
52167754Smsmith
52267754Smsmith    if (!ObjDesc)
52367754Smsmith    {
52467754Smsmith        AcpiOsPrintf ("<NullObj>\n");
52567754Smsmith        return;
52667754Smsmith    }
52767754Smsmith
52867754Smsmith    /* Decode the object type */
52967754Smsmith
53091116Smsmith    switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))
53167754Smsmith    {
53291116Smsmith    case ACPI_DESC_TYPE_PARSER:
53391116Smsmith
53467754Smsmith        AcpiOsPrintf ("<Parser>  ");
53591116Smsmith        break;
53667754Smsmith
53791116Smsmith
53891116Smsmith    case ACPI_DESC_TYPE_NAMED:
53991116Smsmith
540100966Siwasaki        AcpiDbDecodeNode ((ACPI_NAMESPACE_NODE *) ObjDesc);
54191116Smsmith        break;
54267754Smsmith
54391116Smsmith
54499679Siwasaki    case ACPI_DESC_TYPE_OPERAND:
54591116Smsmith
54699679Siwasaki        Type = ACPI_GET_OBJECT_TYPE (ObjDesc);
547107325Siwasaki        if (Type > ACPI_TYPE_LOCAL_MAX)
54867754Smsmith        {
549104470Siwasaki            AcpiOsPrintf (" Type %X [Invalid Type]", (UINT32) Type);
55067754Smsmith            return;
55167754Smsmith        }
55267754Smsmith
55367754Smsmith        /* Decode the ACPI object type */
55467754Smsmith
55599679Siwasaki        switch (ACPI_GET_OBJECT_TYPE (ObjDesc))
55667754Smsmith        {
557107325Siwasaki        case ACPI_TYPE_LOCAL_REFERENCE:
558100966Siwasaki
55977424Smsmith            switch (ObjDesc->Reference.Opcode)
56067754Smsmith            {
56167754Smsmith            case AML_LOCAL_OP:
562100966Siwasaki
56399146Siwasaki                AcpiOsPrintf ("[Local%d] ", ObjDesc->Reference.Offset);
56467754Smsmith                if (WalkState)
56567754Smsmith                {
56667754Smsmith                    ObjDesc = WalkState->LocalVariables[ObjDesc->Reference.Offset].Object;
56799146Siwasaki                    AcpiOsPrintf ("%p", ObjDesc);
56867754Smsmith                    AcpiDbDecodeInternalObject (ObjDesc);
56967754Smsmith                }
57067754Smsmith                break;
57167754Smsmith
572100966Siwasaki
57367754Smsmith            case AML_ARG_OP:
574100966Siwasaki
57599146Siwasaki                AcpiOsPrintf ("[Arg%d]   ", ObjDesc->Reference.Offset);
57667754Smsmith                if (WalkState)
57767754Smsmith                {
57867754Smsmith                    ObjDesc = WalkState->Arguments[ObjDesc->Reference.Offset].Object;
57999146Siwasaki                    AcpiOsPrintf ("%p", ObjDesc);
58067754Smsmith                    AcpiDbDecodeInternalObject (ObjDesc);
58167754Smsmith                }
58267754Smsmith                break;
58367754Smsmith
584100966Siwasaki
58567754Smsmith            case AML_DEBUG_OP:
586100966Siwasaki
58767754Smsmith                AcpiOsPrintf ("[Debug]  ");
58867754Smsmith                break;
58967754Smsmith
590100966Siwasaki
59167754Smsmith            case AML_INDEX_OP:
592100966Siwasaki
593100966Siwasaki                AcpiOsPrintf ("[Index]          ");
594104470Siwasaki                if (!ObjDesc->Reference.Where)
595104470Siwasaki                {
596104470Siwasaki                    AcpiOsPrintf ("Uninitialized WHERE ptr");
597104470Siwasaki                }
598104470Siwasaki                else
599104470Siwasaki                {
600104470Siwasaki                    AcpiDbDecodeInternalObject (*(ObjDesc->Reference.Where));
601104470Siwasaki                }
60267754Smsmith                break;
60367754Smsmith
604100966Siwasaki
605100966Siwasaki            case AML_REF_OF_OP:
606100966Siwasaki
607104470Siwasaki                AcpiOsPrintf ("[RefOf]          ");
608100966Siwasaki
609100966Siwasaki                /* Reference can be to a Node or an Operand object */
610100966Siwasaki
611100966Siwasaki                switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc->Reference.Object))
612100966Siwasaki                {
613100966Siwasaki                case ACPI_DESC_TYPE_NAMED:
614100966Siwasaki                    AcpiDbDecodeNode (ObjDesc->Reference.Object);
615100966Siwasaki                    break;
616100966Siwasaki
617100966Siwasaki                case ACPI_DESC_TYPE_OPERAND:
618100966Siwasaki                    AcpiDbDecodeInternalObject (ObjDesc->Reference.Object);
619100966Siwasaki                    break;
620100966Siwasaki
621100966Siwasaki                default:
622100966Siwasaki                    break;
623100966Siwasaki                }
624100966Siwasaki                break;
625100966Siwasaki
626100966Siwasaki
62767754Smsmith            default:
628100966Siwasaki
629102550Siwasaki                AcpiOsPrintf ("Unknown Reference opcode %X\n",
63099679Siwasaki                    ObjDesc->Reference.Opcode);
63167754Smsmith                break;
63267754Smsmith            }
63367754Smsmith            break;
63467754Smsmith
63567754Smsmith        default:
636100966Siwasaki
63784491Smsmith            AcpiOsPrintf ("<Obj> ");
63871867Smsmith            AcpiOsPrintf ("           ");
63967754Smsmith            AcpiDbDecodeInternalObject (ObjDesc);
64067754Smsmith            break;
64167754Smsmith        }
64291116Smsmith        break;
64367754Smsmith
64491116Smsmith
64591116Smsmith    default:
64691116Smsmith
64767754Smsmith        AcpiOsPrintf ("<Not a valid ACPI Object Descriptor> ");
64891116Smsmith        break;
64967754Smsmith    }
65067754Smsmith
65167754Smsmith    AcpiOsPrintf ("\n");
65267754Smsmith}
65367754Smsmith
65467754Smsmith
65567754Smsmith/*******************************************************************************
65667754Smsmith *
65767754Smsmith * FUNCTION:    AcpiDbDisplayMethodInfo
65867754Smsmith *
65967754Smsmith * PARAMETERS:  StartOp         - Root of the control method parse tree
66067754Smsmith *
66167754Smsmith * RETURN:      None
66267754Smsmith *
66367754Smsmith * DESCRIPTION: Display information about the current method
66467754Smsmith *
66567754Smsmith ******************************************************************************/
66667754Smsmith
66767754Smsmithvoid
66867754SmsmithAcpiDbDisplayMethodInfo (
66967754Smsmith    ACPI_PARSE_OBJECT       *StartOp)
67067754Smsmith{
67167754Smsmith    ACPI_WALK_STATE         *WalkState;
67267754Smsmith    ACPI_OPERAND_OBJECT     *ObjDesc;
67367754Smsmith    ACPI_NAMESPACE_NODE     *Node;
67467754Smsmith    ACPI_PARSE_OBJECT       *RootOp;
67567754Smsmith    ACPI_PARSE_OBJECT       *Op;
67683174Smsmith    const ACPI_OPCODE_INFO  *OpInfo;
67767754Smsmith    UINT32                  NumOps = 0;
67867754Smsmith    UINT32                  NumOperands = 0;
67967754Smsmith    UINT32                  NumOperators = 0;
68067754Smsmith    UINT32                  NumRemainingOps = 0;
68167754Smsmith    UINT32                  NumRemainingOperands = 0;
68267754Smsmith    UINT32                  NumRemainingOperators = 0;
68367754Smsmith    UINT32                  NumArgs;
68467754Smsmith    UINT32                  Concurrency;
68567754Smsmith    BOOLEAN                 CountRemaining = FALSE;
68667754Smsmith
68767754Smsmith
68867754Smsmith    WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
68967754Smsmith    if (!WalkState)
69067754Smsmith    {
69167754Smsmith        AcpiOsPrintf ("There is no method currently executing\n");
69267754Smsmith        return;
69367754Smsmith    }
69467754Smsmith
69567754Smsmith    ObjDesc = WalkState->MethodDesc;
69687031Smsmith    Node    = WalkState->MethodNode;
69767754Smsmith
69887031Smsmith    NumArgs     = ObjDesc->Method.ParamCount;
69967754Smsmith    Concurrency = ObjDesc->Method.Concurrency;
70067754Smsmith
70199679Siwasaki    AcpiOsPrintf ("Currently executing control method is [%4.4s]\n", Node->Name.Ascii);
70269746Smsmith    AcpiOsPrintf ("%X arguments, max concurrency = %X\n", NumArgs, Concurrency);
70367754Smsmith
70467754Smsmith
70567754Smsmith    RootOp = StartOp;
70699679Siwasaki    while (RootOp->Common.Parent)
70767754Smsmith    {
70899679Siwasaki        RootOp = RootOp->Common.Parent;
70967754Smsmith    }
71067754Smsmith
71167754Smsmith    Op = RootOp;
71267754Smsmith
71367754Smsmith    while (Op)
71467754Smsmith    {
71567754Smsmith        if (Op == StartOp)
71667754Smsmith        {
71767754Smsmith            CountRemaining = TRUE;
71867754Smsmith        }
71967754Smsmith
72067754Smsmith        NumOps++;
72167754Smsmith        if (CountRemaining)
72267754Smsmith        {
72367754Smsmith            NumRemainingOps++;
72467754Smsmith        }
72567754Smsmith
72667754Smsmith        /* Decode the opcode */
72767754Smsmith
72899679Siwasaki        OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
72985756Smsmith        switch (OpInfo->Class)
73067754Smsmith        {
73185756Smsmith        case AML_CLASS_ARGUMENT:
73267754Smsmith            if (CountRemaining)
73367754Smsmith            {
73467754Smsmith                NumRemainingOperands++;
73567754Smsmith            }
73667754Smsmith
73767754Smsmith            NumOperands++;
73867754Smsmith            break;
73967754Smsmith
74085756Smsmith        case AML_CLASS_UNKNOWN:
74185756Smsmith            /* Bad opcode or ASCII character */
74285756Smsmith
74385756Smsmith            continue;
74485756Smsmith
74567754Smsmith        default:
74667754Smsmith            if (CountRemaining)
74767754Smsmith            {
74867754Smsmith                NumRemainingOperators++;
74967754Smsmith            }
75067754Smsmith
75167754Smsmith            NumOperators++;
75267754Smsmith            break;
75367754Smsmith        }
75467754Smsmith
75567754Smsmith        Op = AcpiPsGetDepthNext (StartOp, Op);
75667754Smsmith    }
75767754Smsmith
75869746Smsmith    AcpiOsPrintf ("Method contains:       %X AML Opcodes - %X Operators, %X Operands\n",
75967754Smsmith                NumOps, NumOperators, NumOperands);
76067754Smsmith
76169746Smsmith    AcpiOsPrintf ("Remaining to execute:  %X AML Opcodes - %X Operators, %X Operands\n",
76267754Smsmith                NumRemainingOps, NumRemainingOperators, NumRemainingOperands);
76367754Smsmith}
76467754Smsmith
76567754Smsmith
76667754Smsmith/*******************************************************************************
76767754Smsmith *
76867754Smsmith * FUNCTION:    AcpiDbDisplayLocals
76967754Smsmith *
77067754Smsmith * PARAMETERS:  None
77167754Smsmith *
77267754Smsmith * RETURN:      None
77367754Smsmith *
77467754Smsmith * DESCRIPTION: Display all locals for the currently running control method
77567754Smsmith *
77667754Smsmith ******************************************************************************/
77767754Smsmith
77867754Smsmithvoid
77967754SmsmithAcpiDbDisplayLocals (void)
78067754Smsmith{
78167754Smsmith    UINT32                  i;
78267754Smsmith    ACPI_WALK_STATE         *WalkState;
78367754Smsmith    ACPI_OPERAND_OBJECT     *ObjDesc;
78467754Smsmith    ACPI_NAMESPACE_NODE     *Node;
78567754Smsmith
78667754Smsmith
78767754Smsmith    WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
78867754Smsmith    if (!WalkState)
78967754Smsmith    {
79067754Smsmith        AcpiOsPrintf ("There is no method currently executing\n");
79167754Smsmith        return;
79267754Smsmith    }
79367754Smsmith
79467754Smsmith    ObjDesc = WalkState->MethodDesc;
79569450Smsmith    Node = WalkState->MethodNode;
796114237Snjl    if (!Node)
797114237Snjl    {
798114237Snjl        AcpiOsPrintf ("No method node (Executing subtree for buffer or opregion)\n");
799114237Snjl        return;
800114237Snjl    }
801114237Snjl
80299679Siwasaki    AcpiOsPrintf ("Local Variables for method [%4.4s]:\n", Node->Name.Ascii);
80367754Smsmith
804114237Snjl    for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++)
80567754Smsmith    {
80667754Smsmith        ObjDesc = WalkState->LocalVariables[i].Object;
80767754Smsmith        AcpiOsPrintf ("Local%d: ", i);
80867754Smsmith        AcpiDbDisplayInternalObject (ObjDesc, WalkState);
80967754Smsmith    }
81067754Smsmith}
81167754Smsmith
81267754Smsmith
81367754Smsmith/*******************************************************************************
81467754Smsmith *
81567754Smsmith * FUNCTION:    AcpiDbDisplayArguments
81667754Smsmith *
81767754Smsmith * PARAMETERS:  None
81867754Smsmith *
81967754Smsmith * RETURN:      None
82067754Smsmith *
82167754Smsmith * DESCRIPTION: Display all arguments for the currently running control method
82267754Smsmith *
82367754Smsmith ******************************************************************************/
82467754Smsmith
82567754Smsmithvoid
82667754SmsmithAcpiDbDisplayArguments (void)
82767754Smsmith{
82867754Smsmith    UINT32                  i;
82967754Smsmith    ACPI_WALK_STATE         *WalkState;
83067754Smsmith    ACPI_OPERAND_OBJECT     *ObjDesc;
83167754Smsmith    UINT32                  NumArgs;
83267754Smsmith    UINT32                  Concurrency;
83367754Smsmith    ACPI_NAMESPACE_NODE     *Node;
83467754Smsmith
83567754Smsmith
83667754Smsmith    WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
83767754Smsmith    if (!WalkState)
83867754Smsmith    {
83967754Smsmith        AcpiOsPrintf ("There is no method currently executing\n");
84067754Smsmith        return;
84167754Smsmith    }
84267754Smsmith
84367754Smsmith    ObjDesc = WalkState->MethodDesc;
84487031Smsmith    Node    = WalkState->MethodNode;
845114237Snjl    if (!Node)
846114237Snjl    {
847114237Snjl        AcpiOsPrintf ("No method node (Executing subtree for buffer or opregion)\n");
848114237Snjl        return;
849114237Snjl    }
85067754Smsmith
85187031Smsmith    NumArgs     = ObjDesc->Method.ParamCount;
85267754Smsmith    Concurrency = ObjDesc->Method.Concurrency;
85367754Smsmith
85487031Smsmith    AcpiOsPrintf ("Method [%4.4s] has %X arguments, max concurrency = %X\n",
85599679Siwasaki            Node->Name.Ascii, NumArgs, Concurrency);
85667754Smsmith
857114237Snjl    for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++)
85867754Smsmith    {
85967754Smsmith        ObjDesc = WalkState->Arguments[i].Object;
86067754Smsmith        AcpiOsPrintf ("Arg%d: ", i);
86167754Smsmith        AcpiDbDisplayInternalObject (ObjDesc, WalkState);
86267754Smsmith    }
86367754Smsmith}
86467754Smsmith
86567754Smsmith
86667754Smsmith/*******************************************************************************
86767754Smsmith *
86867754Smsmith * FUNCTION:    AcpiDbDisplayResults
86967754Smsmith *
87067754Smsmith * PARAMETERS:  None
87167754Smsmith *
87267754Smsmith * RETURN:      None
87367754Smsmith *
87467754Smsmith * DESCRIPTION: Display current contents of a method result stack
87567754Smsmith *
87667754Smsmith ******************************************************************************/
87767754Smsmith
87867754Smsmithvoid
87967754SmsmithAcpiDbDisplayResults (void)
88067754Smsmith{
88167754Smsmith    UINT32                  i;
88267754Smsmith    ACPI_WALK_STATE         *WalkState;
88367754Smsmith    ACPI_OPERAND_OBJECT     *ObjDesc;
88469746Smsmith    UINT32                  NumResults = 0;
88567754Smsmith    ACPI_NAMESPACE_NODE     *Node;
88667754Smsmith
88767754Smsmith
88867754Smsmith    WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
88967754Smsmith    if (!WalkState)
89067754Smsmith    {
89167754Smsmith        AcpiOsPrintf ("There is no method currently executing\n");
89267754Smsmith        return;
89367754Smsmith    }
89467754Smsmith
89567754Smsmith    ObjDesc = WalkState->MethodDesc;
89667754Smsmith    Node = WalkState->MethodNode;
89767754Smsmith
89869746Smsmith    if (WalkState->Results)
89969746Smsmith    {
90069746Smsmith        NumResults = WalkState->Results->Results.NumResults;
90169746Smsmith    }
90267754Smsmith
90387031Smsmith    AcpiOsPrintf ("Method [%4.4s] has %X stacked result objects\n",
90499679Siwasaki        Node->Name.Ascii, NumResults);
90569746Smsmith
90669746Smsmith    for (i = 0; i < NumResults; i++)
90767754Smsmith    {
90869746Smsmith        ObjDesc = WalkState->Results->Results.ObjDesc[i];
90967754Smsmith        AcpiOsPrintf ("Result%d: ", i);
91067754Smsmith        AcpiDbDisplayInternalObject (ObjDesc, WalkState);
91167754Smsmith    }
91267754Smsmith}
91367754Smsmith
91467754Smsmith
91567754Smsmith/*******************************************************************************
91667754Smsmith *
91767754Smsmith * FUNCTION:    AcpiDbDisplayCallingTree
91867754Smsmith *
91967754Smsmith * PARAMETERS:  None
92067754Smsmith *
92167754Smsmith * RETURN:      None
92267754Smsmith *
92367754Smsmith * DESCRIPTION: Display current calling tree of nested control methods
92467754Smsmith *
92567754Smsmith ******************************************************************************/
92667754Smsmith
92767754Smsmithvoid
92867754SmsmithAcpiDbDisplayCallingTree (void)
92967754Smsmith{
93067754Smsmith    ACPI_WALK_STATE         *WalkState;
93167754Smsmith    ACPI_NAMESPACE_NODE     *Node;
93267754Smsmith
93367754Smsmith
93467754Smsmith    WalkState = AcpiDsGetCurrentWalkState (AcpiGbl_CurrentWalkList);
93567754Smsmith    if (!WalkState)
93667754Smsmith    {
93767754Smsmith        AcpiOsPrintf ("There is no method currently executing\n");
93867754Smsmith        return;
93967754Smsmith    }
94067754Smsmith
94169450Smsmith    Node = WalkState->MethodNode;
94267754Smsmith    AcpiOsPrintf ("Current Control Method Call Tree\n");
94367754Smsmith
94499679Siwasaki    while (WalkState)
94567754Smsmith    {
94669450Smsmith        Node = WalkState->MethodNode;
94767754Smsmith
94899679Siwasaki        AcpiOsPrintf ("    [%4.4s]\n", Node->Name.Ascii);
94967754Smsmith
95067754Smsmith        WalkState = WalkState->Next;
95167754Smsmith    }
95267754Smsmith}
95367754Smsmith
95467754Smsmith
95567754Smsmith/*******************************************************************************
95667754Smsmith *
95767754Smsmith * FUNCTION:    AcpiDbDisplayResultObject
95867754Smsmith *
95967754Smsmith * PARAMETERS:  ObjDesc         - Object to be displayed
96067754Smsmith *              WalkState       - Current walk state
96167754Smsmith *
96267754Smsmith * RETURN:      None
96367754Smsmith *
96467754Smsmith * DESCRIPTION: Display the result of an AML opcode
96567754Smsmith *
96691116Smsmith * Note: Curently only displays the result object if we are single stepping.
96791116Smsmith * However, this output may be useful in other contexts and could be enabled
96891116Smsmith * to do so if needed.
96991116Smsmith *
97067754Smsmith ******************************************************************************/
97167754Smsmith
97267754Smsmithvoid
97367754SmsmithAcpiDbDisplayResultObject (
97467754Smsmith    ACPI_OPERAND_OBJECT     *ObjDesc,
97567754Smsmith    ACPI_WALK_STATE         *WalkState)
97667754Smsmith{
97767754Smsmith
97891116Smsmith    /* Only display if single stepping */
97991116Smsmith
98067754Smsmith    if (!AcpiGbl_CmSingleStep)
98167754Smsmith    {
98267754Smsmith        return;
98367754Smsmith    }
98467754Smsmith
98567754Smsmith    AcpiOsPrintf ("ResultObj: ");
98667754Smsmith    AcpiDbDisplayInternalObject (ObjDesc, WalkState);
98767754Smsmith    AcpiOsPrintf ("\n");
98867754Smsmith}
98967754Smsmith
99067754Smsmith
99167754Smsmith/*******************************************************************************
99267754Smsmith *
99367754Smsmith * FUNCTION:    AcpiDbDisplayArgumentObject
99467754Smsmith *
99567754Smsmith * PARAMETERS:  ObjDesc         - Object to be displayed
99667754Smsmith *              WalkState       - Current walk state
99767754Smsmith *
99867754Smsmith * RETURN:      None
99967754Smsmith *
100067754Smsmith * DESCRIPTION: Display the result of an AML opcode
100167754Smsmith *
100267754Smsmith ******************************************************************************/
100367754Smsmith
100467754Smsmithvoid
100567754SmsmithAcpiDbDisplayArgumentObject (
100667754Smsmith    ACPI_OPERAND_OBJECT     *ObjDesc,
100767754Smsmith    ACPI_WALK_STATE         *WalkState)
100867754Smsmith{
100967754Smsmith
101067754Smsmith    if (!AcpiGbl_CmSingleStep)
101167754Smsmith    {
101267754Smsmith        return;
101367754Smsmith    }
101467754Smsmith
101567754Smsmith    AcpiOsPrintf ("ArgObj:    ");
101667754Smsmith    AcpiDbDisplayInternalObject (ObjDesc, WalkState);
101767754Smsmith}
101867754Smsmith
1019114237Snjl
1020114237Snjl/*******************************************************************************
1021114237Snjl *
1022114237Snjl * FUNCTION:    AcpiDbDisplayGpes
1023114237Snjl *
1024114237Snjl * PARAMETERS:
1025114237Snjl *
1026114237Snjl * RETURN:      None
1027114237Snjl *
1028114237Snjl * DESCRIPTION: Display the GPE structures
1029114237Snjl *
1030114237Snjl ******************************************************************************/
1031114237Snjl
1032114237Snjlvoid
1033114237SnjlAcpiDbDisplayGpes (void)
1034114237Snjl{
1035114237Snjl    ACPI_GPE_BLOCK_INFO     *GpeBlock;
1036114237Snjl    UINT32                  i = 0;
1037114237Snjl
1038114237Snjl
1039114237Snjl    GpeBlock = AcpiGbl_GpeBlockListHead;
1040114237Snjl    while (GpeBlock)
1041114237Snjl    {
1042114237Snjl        AcpiOsPrintf ("Block %d - %p\n", i, GpeBlock);
1043114237Snjl        AcpiOsPrintf ("    Registers:    %d\n", GpeBlock->RegisterCount);
1044114237Snjl        AcpiOsPrintf ("    GPE range:    %d to %d\n", GpeBlock->BlockBaseNumber,
1045114237Snjl                        GpeBlock->BlockBaseNumber + (GpeBlock->RegisterCount * 8) -1);
1046114237Snjl        AcpiOsPrintf ("    RegisterInfo: %p\n", GpeBlock->RegisterInfo);
1047114237Snjl        AcpiOsPrintf ("    EventInfo:    %p\n", GpeBlock->EventInfo);
1048114237Snjl        i++;
1049114237Snjl
1050114237Snjl        GpeBlock = GpeBlock->Next;
1051114237Snjl    }
1052114237Snjl}
1053114237Snjl
1054114237Snjl
1055102550Siwasaki#endif /* ACPI_DEBUGGER */
105667754Smsmith
1057