Print this page
update to acpica-unix2-20140114
acpica-unix2-20130823
PANKOVs restructure

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/io/acpica/dispatcher/dsmthdat.c
          +++ new/usr/src/common/acpica/components/dispatcher/dsmthdat.c
   1    1  /*******************************************************************************
   2    2   *
   3    3   * Module Name: dsmthdat - control method arguments and local variables
   4    4   *
   5    5   ******************************************************************************/
   6    6  
   7    7  /*
   8      - * Copyright (C) 2000 - 2011, Intel Corp.
        8 + * Copyright (C) 2000 - 2014, Intel Corp.
   9    9   * All rights reserved.
  10   10   *
  11   11   * Redistribution and use in source and binary forms, with or without
  12   12   * modification, are permitted provided that the following conditions
  13   13   * are met:
  14   14   * 1. Redistributions of source code must retain the above copyright
  15   15   *    notice, this list of conditions, and the following disclaimer,
  16   16   *    without modification.
  17   17   * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  18   18   *    substantially similar to the "NO WARRANTY" disclaimer below
↓ open down ↓ 60 lines elided ↑ open up ↑
  79   79  
  80   80  /*******************************************************************************
  81   81   *
  82   82   * FUNCTION:    AcpiDsMethodDataInit
  83   83   *
  84   84   * PARAMETERS:  WalkState           - Current walk state object
  85   85   *
  86   86   * RETURN:      Status
  87   87   *
  88   88   * DESCRIPTION: Initialize the data structures that hold the method's arguments
  89      - *              and locals.  The data struct is an array of namespace nodes for
       89 + *              and locals. The data struct is an array of namespace nodes for
  90   90   *              each - this allows RefOf and DeRefOf to work properly for these
  91   91   *              special data types.
  92   92   *
  93   93   * NOTES:       WalkState fields are initialized to zero by the
  94   94   *              ACPI_ALLOCATE_ZEROED().
  95   95   *
  96   96   *              A pseudo-Namespace Node is assigned to each argument and local
  97   97   *              so that RefOf() can return a pointer to the Node.
  98   98   *
  99   99   ******************************************************************************/
