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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/intel/io/acpica/namespace/nsalloc.c
          +++ new/usr/src/common/acpica/components/namespace/nsalloc.c
   1    1  /*******************************************************************************
   2    2   *
   3    3   * Module Name: nsalloc - Namespace allocation and deletion utilities
   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 ↓ 95 lines elided ↑ open up ↑
 114  114   *              data. If a handler is associated with attached data, it is
 115  115   *              invoked before the node is deleted.
 116  116   *
 117  117   ******************************************************************************/
 118  118  
 119  119  void
 120  120  AcpiNsDeleteNode (
 121  121      ACPI_NAMESPACE_NODE     *Node)
 122  122  {
 123  123      ACPI_OPERAND_OBJECT     *ObjDesc;
      124 +    ACPI_OPERAND_OBJECT     *NextDesc;
 124  125  
 125  126  
 126  127      ACPI_FUNCTION_NAME (NsDeleteNode);
 127  128  
 128  129  
 129  130      /* Detach an object if there is one */
 130  131  
 131  132      AcpiNsDetachObject (Node);
 132  133  
 133  134      /*
 134      -     * Delete an attached data object if present (an object that was created
 135      -     * and attached via AcpiAttachData). Note: After any normal object is
 136      -     * detached above, the only possible remaining object is a data object.
      135 +     * Delete an attached data object list if present (objects that were
      136 +     * attached via AcpiAttachData). Note: After any normal object is
      137 +     * detached above, the only possible remaining object(s) are data
      138 +     * objects, in a linked list.
 137  139       */
 138  140      ObjDesc = Node->Object;
 139      -    if (ObjDesc &&
      141 +    while (ObjDesc &&
 140  142          (ObjDesc->Common.Type == ACPI_TYPE_LOCAL_DATA))
 141  143      {
 142  144          /* Invoke the attached data deletion handler if present */
 143  145  
 144  146          if (ObjDesc->Data.Handler)
 145  147          {
 146  148              ObjDesc->Data.Handler (Node, ObjDesc->Data.Pointer);
 147  149          }
 148  150  
      151 +        NextDesc = ObjDesc->Common.NextObject;
 149  152          AcpiUtRemoveReference (ObjDesc);
      153 +        ObjDesc = NextDesc;
 150  154      }
 151  155  
      156 +    /* Special case for the statically allocated root node */
      157 +
      158 +    if (Node == AcpiGbl_RootNode)
      159 +    {
      160 +        return;
      161 +    }
      162 +
 152  163      /* Now we can delete the node */
 153  164  
 154  165      (void) AcpiOsReleaseObject (AcpiGbl_NamespaceCache, Node);
 155  166  
 156  167      ACPI_MEM_TRACKING (AcpiGbl_NsNodeList->TotalFreed++);
 157  168      ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Node %p, Remaining %X\n",
 158  169          Node, AcpiGbl_CurrentNodeCount));
 159  170  }
 160  171  
 161  172  
↓ open down ↓ 207 lines elided ↑ open up ↑
 369  380  
 370  381  
 371  382  /*******************************************************************************
 372  383   *
 373  384   * FUNCTION:    AcpiNsDeleteNamespaceSubtree
 374  385   *
 375  386   * PARAMETERS:  ParentNode      - Root of the subtree to be deleted
 376  387   *
 377  388   * RETURN:      None.
 378  389   *
 379      - * DESCRIPTION: Delete a subtree of the namespace.  This includes all objects
      390 + * DESCRIPTION: Delete a subtree of the namespace. This includes all objects
 380  391   *              stored within the subtree.
 381  392   *
 382  393   ******************************************************************************/
 383  394  
 384  395  void
 385  396  AcpiNsDeleteNamespaceSubtree (
 386  397      ACPI_NAMESPACE_NODE     *ParentNode)
 387  398  {
 388  399      ACPI_NAMESPACE_NODE     *ChildNode = NULL;
 389  400      UINT32                  Level = 1;
↓ open down ↓ 75 lines elided ↑ open up ↑
 465  476  
 466  477  /*******************************************************************************
 467  478   *
 468  479   * FUNCTION:    AcpiNsDeleteNamespaceByOwner
 469  480   *
 470  481   * PARAMETERS:  OwnerId     - All nodes with this owner will be deleted
 471  482   *
 472  483   * RETURN:      Status
 473  484   *
 474  485   * DESCRIPTION: Delete entries within the namespace that are owned by a
 475      - *              specific ID.  Used to delete entire ACPI tables.  All
      486 + *              specific ID. Used to delete entire ACPI tables. All
 476  487   *              reference counts are updated.
 477  488   *
 478  489   * MUTEX:       Locks namespace during deletion walk.
 479  490   *
 480  491   ******************************************************************************/
 481  492  
 482  493  void
 483  494  AcpiNsDeleteNamespaceByOwner (
 484  495      ACPI_OWNER_ID            OwnerId)
 485  496  {
↓ open down ↓ 91 lines elided ↑ open up ↑
 577  588  
 578  589              /* Move up the tree to the grandparent */
 579  590  
 580  591              ParentNode = ParentNode->Parent;
 581  592          }
 582  593      }
 583  594  
 584  595      (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
 585  596      return_VOID;
 586  597  }
 587      -
 588      -
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX