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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/io/acpica/executer/exresnte.c
          +++ new/usr/src/common/acpica/components/executer/exresnte.c
   1      -
   2    1  /******************************************************************************
   3    2   *
   4    3   * Module Name: exresnte - AML Interpreter object resolution
   5    4   *
   6    5   *****************************************************************************/
   7    6  
   8    7  /*
   9      - * Copyright (C) 2000 - 2011, Intel Corp.
        8 + * Copyright (C) 2000 - 2013, Intel Corp.
  10    9   * All rights reserved.
  11   10   *
  12   11   * Redistribution and use in source and binary forms, with or without
  13   12   * modification, are permitted provided that the following conditions
  14   13   * are met:
  15   14   * 1. Redistributions of source code must retain the above copyright
  16   15   *    notice, this list of conditions, and the following disclaimer,
  17   16   *    without modification.
  18   17   * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  19   18   *    substantially similar to the "NO WARRANTY" disclaimer below
↓ open down ↓ 35 lines elided ↑ open up ↑
  55   54          ACPI_MODULE_NAME    ("exresnte")
  56   55  
  57   56  
  58   57  /*******************************************************************************
  59   58   *
  60   59   * FUNCTION:    AcpiExResolveNodeToValue
  61   60   *
  62   61   * PARAMETERS:  ObjectPtr       - Pointer to a location that contains
  63   62   *                                a pointer to a NS node, and will receive a
  64   63   *                                pointer to the resolved object.
  65      - *              WalkState       - Current state.  Valid only if executing AML
  66      - *                                code.  NULL if simply resolving an object
       64 + *              WalkState       - Current state. Valid only if executing AML
       65 + *                                code. NULL if simply resolving an object
  67   66   *
  68   67   * RETURN:      Status
  69   68   *
  70   69   * DESCRIPTION: Resolve a Namespace node to a valued object
  71   70   *
  72   71   * Note: for some of the data types, the pointer attached to the Node
  73   72   * can be either a pointer to an actual internal object or a pointer into the
  74      - * AML stream itself.  These types are currently:
       73 + * AML stream itself. These types are currently:
  75   74   *
  76   75   *      ACPI_TYPE_INTEGER
  77   76   *      ACPI_TYPE_STRING
  78   77   *      ACPI_TYPE_BUFFER
  79   78   *      ACPI_TYPE_MUTEX
  80   79   *      ACPI_TYPE_PACKAGE
  81   80   *
  82   81   ******************************************************************************/
  83   82  
  84   83  ACPI_STATUS