↓ open down ↓ 36 lines elided ↑ open up ↑
 136  136  
 137  137  
 138  138  /*******************************************************************************
 139  139   *
 140  140   * FUNCTION:    AcpiDsMethodDataDeleteAll
 141  141   *
 142  142   * PARAMETERS:  WalkState           - Current walk state object
 143  143   *
 144  144   * RETURN:      None
 145  145   *
 146      - * DESCRIPTION: Delete method locals and arguments.  Arguments are only
      146 + * DESCRIPTION: Delete method locals and arguments. Arguments are only
 147  147   *              deleted if this method was called from another method.
 148  148   *
 149  149   ******************************************************************************/
 150  150  
 151  151  void
 152  152  AcpiDsMethodDataDeleteAll (
 153  153      ACPI_WALK_STATE         *WalkState)
 154  154  {
 155  155      UINT32                  Index;
 156  156  
↓ open down ↓ 38 lines elided ↑ open up ↑
 195  195  /*******************************************************************************
 196  196   *
 197  197   * FUNCTION:    AcpiDsMethodDataInitArgs
 198  198   *
 199  199   * PARAMETERS:  *Params         - Pointer to a parameter list for the method
 200  200   *              MaxParamCount   - The arg count for this method
 201  201   *              WalkState       - Current walk state object
 202  202   *
 203  203   * RETURN:      Status
 204  204   *
 205      - * DESCRIPTION: Initialize arguments for a method.  The parameter list is a list
      205 + * DESCRIPTION: Initialize arguments for a method. The parameter list is a list
 206  206   *              of ACPI operand objects, either null terminated or whose length
 207  207   *              is defined by MaxParamCount.
 208  208   *
 209  209   ******************************************************************************/
 210  210  
 211  211  ACPI_STATUS
 212  212  AcpiDsMethodDataInitArgs (
 213  213      ACPI_OPERAND_OBJECT     **Params,
 214  214      UINT32                  MaxParamCount,
 215  215      ACPI_WALK_STATE         *WalkState)
↓ open down ↓ 92 lines elided ↑ open up ↑
 308  308                  Index, ACPI_METHOD_MAX_ARG));
 309  309              return_ACPI_STATUS (AE_AML_INVALID_INDEX);
 310  310          }
 311  311  
 312  312          /* Return a pointer to the pseudo-node */
 313  313  
 314  314          *Node = &WalkState->Arguments[Index];
 315  315          break;
 316  316  
 317  317      default:
      318 +
 318  319          ACPI_ERROR ((AE_INFO, "Type %u is invalid", Type));
 319  320          return_ACPI_STATUS (AE_TYPE);
 320  321      }
 321  322  
 322  323      return_ACPI_STATUS (AE_OK);
 323  324  }
 324  325  
 325  326  
 326  327  /*******************************************************************************
 327  328   *
↓ open down ↓ 108 lines elided ↑ open up ↑
 436  437  
 437  438      /* Examine the returned object, it must be valid. */
 438  439  
 439  440      if (!Object)
 440  441      {
 441  442          /*
 442  443           * Index points to uninitialized object.
 443  444           * This means that either 1) The expected argument was
 444  445           * not passed to the method, or 2) A local variable
 445  446           * was referenced by the method (via the ASL)
 446      -         * before it was initialized.  Either case is an error.
      447 +         * before it was initialized. Either case is an error.
 447  448           */
 448  449  
 449  450          /* If slack enabled, init the LocalX/ArgX to an Integer of value zero */
 450  451  
 451  452          if (AcpiGbl_EnableInterpreterSlack)
 452  453          {
 453  454              Object = AcpiUtCreateIntegerObject ((UINT64) 0);
 454  455              if (!Object)
 455  456              {
 456  457                  return_ACPI_STATUS (AE_NO_MEMORY);
↓ open down ↓ 8 lines elided ↑ open up ↑
 465  466          {
 466  467          case ACPI_REFCLASS_ARG:
 467  468  
 468  469              ACPI_ERROR ((AE_INFO,
 469  470                  "Uninitialized Arg[%u] at node %p",
 470  471                  Index, Node));
 471  472  
 472  473              return_ACPI_STATUS (AE_AML_UNINITIALIZED_ARG);
 473  474  
 474  475          case ACPI_REFCLASS_LOCAL:
 475      -
 476  476              /*
 477  477               * No error message for this case, will be trapped again later to
 478  478               * detect and ignore cases of Store(LocalX,LocalX)
 479  479               */
 480  480              return_ACPI_STATUS (AE_AML_UNINITIALIZED_LOCAL);
 481  481  
 482  482          default:
 483  483  
 484  484              ACPI_ERROR ((AE_INFO, "Not a Arg/Local opcode: 0x%X", Type));
 485  485              return_ACPI_STATUS (AE_AML_INTERNAL);
↓ open down ↓ 15 lines elided ↑ open up ↑
 501  501   *
 502  502   * FUNCTION:    AcpiDsMethodDataDeleteValue
 503  503   *
 504  504   * PARAMETERS:  Type                - Either ACPI_REFCLASS_LOCAL or
 505  505   *                                    ACPI_REFCLASS_ARG
 506  506   *              Index               - Which localVar or argument to delete
 507  507   *              WalkState           - Current walk state object
 508  508   *
 509  509   * RETURN:      None
 510  510   *
 511      - * DESCRIPTION: Delete the entry at Opcode:Index.  Inserts
      511 + * DESCRIPTION: Delete the entry at Opcode:Index. Inserts
 512  512   *              a null into the stack slot after the object is deleted.
 513  513   *
 514  514   ******************************************************************************/
 515  515  
 516  516  static void
 517  517  AcpiDsMethodDataDeleteValue (
 518  518      UINT8                   Type,
 519  519      UINT32                  Index,
 520  520      ACPI_WALK_STATE         *WalkState)
 521  521  {
↓ open down ↓ 44 lines elided ↑ open up ↑
 566  566   * FUNCTION:    AcpiDsStoreObjectToLocal
 567  567   *
 568  568   * PARAMETERS:  Type                - Either ACPI_REFCLASS_LOCAL or
 569  569   *                                    ACPI_REFCLASS_ARG
 570  570   *              Index               - Which Local or Arg to set
 571  571   *              ObjDesc             - Value to be stored
 572  572   *              WalkState           - Current walk state
 573  573   *
 574  574   * RETURN:      Status
 575  575   *
 576      - * DESCRIPTION: Store a value in an Arg or Local.  The ObjDesc is installed
      576 + * DESCRIPTION: Store a value in an Arg or Local. The ObjDesc is installed
 577  577   *              as the new value for the Arg or Local and the reference count
 578  578   *              for ObjDesc is incremented.
 579  579   *
 580  580   ******************************************************************************/
 581  581  
 582  582  ACPI_STATUS
 583  583  AcpiDsStoreObjectToLocal (
 584  584      UINT8                   Type,
 585  585      UINT32                  Index,
 586  586      ACPI_OPERAND_OBJECT     *ObjDesc,
↓ open down ↓ 27 lines elided ↑ open up ↑
 614  614      CurrentObjDesc = AcpiNsGetAttachedObject (Node);
 615  615      if (CurrentObjDesc == ObjDesc)
 616  616      {
 617  617          ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Obj=%p already installed!\n",
 618  618              ObjDesc));
 619  619          return_ACPI_STATUS (Status);
 620  620      }
 621  621  
 622  622      /*
 623  623       * If the reference count on the object is more than one, we must
 624      -     * take a copy of the object before we store.  A reference count
      624 +     * take a copy of the object before we store. A reference count
 625  625       * of exactly 1 means that the object was just created during the
 626  626       * evaluation of an expression, and we can safely use it since it
 627  627       * is not used anywhere else.
 628  628       */
 629  629      NewObjDesc = ObjDesc;
 630  630      if (ObjDesc->Common.ReferenceCount > 1)
 631  631      {
 632  632          Status = AcpiUtCopyIobjectToIobject (ObjDesc, &NewObjDesc, WalkState);
 633  633          if (ACPI_FAILURE (Status))
 634  634          {
↓ open down ↓ 126 lines elided ↑ open up ↑
 761  761          /* Uninitialized local/arg, return TYPE_ANY */
 762  762  
 763  763          return_VALUE (ACPI_TYPE_ANY);
 764  764      }
 765  765  
 766  766      /* Get the object type */
 767  767  
 768  768      return_VALUE (Object->Type);
 769  769  }
 770  770  #endif
 771      -
 772      -
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX