Print this page
update to acpica-unix2-20131218
update to acpica-unix2-20130927
acpica-unix2-20130823
PANKOVs restructure

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/io/acpica/namespace/nsxfeval.c
          +++ new/usr/src/common/acpica/components/namespace/nsxfeval.c
   1    1  /*******************************************************************************
   2    2   *
   3    3   * Module Name: nsxfeval - Public interfaces to the ACPI subsystem
   4    4   *                         ACPI Object evaluation interfaces
   5    5   *
   6    6   ******************************************************************************/
   7    7  
   8    8  /*
   9      - * Copyright (C) 2000 - 2011, Intel Corp.
        9 + * Copyright (C) 2000 - 2013, Intel Corp.
  10   10   * All rights reserved.
  11   11   *
  12   12   * Redistribution and use in source and binary forms, with or without
  13   13   * modification, are permitted provided that the following conditions
  14   14   * are met:
  15   15   * 1. Redistributions of source code must retain the above copyright
  16   16   *    notice, this list of conditions, and the following disclaimer,
  17   17   *    without modification.
  18   18   * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  19   19   *    substantially similar to the "NO WARRANTY" disclaimer below
↓ open down ↓ 17 lines elided ↑ open up ↑
  37   37   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  38   38   * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  39   39   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  40   40   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  41   41   * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  42   42   * POSSIBILITY OF SUCH DAMAGES.
  43   43   */
  44   44  
  45   45  
  46   46  #define __NSXFEVAL_C__
       47 +#define EXPORT_ACPI_INTERFACES
  47   48  
  48   49  #include "acpi.h"
  49   50  #include "accommon.h"
  50   51  #include "acnamesp.h"
  51   52  #include "acinterp.h"
  52   53  
  53   54  
  54   55  #define _COMPONENT          ACPI_NAMESPACE
  55   56          ACPI_MODULE_NAME    ("nsxfeval")
  56   57  
↓ open down ↓ 4 lines elided ↑ open up ↑
  61   62      ACPI_EVALUATE_INFO      *Info);
  62   63  
  63   64  
  64   65  /*******************************************************************************
  65   66   *
  66   67   * FUNCTION:    AcpiEvaluateObjectTyped
  67   68   *
  68   69   * PARAMETERS:  Handle              - Object handle (optional)
  69   70   *              Pathname            - Object pathname (optional)
  70   71   *              ExternalParams      - List of parameters to pass to method,
  71      - *                                    terminated by NULL.  May be NULL
       72 + *                                    terminated by NULL. May be NULL
  72   73   *                                    if no parameters are being passed.
  73   74   *              ReturnBuffer        - Where to put method's return value (if
  74      - *                                    any).  If NULL, no value is returned.
       75 + *                                    any). If NULL, no value is returned.
  75   76   *              ReturnType          - Expected type of return object
  76   77   *
  77   78   * RETURN:      Status
  78   79   *
  79   80   * DESCRIPTION: Find and evaluate the given object, passing the given
  80      - *              parameters if necessary.  One of "Handle" or "Pathname" must
       81 + *              parameters if necessary. One of "Handle" or "Pathname" must
  81   82   *              be valid (non-null)
  82   83   *
  83   84   ******************************************************************************/
  84   85  
  85   86  ACPI_STATUS
  86   87  AcpiEvaluateObjectTyped (
  87   88      ACPI_HANDLE             Handle,
  88   89      ACPI_STRING             Pathname,
  89   90      ACPI_OBJECT_LIST        *ExternalParams,
  90   91      ACPI_BUFFER             *ReturnBuffer,
  91   92      ACPI_OBJECT_TYPE        ReturnType)
  92   93  {
  93   94      ACPI_STATUS             Status;
  94      -    BOOLEAN                 MustFree = FALSE;
       95 +    BOOLEAN                 FreeBufferOnError = FALSE;
  95   96  
  96   97  
  97   98      ACPI_FUNCTION_TRACE (AcpiEvaluateObjectTyped);
  98   99  
  99  100  
 100  101      /* Return buffer must be valid */
 101  102  
 102  103      if (!ReturnBuffer)
 103  104      {
 104  105          return_ACPI_STATUS (AE_BAD_PARAMETER);
 105  106      }
 106  107  
 107  108      if (ReturnBuffer->Length == ACPI_ALLOCATE_BUFFER)
 108  109      {
 109      -        MustFree = TRUE;
      110 +        FreeBufferOnError = TRUE;
 110  111      }
 111  112  
 112  113      /* Evaluate the object */
 113  114  
 114      -    Status = AcpiEvaluateObject (Handle, Pathname, ExternalParams, ReturnBuffer);
      115 +    Status = AcpiEvaluateObject (Handle, Pathname,
      116 +        ExternalParams, ReturnBuffer);
 115  117      if (ACPI_FAILURE (Status))
 116  118      {
 117  119          return_ACPI_STATUS (Status);
 118  120      }
 119  121  
 120  122      /* Type ANY means "don't care" */
 121  123  
 122  124      if (ReturnType == ACPI_TYPE_ANY)
 123  125      {
 124  126          return_ACPI_STATUS (AE_OK);
↓ open down ↓ 14 lines elided ↑ open up ↑
 139  141          return_ACPI_STATUS (AE_OK);
 140  142      }
 141  143  
 142  144      /* Return object type does not match requested type */
 143  145  
 144  146      ACPI_ERROR ((AE_INFO,
 145  147          "Incorrect return type [%s] requested [%s]",
 146  148          AcpiUtGetTypeName (((ACPI_OBJECT *) ReturnBuffer->Pointer)->Type),
 147  149          AcpiUtGetTypeName (ReturnType)));
 148  150  
 149      -    if (MustFree)
      151 +    if (FreeBufferOnError)
 150  152      {
 151      -        /* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */
 152      -
      153 +        /*
      154 +         * Free a buffer created via ACPI_ALLOCATE_BUFFER.
      155 +         * Note: We use AcpiOsFree here because AcpiOsAllocate was used
      156 +         * to allocate the buffer. This purposefully bypasses the
      157 +         * (optionally enabled) allocation tracking mechanism since we
      158 +         * only want to track internal allocations.
      159 +         */
 153  160          AcpiOsFree (ReturnBuffer->Pointer);
 154  161          ReturnBuffer->Pointer = NULL;
 155  162      }
 156  163  
 157  164      ReturnBuffer->Length = 0;
 158  165      return_ACPI_STATUS (AE_TYPE);
 159  166  }
 160  167  
 161  168  ACPI_EXPORT_SYMBOL (AcpiEvaluateObjectTyped)
 162  169  
 163  170  
 164  171  /*******************************************************************************
 165  172   *
 166  173   * FUNCTION:    AcpiEvaluateObject
 167  174   *
 168  175   * PARAMETERS:  Handle              - Object handle (optional)
 169  176   *              Pathname            - Object pathname (optional)
 170  177   *              ExternalParams      - List of parameters to pass to method,
 171      - *                                    terminated by NULL.  May be NULL
      178 + *                                    terminated by NULL. May be NULL
 172  179   *                                    if no parameters are being passed.
 173  180   *              ReturnBuffer        - Where to put method's return value (if
 174      - *                                    any).  If NULL, no value is returned.
      181 + *                                    any). If NULL, no value is returned.
 175  182   *
 176  183   * RETURN:      Status
 177  184   *
 178  185   * DESCRIPTION: Find and evaluate the given object, passing the given
 179      - *              parameters if necessary.  One of "Handle" or "Pathname" must
      186 + *              parameters if necessary. One of "Handle" or "Pathname" must
 180  187   *              be valid (non-null)
 181  188   *
 182  189   ******************************************************************************/
 183  190  
 184  191  ACPI_STATUS
 185  192  AcpiEvaluateObject (
 186  193      ACPI_HANDLE             Handle,
 187  194      ACPI_STRING             Pathname,
 188  195      ACPI_OBJECT_LIST        *ExternalParams,
 189  196      ACPI_BUFFER             *ReturnBuffer)