↓ open down ↓ 6 lines elided ↑ open up ↑
  91   90      ACPI_OPERAND_OBJECT     *SourceDesc;
  92   91      ACPI_OPERAND_OBJECT     *ObjDesc = NULL;
  93   92      ACPI_NAMESPACE_NODE     *Node;
  94   93      ACPI_OBJECT_TYPE        EntryType;
  95   94  
  96   95  
  97   96      ACPI_FUNCTION_TRACE (ExResolveNodeToValue);
  98   97  
  99   98  
 100   99      /*
 101      -     * The stack pointer points to a ACPI_NAMESPACE_NODE (Node).  Get the
      100 +     * The stack pointer points to a ACPI_NAMESPACE_NODE (Node). Get the
 102  101       * object that is attached to the Node.
 103  102       */
 104  103      Node       = *ObjectPtr;
 105  104      SourceDesc = AcpiNsGetAttachedObject (Node);
 106  105      EntryType  = AcpiNsGetType ((ACPI_HANDLE) Node);
 107  106  
 108  107      ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Entry=%p SourceDesc=%p [%s]\n",
 109  108           Node, SourceDesc, AcpiUtGetTypeName (EntryType)));
 110  109  
 111  110      if ((EntryType == ACPI_TYPE_LOCAL_ALIAS) ||
↓ open down ↓ 16 lines elided ↑ open up ↑
 128  127      if ((EntryType == ACPI_TYPE_DEVICE)  ||
 129  128          (EntryType == ACPI_TYPE_THERMAL) ||
 130  129          (EntryType == ACPI_TYPE_METHOD)  ||
 131  130          (Node->Flags & (ANOBJ_METHOD_ARG | ANOBJ_METHOD_LOCAL)))
 132  131      {
 133  132          return_ACPI_STATUS (AE_OK);
 134  133      }
 135  134  
 136  135      if (!SourceDesc)
 137  136      {
 138      -        ACPI_ERROR ((AE_INFO, "No object attached to node %p",
 139      -            Node));
      137 +        ACPI_ERROR ((AE_INFO, "No object attached to node [%4.4s] %p",
      138 +            Node->Name.Ascii, Node));
 140  139          return_ACPI_STATUS (AE_AML_NO_OPERAND);
 141  140      }
 142  141  
 143  142      /*
 144  143       * Action is based on the type of the Node, which indicates the type
 145  144       * of the attached object or pointer
 146  145       */
 147  146      switch (EntryType)
 148  147      {
 149  148      case ACPI_TYPE_PACKAGE:
↓ open down ↓ 8 lines elided ↑ open up ↑
 158  157          Status = AcpiDsGetPackageArguments (SourceDesc);
 159  158          if (ACPI_SUCCESS (Status))
 160  159          {
 161  160              /* Return an additional reference to the object */
 162  161  
 163  162              ObjDesc = SourceDesc;
 164  163              AcpiUtAddReference (ObjDesc);
 165  164          }
 166  165          break;
 167  166  
 168      -
 169  167      case ACPI_TYPE_BUFFER:
 170  168  
 171  169          if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER)
 172  170          {
 173  171              ACPI_ERROR ((AE_INFO, "Object not a Buffer, type %s",
 174  172                  AcpiUtGetObjectTypeName (SourceDesc)));
 175  173              return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
 176  174          }
 177  175  
 178  176          Status = AcpiDsGetBufferArguments (SourceDesc);
 179  177          if (ACPI_SUCCESS (Status))
 180  178          {
 181  179              /* Return an additional reference to the object */
 182  180  
 183  181              ObjDesc = SourceDesc;
 184  182              AcpiUtAddReference (ObjDesc);
 185  183          }
 186  184          break;
 187  185  
 188      -
 189  186      case ACPI_TYPE_STRING:
 190  187  
 191  188          if (SourceDesc->Common.Type != ACPI_TYPE_STRING)
 192  189          {
 193  190              ACPI_ERROR ((AE_INFO, "Object not a String, type %s",
 194  191                  AcpiUtGetObjectTypeName (SourceDesc)));
 195  192              return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
 196  193          }
 197  194  
 198  195          /* Return an additional reference to the object */
 199  196  
 200  197          ObjDesc = SourceDesc;
 201  198          AcpiUtAddReference (ObjDesc);
 202  199          break;
 203  200  
 204      -
 205  201      case ACPI_TYPE_INTEGER:
 206  202  
 207  203          if (SourceDesc->Common.Type != ACPI_TYPE_INTEGER)
 208  204          {
 209  205              ACPI_ERROR ((AE_INFO, "Object not a Integer, type %s",
 210  206                  AcpiUtGetObjectTypeName (SourceDesc)));
 211  207              return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
 212  208          }
 213  209  
 214  210          /* Return an additional reference to the object */
 215  211  
 216  212          ObjDesc = SourceDesc;
 217  213          AcpiUtAddReference (ObjDesc);
 218  214          break;
 219  215  
 220      -
 221  216      case ACPI_TYPE_BUFFER_FIELD:
 222  217      case ACPI_TYPE_LOCAL_REGION_FIELD:
 223  218      case ACPI_TYPE_LOCAL_BANK_FIELD:
 224  219      case ACPI_TYPE_LOCAL_INDEX_FIELD:
 225  220  
 226  221          ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
 227  222              "FieldRead Node=%p SourceDesc=%p Type=%X\n",
 228  223              Node, SourceDesc, EntryType));
 229  224  
 230  225          Status = AcpiExReadDataFromField (WalkState, SourceDesc, &ObjDesc);
↓ open down ↓ 15 lines elided ↑ open up ↑
 246  241  
 247  242      /* TYPE_ANY is untyped, and thus there is no object associated with it */
 248  243  
 249  244      case ACPI_TYPE_ANY:
 250  245  
 251  246          ACPI_ERROR ((AE_INFO,
 252  247              "Untyped entry %p, no attached object!", Node));
 253  248  
 254  249          return_ACPI_STATUS (AE_AML_OPERAND_TYPE);  /* Cannot be AE_TYPE */
 255  250  
 256      -
 257  251      case ACPI_TYPE_LOCAL_REFERENCE:
 258  252  
 259  253          switch (SourceDesc->Reference.Class)
 260  254          {
 261  255          case ACPI_REFCLASS_TABLE:   /* This is a DdbHandle */
 262  256          case ACPI_REFCLASS_REFOF:
 263  257          case ACPI_REFCLASS_INDEX:
 264  258  
 265  259              /* Return an additional reference to the object */
 266  260  
 267  261              ObjDesc = SourceDesc;
 268  262              AcpiUtAddReference (ObjDesc);
 269  263              break;
 270  264  
 271  265          default:
      266 +
 272  267              /* No named references are allowed here */
 273  268  
 274  269              ACPI_ERROR ((AE_INFO,
 275  270                  "Unsupported Reference type 0x%X",
 276  271                  SourceDesc->Reference.Class));
 277  272  
 278  273              return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
 279  274          }
 280  275          break;
 281  276  
 282      -
 283  277      default:
 284  278  
 285  279          /* Default case is for unknown types */
 286  280  
 287  281          ACPI_ERROR ((AE_INFO,
 288  282              "Node %p - Unknown object type 0x%X",
 289  283              Node, EntryType));
 290  284  
 291  285          return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
 292  286  
 293  287      } /* switch (EntryType) */
 294  288  
 295  289  
 296  290      /* Return the object descriptor */
 297  291  
 298  292      *ObjectPtr = (void *) ObjDesc;
 299  293      return_ACPI_STATUS (Status);
 300  294  }
 301      -
 302      -
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX