diff mbox

[2/3] ACPICA: Keep track of method changes to namespace

Message ID 20100518202531.29771.18173.stgit@thinkpad (mailing list archive)
State New, archived
Headers show

Commit Message

Alexey Starikovskiy May 18, 2010, 8:25 p.m. UTC
None
diff mbox

Patch

diff --git a/source/components/dispatcher/dsmethod.c b/source/components/dispatcher/dsmethod.c
index 969c9ca..fe7a9a8 100644
--- a/source/components/dispatcher/dsmethod.c
+++ b/source/components/dispatcher/dsmethod.c
@@ -700,7 +700,10 @@  AcpiDsTerminateControlMethod (
          */
         if (!(MethodDesc->Method.Flags & AOPOBJ_MODULE_LEVEL))
         {
-            AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId);
+            if (MethodDesc->Method.UsesNamespace)
+            {
+                AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId);
+            }
         }
     }
 
diff --git a/source/components/namespace/nsalloc.c b/source/components/namespace/nsalloc.c
index aadafbf..16bcdd3 100644
--- a/source/components/namespace/nsalloc.c
+++ b/source/components/namespace/nsalloc.c
@@ -343,6 +343,10 @@  AcpiNsInstallNode (
     if (WalkState)
     {
         OwnerId = WalkState->OwnerId;
+        if (WalkState->MethodDesc)
+        {
+            WalkState->MethodDesc->Method.UsesNamespace = 1;
+        }
     }
 
     /* Link the new entry into the parent and existing children */
diff --git a/source/include/acobject.h b/source/include/acobject.h
index f86f839..502132a 100644
--- a/source/include/acobject.h
+++ b/source/include/acobject.h
@@ -296,6 +296,7 @@  typedef struct acpi_object_method
 
     UINT32                          AmlLength;
     UINT8                           ThreadCount;
+    UINT8                           UsesNamespace;
     ACPI_OWNER_ID                   OwnerId;
 
 } ACPI_OBJECT_METHOD;