↓ open down ↓ 8 lines elided ↑ open up ↑
 198  205  
 199  206  
 200  207      /* Allocate and initialize the evaluation information block */
 201  208  
 202  209      Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EVALUATE_INFO));
 203  210      if (!Info)
 204  211      {
 205  212          return_ACPI_STATUS (AE_NO_MEMORY);
 206  213      }
 207  214  
 208      -    Info->Pathname = Pathname;
 209      -
 210  215      /* Convert and validate the device handle */
 211  216  
 212  217      Info->PrefixNode = AcpiNsValidateHandle (Handle);
 213  218      if (!Info->PrefixNode)
 214  219      {
 215  220          Status = AE_BAD_PARAMETER;
 216  221          goto Cleanup;
 217  222      }
 218  223  
 219  224      /*
 220      -     * If there are parameters to be passed to a control method, the external
 221      -     * objects must all be converted to internal objects
      225 +     * Get the actual namespace node for the target object.
      226 +     * Handles these cases:
      227 +     *
      228 +     * 1) Null node, valid pathname from root (absolute path)
      229 +     * 2) Node and valid pathname (path relative to Node)
      230 +     * 3) Node, Null pathname
 222  231       */
      232 +    if ((Pathname) &&
      233 +        (ACPI_IS_ROOT_PREFIX (Pathname[0])))
      234 +    {
      235 +        /* The path is fully qualified, just evaluate by name */
      236 +
      237 +        Info->PrefixNode = NULL;
      238 +    }
      239 +    else if (!Handle)
      240 +    {
      241 +        /*
      242 +         * A handle is optional iff a fully qualified pathname is specified.
      243 +         * Since we've already handled fully qualified names above, this is
      244 +         * an error.
      245 +         */
      246 +        if (!Pathname)
      247 +        {
      248 +            ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
      249 +                "Both Handle and Pathname are NULL"));
      250 +        }
      251 +        else
      252 +        {
      253 +            ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
      254 +                "Null Handle with relative pathname [%s]", Pathname));
      255 +        }
      256 +
      257 +        Status = AE_BAD_PARAMETER;
      258 +        goto Cleanup;
      259 +    }
      260 +
      261 +    Info->RelativePathname = Pathname;
      262 +
      263 +    /*
      264 +     * Convert all external objects passed as arguments to the
      265 +     * internal version(s).
      266 +     */
 223  267      if (ExternalParams && ExternalParams->Count)
 224  268      {
      269 +        Info->ParamCount = (UINT16) ExternalParams->Count;
      270 +
      271 +        /* Warn on impossible argument count */
      272 +
      273 +        if (Info->ParamCount > ACPI_METHOD_NUM_ARGS)
      274 +        {
      275 +            ACPI_WARN_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS,
      276 +                "Excess arguments (%u) - using only %u",
      277 +                Info->ParamCount, ACPI_METHOD_NUM_ARGS));
      278 +
      279 +            Info->ParamCount = ACPI_METHOD_NUM_ARGS;
      280 +        }
      281 +
 225  282          /*
 226  283           * Allocate a new parameter block for the internal objects
 227  284           * Add 1 to count to allow for null terminated internal list
 228  285           */
 229  286          Info->Parameters = ACPI_ALLOCATE_ZEROED (
 230      -            ((ACPI_SIZE) ExternalParams->Count + 1) * sizeof (void *));
      287 +            ((ACPI_SIZE) Info->ParamCount + 1) * sizeof (void *));
 231  288          if (!Info->Parameters)
 232  289          {
 233  290              Status = AE_NO_MEMORY;
 234  291              goto Cleanup;
 235  292          }
 236  293  
 237  294          /* Convert each external object in the list to an internal object */
 238  295  
 239      -        for (i = 0; i < ExternalParams->Count; i++)
      296 +        for (i = 0; i < Info->ParamCount; i++)
 240  297          {
 241  298              Status = AcpiUtCopyEobjectToIobject (
 242      -                        &ExternalParams->Pointer[i], &Info->Parameters[i]);
      299 +                &ExternalParams->Pointer[i], &Info->Parameters[i]);
 243  300              if (ACPI_FAILURE (Status))
 244  301              {
 245  302                  goto Cleanup;
 246  303              }
 247  304          }
 248      -        Info->Parameters[ExternalParams->Count] = NULL;
      305 +
      306 +        Info->Parameters[Info->ParamCount] = NULL;
 249  307      }
 250  308  
      309 +
      310 +#if 0
      311 +
 251  312      /*
 252      -     * Three major cases:
 253      -     * 1) Fully qualified pathname
 254      -     * 2) No handle, not fully qualified pathname (error)
 255      -     * 3) Valid handle
      313 +     * Begin incoming argument count analysis. Check for too few args
      314 +     * and too many args.
 256  315       */
 257      -    if ((Pathname) &&
 258      -        (AcpiNsValidRootPrefix (Pathname[0])))
 259      -    {
 260      -        /* The path is fully qualified, just evaluate by name */
 261  316  
 262      -        Info->PrefixNode = NULL;
 263      -        Status = AcpiNsEvaluate (Info);
 264      -    }
 265      -    else if (!Handle)
      317 +    switch (AcpiNsGetType (Info->Node))
 266  318      {
      319 +    case ACPI_TYPE_METHOD:
      320 +
      321 +        /* Check incoming argument count against the method definition */
      322 +
      323 +        if (Info->ObjDesc->Method.ParamCount > Info->ParamCount)
      324 +        {
      325 +            ACPI_ERROR ((AE_INFO,
      326 +                "Insufficient arguments (%u) - %u are required",
      327 +                Info->ParamCount,
      328 +                Info->ObjDesc->Method.ParamCount));
      329 +
      330 +            Status = AE_MISSING_ARGUMENTS;
      331 +            goto Cleanup;
      332 +        }
      333 +
      334 +        else if (Info->ObjDesc->Method.ParamCount < Info->ParamCount)
      335 +        {
      336 +            ACPI_WARNING ((AE_INFO,
      337 +                "Excess arguments (%u) - only %u are required",
      338 +                Info->ParamCount,
      339 +                Info->ObjDesc->Method.ParamCount));
      340 +
      341 +            /* Just pass the required number of arguments */
      342 +
      343 +            Info->ParamCount = Info->ObjDesc->Method.ParamCount;
      344 +        }
      345 +
 267  346          /*
 268      -         * A handle is optional iff a fully qualified pathname is specified.
 269      -         * Since we've already handled fully qualified names above, this is
 270      -         * an error
      347 +         * Any incoming external objects to be passed as arguments to the
      348 +         * method must be converted to internal objects
 271  349           */
 272      -        if (!Pathname)
      350 +        if (Info->ParamCount)
 273  351          {
 274      -            ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
 275      -                "Both Handle and Pathname are NULL"));
      352 +            /*
      353 +             * Allocate a new parameter block for the internal objects
      354 +             * Add 1 to count to allow for null terminated internal list
      355 +             */
      356 +            Info->Parameters = ACPI_ALLOCATE_ZEROED (
      357 +                ((ACPI_SIZE) Info->ParamCount + 1) * sizeof (void *));
      358 +            if (!Info->Parameters)
      359 +            {
      360 +                Status = AE_NO_MEMORY;
      361 +                goto Cleanup;
      362 +            }
      363 +
      364 +            /* Convert each external object in the list to an internal object */
      365 +
      366 +            for (i = 0; i < Info->ParamCount; i++)
      367 +            {
      368 +                Status = AcpiUtCopyEobjectToIobject (
      369 +                    &ExternalParams->Pointer[i], &Info->Parameters[i]);
      370 +                if (ACPI_FAILURE (Status))
      371 +                {
      372 +                    goto Cleanup;
      373 +                }
      374 +            }
      375 +
      376 +            Info->Parameters[Info->ParamCount] = NULL;
 276  377          }
 277      -        else
      378 +        break;
      379 +
      380 +    default:
      381 +
      382 +        /* Warn if arguments passed to an object that is not a method */
      383 +
      384 +        if (Info->ParamCount)
 278  385          {
 279      -            ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
 280      -                "Null Handle with relative pathname [%s]", Pathname));
      386 +            ACPI_WARNING ((AE_INFO,
      387 +                "%u arguments were passed to a non-method ACPI object",
      388 +                Info->ParamCount));
 281  389          }
 282      -
 283      -        Status = AE_BAD_PARAMETER;
      390 +        break;
 284  391      }
 285      -    else
 286      -    {
 287      -        /* We have a namespace a node and a possible relative path */
 288  392  
 289      -        Status = AcpiNsEvaluate (Info);
 290      -    }
      393 +#endif
 291  394  
      395 +
      396 +    /* Now we can evaluate the object */
      397 +
      398 +    Status = AcpiNsEvaluate (Info);
      399 +
 292  400      /*
 293  401       * If we are expecting a return value, and all went well above,
 294  402       * copy the return value to an external object.
 295  403       */
 296  404      if (ReturnBuffer)
 297  405      {
 298  406          if (!Info->ReturnObject)
 299  407          {
 300  408              ReturnBuffer->Length = 0;
 301  409          }
↓ open down ↓ 140 lines elided ↑ open up ↑
 442  550      case ACPI_REFCLASS_REFOF:
 443  551  
 444  552          Node = Info->ReturnObject->Reference.Object;
 445  553          if (Node)
 446  554          {
 447  555              ObjDesc = Node->Object;
 448  556          }
 449  557          break;
 450  558  
 451  559      default:
      560 +
 452  561          return;
 453  562      }
 454  563  
 455  564      /* Replace the existing reference object */
 456  565  
 457  566      if (ObjDesc)
 458  567      {
 459  568          AcpiUtAddReference (ObjDesc);
 460  569          AcpiUtRemoveReference (Info->ReturnObject);
 461  570          Info->ReturnObject = ObjDesc;
↓ open down ↓ 3 lines elided ↑ open up ↑
 465  574  }
 466  575  
 467  576  
 468  577  /*******************************************************************************
 469  578   *
 470  579   * FUNCTION:    AcpiWalkNamespace
 471  580   *
 472  581   * PARAMETERS:  Type                - ACPI_OBJECT_TYPE to search for
 473  582   *              StartObject         - Handle in namespace where search begins
 474  583   *              MaxDepth            - Depth to which search is to reach
 475      - *              PreOrderVisit       - Called during tree pre-order visit
      584 + *              DescendingCallback  - Called during tree descent
 476  585   *                                    when an object of "Type" is found
 477      - *              PostOrderVisit      - Called during tree post-order visit
      586 + *              AscendingCallback   - Called during tree ascent
 478  587   *                                    when an object of "Type" is found
 479  588   *              Context             - Passed to user function(s) above
 480  589   *              ReturnValue         - Location where return value of
 481  590   *                                    UserFunction is put if terminated early
 482  591   *
 483  592   * RETURNS      Return value from the UserFunction if terminated early.
 484  593   *              Otherwise, returns NULL.
 485  594   *
 486  595   * DESCRIPTION: Performs a modified depth-first walk of the namespace tree,
 487  596   *              starting (and ending) at the object specified by StartHandle.
↓ open down ↓ 8 lines elided ↑ open up ↑
 496  605   *              tailored to each task, whether it is a print function,
 497  606   *              a compare function, etc.
 498  607   *
 499  608   ******************************************************************************/
 500  609  
 501  610  ACPI_STATUS
 502  611  AcpiWalkNamespace (
 503  612      ACPI_OBJECT_TYPE        Type,
 504  613      ACPI_HANDLE             StartObject,
 505  614      UINT32                  MaxDepth,
 506      -    ACPI_WALK_CALLBACK      PreOrderVisit,
 507      -    ACPI_WALK_CALLBACK      PostOrderVisit,
      615 +    ACPI_WALK_CALLBACK      DescendingCallback,
      616 +    ACPI_WALK_CALLBACK      AscendingCallback,
 508  617      void                    *Context,
 509  618      void                    **ReturnValue)
 510  619  {
 511  620      ACPI_STATUS             Status;
 512  621  
 513  622  
 514  623      ACPI_FUNCTION_TRACE (AcpiWalkNamespace);
 515  624  
 516  625  
 517  626      /* Parameter validation */
 518  627  
 519  628      if ((Type > ACPI_TYPE_LOCAL_MAX) ||
 520  629          (!MaxDepth)                  ||
 521      -        (!PreOrderVisit && !PostOrderVisit))
      630 +        (!DescendingCallback && !AscendingCallback))
 522  631      {
 523  632          return_ACPI_STATUS (AE_BAD_PARAMETER);
 524  633      }
 525  634  
 526  635      /*
 527  636       * Need to acquire the namespace reader lock to prevent interference
 528  637       * with any concurrent table unloads (which causes the deletion of
 529  638       * namespace objects). We cannot allow the deletion of a namespace node
 530  639       * while the user function is using it. The exception to this are the
 531  640       * nodes created and deleted during control method execution -- these
 532  641       * nodes are marked as temporary nodes and are ignored by the namespace
 533  642       * walk. Thus, control methods can be executed while holding the
 534  643       * namespace deletion lock (and the user function can execute control
 535  644       * methods.)
 536  645       */
 537  646      Status = AcpiUtAcquireReadLock (&AcpiGbl_NamespaceRwLock);
 538  647      if (ACPI_FAILURE (Status))
 539  648      {
 540      -        return (Status);
      649 +        return_ACPI_STATUS (Status);
 541  650      }
 542  651  
 543  652      /*
 544  653       * Lock the namespace around the walk. The namespace will be
 545  654       * unlocked/locked around each call to the user function - since the user
 546  655       * function must be allowed to make ACPICA calls itself (for example, it
 547  656       * will typically execute control methods during device enumeration.)
 548  657       */
 549  658      Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
 550  659      if (ACPI_FAILURE (Status))
 551  660      {
 552  661          goto UnlockAndExit;
 553  662      }
 554  663  
      664 +    /* Now we can validate the starting node */
      665 +
      666 +    if (!AcpiNsValidateHandle (StartObject))
      667 +    {
      668 +        Status = AE_BAD_PARAMETER;
      669 +        goto UnlockAndExit2;
      670 +    }
      671 +
 555  672      Status = AcpiNsWalkNamespace (Type, StartObject, MaxDepth,
 556      -                ACPI_NS_WALK_UNLOCK, PreOrderVisit,
 557      -                PostOrderVisit, Context, ReturnValue);
      673 +                ACPI_NS_WALK_UNLOCK, DescendingCallback,
      674 +                AscendingCallback, Context, ReturnValue);
 558  675  
      676 +UnlockAndExit2:
 559  677      (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
 560  678  
 561  679  UnlockAndExit:
 562  680      (void) AcpiUtReleaseReadLock (&AcpiGbl_NamespaceRwLock);
 563  681      return_ACPI_STATUS (Status);
 564  682  }
 565  683  
 566  684  ACPI_EXPORT_SYMBOL (AcpiWalkNamespace)
 567  685  
 568  686  
