Print this page
update to acpica-unix2-20140114
update to acpica-unix2-20130927
acpica-unix2-20130823
PANKOVs restructure
   1 /*******************************************************************************
   2  *
   3  * Module Name: dbnames - Debugger commands for the acpi namespace
   4  *
   5  ******************************************************************************/
   6 
   7 /*
   8  * Copyright (C) 2000 - 2011, Intel Corp.
   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.h"
  46 #include "accommon.h"
  47 #include "acnamesp.h"
  48 #include "acdebug.h"

  49 
  50 
  51 #ifdef ACPI_DEBUGGER
  52 
  53 #define _COMPONENT          ACPI_CA_DEBUGGER
  54         ACPI_MODULE_NAME    ("dbnames")
  55 
  56 
  57 /* Local prototypes */
  58 
  59 static ACPI_STATUS
  60 AcpiDbWalkAndMatchName (
  61     ACPI_HANDLE             ObjHandle,
  62     UINT32                  NestingLevel,
  63     void                    *Context,
  64     void                    **ReturnValue);
  65 
  66 static ACPI_STATUS
  67 AcpiDbWalkForPredefinedNames (
  68     ACPI_HANDLE             ObjHandle,


  85     void                    **ReturnValue);
  86 
  87 static ACPI_STATUS
  88 AcpiDbWalkForReferences (
  89     ACPI_HANDLE             ObjHandle,
  90     UINT32                  NestingLevel,
  91     void                    *Context,
  92     void                    **ReturnValue);
  93 
  94 static ACPI_STATUS
  95 AcpiDbBusWalk (
  96     ACPI_HANDLE             ObjHandle,
  97     UINT32                  NestingLevel,
  98     void                    *Context,
  99     void                    **ReturnValue);
 100 
 101 /*
 102  * Arguments for the Objects command
 103  * These object types map directly to the ACPI_TYPES
 104  */
 105 static ARGUMENT_INFO        AcpiDbObjectTypes [] =
 106 {
 107     {"ANY"},
 108     {"INTEGERS"},
 109     {"STRINGS"},
 110     {"BUFFERS"},
 111     {"PACKAGES"},
 112     {"FIELDS"},
 113     {"DEVICES"},
 114     {"EVENTS"},
 115     {"METHODS"},
 116     {"MUTEXES"},
 117     {"REGIONS"},
 118     {"POWERRESOURCES"},
 119     {"PROCESSORS"},
 120     {"THERMALZONES"},
 121     {"BUFFERFIELDS"},
 122     {"DDBHANDLES"},
 123     {"DEBUG"},
 124     {"REGIONFIELDS"},
 125     {"BANKFIELDS"},


 142  *              The scope is used as a prefix to ACPI paths.
 143  *
 144  ******************************************************************************/
 145 
 146 void
 147 AcpiDbSetScope (
 148     char                    *Name)
 149 {
 150     ACPI_STATUS             Status;
 151     ACPI_NAMESPACE_NODE     *Node;
 152 
 153 
 154     if (!Name || Name[0] == 0)
 155     {
 156         AcpiOsPrintf ("Current scope: %s\n", AcpiGbl_DbScopeBuf);
 157         return;
 158     }
 159 
 160     AcpiDbPrepNamestring (Name);
 161 
 162     if (Name[0] == '\\')
 163     {
 164         /* Validate new scope from the root */
 165 
 166         Status = AcpiNsGetNode (AcpiGbl_RootNode, Name, ACPI_NS_NO_UPSEARCH,
 167                     &Node);
 168         if (ACPI_FAILURE (Status))
 169         {
 170             goto ErrorExit;
 171         }
 172 
 173         ACPI_STRCPY (AcpiGbl_DbScopeBuf, Name);
 174         ACPI_STRCAT (AcpiGbl_DbScopeBuf, "\\");
 175     }
 176     else
 177     {
 178         /* Validate new scope relative to old scope */
 179 
 180         Status = AcpiNsGetNode (AcpiGbl_DbScopeNode, Name, ACPI_NS_NO_UPSEARCH,
 181                     &Node);
 182         if (ACPI_FAILURE (Status))
 183         {
 184             goto ErrorExit;
 185         }

 186 
 187         ACPI_STRCAT (AcpiGbl_DbScopeBuf, Name);
 188         ACPI_STRCAT (AcpiGbl_DbScopeBuf, "\\");





 189     }
 190 







 191     AcpiGbl_DbScopeNode = Node;
 192     AcpiOsPrintf ("New scope: %s\n", AcpiGbl_DbScopeBuf);
 193     return;
 194 
 195 ErrorExit:
 196 
 197     AcpiOsPrintf ("Could not attach scope: %s, %s\n",
 198         Name, AcpiFormatException (Status));
 199 }
 200 
 201 
 202 /*******************************************************************************
 203  *
 204  * FUNCTION:    AcpiDbDumpNamespace
 205  *
 206  * PARAMETERS:  StartArg        - Node to begin namespace dump
 207  *              DepthArg        - Maximum tree depth to be dumped
 208  *
 209  * RETURN:      None
 210  *


 238         {
 239             MaxDepth = ACPI_STRTOUL (DepthArg, NULL, 0);
 240         }
 241     }
 242 
 243     AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
 244     AcpiOsPrintf ("ACPI Namespace (from %4.4s (%p) subtree):\n",
 245         ((ACPI_NAMESPACE_NODE *) SubtreeEntry)->Name.Ascii, SubtreeEntry);
 246 
 247     /* Display the subtree */
 248 
 249     AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
 250     AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth,
 251         ACPI_OWNER_ID_MAX, SubtreeEntry);
 252     AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
 253 }
 254 
 255 
 256 /*******************************************************************************
 257  *































 258  * FUNCTION:    AcpiDbDumpNamespaceByOwner
 259  *
 260  * PARAMETERS:  OwnerArg        - Owner ID whose nodes will be displayed
 261  *              DepthArg        - Maximum tree depth to be dumped
 262  *
 263  * RETURN:      None
 264  *
 265  * DESCRIPTION: Dump elements of the namespace that are owned by the OwnerId.
 266  *
 267  ******************************************************************************/
 268 
 269 void
 270 AcpiDbDumpNamespaceByOwner (
 271     char                    *OwnerArg,
 272     char                    *DepthArg)
 273 {
 274     ACPI_HANDLE             SubtreeEntry = AcpiGbl_RootNode;
 275     UINT32                  MaxDepth = ACPI_UINT32_MAX;
 276     ACPI_OWNER_ID           OwnerId;
 277 


 417  *
 418  * RETURN:      Status
 419  *
 420  * DESCRIPTION: Detect and display predefined ACPI names (names that start with
 421  *              an underscore)
 422  *
 423  ******************************************************************************/
 424 
 425 static ACPI_STATUS
 426 AcpiDbWalkForPredefinedNames (
 427     ACPI_HANDLE             ObjHandle,
 428     UINT32                  NestingLevel,
 429     void                    *Context,
 430     void                    **ReturnValue)
 431 {
 432     ACPI_NAMESPACE_NODE         *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
 433     UINT32                      *Count = (UINT32 *) Context;
 434     const ACPI_PREDEFINED_INFO  *Predefined;
 435     const ACPI_PREDEFINED_INFO  *Package = NULL;
 436     char                        *Pathname;

 437 
 438 
 439     Predefined = AcpiNsCheckForPredefinedName (Node);
 440     if (!Predefined)
 441     {
 442         return (AE_OK);
 443     }
 444 
 445     Pathname = AcpiNsGetExternalPathname (Node);
 446     if (!Pathname)
 447     {
 448         return (AE_OK);
 449     }
 450 
 451     /* If method returns a package, the info is in the next table entry */
 452 
 453     if (Predefined->Info.ExpectedBtypes & ACPI_BTYPE_PACKAGE)
 454     {
 455         Package = Predefined + 1;
 456     }
 457 
 458     AcpiOsPrintf ("%-32s arg %X ret %2.2X", Pathname,
 459         Predefined->Info.ParamCount, Predefined->Info.ExpectedBtypes);
 460 




 461     if (Package)
 462     {
 463         AcpiOsPrintf (" PkgType %2.2X ObjType %2.2X Count %2.2X",
 464             Package->RetInfo.Type, Package->RetInfo.ObjectType1,
 465             Package->RetInfo.Count1);
 466     }
 467 
 468     AcpiOsPrintf("\n");
 469 
 470     AcpiNsCheckParameterCount (Pathname, Node, ACPI_UINT32_MAX, Predefined);



 471     ACPI_FREE (Pathname);
 472     (*Count)++;
 473 
 474     return (AE_OK);
 475 }
 476 
 477 
 478 /*******************************************************************************
 479  *
 480  * FUNCTION:    AcpiDbCheckPredefinedNames
 481  *
 482  * PARAMETERS:  None
 483  *
 484  * RETURN:      None
 485  *
 486  * DESCRIPTION: Validate all predefined names in the namespace
 487  *
 488  ******************************************************************************/
 489 
 490 void
 491 AcpiDbCheckPredefinedNames (
 492     void)
 493 {


 646         }
 647 
 648         if ((Node->Type == ACPI_TYPE_LOCAL_ALIAS)  ||
 649             (Node->Type == ACPI_TYPE_LOCAL_METHOD_ALIAS))
 650         {
 651             Node = (ACPI_NAMESPACE_NODE *) Node->Object;
 652         }
 653         else
 654         {
 655             Alias = FALSE;
 656         }
 657     }
 658 
 659     if (Node->Type > ACPI_TYPE_LOCAL_MAX)
 660     {
 661         AcpiOsPrintf ("Invalid Object Type for Node %p, Type = %X\n",
 662             Node, Node->Type);
 663         return (AE_OK);
 664     }
 665 
 666     if (!AcpiUtValidAcpiName (Node->Name.Integer))
 667     {
 668         AcpiOsPrintf ("Invalid AcpiName for Node %p\n", Node);
 669         return (AE_OK);
 670     }
 671 
 672     Object = AcpiNsGetAttachedObject (Node);
 673     if (Object)
 674     {
 675         Info->Objects++;
 676         if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND)
 677         {
 678             AcpiOsPrintf ("Invalid Descriptor Type for Object %p [%s]\n",
 679                 Object, AcpiUtGetDescriptorName (Object));
 680         }
 681     }
 682 
 683     return (AE_OK);
 684 }
 685 
 686 


 758 }
 759 
 760 
 761 /*******************************************************************************
 762  *
 763  * FUNCTION:    AcpiDbFindReferences
 764  *
 765  * PARAMETERS:  ObjectArg       - String with hex value of the object
 766  *
 767  * RETURN:      None
 768  *
 769  * DESCRIPTION: Search namespace for all references to the input object
 770  *
 771  ******************************************************************************/
 772 
 773 void
 774 AcpiDbFindReferences (
 775     char                    *ObjectArg)
 776 {
 777     ACPI_OPERAND_OBJECT     *ObjDesc;

 778 
 779 
 780     /* Convert string to object pointer */
 781 
 782     ObjDesc = ACPI_TO_POINTER (ACPI_STRTOUL (ObjectArg, NULL, 16));

 783 
 784     /* Search all nodes in namespace */
 785 
 786     (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
 787                     AcpiDbWalkForReferences, NULL, (void *) ObjDesc, NULL);
 788 }
 789 
 790 
 791 /*******************************************************************************
 792  *
 793  * FUNCTION:    AcpiDbBusWalk
 794  *
 795  * PARAMETERS:  Callback from WalkNamespace
 796  *
 797  * RETURN:      Status
 798  *
 799  * DESCRIPTION: Display info about device objects that have a corresponding
 800  *              _PRT method.
 801  *
 802  ******************************************************************************/


   1 /*******************************************************************************
   2  *
   3  * Module Name: dbnames - Debugger commands for the acpi namespace
   4  *
   5  ******************************************************************************/
   6 
   7 /*
   8  * Copyright (C) 2000 - 2014, Intel Corp.
   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.h"
  46 #include "accommon.h"
  47 #include "acnamesp.h"
  48 #include "acdebug.h"
  49 #include "acpredef.h"
  50 
  51 
  52 #ifdef ACPI_DEBUGGER
  53 
  54 #define _COMPONENT          ACPI_CA_DEBUGGER
  55         ACPI_MODULE_NAME    ("dbnames")
  56 
  57 
  58 /* Local prototypes */
  59 
  60 static ACPI_STATUS
  61 AcpiDbWalkAndMatchName (
  62     ACPI_HANDLE             ObjHandle,
  63     UINT32                  NestingLevel,
  64     void                    *Context,
  65     void                    **ReturnValue);
  66 
  67 static ACPI_STATUS
  68 AcpiDbWalkForPredefinedNames (
  69     ACPI_HANDLE             ObjHandle,


  86     void                    **ReturnValue);
  87 
  88 static ACPI_STATUS
  89 AcpiDbWalkForReferences (
  90     ACPI_HANDLE             ObjHandle,
  91     UINT32                  NestingLevel,
  92     void                    *Context,
  93     void                    **ReturnValue);
  94 
  95 static ACPI_STATUS
  96 AcpiDbBusWalk (
  97     ACPI_HANDLE             ObjHandle,
  98     UINT32                  NestingLevel,
  99     void                    *Context,
 100     void                    **ReturnValue);
 101 
 102 /*
 103  * Arguments for the Objects command
 104  * These object types map directly to the ACPI_TYPES
 105  */
 106 static ACPI_DB_ARGUMENT_INFO    AcpiDbObjectTypes [] =
 107 {
 108     {"ANY"},
 109     {"INTEGERS"},
 110     {"STRINGS"},
 111     {"BUFFERS"},
 112     {"PACKAGES"},
 113     {"FIELDS"},
 114     {"DEVICES"},
 115     {"EVENTS"},
 116     {"METHODS"},
 117     {"MUTEXES"},
 118     {"REGIONS"},
 119     {"POWERRESOURCES"},
 120     {"PROCESSORS"},
 121     {"THERMALZONES"},
 122     {"BUFFERFIELDS"},
 123     {"DDBHANDLES"},
 124     {"DEBUG"},
 125     {"REGIONFIELDS"},
 126     {"BANKFIELDS"},


 143  *              The scope is used as a prefix to ACPI paths.
 144  *
 145  ******************************************************************************/
 146 
 147 void
 148 AcpiDbSetScope (
 149     char                    *Name)
 150 {
 151     ACPI_STATUS             Status;
 152     ACPI_NAMESPACE_NODE     *Node;
 153 
 154 
 155     if (!Name || Name[0] == 0)
 156     {
 157         AcpiOsPrintf ("Current scope: %s\n", AcpiGbl_DbScopeBuf);
 158         return;
 159     }
 160 
 161     AcpiDbPrepNamestring (Name);
 162 
 163     if (ACPI_IS_ROOT_PREFIX (Name[0]))
 164     {
 165         /* Validate new scope from the root */
 166 
 167         Status = AcpiNsGetNode (AcpiGbl_RootNode, Name, ACPI_NS_NO_UPSEARCH,
 168                     &Node);
 169         if (ACPI_FAILURE (Status))
 170         {
 171             goto ErrorExit;
 172         }
 173 
 174         AcpiGbl_DbScopeBuf[0] = 0;

 175     }
 176     else
 177     {
 178         /* Validate new scope relative to old scope */
 179 
 180         Status = AcpiNsGetNode (AcpiGbl_DbScopeNode, Name, ACPI_NS_NO_UPSEARCH,
 181                     &Node);
 182         if (ACPI_FAILURE (Status))
 183         {
 184             goto ErrorExit;
 185         }
 186     }
 187 
 188     /* Build the final pathname */
 189 
 190     if (AcpiUtSafeStrcat (AcpiGbl_DbScopeBuf, sizeof (AcpiGbl_DbScopeBuf),
 191         Name))
 192     {
 193         Status = AE_BUFFER_OVERFLOW;
 194         goto ErrorExit;
 195     }
 196 
 197     if (AcpiUtSafeStrcat (AcpiGbl_DbScopeBuf, sizeof (AcpiGbl_DbScopeBuf),
 198         "\\"))
 199     {
 200         Status = AE_BUFFER_OVERFLOW;
 201         goto ErrorExit;
 202     }
 203 
 204     AcpiGbl_DbScopeNode = Node;
 205     AcpiOsPrintf ("New scope: %s\n", AcpiGbl_DbScopeBuf);
 206     return;
 207 
 208 ErrorExit:
 209 
 210     AcpiOsPrintf ("Could not attach scope: %s, %s\n",
 211         Name, AcpiFormatException (Status));
 212 }
 213 
 214 
 215 /*******************************************************************************
 216  *
 217  * FUNCTION:    AcpiDbDumpNamespace
 218  *
 219  * PARAMETERS:  StartArg        - Node to begin namespace dump
 220  *              DepthArg        - Maximum tree depth to be dumped
 221  *
 222  * RETURN:      None
 223  *


 251         {
 252             MaxDepth = ACPI_STRTOUL (DepthArg, NULL, 0);
 253         }
 254     }
 255 
 256     AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
 257     AcpiOsPrintf ("ACPI Namespace (from %4.4s (%p) subtree):\n",
 258         ((ACPI_NAMESPACE_NODE *) SubtreeEntry)->Name.Ascii, SubtreeEntry);
 259 
 260     /* Display the subtree */
 261 
 262     AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
 263     AcpiNsDumpObjects (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY, MaxDepth,
 264         ACPI_OWNER_ID_MAX, SubtreeEntry);
 265     AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
 266 }
 267 
 268 
 269 /*******************************************************************************
 270  *
 271  * FUNCTION:    AcpiDbDumpNamespacePaths
 272  *
 273  * PARAMETERS:  None
 274  *
 275  * RETURN:      None
 276  *
 277  * DESCRIPTION: Dump entire namespace with full object pathnames and object
 278  *              type information. Alternative to "namespace" command.
 279  *
 280  ******************************************************************************/
 281 
 282 void
 283 AcpiDbDumpNamespacePaths (
 284     void)
 285 {
 286 
 287     AcpiDbSetOutputDestination (ACPI_DB_DUPLICATE_OUTPUT);
 288     AcpiOsPrintf ("ACPI Namespace (from root):\n");
 289 
 290     /* Display the entire namespace */
 291 
 292     AcpiDbSetOutputDestination (ACPI_DB_REDIRECTABLE_OUTPUT);
 293     AcpiNsDumpObjectPaths (ACPI_TYPE_ANY, ACPI_DISPLAY_SUMMARY,
 294         ACPI_UINT32_MAX, ACPI_OWNER_ID_MAX, AcpiGbl_RootNode);
 295 
 296     AcpiDbSetOutputDestination (ACPI_DB_CONSOLE_OUTPUT);
 297 }
 298 
 299 
 300 /*******************************************************************************
 301  *
 302  * FUNCTION:    AcpiDbDumpNamespaceByOwner
 303  *
 304  * PARAMETERS:  OwnerArg        - Owner ID whose nodes will be displayed
 305  *              DepthArg        - Maximum tree depth to be dumped
 306  *
 307  * RETURN:      None
 308  *
 309  * DESCRIPTION: Dump elements of the namespace that are owned by the OwnerId.
 310  *
 311  ******************************************************************************/
 312 
 313 void
 314 AcpiDbDumpNamespaceByOwner (
 315     char                    *OwnerArg,
 316     char                    *DepthArg)
 317 {
 318     ACPI_HANDLE             SubtreeEntry = AcpiGbl_RootNode;
 319     UINT32                  MaxDepth = ACPI_UINT32_MAX;
 320     ACPI_OWNER_ID           OwnerId;
 321 


 461  *
 462  * RETURN:      Status
 463  *
 464  * DESCRIPTION: Detect and display predefined ACPI names (names that start with
 465  *              an underscore)
 466  *
 467  ******************************************************************************/
 468 
 469 static ACPI_STATUS
 470 AcpiDbWalkForPredefinedNames (
 471     ACPI_HANDLE             ObjHandle,
 472     UINT32                  NestingLevel,
 473     void                    *Context,
 474     void                    **ReturnValue)
 475 {
 476     ACPI_NAMESPACE_NODE         *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
 477     UINT32                      *Count = (UINT32 *) Context;
 478     const ACPI_PREDEFINED_INFO  *Predefined;
 479     const ACPI_PREDEFINED_INFO  *Package = NULL;
 480     char                        *Pathname;
 481     char                        StringBuffer[48];
 482 
 483 
 484     Predefined = AcpiUtMatchPredefinedMethod (Node->Name.Ascii);
 485     if (!Predefined)
 486     {
 487         return (AE_OK);
 488     }
 489 
 490     Pathname = AcpiNsGetExternalPathname (Node);
 491     if (!Pathname)
 492     {
 493         return (AE_OK);
 494     }
 495 
 496     /* If method returns a package, the info is in the next table entry */
 497 
 498     if (Predefined->Info.ExpectedBtypes & ACPI_RTYPE_PACKAGE)
 499     {
 500         Package = Predefined + 1;
 501     }
 502 
 503     AcpiUtGetExpectedReturnTypes (StringBuffer,
 504         Predefined->Info.ExpectedBtypes);
 505 
 506     AcpiOsPrintf ("%-32s Arguments %X, Return Types: %s", Pathname,
 507         METHOD_GET_ARG_COUNT (Predefined->Info.ArgumentList),
 508         StringBuffer);
 509 
 510     if (Package)
 511     {
 512         AcpiOsPrintf (" (PkgType %2.2X, ObjType %2.2X, Count %2.2X)",
 513             Package->RetInfo.Type, Package->RetInfo.ObjectType1,
 514             Package->RetInfo.Count1);
 515     }
 516 
 517     AcpiOsPrintf("\n");
 518 
 519     /* Check that the declared argument count matches the ACPI spec */
 520 
 521     AcpiNsCheckAcpiCompliance (Pathname, Node, Predefined);
 522 
 523     ACPI_FREE (Pathname);
 524     (*Count)++;

 525     return (AE_OK);
 526 }
 527 
 528 
 529 /*******************************************************************************
 530  *
 531  * FUNCTION:    AcpiDbCheckPredefinedNames
 532  *
 533  * PARAMETERS:  None
 534  *
 535  * RETURN:      None
 536  *
 537  * DESCRIPTION: Validate all predefined names in the namespace
 538  *
 539  ******************************************************************************/
 540 
 541 void
 542 AcpiDbCheckPredefinedNames (
 543     void)
 544 {


 697         }
 698 
 699         if ((Node->Type == ACPI_TYPE_LOCAL_ALIAS)  ||
 700             (Node->Type == ACPI_TYPE_LOCAL_METHOD_ALIAS))
 701         {
 702             Node = (ACPI_NAMESPACE_NODE *) Node->Object;
 703         }
 704         else
 705         {
 706             Alias = FALSE;
 707         }
 708     }
 709 
 710     if (Node->Type > ACPI_TYPE_LOCAL_MAX)
 711     {
 712         AcpiOsPrintf ("Invalid Object Type for Node %p, Type = %X\n",
 713             Node, Node->Type);
 714         return (AE_OK);
 715     }
 716 
 717     if (!AcpiUtValidAcpiName (Node->Name.Ascii))
 718     {
 719         AcpiOsPrintf ("Invalid AcpiName for Node %p\n", Node);
 720         return (AE_OK);
 721     }
 722 
 723     Object = AcpiNsGetAttachedObject (Node);
 724     if (Object)
 725     {
 726         Info->Objects++;
 727         if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND)
 728         {
 729             AcpiOsPrintf ("Invalid Descriptor Type for Object %p [%s]\n",
 730                 Object, AcpiUtGetDescriptorName (Object));
 731         }
 732     }
 733 
 734     return (AE_OK);
 735 }
 736 
 737 


 809 }
 810 
 811 
 812 /*******************************************************************************
 813  *
 814  * FUNCTION:    AcpiDbFindReferences
 815  *
 816  * PARAMETERS:  ObjectArg       - String with hex value of the object
 817  *
 818  * RETURN:      None
 819  *
 820  * DESCRIPTION: Search namespace for all references to the input object
 821  *
 822  ******************************************************************************/
 823 
 824 void
 825 AcpiDbFindReferences (
 826     char                    *ObjectArg)
 827 {
 828     ACPI_OPERAND_OBJECT     *ObjDesc;
 829     ACPI_SIZE               Address;
 830 
 831 
 832     /* Convert string to object pointer */
 833 
 834     Address = ACPI_STRTOUL (ObjectArg, NULL, 16);
 835     ObjDesc = ACPI_TO_POINTER (Address);
 836 
 837     /* Search all nodes in namespace */
 838 
 839     (void) AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
 840                     AcpiDbWalkForReferences, NULL, (void *) ObjDesc, NULL);
 841 }
 842 
 843 
 844 /*******************************************************************************
 845  *
 846  * FUNCTION:    AcpiDbBusWalk
 847  *
 848  * PARAMETERS:  Callback from WalkNamespace
 849  *
 850  * RETURN:      Status
 851  *
 852  * DESCRIPTION: Display info about device objects that have a corresponding
 853  *              _PRT method.
 854  *
 855  ******************************************************************************/