Print this page
acpica-unix2-20130823
PANKOVs restructure

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/io/acpica/dispatcher/dsmethod.c
          +++ new/usr/src/common/acpica/components/dispatcher/dsmethod.c
   1    1  /******************************************************************************
   2    2   *
   3    3   * Module Name: dsmethod - Parser/Interpreter interface - control method parsing
   4    4   *
   5    5   *****************************************************************************/
   6    6  
   7    7  /*
   8      - * Copyright (C) 2000 - 2011, Intel Corp.
        8 + * Copyright (C) 2000 - 2013, 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 ↓ 137 lines elided ↑ open up ↑
 156  156      if (!MutexDesc)
 157  157      {
 158  158          return_ACPI_STATUS (AE_NO_MEMORY);
 159  159      }
 160  160  
 161  161      /* Create the actual OS Mutex */
 162  162  
 163  163      Status = AcpiOsCreateMutex (&MutexDesc->Mutex.OsMutex);
 164  164      if (ACPI_FAILURE (Status))
 165  165      {
      166 +        AcpiUtDeleteObjectDesc (MutexDesc);
 166  167          return_ACPI_STATUS (Status);
 167  168      }
 168  169  
 169  170      MutexDesc->Mutex.SyncLevel = MethodDesc->Method.SyncLevel;
 170  171      MethodDesc->Method.Mutex = MutexDesc;
 171  172      return_ACPI_STATUS (AE_OK);
 172  173  }
 173  174  
 174  175  
 175  176  /*******************************************************************************
 176  177   *
 177  178   * FUNCTION:    AcpiDsBeginMethodExecution
 178  179   *
 179  180   * PARAMETERS:  MethodNode          - Node of the method
 180  181   *              ObjDesc             - The method object
 181  182   *              WalkState           - current state, NULL if not yet executing
 182  183   *                                    a method.
 183  184   *
 184  185   * RETURN:      Status
 185  186   *
 186      - * DESCRIPTION: Prepare a method for execution.  Parses the method if necessary,
      187 + * DESCRIPTION: Prepare a method for execution. Parses the method if necessary,
 187  188   *              increments the thread count, and waits at the method semaphore
 188  189   *              for clearance to execute.
 189  190   *
 190  191   ******************************************************************************/
 191  192  
 192  193  ACPI_STATUS
 193  194  AcpiDsBeginMethodExecution (
 194  195      ACPI_NAMESPACE_NODE     *MethodNode,
 195  196      ACPI_OPERAND_OBJECT     *ObjDesc,
 196  197      ACPI_WALK_STATE         *WalkState)
↓ open down ↓ 205 lines elided ↑ open up ↑
 402  403      ThisWalkState->Operands [ThisWalkState->NumOperands] = NULL;
 403  404  
 404  405      /*
 405  406       * Allocate and initialize the evaluation information block
 406  407       * TBD: this is somewhat inefficient, should change interface to
 407  408       * DsInitAmlWalk. For now, keeps this struct off the CPU stack
 408  409       */
 409  410      Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EVALUATE_INFO));
 410  411      if (!Info)
 411  412      {
 412      -        return_ACPI_STATUS (AE_NO_MEMORY);
      413 +        Status = AE_NO_MEMORY;
      414 +        goto Cleanup;
 413  415      }
 414  416  
 415  417      Info->Parameters = &ThisWalkState->Operands[0];
 416  418  
 417  419      Status = AcpiDsInitAmlWalk (NextWalkState, NULL, MethodNode,
 418  420                  ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength,
 419  421                  Info, ACPI_IMODE_EXECUTE);
 420  422  
 421  423      ACPI_FREE (Info);
 422  424      if (ACPI_FAILURE (Status))
↓ open down ↓ 50 lines elided ↑ open up ↑
 473  475  /*******************************************************************************
 474  476   *
 475  477   * FUNCTION:    AcpiDsRestartControlMethod
 476  478   *
 477  479   * PARAMETERS:  WalkState           - State for preempted method (caller)
 478  480   *              ReturnDesc          - Return value from the called method
 479  481   *
 480  482   * RETURN:      Status
 481  483   *
 482  484   * DESCRIPTION: Restart a method that was preempted by another (nested) method
 483      - *              invocation.  Handle the return value (if any) from the callee.
      485 + *              invocation. Handle the return value (if any) from the callee.
 484  486   *
 485  487   ******************************************************************************/
 486  488  
 487  489  ACPI_STATUS
 488  490  AcpiDsRestartControlMethod (
 489  491      ACPI_WALK_STATE         *WalkState,
 490  492      ACPI_OPERAND_OBJECT     *ReturnDesc)
 491  493  {
 492  494      ACPI_STATUS             Status;
 493  495      int                     SameAsImplicitReturn;
↓ open down ↓ 69 lines elided ↑ open up ↑
 563  565  
 564  566  /*******************************************************************************
 565  567   *
 566  568   * FUNCTION:    AcpiDsTerminateControlMethod
 567  569   *
 568  570   * PARAMETERS:  MethodDesc          - Method object
 569  571   *              WalkState           - State associated with the method
 570  572   *
 571  573   * RETURN:      None
 572  574   *
 573      - * DESCRIPTION: Terminate a control method.  Delete everything that the method
      575 + * DESCRIPTION: Terminate a control method. Delete everything that the method
 574  576   *              created, delete all locals and arguments, and delete the parse
 575  577   *              tree if requested.
 576  578   *
 577  579   * MUTEX:       Interpreter is locked
 578  580   *
 579  581   ******************************************************************************/
 580  582  
 581  583  void
 582  584  AcpiDsTerminateControlMethod (
 583  585      ACPI_OPERAND_OBJECT     *MethodDesc,
↓ open down ↓ 131 lines elided ↑ open up ↑
 715  717          /* No more threads, we can free the OwnerId */
 716  718  
 717  719          if (!(MethodDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL))
 718  720          {
 719  721              AcpiUtReleaseOwnerId (&MethodDesc->Method.OwnerId);
 720  722          }
 721  723      }
 722  724  
 723  725      return_VOID;
 724  726  }
 725      -
 726      -
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX