diff options
Diffstat (limited to 'source/components/namespace')
22 files changed, 73 insertions, 40 deletions
diff --git a/source/components/namespace/nsaccess.c b/source/components/namespace/nsaccess.c index 774d7c0b74bb..64db3a9ea2a7 100644 --- a/source/components/namespace/nsaccess.c +++ b/source/components/namespace/nsaccess.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nsalloc.c b/source/components/namespace/nsalloc.c index f42fe2653a12..72a974f5b4c7 100644 --- a/source/components/namespace/nsalloc.c +++ b/source/components/namespace/nsalloc.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nsarguments.c b/source/components/namespace/nsarguments.c index 054150d25625..1483e8121bec 100644 --- a/source/components/namespace/nsarguments.c +++ b/source/components/namespace/nsarguments.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nsconvert.c b/source/components/namespace/nsconvert.c index 5d3eb033e713..8cccf99afc4f 100644 --- a/source/components/namespace/nsconvert.c +++ b/source/components/namespace/nsconvert.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nsdump.c b/source/components/namespace/nsdump.c index 93e24df4c1d3..72ef07eca36f 100644 --- a/source/components/namespace/nsdump.c +++ b/source/components/namespace/nsdump.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nsdumpdv.c b/source/components/namespace/nsdumpdv.c index 818694e5c1be..ea143fb5b45d 100644 --- a/source/components/namespace/nsdumpdv.c +++ b/source/components/namespace/nsdumpdv.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nseval.c b/source/components/namespace/nseval.c index a4819947dae4..33a45c03a7e1 100644 --- a/source/components/namespace/nseval.c +++ b/source/components/namespace/nseval.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -418,7 +418,7 @@ AcpiNsExecModuleCodeList ( * * DESCRIPTION: Execute a control method containing a block of module-level * executable AML code. The control method is temporarily - * installed to a local copy of the root node, then evaluated. + * installed to the root node, then evaluated. * ******************************************************************************/ @@ -427,9 +427,10 @@ AcpiNsExecModuleCode ( ACPI_OPERAND_OBJECT *MethodObj, ACPI_EVALUATE_INFO *Info) { - ACPI_STATUS Status; - ACPI_NAMESPACE_NODE *TempNode; + ACPI_OPERAND_OBJECT *ParentObj; ACPI_NAMESPACE_NODE *ParentNode; + ACPI_OBJECT_TYPE Type; + ACPI_STATUS Status; ACPI_FUNCTION_TRACE (NsExecModuleCode); @@ -439,20 +440,23 @@ AcpiNsExecModuleCode ( * Get the parent node. We cheat by using the NextObject field * of the method object descriptor. */ - ParentNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, - MethodObj->Method.NextObject); + ParentNode = ACPI_CAST_PTR ( + ACPI_NAMESPACE_NODE, MethodObj->Method.NextObject); + Type = AcpiNsGetType (ParentNode); - /* Take a copy of the parent node to act as parent of this method */ - - TempNode = ACPI_ALLOCATE (sizeof (ACPI_NAMESPACE_NODE)); - if (!TempNode) + /* + * Get the region handler and save it in the method object. We may need + * this if an operation region declaration causes a _REG method to be run. + * + * We can't do this in AcpiPsLinkModuleCode because + * AcpiGbl_RootNode->Object is NULL at PASS1. + */ + if ((Type == ACPI_TYPE_DEVICE) && ParentNode->Object) { - return_VOID; + MethodObj->Method.Dispatch.Handler = + ParentNode->Object->Device.Handler; } - memcpy (TempNode, ParentNode, sizeof (ACPI_NAMESPACE_NODE)); - TempNode->Object = NULL; /* Clear the subobject */ - /* Must clear NextObject (AcpiNsAttachObject needs the field) */ MethodObj->Method.NextObject = NULL; @@ -460,14 +464,25 @@ AcpiNsExecModuleCode ( /* Initialize the evaluation information block */ memset (Info, 0, sizeof (ACPI_EVALUATE_INFO)); - Info->PrefixNode = TempNode; + Info->PrefixNode = ParentNode; + + /* + * Get the currently attached parent object. Add a reference, + * because the ref count will be decreased when the method object + * is installed to the parent node. + */ + ParentObj = AcpiNsGetAttachedObject (ParentNode); + if (ParentObj) + { + AcpiUtAddReference (ParentObj); + } /* Install the method (module-level code) in the parent node */ - Status = AcpiNsAttachObject (TempNode, MethodObj, ACPI_TYPE_METHOD); + Status = AcpiNsAttachObject (ParentNode, MethodObj, ACPI_TYPE_METHOD); if (ACPI_FAILURE (Status)) { - goto Cleanup; + goto Exit; } /* Execute the parent node as a control method */ @@ -485,7 +500,25 @@ AcpiNsExecModuleCode ( AcpiUtRemoveReference (Info->ReturnObject); } -Cleanup: - ACPI_FREE (TempNode); + /* Detach the temporary method object */ + + AcpiNsDetachObject (ParentNode); + + /* Restore the original parent object */ + + if (ParentObj) + { + Status = AcpiNsAttachObject (ParentNode, ParentObj, Type); + } + else + { + ParentNode->Type = (UINT8) Type; + } + +Exit: + if (ParentObj) + { + AcpiUtRemoveReference (ParentObj); + } return_VOID; } diff --git a/source/components/namespace/nsinit.c b/source/components/namespace/nsinit.c index b2e2be324a0b..fc0819786db6 100644 --- a/source/components/namespace/nsinit.c +++ b/source/components/namespace/nsinit.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nsload.c b/source/components/namespace/nsload.c index edd79327ff93..5cfadf365b79 100644 --- a/source/components/namespace/nsload.c +++ b/source/components/namespace/nsload.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nsnames.c b/source/components/namespace/nsnames.c index d132d9e1c4cd..95f8c8db970c 100644 --- a/source/components/namespace/nsnames.c +++ b/source/components/namespace/nsnames.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nsobject.c b/source/components/namespace/nsobject.c index 3bac53e3be01..cf2436155b43 100644 --- a/source/components/namespace/nsobject.c +++ b/source/components/namespace/nsobject.c @@ -6,7 +6,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nsparse.c b/source/components/namespace/nsparse.c index 331be76da693..1ff33362ed1a 100644 --- a/source/components/namespace/nsparse.c +++ b/source/components/namespace/nsparse.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nspredef.c b/source/components/namespace/nspredef.c index 7221c88c1321..ccd4aba8f277 100644 --- a/source/components/namespace/nspredef.c +++ b/source/components/namespace/nspredef.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nsprepkg.c b/source/components/namespace/nsprepkg.c index beec84de88fa..3cc9f536046f 100644 --- a/source/components/namespace/nsprepkg.c +++ b/source/components/namespace/nsprepkg.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nsrepair.c b/source/components/namespace/nsrepair.c index bb4b8a2fd720..524fcf66714d 100644 --- a/source/components/namespace/nsrepair.c +++ b/source/components/namespace/nsrepair.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nsrepair2.c b/source/components/namespace/nsrepair2.c index 17c3ce5c5e10..d8625899a615 100644 --- a/source/components/namespace/nsrepair2.c +++ b/source/components/namespace/nsrepair2.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nssearch.c b/source/components/namespace/nssearch.c index fa6fc87806d3..3a0fe90ea435 100644 --- a/source/components/namespace/nssearch.c +++ b/source/components/namespace/nssearch.c @@ -5,7 +5,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nsutils.c b/source/components/namespace/nsutils.c index 126794fde5d4..72f9105ef5a8 100644 --- a/source/components/namespace/nsutils.c +++ b/source/components/namespace/nsutils.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nswalk.c b/source/components/namespace/nswalk.c index 2deee0eb3827..08637a6eeec5 100644 --- a/source/components/namespace/nswalk.c +++ b/source/components/namespace/nswalk.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nsxfeval.c b/source/components/namespace/nsxfeval.c index e279f40959c5..91f8b72b5612 100644 --- a/source/components/namespace/nsxfeval.c +++ b/source/components/namespace/nsxfeval.c @@ -6,7 +6,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nsxfname.c b/source/components/namespace/nsxfname.c index 757e6bc7675a..cfd6937f497f 100644 --- a/source/components/namespace/nsxfname.c +++ b/source/components/namespace/nsxfname.c @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without diff --git a/source/components/namespace/nsxfobj.c b/source/components/namespace/nsxfobj.c index b23c32e02d36..f006047431d2 100644 --- a/source/components/namespace/nsxfobj.c +++ b/source/components/namespace/nsxfobj.c @@ -6,7 +6,7 @@ ******************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without |