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/executer/exstoren.c
          +++ new/usr/src/common/acpica/components/executer/exstoren.c
   1      -
   2    1  /******************************************************************************
   3    2   *
   4    3   * Module Name: exstoren - AML Interpreter object store support,
   5    4   *                        Store to Node (namespace object)
   6    5   *
   7    6   *****************************************************************************/
   8    7  
   9    8  /*
  10      - * Copyright (C) 2000 - 2011, Intel Corp.
        9 + * Copyright (C) 2000 - 2014, Intel Corp.
  11   10   * All rights reserved.
  12   11   *
  13   12   * Redistribution and use in source and binary forms, with or without
  14   13   * modification, are permitted provided that the following conditions
  15   14   * are met:
  16   15   * 1. Redistributions of source code must retain the above copyright
  17   16   *    notice, this list of conditions, and the following disclaimer,
  18   17   *    without modification.
  19   18   * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  20   19   *    substantially similar to the "NO WARRANTY" disclaimer below
↓ open down ↓ 37 lines elided ↑ open up ↑
  58   57  /*******************************************************************************
  59   58   *
  60   59   * FUNCTION:    AcpiExResolveObject
  61   60   *
  62   61   * PARAMETERS:  SourceDescPtr       - Pointer to the source object
  63   62   *              TargetType          - Current type of the target
  64   63   *              WalkState           - Current walk state
  65   64   *
  66   65   * RETURN:      Status, resolved object in SourceDescPtr.
  67   66   *
  68      - * DESCRIPTION: Resolve an object.  If the object is a reference, dereference
       67 + * DESCRIPTION: Resolve an object. If the object is a reference, dereference
  69   68   *              it and return the actual object in the SourceDescPtr.
  70   69   *
  71   70   ******************************************************************************/
  72   71  
  73   72  ACPI_STATUS
  74   73  AcpiExResolveObject (
  75   74      ACPI_OPERAND_OBJECT     **SourceDescPtr,
  76   75      ACPI_OBJECT_TYPE        TargetType,
  77   76      ACPI_WALK_STATE         *WalkState)
  78   77  {
↓ open down ↓ 9 lines elided ↑ open up ↑
  88   87      switch (TargetType)
  89   88      {
  90   89      case ACPI_TYPE_BUFFER_FIELD:
  91   90      case ACPI_TYPE_LOCAL_REGION_FIELD:
  92   91      case ACPI_TYPE_LOCAL_BANK_FIELD:
  93   92      case ACPI_TYPE_LOCAL_INDEX_FIELD:
  94   93          /*
  95   94           * These cases all require only Integers or values that
  96   95           * can be converted to Integers (Strings or Buffers)
  97   96           */
  98      -
  99   97      case ACPI_TYPE_INTEGER:
 100   98      case ACPI_TYPE_STRING:
 101   99      case ACPI_TYPE_BUFFER:
 102      -
 103  100          /*
 104  101           * Stores into a Field/Region or into a Integer/Buffer/String
 105      -         * are all essentially the same.  This case handles the
      102 +         * are all essentially the same. This case handles the
 106  103           * "interchangeable" types Integer, String, and Buffer.
 107  104           */
 108  105          if (SourceDesc->Common.Type == ACPI_TYPE_LOCAL_REFERENCE)
 109  106          {
 110  107              /* Resolve a reference object first */
 111  108  
 112  109              Status = AcpiExResolveToValue (SourceDescPtr, WalkState);
 113  110              if (ACPI_FAILURE (Status))
 114  111              {
 115  112                  break;
↓ open down ↓ 18 lines elided ↑ open up ↑
 134  131              /* Conversion successful but still not a valid type */
 135  132  
 136  133              ACPI_ERROR ((AE_INFO,
 137  134                  "Cannot assign type %s to %s (must be type Int/Str/Buf)",
 138  135                  AcpiUtGetObjectTypeName (SourceDesc),
 139  136                  AcpiUtGetTypeName (TargetType)));
 140  137              Status = AE_AML_OPERAND_TYPE;
 141  138          }
 142  139          break;
 143  140  
 144      -
 145  141      case ACPI_TYPE_LOCAL_ALIAS:
 146  142      case ACPI_TYPE_LOCAL_METHOD_ALIAS:
 147      -
 148  143          /*
 149  144           * All aliases should have been resolved earlier, during the
 150  145           * operand resolution phase.
 151  146           */
 152  147          ACPI_ERROR ((AE_INFO, "Store into an unresolved Alias object"));
 153  148          Status = AE_AML_INTERNAL;
 154  149          break;
 155  150  
 156      -
 157  151      case ACPI_TYPE_PACKAGE:
 158  152      default:
 159      -
 160  153          /*
 161  154           * All other types than Alias and the various Fields come here,
 162  155           * including the untyped case - ACPI_TYPE_ANY.
 163  156           */
 164  157          break;
 165  158      }
 166  159  
 167  160      return_ACPI_STATUS (Status);
 168  161  }
 169  162  
↓ open down ↓ 2 lines elided ↑ open up ↑
 172  165   *
 173  166   * FUNCTION:    AcpiExStoreObjectToObject
 174  167   *
 175  168   * PARAMETERS:  SourceDesc          - Object to store
 176  169   *              DestDesc            - Object to receive a copy of the source
 177  170   *              NewDesc             - New object if DestDesc is obsoleted
 178  171   *              WalkState           - Current walk state
 179  172   *
 180  173   * RETURN:      Status
 181  174   *
 182      - * DESCRIPTION: "Store" an object to another object.  This may include
      175 + * DESCRIPTION: "Store" an object to another object. This may include
 183  176   *              converting the source type to the target type (implicit
 184  177   *              conversion), and a copy of the value of the source to
 185  178   *              the target.
 186  179   *
 187  180   *              The Assignment of an object to another (not named) object
 188  181   *              is handled here.
 189  182   *              The Source passed in will replace the current value (if any)
 190  183   *              with the input value.
 191  184   *
 192  185   *              When storing into an object the data is converted to the
 193      - *              target object type then stored in the object.  This means
      186 + *              target object type then stored in the object. This means
 194  187   *              that the target object type (for an initialized target) will
 195  188   *              not be changed by a store operation.
 196  189   *
 197  190   *              This module allows destination types of Number, String,
 198  191   *              Buffer, and Package.
 199  192   *
 200      - *              Assumes parameters are already validated.  NOTE: SourceDesc
      193 + *              Assumes parameters are already validated. NOTE: SourceDesc
 201  194   *              resolution (from a reference object) must be performed by
 202  195   *              the caller if necessary.
 203  196   *
 204  197   ******************************************************************************/
 205  198  
 206  199  ACPI_STATUS
 207  200  AcpiExStoreObjectToObject (
 208  201      ACPI_OPERAND_OBJECT     *SourceDesc,
 209  202      ACPI_OPERAND_OBJECT     *DestDesc,
 210  203      ACPI_OPERAND_OBJECT     **NewDesc,
↓ open down ↓ 52 lines elided ↑ open up ↑
 263  256       * copy of the *value* of the source object.
 264  257       */
 265  258      switch (DestDesc->Common.Type)
 266  259      {
 267  260      case ACPI_TYPE_INTEGER:
 268  261  
 269  262          DestDesc->Integer.Value = ActualSrcDesc->Integer.Value;
 270  263  
 271  264          /* Truncate value if we are executing from a 32-bit ACPI table */
 272  265  
 273      -        AcpiExTruncateFor32bitTable (DestDesc);
      266 +        (void) AcpiExTruncateFor32bitTable (DestDesc);
 274  267          break;
 275  268  
 276  269      case ACPI_TYPE_STRING:
 277  270  
 278  271          Status = AcpiExStoreStringToString (ActualSrcDesc, DestDesc);
 279  272          break;
 280  273  
 281  274      case ACPI_TYPE_BUFFER:
 282  275  
 283  276          Status = AcpiExStoreBufferToBuffer (ActualSrcDesc, DestDesc);
↓ open down ↓ 19 lines elided ↑ open up ↑
 303  296      if (ActualSrcDesc != SourceDesc)
 304  297      {
 305  298          /* Delete the intermediate (temporary) source object */
 306  299  
 307  300          AcpiUtRemoveReference (ActualSrcDesc);
 308  301      }
 309  302  
 310  303      *NewDesc = DestDesc;
 311  304      return_ACPI_STATUS (Status);
 312  305  }
 313      -
 314      -
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX