ACPICA: make ObjectCount to be UINT32
PATCH 1/3 ACPICA: make ObjectCount to be UINT32
SGI UV machine does not fit into UINT16 count
Signed-off-by Alexey Starikovskiy <[email protected]>
---
source/components/dispatcher/dsinit.c | 2 +- source/components/namespace/nsinit.c | 2 +- source/include/acstruct.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
source/components/dispatcher/dsinit.c +1 -1
@@ -297,7 +297,7 @@ AcpiDsInitializeObjects ( }ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT , -"\nTable [%4.4s](id %4.4X) - %hd Objects with %hd Devices %hd Methods %hd Regions\n" , +"\nTable [%4.4s](id %4.4X) - %d Objects with %hd Devices %hd Methods %hd Regions\n" , Table->Signature, OwnerId, Info.ObjectCount, Info.DeviceCount, Info.MethodCount, Info.OpRegionCount));
source/components/namespace/nsinit.c +1 -1
@@ -194,7 +194,7 @@ AcpiNsInitializeObjects ( ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "\nInitialized %hd/%hd Regions %hd/%hd Fields %hd/%hd " - "Buffers %hd/%hd Packages (%hd nodes)\n", + "Buffers %hd/%hd Packages (%d nodes)\n", Info.OpRegionInit, Info.OpRegionCount, Info.FieldInit, Info.FieldCount, Info.BufferInit, Info.BufferCount,
source/include/acstruct.h +1 -1
@@ -218,7 +218,7 @@ typedef struct acpi_init_walk_infoUINT16 FieldInit;UINT16 BufferInit;UINT16 PackageInit; -UINT16 ObjectCount; +UINT32 ObjectCount;ACPI_OWNER_ID OwnerId;UINT32 TableIndex;
PATCH 2/3 ACPICA: Keep track of method changes to namespace
Try to delete nodes from namespace only if method really added them
Signed-off-by Alexey Starikovskiy <[email protected]>
---
source/components/dispatcher/dsmethod.c | 5 ++++- source/components/namespace/nsalloc.c | 4 ++++ source/include/acobject.h | 1 + 3 files changed, 9 insertions(+), 1 deletions(-)
source/components/dispatcher/dsmethod.c +4 -1
@@ -700,7 +700,10 @@ AcpiDsTerminateControlMethod (*/ if (!(MethodDesc->Method.Flags &AOPOBJ_MODULE_LEVEL )) { -AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId); +if (MethodDesc->Method.UsesNamespace) + { +AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId); + } } }
source/components/namespace/nsalloc.c +4 -0
@@ -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 */
source/include/acobject.h +1 -0
@@ -296,6 +296,7 @@ typedef struct acpi_object_methodUINT32 AmlLength;UINT8 ThreadCount; +UINT8 UsesNamespace;ACPI_OWNER_ID OwnerId; }ACPI_OBJECT_METHOD ;
PATCH 3/3 ACPICA: Add direct pointer to parent
In reply to Alexey StarikovskiyIt is starts to be time consuming to scan list of peers for the parent pointer.
Signed-off-by Alexey Starikovskiy <[email protected]>
---
source/common/dmextern.c | 2 - source/common/dmrestag.c | 7 --- source/components/dispatcher/dsopcode.c | 6 +-- source/components/events/evrgnini.c | 10 ++-- source/components/executer/exdump.c | 2 - source/components/namespace/nsaccess.c | 4 +- source/components/namespace/nsalloc.c | 72 ++++++++----------------------- source/components/namespace/nsinit.c | 4 +- source/components/namespace/nsnames.c | 4 +- source/components/namespace/nssearch.c | 16 +------ source/components/namespace/nsutils.c | 73 ------------------------------- source/components/namespace/nswalk.c | 18 ++------ source/components/namespace/nsxfobj.c | 2 - source/include/aclocal.h | 3 + source/include/acnamesp.h | 9 ---- 15 files changed, 44 insertions(+), 188 deletions(-)
source/common/dmextern.c +1 -1
@@ -252,7 +252,7 @@ AcpiDmNormalizeParentPrefix ( Node = Op->Common.Node;while (Node && (*Path == (UINT8 )AML_PARENT_PREFIX )) { - Node =AcpiNsGetParentNode (Node); + Node = Node->Parent; Path++; }
source/common/dmrestag.c +0 -7
@@ -549,13 +549,6 @@ AcpiDmGetResourceNode (return (Node); } -/* List is circular, this flag marks the end */ - -if (Node->Flags &ANOBJ_END_OF_PEER_LIST ) - { -return (NULL ); - } - Node = Node->Peer; }
source/components/dispatcher/dsopcode.c +3 -3
@@ -307,7 +307,7 @@ AcpiDsGetBufferFieldArguments (/* Execute the AML code for the TermArg arguments */ - Status =AcpiDsExecuteArguments (Node,AcpiNsGetParentNode (Node), + Status =AcpiDsExecuteArguments (Node, Node->Parent, ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);return_ACPI_STATUS (Status); }
@@ -354,7 +354,7 @@ AcpiDsGetBankFieldArguments (/* Execute the AML code for the TermArg arguments */ - Status =AcpiDsExecuteArguments (Node,AcpiNsGetParentNode (Node), + Status =AcpiDsExecuteArguments (Node, Node->Parent, ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);return_ACPI_STATUS (Status); }
@@ -505,7 +505,7 @@ AcpiDsGetRegionArguments (/* Execute the argument AML */ - Status =AcpiDsExecuteArguments (Node,AcpiNsGetParentNode (Node), + Status =AcpiDsExecuteArguments (Node, Node->Parent, ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);return_ACPI_STATUS (Status); }
source/components/events/evrgnini.c +5 -5
@@ -294,7 +294,7 @@ AcpiEvPciConfigRegionSetup (return_ACPI_STATUS (Status); } - ParentNode =AcpiNsGetParentNode (RegionObj->Region.Node); + ParentNode = RegionObj->Region.Node->Parent;/* * Get the _SEG and _BBN values from the device upon which the handler
@@ -348,7 +348,7 @@ AcpiEvPciConfigRegionSetup (break ; } - PciRootNode =AcpiNsGetParentNode (PciRootNode); + PciRootNode = PciRootNode->Parent; }/* PCI root bridge not found, use namespace root node */
@@ -385,7 +385,7 @@ AcpiEvPciConfigRegionSetup ( PciDeviceNode = RegionObj->Region.Node;while (PciDeviceNode && (PciDeviceNode->Type !=ACPI_TYPE_DEVICE )) { - PciDeviceNode =AcpiNsGetParentNode (PciDeviceNode); + PciDeviceNode = PciDeviceNode->Parent; }if (!PciDeviceNode)
@@ -661,7 +661,7 @@ AcpiEvInitializeRegion (return_ACPI_STATUS (AE_NOT_EXIST ); } - Node =AcpiNsGetParentNode (RegionObj->Region.Node); + Node = RegionObj->Region.Node->Parent; SpaceId = RegionObj->Region.SpaceId;/* Setup defaults */
@@ -785,7 +785,7 @@ AcpiEvInitializeRegion (/* This node does not have the handler we need; Pop up one level */ - Node =AcpiNsGetParentNode (Node); + Node = Node->Parent; }/* If we get here, there is no handler for this region */
source/components/executer/exdump.c +1 -1
@@ -948,7 +948,7 @@ AcpiExDumpNamespaceNode (AcpiOsPrintf ("%20s : %4.4s\n" ,"Name" ,AcpiUtGetNodeName (Node));AcpiExOutString ("Type" ,AcpiUtGetTypeName (Node->Type));AcpiExOutPointer ("Attached Object" ,AcpiNsGetAttachedObject (Node)); -AcpiExOutPointer ("Parent" ,AcpiNsGetParentNode (Node)); +AcpiExOutPointer ("Parent" , Node->Parent);AcpiExDumpObject (ACPI_CAST_PTR (ACPI_OPERAND_OBJECT , Node), AcpiExDumpNode);
source/components/namespace/nsaccess.c +2 -2
@@ -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 */
source/components/namespace/nsalloc.c +18 -54
146 lines not on this page · raw message
source/components/namespace/nsinit.c +2 -2
@@ -510,7 +510,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 +522,7 @@ AcpiNsFindIniMethods (while (ParentNode) { ParentNode->Flags |=ANOBJ_SUBTREE_HAS_INI ; - ParentNode =AcpiNsGetParentNode (ParentNode); + ParentNode = ParentNode->Parent; }break ;
source/components/namespace/nsnames.c +2 -2
@@ -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)
source/components/namespace/nssearch.c +2 -14
@@ -229,19 +229,7 @@ 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 +284,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 +329,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 */
source/components/namespace/nsutils.c +1 -72
85 lines not on this page · raw message
source/components/namespace/nswalk.c +4 -14
@@ -155,22 +155,12 @@ AcpiNsGetNextNode ( {/* It's really the parent's _scope_ that we want */ -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 ; +return ParentNode->Child; }/* Otherwise just return the next peer */ -return (ChildNode->Peer); +return ChildNode->Peer; }
@@ -229,7 +219,7 @@ AcpiNsGetNextNodeTyped (/* Otherwise, move on to the next 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; }
source/components/namespace/nsxfobj.c +1 -1
@@ -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 */
source/include/aclocal.h +2 -1
@@ -276,7 +276,8 @@ typedef struct acpi_namespace_nodeACPI_OWNER_ID OwnerId;/* Node creator */ ACPI_NAME_UNION Name;/* ACPI Name, always 4 chars per ACPI spec */ struct acpi_namespace_node *Child;/* First child */ -struct acpi_namespace_node *Peer;/* Peer. Parent if ANOBJ_END_OF_PEER_LIST set */ +struct acpi_namespace_node *Parent;/* Parent */ +struct acpi_namespace_node *Peer;/* Peer */ /* * The following fields are used by the ASL compiler and disassembler only
source/include/acnamesp.h +0 -9
@@ -562,13 +562,4 @@ voidAcpiNsTerminate ( void); -ACPI_NAMESPACE_NODE * -AcpiNsGetParentNode ( -ACPI_NAMESPACE_NODE *Node); - - -ACPI_NAMESPACE_NODE * -AcpiNsGetNextValidNode ( -ACPI_NAMESPACE_NODE *Node); -#endif /* __ACNAMESP_H__ */