diff options
author | njl <njl@FreeBSD.org> | 2003-05-27 19:19:05 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2003-05-27 19:19:05 +0000 |
commit | 67cec6fd5b8c438e54c0febaed2c879fbd263a97 (patch) | |
tree | bba1939039b11ebcb165a31e2a7c6b5b9b744e0e /sys | |
parent | 79b642f8ca56efefcf8ebb6d398b2cee4fe40d8e (diff) | |
parent | ebca308bcf9ac3166782aebbd62660d175252227 (diff) | |
download | FreeBSD-src-67cec6fd5b8c438e54c0febaed2c879fbd263a97.zip FreeBSD-src-67cec6fd5b8c438e54c0febaed2c879fbd263a97.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r115351,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/contrib/dev/acpica/dsmethod.c | 2 | ||||
-rw-r--r-- | sys/contrib/dev/acpica/nsalloc.c | 46 |
2 files changed, 44 insertions, 4 deletions
diff --git a/sys/contrib/dev/acpica/dsmethod.c b/sys/contrib/dev/acpica/dsmethod.c index 3916387..d043121 100644 --- a/sys/contrib/dev/acpica/dsmethod.c +++ b/sys/contrib/dev/acpica/dsmethod.c @@ -378,6 +378,8 @@ AcpiDsCallControlMethod ( return_ACPI_STATUS (AE_NULL_OBJECT); } + ObjDesc->Method.OwningId = AcpiUtAllocateOwnerId (ACPI_OWNER_TYPE_METHOD); + /* Init for new method, wait on concurrency semaphore */ Status = AcpiDsBeginMethodExecution (MethodNode, ObjDesc, diff --git a/sys/contrib/dev/acpica/nsalloc.c b/sys/contrib/dev/acpica/nsalloc.c index 74220f3..e221973 100644 --- a/sys/contrib/dev/acpica/nsalloc.c +++ b/sys/contrib/dev/acpica/nsalloc.c @@ -1,7 +1,7 @@ /******************************************************************************* * * Module Name: nsalloc - Namespace allocation and deletion utilities - * $Revision: 79 $ + * $Revision: 82 $ * ******************************************************************************/ @@ -192,6 +192,8 @@ AcpiNsDeleteNode ( PrevNode = NULL; NextNode = ParentNode->Child; + /* Find the node that is the previous peer in the parent's child list */ + while (NextNode != Node) { PrevNode = NextNode; @@ -200,6 +202,8 @@ AcpiNsDeleteNode ( if (PrevNode) { + /* Node is not first child, unlink it */ + PrevNode->Peer = NextNode->Peer; if (NextNode->Flags & ANOBJ_END_OF_PEER_LIST) { @@ -208,7 +212,19 @@ AcpiNsDeleteNode ( } else { - ParentNode->Child = NextNode->Peer; + /* Node is first child (has no previous peer) */ + + if (NextNode->Flags & ANOBJ_END_OF_PEER_LIST) + { + /* No peers at all */ + + ParentNode->Child = NULL; + } + else + { /* Link peer list to parent */ + + ParentNode->Child = NextNode->Peer; + } } @@ -305,7 +321,7 @@ AcpiNsInstallNode ( ACPI_NAMESPACE_NODE *Node, /* New Child*/ ACPI_OBJECT_TYPE Type) { - UINT16 OwnerId = TABLE_ID_DSDT; + UINT16 OwnerId = 0; ACPI_NAMESPACE_NODE *ChildNode; #ifdef ACPI_ALPHABETIC_NAMESPACE @@ -448,6 +464,7 @@ AcpiNsDeleteChildren ( { ACPI_NAMESPACE_NODE *ChildNode; ACPI_NAMESPACE_NODE *NextNode; + ACPI_NAMESPACE_NODE *Node; UINT8 Flags; @@ -496,6 +513,27 @@ AcpiNsDeleteChildren ( * Detach an object if there is one, then free the child node */ AcpiNsDetachObject (ChildNode); + + /* + * Decrement the reference count(s) of all parents up to + * the root! (counts were incremented when the node was created) + */ + Node = ChildNode; + while ((Node = AcpiNsGetParentNode (Node)) != NULL) + { + Node->ReferenceCount--; + } + + /* There should be only one reference remaining on this node */ + + if (ChildNode->ReferenceCount != 1) + { + ACPI_REPORT_WARNING (("Existing references (%d) on node being deleted (%p)\n", + ChildNode->ReferenceCount, ChildNode)); + } + + /* Now we can delete the node */ + ACPI_MEM_FREE (ChildNode); /* And move on to the next child in the list */ @@ -614,7 +652,7 @@ AcpiNsDeleteNamespaceSubtree ( * ******************************************************************************/ -static void +void AcpiNsRemoveReference ( ACPI_NAMESPACE_NODE *Node) { |