↓ open down ↓ 15 lines elided ↑ open up ↑
 584  702  AcpiNsGetDeviceCallback (
 585  703      ACPI_HANDLE             ObjHandle,
 586  704      UINT32                  NestingLevel,
 587  705      void                    *Context,
 588  706      void                    **ReturnValue)
 589  707  {
 590  708      ACPI_GET_DEVICES_INFO   *Info = Context;
 591  709      ACPI_STATUS             Status;
 592  710      ACPI_NAMESPACE_NODE     *Node;
 593  711      UINT32                  Flags;
 594      -    ACPI_DEVICE_ID          *Hid;
 595      -    ACPI_DEVICE_ID_LIST     *Cid;
      712 +    ACPI_PNP_DEVICE_ID      *Hid;
      713 +    ACPI_PNP_DEVICE_ID_LIST *Cid;
 596  714      UINT32                  i;
 597  715      BOOLEAN                 Found;
 598  716      int                     NoMatch;
 599  717  
 600  718  
 601  719      Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
 602  720      if (ACPI_FAILURE (Status))
 603  721      {
 604  722          return (Status);
 605  723      }
↓ open down ↓ 113 lines elided ↑ open up ↑
 719  837   *              Context             - Passed to user function
 720  838   *              ReturnValue         - Location where return value of
 721  839   *                                    UserFunction is put if terminated early
 722  840   *
 723  841   * RETURNS      Return value from the UserFunction if terminated early.
 724  842   *              Otherwise, returns NULL.
 725  843   *
 726  844   * DESCRIPTION: Performs a modified depth-first walk of the namespace tree,
 727  845   *              starting (and ending) at the object specified by StartHandle.
 728  846   *              The UserFunction is called whenever an object of type
 729      - *              Device is found.  If the user function returns
      847 + *              Device is found. If the user function returns
 730  848   *              a non-zero value, the search is terminated immediately and this
 731  849   *              value is returned to the caller.
 732  850   *
 733  851   *              This is a wrapper for WalkNamespace, but the callback performs
 734  852   *              additional filtering. Please see AcpiNsGetDeviceCallback.
 735  853   *
 736  854   ******************************************************************************/
 737  855  
 738  856  ACPI_STATUS
 739  857  AcpiGetDevices (
↓ open down ↓ 209 lines elided ↑ open up ↑
 949 1067      }
 950 1068  
 951 1069      Status = AcpiNsGetAttachedData (Node, Handler, Data);
 952 1070  
 953 1071  UnlockAndExit:
 954 1072      (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
 955 1073      return (Status);
 956 1074  }
 957 1075  
 958 1076  ACPI_EXPORT_SYMBOL (AcpiGetData)
 959      -
 960      -
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX