diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2010-05-28 18:46:48 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2010-05-28 18:46:48 +0000 |
commit | f2bf96d30fe08965ffd53a28099131ac030e43d5 (patch) | |
tree | 2429d13f44367948f54b059645bd882e2e28f2d4 /namespace | |
parent | 5b663f0c698a9ecf7e562f7f7f730d056e499b5f (diff) | |
download | src-f2bf96d30fe08965ffd53a28099131ac030e43d5.tar.gz src-f2bf96d30fe08965ffd53a28099131ac030e43d5.zip |
Import ACPICA 20100528.vendor/acpica/20100528
Notes
Notes:
svn path=/vendor-sys/acpica/dist/; revision=208625
svn path=/vendor-sys/acpica/20100528/; revision=208626; tag=vendor/acpica/20100528
Diffstat (limited to 'namespace')
-rw-r--r-- | namespace/nsaccess.c | 8 | ||||
-rw-r--r-- | namespace/nsalloc.c | 98 | ||||
-rw-r--r-- | namespace/nsdump.c | 2 | ||||
-rw-r--r-- | namespace/nsinit.c | 30 | ||||
-rw-r--r-- | namespace/nsnames.c | 4 | ||||
-rw-r--r-- | namespace/nsparse.c | 2 | ||||
-rw-r--r-- | namespace/nsrepair2.c | 7 | ||||
-rw-r--r-- | namespace/nssearch.c | 15 | ||||
-rw-r--r-- | namespace/nsutils.c | 125 | ||||
-rw-r--r-- | namespace/nswalk.c | 16 | ||||
-rw-r--r-- | namespace/nsxfobj.c | 2 |
11 files changed, 82 insertions, 227 deletions
diff --git a/namespace/nsaccess.c b/namespace/nsaccess.c index 7a8dc6d1a77e..b2af47f2152c 100644 --- a/namespace/nsaccess.c +++ b/namespace/nsaccess.c @@ -435,7 +435,7 @@ AcpiNsLookup ( while (!AcpiNsOpensScope (PrefixNode->Type) && PrefixNode->Type != ACPI_TYPE_ANY) { - PrefixNode = AcpiNsGetParentNode (PrefixNode); + PrefixNode = PrefixNode->Parent; } } } @@ -516,7 +516,7 @@ AcpiNsLookup ( /* Backup to the parent node */ NumCarats++; - ThisNode = AcpiNsGetParentNode (ThisNode); + ThisNode = ThisNode->Parent; if (!ThisNode) { /* Current scope has no parent scope */ @@ -531,7 +531,7 @@ AcpiNsLookup ( if (SearchParentFlag == ACPI_NS_NO_UPSEARCH) { ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, - "Search scope is [%4.4s], path has %d carat(s)\n", + "Search scope is [%4.4s], path has %u carat(s)\n", AcpiUtGetNodeName (ThisNode), NumCarats)); } } @@ -592,7 +592,7 @@ AcpiNsLookup ( Path++; ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, - "Multi Pathname (%d Segments, Flags=%X)\n", + "Multi Pathname (%u Segments, Flags=%X)\n", NumSegments, Flags)); break; diff --git a/namespace/nsalloc.c b/namespace/nsalloc.c index aadafbf7818b..a879fc1ea8d5 100644 --- a/namespace/nsalloc.c +++ b/namespace/nsalloc.c @@ -255,7 +255,7 @@ AcpiNsRemoveNode ( ACPI_FUNCTION_TRACE_PTR (NsRemoveNode, Node); - ParentNode = AcpiNsGetParentNode (Node); + ParentNode = Node->Parent; PrevNode = NULL; NextNode = ParentNode->Child; @@ -265,34 +265,22 @@ AcpiNsRemoveNode ( while (NextNode != Node) { PrevNode = NextNode; - NextNode = PrevNode->Peer; + NextNode = NextNode->Peer; } if (PrevNode) { /* Node is not first child, unlink it */ - PrevNode->Peer = NextNode->Peer; - if (NextNode->Flags & ANOBJ_END_OF_PEER_LIST) - { - PrevNode->Flags |= ANOBJ_END_OF_PEER_LIST; - } + PrevNode->Peer = Node->Peer; } else { - /* 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; - } + /* + * Node is first child (has no previous peer). + * Link peer list to parent + */ + ParentNode->Child = Node->Peer; } /* Delete the node and any attached objects */ @@ -336,38 +324,47 @@ AcpiNsInstallNode ( ACPI_FUNCTION_TRACE (NsInstallNode); - /* - * Get the owner ID from the Walk state. The owner ID is used to track - * table deletion and deletion of objects created by methods. - */ if (WalkState) { + /* + * Get the owner ID from the Walk state. The owner ID is used to + * track table deletion and deletion of objects created by methods. + */ OwnerId = WalkState->OwnerId; + + if ((WalkState->MethodDesc) && + (ParentNode != WalkState->MethodNode)) + { + /* + * A method is creating a new node that is not a child of the + * method (it is non-local). Mark the executing method as having + * modified the namespace. This is used for cleanup when the + * method exits. + */ + WalkState->MethodDesc->Method.Flags |= AOPOBJ_MODIFIED_NAMESPACE; + } } /* Link the new entry into the parent and existing children */ + Node->Peer = NULL; + Node->Parent = ParentNode; ChildNode = ParentNode->Child; + if (!ChildNode) { ParentNode->Child = Node; - Node->Flags |= ANOBJ_END_OF_PEER_LIST; - Node->Peer = ParentNode; } else { - while (!(ChildNode->Flags & ANOBJ_END_OF_PEER_LIST)) + /* Add node to the end of the peer list */ + + while (ChildNode->Peer) { ChildNode = ChildNode->Peer; } ChildNode->Peer = Node; - - /* Clear end-of-list flag */ - - ChildNode->Flags &= ~ANOBJ_END_OF_PEER_LIST; - Node->Flags |= ANOBJ_END_OF_PEER_LIST; - Node->Peer = ParentNode; } /* Init the new entry */ @@ -402,9 +399,8 @@ void AcpiNsDeleteChildren ( ACPI_NAMESPACE_NODE *ParentNode) { - ACPI_NAMESPACE_NODE *ChildNode; ACPI_NAMESPACE_NODE *NextNode; - UINT8 Flags; + ACPI_NAMESPACE_NODE *NodeToDelete; ACPI_FUNCTION_TRACE_PTR (NsDeleteChildren, ParentNode); @@ -415,39 +411,27 @@ AcpiNsDeleteChildren ( return_VOID; } - /* If no children, all done! */ - - ChildNode = ParentNode->Child; - if (!ChildNode) - { - return_VOID; - } - /* Deallocate all children at this level */ - do + NextNode = ParentNode->Child; + while (NextNode) { - /* Get the things we need */ - - NextNode = ChildNode->Peer; - Flags = ChildNode->Flags; - /* Grandchildren should have all been deleted already */ - if (ChildNode->Child) + if (NextNode->Child) { ACPI_ERROR ((AE_INFO, "Found a grandchild! P=%p C=%p", - ParentNode, ChildNode)); + ParentNode, NextNode)); } /* * Delete this child node and move on to the next child in the list. * No need to unlink the node since we are deleting the entire branch. */ - AcpiNsDeleteNode (ChildNode); - ChildNode = NextNode; - - } while (!(Flags & ANOBJ_END_OF_PEER_LIST)); + NodeToDelete = NextNode; + NextNode = NextNode->Peer; + AcpiNsDeleteNode (NodeToDelete); + }; /* Clear the parent's child pointer */ @@ -533,7 +517,7 @@ AcpiNsDeleteNamespaceSubtree ( /* Move up the tree to the grandparent */ - ParentNode = AcpiNsGetParentNode (ParentNode); + ParentNode = ParentNode->Parent; } } @@ -655,7 +639,7 @@ AcpiNsDeleteNamespaceByOwner ( /* Move up the tree to the grandparent */ - ParentNode = AcpiNsGetParentNode (ParentNode); + ParentNode = ParentNode->Parent; } } diff --git a/namespace/nsdump.c b/namespace/nsdump.c index 0b0af613f24d..242033126f36 100644 --- a/namespace/nsdump.c +++ b/namespace/nsdump.c @@ -537,7 +537,7 @@ AcpiNsDumpOneObject ( return (AE_OK); } - AcpiOsPrintf ("(R%d)", ObjDesc->Common.ReferenceCount); + AcpiOsPrintf ("(R%u)", ObjDesc->Common.ReferenceCount); switch (Type) { diff --git a/namespace/nsinit.c b/namespace/nsinit.c index 770235e8e33d..39067bb440be 100644 --- a/namespace/nsinit.c +++ b/namespace/nsinit.c @@ -185,25 +185,25 @@ AcpiNsInitializeObjects ( /* Walk entire namespace from the supplied root */ Status = AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, AcpiNsInitOneObject, NULL, - &Info, NULL); + ACPI_UINT32_MAX, AcpiNsInitOneObject, NULL, + &Info, NULL); if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "During WalkNamespace")); } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, - "\nInitialized %hd/%hd Regions %hd/%hd Fields %hd/%hd " - "Buffers %hd/%hd Packages (%hd nodes)\n", + "\nInitialized %u/%u Regions %u/%u Fields %u/%u " + "Buffers %u/%u Packages (%u nodes)\n", Info.OpRegionInit, Info.OpRegionCount, Info.FieldInit, Info.FieldCount, Info.BufferInit, Info.BufferCount, Info.PackageInit, Info.PackageCount, Info.ObjectCount)); ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "%hd Control Methods found\n", Info.MethodCount)); + "%u Control Methods found\n", Info.MethodCount)); ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "%hd Op Regions found\n", Info.OpRegionCount)); + "%u Op Regions found\n", Info.OpRegionCount)); return_ACPI_STATUS (AE_OK); } @@ -285,6 +285,16 @@ AcpiNsInitializeDevices ( Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, FALSE, AcpiNsInitOneDevice, NULL, &Info, NULL); + /* + * Any _OSI requests should be completed by now. If the BIOS has + * requested any Windows OSI strings, we will always truncate + * I/O addresses to 16 bits -- for Windows compatibility. + */ + if (AcpiGbl_OsiData >= ACPI_OSI_WIN_2000) + { + AcpiGbl_TruncateIoAddresses = TRUE; + } + ACPI_FREE (Info.EvaluateInfo); if (ACPI_FAILURE (Status)) { @@ -292,8 +302,8 @@ AcpiNsInitializeDevices ( } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, - "\nExecuted %hd _INI methods requiring %hd _STA executions " - "(examined %hd objects)\n", + "\nExecuted %u _INI methods requiring %u _STA executions " + "(examined %u objects)\n", Info.Num_INI, Info.Num_STA, Info.DeviceCount)); return_ACPI_STATUS (Status); @@ -510,7 +520,7 @@ AcpiNsFindIniMethods ( * The only _INI methods that we care about are those that are * present under Device, Processor, and Thermal objects. */ - ParentNode = AcpiNsGetParentNode (Node); + ParentNode = Node->Parent; switch (ParentNode->Type) { case ACPI_TYPE_DEVICE: @@ -522,7 +532,7 @@ AcpiNsFindIniMethods ( while (ParentNode) { ParentNode->Flags |= ANOBJ_SUBTREE_HAS_INI; - ParentNode = AcpiNsGetParentNode (ParentNode); + ParentNode = ParentNode->Parent; } break; diff --git a/namespace/nsnames.c b/namespace/nsnames.c index 7eb3e549bf93..f05288e41714 100644 --- a/namespace/nsnames.c +++ b/namespace/nsnames.c @@ -176,7 +176,7 @@ AcpiNsBuildExternalPath ( /* Put the name into the buffer */ ACPI_MOVE_32_TO_32 ((NameBuffer + Index), &ParentNode->Name); - ParentNode = AcpiNsGetParentNode (ParentNode); + ParentNode = ParentNode->Parent; /* Prefix name with the path separator */ @@ -298,7 +298,7 @@ AcpiNsGetPathnameLength ( return 0; } Size += ACPI_PATH_SEGMENT_LENGTH; - NextNode = AcpiNsGetParentNode (NextNode); + NextNode = NextNode->Parent; } if (!Size) diff --git a/namespace/nsparse.c b/namespace/nsparse.c index 52cbc975992f..d97c9af702df 100644 --- a/namespace/nsparse.c +++ b/namespace/nsparse.c @@ -223,7 +223,7 @@ AcpiNsOneCompleteParse ( /* Parse the AML */ - ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "*PARSE* pass %d parse\n", PassNumber)); + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "*PARSE* pass %u parse\n", PassNumber)); Status = AcpiPsParseAml (WalkState); Cleanup: diff --git a/namespace/nsrepair2.c b/namespace/nsrepair2.c index 220608e2db61..6ac7d6c356ef 100644 --- a/namespace/nsrepair2.c +++ b/namespace/nsrepair2.c @@ -200,6 +200,13 @@ AcpiNsSortList ( * _GTM: Convert Buffer of BYTEs to a Buffer of DWORDs * _PSS: Sort the list descending by Power * _TSS: Sort the list descending by Power + * + * Names that must be packages, but cannot be sorted: + * + * _BCL: Values are tied to the Package index where they appear, and cannot + * be moved or sorted. These index values are used for _BQC and _BCM. + * However, we can fix the case where a buffer is returned, by converting + * it to a Package of integers. */ static const ACPI_REPAIR_INFO AcpiNsRepairableNames[] = { diff --git a/namespace/nssearch.c b/namespace/nssearch.c index fa15b9c5bb0f..3bee106f2d71 100644 --- a/namespace/nssearch.c +++ b/namespace/nssearch.c @@ -229,17 +229,6 @@ AcpiNsSearchOneScope ( return_ACPI_STATUS (AE_OK); } - /* - * The last entry in the list points back to the parent, - * so a flag is used to indicate the end-of-list - */ - if (Node->Flags & ANOBJ_END_OF_PEER_LIST) - { - /* Searched entire list, we are done */ - - break; - } - /* Didn't match name, move on to the next peer object */ Node = Node->Peer; @@ -296,7 +285,7 @@ AcpiNsSearchParentTree ( ACPI_FUNCTION_TRACE (NsSearchParentTree); - ParentNode = AcpiNsGetParentNode (Node); + ParentNode = Node->Parent; /* * If there is no parent (i.e., we are at the root) or type is "local", @@ -341,7 +330,7 @@ AcpiNsSearchParentTree ( /* Not found here, go up another level (until we reach the root) */ - ParentNode = AcpiNsGetParentNode (ParentNode); + ParentNode = ParentNode->Parent; } /* Not found in parent tree */ diff --git a/namespace/nsutils.c b/namespace/nsutils.c index 98ec9ff3c4b6..fc6140c00f1e 100644 --- a/namespace/nsutils.c +++ b/namespace/nsutils.c @@ -1057,128 +1057,3 @@ Cleanup: ACPI_FREE (InternalPath); return_ACPI_STATUS (Status); } - - -/******************************************************************************* - * - * FUNCTION: AcpiNsGetParentNode - * - * PARAMETERS: Node - Current table entry - * - * RETURN: Parent entry of the given entry - * - * DESCRIPTION: Obtain the parent entry for a given entry in the namespace. - * - ******************************************************************************/ - -ACPI_NAMESPACE_NODE * -AcpiNsGetParentNode ( - ACPI_NAMESPACE_NODE *Node) -{ - ACPI_FUNCTION_ENTRY (); - - - if (!Node) - { - return (NULL); - } - - /* - * Walk to the end of this peer list. The last entry is marked with a flag - * and the peer pointer is really a pointer back to the parent. This saves - * putting a parent back pointer in each and every named object! - */ - while (!(Node->Flags & ANOBJ_END_OF_PEER_LIST)) - { - Node = Node->Peer; - } - - return (Node->Peer); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiNsGetNextValidNode - * - * PARAMETERS: Node - Current table entry - * - * RETURN: Next valid Node in the linked node list. NULL if no more valid - * nodes. - * - * DESCRIPTION: Find the next valid node within a name table. - * Useful for implementing NULL-end-of-list loops. - * - ******************************************************************************/ - -ACPI_NAMESPACE_NODE * -AcpiNsGetNextValidNode ( - ACPI_NAMESPACE_NODE *Node) -{ - - /* If we are at the end of this peer list, return NULL */ - - if (Node->Flags & ANOBJ_END_OF_PEER_LIST) - { - return NULL; - } - - /* Otherwise just return the next peer */ - - return (Node->Peer); -} - - -#ifdef ACPI_OBSOLETE_FUNCTIONS -/******************************************************************************* - * - * FUNCTION: AcpiNsFindParentName - * - * PARAMETERS: *ChildNode - Named Obj whose name is to be found - * - * RETURN: The ACPI name - * - * DESCRIPTION: Search for the given obj in its parent scope and return the - * name segment, or "????" if the parent name can't be found - * (which "should not happen"). - * - ******************************************************************************/ - -ACPI_NAME -AcpiNsFindParentName ( - ACPI_NAMESPACE_NODE *ChildNode) -{ - ACPI_NAMESPACE_NODE *ParentNode; - - - ACPI_FUNCTION_TRACE (NsFindParentName); - - - if (ChildNode) - { - /* Valid entry. Get the parent Node */ - - ParentNode = AcpiNsGetParentNode (ChildNode); - if (ParentNode) - { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "Parent of %p [%4.4s] is %p [%4.4s]\n", - ChildNode, AcpiUtGetNodeName (ChildNode), - ParentNode, AcpiUtGetNodeName (ParentNode))); - - if (ParentNode->Name.Integer) - { - return_VALUE ((ACPI_NAME) ParentNode->Name.Integer); - } - } - - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "Unable to find parent of %p (%4.4s)\n", - ChildNode, AcpiUtGetNodeName (ChildNode))); - } - - return_VALUE (ACPI_UNKNOWN_NAME); -} -#endif - - diff --git a/namespace/nswalk.c b/namespace/nswalk.c index b6c573bda7d5..2863926060ae 100644 --- a/namespace/nswalk.c +++ b/namespace/nswalk.c @@ -158,16 +158,6 @@ AcpiNsGetNextNode ( return (ParentNode->Child); } - /* - * Get the next node. - * - * If we are at the end of this peer list, return NULL - */ - if (ChildNode->Flags & ANOBJ_END_OF_PEER_LIST) - { - return NULL; - } - /* Otherwise just return the next peer */ return (ChildNode->Peer); @@ -227,9 +217,9 @@ AcpiNsGetNextNodeTyped ( return (NextNode); } - /* Otherwise, move on to the next node */ + /* Otherwise, move on to the next peer node */ - NextNode = AcpiNsGetNextValidNode (NextNode); + NextNode = NextNode->Peer; } /* Not found */ @@ -454,7 +444,7 @@ AcpiNsWalkNamespace ( */ Level--; ChildNode = ParentNode; - ParentNode = AcpiNsGetParentNode (ParentNode); + ParentNode = ParentNode->Parent; NodePreviouslyVisited = TRUE; } diff --git a/namespace/nsxfobj.c b/namespace/nsxfobj.c index aef106e80b93..8e6ed643e78c 100644 --- a/namespace/nsxfobj.c +++ b/namespace/nsxfobj.c @@ -242,7 +242,7 @@ AcpiGetParent ( /* Get the parent entry */ - ParentNode = AcpiNsGetParentNode (Node); + ParentNode = Node->Parent; *RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, ParentNode); /* Return exception if parent is null */ |