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/utilities/utstate.c
          +++ new/usr/src/common/acpica/components/utilities/utstate.c
   1    1  /*******************************************************************************
   2    2   *
   3    3   * Module Name: utstate - state object support procedures
   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 ↓ 81 lines elided ↑ open up ↑
 100  100   *
 101  101   * DESCRIPTION: Push a state object onto a state stack
 102  102   *
 103  103   ******************************************************************************/
 104  104  
 105  105  void
 106  106  AcpiUtPushGenericState (
 107  107      ACPI_GENERIC_STATE      **ListHead,
 108  108      ACPI_GENERIC_STATE      *State)
 109  109  {
 110      -    ACPI_FUNCTION_TRACE (UtPushGenericState);
      110 +    ACPI_FUNCTION_ENTRY ();
 111  111  
 112  112  
 113  113      /* Push the state object onto the front of the list (stack) */
 114  114  
 115  115      State->Common.Next = *ListHead;
 116  116      *ListHead = State;
 117      -
 118      -    return_VOID;
      117 +    return;
 119  118  }
 120  119  
 121  120  
 122  121  /*******************************************************************************
 123  122   *
 124  123   * FUNCTION:    AcpiUtPopGenericState
 125  124   *
 126  125   * PARAMETERS:  ListHead            - Head of the state stack
 127  126   *
 128  127   * RETURN:      The popped state object
↓ open down ↓ 2 lines elided ↑ open up ↑
 131  130   *
 132  131   ******************************************************************************/
 133  132  
 134  133  ACPI_GENERIC_STATE *
 135  134  AcpiUtPopGenericState (
 136  135      ACPI_GENERIC_STATE      **ListHead)
 137  136  {
 138  137      ACPI_GENERIC_STATE      *State;
 139  138  
 140  139  
 141      -    ACPI_FUNCTION_TRACE (UtPopGenericState);
      140 +    ACPI_FUNCTION_ENTRY ();
 142  141  
 143  142  
 144  143      /* Remove the state object at the head of the list (stack) */
 145  144  
 146  145      State = *ListHead;
 147  146      if (State)
 148  147      {
 149  148          /* Update the list head */
 150  149  
 151  150          *ListHead = State->Common.Next;
 152  151      }
 153  152  
 154      -    return_PTR (State);
      153 +    return (State);
 155  154  }
 156  155  
 157  156  
 158  157  /*******************************************************************************
 159  158   *
 160  159   * FUNCTION:    AcpiUtCreateGenericState
 161  160   *
 162  161   * PARAMETERS:  None
 163  162   *
 164  163   * RETURN:      The new state object. NULL on failure.
 165  164   *
 166      - * DESCRIPTION: Create a generic state object.  Attempt to obtain one from
      165 + * DESCRIPTION: Create a generic state object. Attempt to obtain one from
 167  166   *              the global state cache;  If none available, create a new one.
 168  167   *
 169  168   ******************************************************************************/
 170  169  
 171  170  ACPI_GENERIC_STATE *
 172  171  AcpiUtCreateGenericState (
 173  172      void)
 174  173  {
 175  174      ACPI_GENERIC_STATE      *State;
 176  175  
↓ open down ↓ 25 lines elided ↑ open up ↑
 202  201   *
 203  202   ******************************************************************************/
 204  203  
 205  204  ACPI_THREAD_STATE *
 206  205  AcpiUtCreateThreadState (
 207  206      void)
 208  207  {
 209  208      ACPI_GENERIC_STATE      *State;
 210  209  
 211  210  
 212      -    ACPI_FUNCTION_TRACE (UtCreateThreadState);
      211 +    ACPI_FUNCTION_ENTRY ();
 213  212  
 214  213  
 215  214      /* Create the generic state object */
 216  215  
 217  216      State = AcpiUtCreateGenericState ();
 218  217      if (!State)
 219  218      {
 220      -        return_PTR (NULL);
      219 +        return (NULL);
 221  220      }
 222  221  
 223  222      /* Init fields specific to the update struct */
 224  223  
 225  224      State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_THREAD;
 226  225      State->Thread.ThreadId = AcpiOsGetThreadId ();
 227  226  
 228  227      /* Check for invalid thread ID - zero is very bad, it will break things */
 229  228  
 230  229      if (!State->Thread.ThreadId)
 231  230      {
 232  231          ACPI_ERROR ((AE_INFO, "Invalid zero ID from AcpiOsGetThreadId"));
 233  232          State->Thread.ThreadId = (ACPI_THREAD_ID) 1;
 234  233      }
 235  234  
 236      -    return_PTR ((ACPI_THREAD_STATE *) State);
      235 +    return ((ACPI_THREAD_STATE *) State);
 237  236  }
 238  237  
 239  238  
 240  239  /*******************************************************************************
 241  240   *
 242  241   * FUNCTION:    AcpiUtCreateUpdateState
 243  242   *
 244  243   * PARAMETERS:  Object          - Initial Object to be installed in the state
 245  244   *              Action          - Update action to be performed
 246  245   *
↓ open down ↓ 6 lines elided ↑ open up ↑
 253  252   ******************************************************************************/
 254  253  
 255  254  ACPI_GENERIC_STATE *
 256  255  AcpiUtCreateUpdateState (
 257  256      ACPI_OPERAND_OBJECT     *Object,
 258  257      UINT16                  Action)
 259  258  {
 260  259      ACPI_GENERIC_STATE      *State;
 261  260  
 262  261  
 263      -    ACPI_FUNCTION_TRACE_PTR (UtCreateUpdateState, Object);
      262 +    ACPI_FUNCTION_ENTRY ();
 264  263  
 265  264  
 266  265      /* Create the generic state object */
 267  266  
 268  267      State = AcpiUtCreateGenericState ();
 269  268      if (!State)
 270  269      {
 271      -        return_PTR (NULL);
      270 +        return (NULL);
 272  271      }
 273  272  
 274  273      /* Init fields specific to the update struct */
 275  274  
 276  275      State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_UPDATE;
 277  276      State->Update.Object = Object;
 278  277      State->Update.Value = Action;
 279      -
 280      -    return_PTR (State);
      278 +    return (State);
 281  279  }
 282  280  
 283  281  
 284  282  /*******************************************************************************
 285  283   *
 286  284   * FUNCTION:    AcpiUtCreatePkgState
 287  285   *
 288  286   * PARAMETERS:  Object          - Initial Object to be installed in the state
 289  287   *              Action          - Update action to be performed
 290  288   *
↓ open down ↓ 5 lines elided ↑ open up ↑
 296  294  
 297  295  ACPI_GENERIC_STATE *
 298  296  AcpiUtCreatePkgState (
 299  297      void                    *InternalObject,
 300  298      void                    *ExternalObject,
 301  299      UINT16                  Index)
 302  300  {
 303  301      ACPI_GENERIC_STATE      *State;
 304  302  
 305  303  
 306      -    ACPI_FUNCTION_TRACE_PTR (UtCreatePkgState, InternalObject);
      304 +    ACPI_FUNCTION_ENTRY ();
 307  305  
 308  306  
 309  307      /* Create the generic state object */
 310  308  
 311  309      State = AcpiUtCreateGenericState ();
 312  310      if (!State)
 313  311      {
 314      -        return_PTR (NULL);
      312 +        return (NULL);
 315  313      }
 316  314  
 317  315      /* Init fields specific to the update struct */
 318  316  
 319  317      State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_PACKAGE;
 320  318      State->Pkg.SourceObject = (ACPI_OPERAND_OBJECT *) InternalObject;
 321  319      State->Pkg.DestObject = ExternalObject;
 322  320      State->Pkg.Index= Index;
 323  321      State->Pkg.NumPackages = 1;
 324      -
 325      -    return_PTR (State);
      322 +    return (State);
 326  323  }
 327  324  
 328  325  
 329  326  /*******************************************************************************
 330  327   *
 331  328   * FUNCTION:    AcpiUtCreateControlState
 332  329   *
 333  330   * PARAMETERS:  None
 334  331   *
 335  332   * RETURN:      New state object, null on failure
↓ open down ↓ 3 lines elided ↑ open up ↑
 339  336   *
 340  337   ******************************************************************************/
 341  338  
 342  339  ACPI_GENERIC_STATE *
 343  340  AcpiUtCreateControlState (
 344  341      void)
 345  342  {
 346  343      ACPI_GENERIC_STATE      *State;
 347  344  
 348  345  
 349      -    ACPI_FUNCTION_TRACE (UtCreateControlState);
      346 +    ACPI_FUNCTION_ENTRY ();
 350  347  
 351  348  
 352  349      /* Create the generic state object */
 353  350  
 354  351      State = AcpiUtCreateGenericState ();
 355  352      if (!State)
 356  353      {
 357      -        return_PTR (NULL);
      354 +        return (NULL);
 358  355      }
 359  356  
 360  357      /* Init fields specific to the control struct */
 361  358  
 362  359      State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_CONTROL;
 363  360      State->Common.State = ACPI_CONTROL_CONDITIONAL_EXECUTING;
 364      -
 365      -    return_PTR (State);
      361 +    return (State);
 366  362  }
 367  363  
 368  364  
 369  365  /*******************************************************************************
 370  366   *
 371  367   * FUNCTION:    AcpiUtDeleteGenericState
 372  368   *
 373  369   * PARAMETERS:  State               - The state object to be deleted
 374  370   *
 375  371   * RETURN:      None
 376  372   *
 377  373   * DESCRIPTION: Release a state object to the state cache. NULL state objects
 378  374   *              are ignored.
 379  375   *
 380  376   ******************************************************************************/
 381  377  
 382  378  void
 383  379  AcpiUtDeleteGenericState (
 384  380      ACPI_GENERIC_STATE      *State)
 385  381  {
 386      -    ACPI_FUNCTION_TRACE (UtDeleteGenericState);
      382 +    ACPI_FUNCTION_ENTRY ();
 387  383  
 388  384  
 389  385      /* Ignore null state */
 390  386  
 391  387      if (State)
 392  388      {
 393  389          (void) AcpiOsReleaseObject (AcpiGbl_StateCache, State);
 394  390      }
 395      -    return_VOID;
      391 +    return;
 396  392  }
 397      -
 398      -
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX