diff options
Diffstat (limited to 'source/components')
-rw-r--r-- | source/components/events/evregion.c | 59 | ||||
-rw-r--r-- | source/components/namespace/nspredef.c | 9 | ||||
-rw-r--r-- | source/components/namespace/nsprepkg.c | 38 | ||||
-rw-r--r-- | source/components/namespace/nsrepair2.c | 39 |
4 files changed, 71 insertions, 74 deletions
diff --git a/source/components/events/evregion.c b/source/components/events/evregion.c index 233e77d4e17b..a62d1c2671b9 100644 --- a/source/components/events/evregion.c +++ b/source/components/events/evregion.c @@ -164,8 +164,10 @@ extern UINT8 AcpiGbl_DefaultAddressSpaces[]; /* Local prototypes */ static void -AcpiEvOrphanEcRegMethod ( - ACPI_NAMESPACE_NODE *EcDeviceNode); +AcpiEvExecuteOrphanRegMethod ( + ACPI_NAMESPACE_NODE *DeviceNode, + ACPI_ADR_SPACE_TYPE SpaceId); + static ACPI_STATUS AcpiEvRegRun ( @@ -869,11 +871,13 @@ AcpiEvExecuteRegMethods ( (void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL, &Info, NULL); - /* Special case for EC: handle "orphan" _REG methods with no region */ - - if (SpaceId == ACPI_ADR_SPACE_EC) + /* + * Special case for EC and GPIO: handle "orphan" _REG methods with + * no region. + */ + if (SpaceId == ACPI_ADR_SPACE_EC || SpaceId == ACPI_ADR_SPACE_GPIO) { - AcpiEvOrphanEcRegMethod (Node); + AcpiEvExecuteOrphanRegMethod (Node, SpaceId); } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, @@ -954,32 +958,29 @@ AcpiEvRegRun ( /******************************************************************************* * - * FUNCTION: AcpiEvOrphanEcRegMethod + * FUNCTION: AcpiEvExecuteOrphanRegMethod * - * PARAMETERS: EcDeviceNode - Namespace node for an EC device + * PARAMETERS: DeviceNode - Namespace node for an ACPI device + * SpaceId - The address space ID * * RETURN: None * - * DESCRIPTION: Execute an "orphan" _REG method that appears under the EC + * DESCRIPTION: Execute an "orphan" _REG method that appears under an ACPI * device. This is a _REG method that has no corresponding region - * within the EC device scope. The orphan _REG method appears to - * have been enabled by the description of the ECDT in the ACPI - * specification: "The availability of the region space can be - * detected by providing a _REG method object underneath the - * Embedded Controller device." - * - * To quickly access the EC device, we use the EcDeviceNode used - * during EC handler installation. Otherwise, we would need to - * perform a time consuming namespace walk, executing _HID - * methods to find the EC device. + * within the device's scope. ACPI tables depending on these + * "orphan" _REG methods have been seen for both EC and GPIO + * Operation Regions. Presumably the Windows ACPI implementation + * always calls the _REG method independent of the presence of + * an actual Operation Region with the correct address space ID. * * MUTEX: Assumes the namespace is locked * ******************************************************************************/ static void -AcpiEvOrphanEcRegMethod ( - ACPI_NAMESPACE_NODE *EcDeviceNode) +AcpiEvExecuteOrphanRegMethod ( + ACPI_NAMESPACE_NODE *DeviceNode, + ACPI_ADR_SPACE_TYPE SpaceId) { ACPI_HANDLE RegMethod; ACPI_NAMESPACE_NODE *NextNode; @@ -988,10 +989,10 @@ AcpiEvOrphanEcRegMethod ( ACPI_OBJECT Objects[2]; - ACPI_FUNCTION_TRACE (EvOrphanEcRegMethod); + ACPI_FUNCTION_TRACE (EvExecuteOrphanRegMethod); - if (!EcDeviceNode) + if (!DeviceNode) { return_VOID; } @@ -1002,7 +1003,7 @@ AcpiEvOrphanEcRegMethod ( /* Get a handle to a _REG method immediately under the EC device */ - Status = AcpiGetHandle (EcDeviceNode, METHOD_NAME__REG, &RegMethod); + Status = AcpiGetHandle (DeviceNode, METHOD_NAME__REG, &RegMethod); if (ACPI_FAILURE (Status)) { goto Exit; /* There is no _REG method present */ @@ -1015,25 +1016,25 @@ AcpiEvOrphanEcRegMethod ( * with other space IDs to be present; but the code below will then * execute the _REG method with the EmbeddedControl SpaceID argument. */ - NextNode = AcpiNsGetNextNode (EcDeviceNode, NULL); + NextNode = AcpiNsGetNextNode (DeviceNode, NULL); while (NextNode) { if ((NextNode->Type == ACPI_TYPE_REGION) && (NextNode->Object) && - (NextNode->Object->Region.SpaceId == ACPI_ADR_SPACE_EC)) + (NextNode->Object->Region.SpaceId == SpaceId)) { goto Exit; /* Do not execute the _REG */ } - NextNode = AcpiNsGetNextNode (EcDeviceNode, NextNode); + NextNode = AcpiNsGetNextNode (DeviceNode, NextNode); } - /* Evaluate the _REG(EmbeddedControl,Connect) method */ + /* Evaluate the _REG(SpaceId,Connect) method */ Args.Count = 2; Args.Pointer = Objects; Objects[0].Type = ACPI_TYPE_INTEGER; - Objects[0].Integer.Value = ACPI_ADR_SPACE_EC; + Objects[0].Integer.Value = SpaceId; Objects[1].Type = ACPI_TYPE_INTEGER; Objects[1].Integer.Value = ACPI_REG_CONNECT; diff --git a/source/components/namespace/nspredef.c b/source/components/namespace/nspredef.c index 70aac113c745..7f7965f2bfa7 100644 --- a/source/components/namespace/nspredef.c +++ b/source/components/namespace/nspredef.c @@ -223,13 +223,14 @@ AcpiNsCheckReturnValue ( ACPI_STATUS Status; const ACPI_PREDEFINED_INFO *Predefined; + ACPI_FUNCTION_TRACE (NsCheckReturnValue); /* If not a predefined name, we cannot validate the return object */ Predefined = Info->Predefined; if (!Predefined) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* @@ -239,7 +240,7 @@ AcpiNsCheckReturnValue ( if ((ReturnStatus != AE_OK) && (ReturnStatus != AE_CTRL_RETURN_VALUE)) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* @@ -259,7 +260,7 @@ AcpiNsCheckReturnValue ( (!Predefined->Info.ExpectedBtypes) || (Predefined->Info.ExpectedBtypes == ACPI_RTYPE_ALL)) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* @@ -325,7 +326,7 @@ Exit: Node->Flags |= ANOBJ_EVALUATED; } - return (Status); + return_ACPI_STATUS (Status); } diff --git a/source/components/namespace/nsprepkg.c b/source/components/namespace/nsprepkg.c index d33b76d65116..689d2c167b5d 100644 --- a/source/components/namespace/nsprepkg.c +++ b/source/components/namespace/nsprepkg.c @@ -214,7 +214,7 @@ AcpiNsCheckPackage ( UINT32 i; - ACPI_FUNCTION_NAME (NsCheckPackage); + ACPI_FUNCTION_TRACE (NsCheckPackage); /* The package info for this name is in the next table entry */ @@ -245,13 +245,13 @@ AcpiNsCheckPackage ( { if (Package->RetInfo.Type == ACPI_PTYPE1_VAR) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, "Return Package has no elements (empty)")); - return (AE_AML_OPERAND_VALUE); + return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } /* @@ -305,7 +305,7 @@ AcpiNsCheckPackage ( Package->RetInfo.ObjectType1, i); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } Elements++; @@ -338,7 +338,7 @@ AcpiNsCheckPackage ( Package->RetInfo3.ObjectType[i], i); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } } else @@ -349,7 +349,7 @@ AcpiNsCheckPackage ( Package->RetInfo3.TailObjectType, i); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } } @@ -365,7 +365,7 @@ AcpiNsCheckPackage ( Info, Elements, ACPI_RTYPE_INTEGER, 0); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } Elements++; @@ -384,7 +384,7 @@ AcpiNsCheckPackage ( Info, Elements, ACPI_RTYPE_INTEGER, 0); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } /* @@ -428,7 +428,7 @@ AcpiNsCheckPackage ( Info, ReturnObject, ReturnObjectPtr); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } /* Update locals to point to the new package (of 1 element) */ @@ -466,7 +466,7 @@ AcpiNsCheckPackage ( Package->RetInfo.ObjectType1, 0); if (ACPI_FAILURE(Status)) { - return (Status); + return_ACPI_STATUS (Status); } /* Validate length of the UUID buffer */ @@ -475,14 +475,14 @@ AcpiNsCheckPackage ( { ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, "Invalid length for UUID Buffer")); - return (AE_AML_OPERAND_VALUE); + return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } Status = AcpiNsCheckObjectType(Info, Elements + 1, Package->RetInfo.ObjectType2, 0); if (ACPI_FAILURE(Status)) { - return (Status); + return_ACPI_STATUS (Status); } Elements += 2; @@ -498,10 +498,10 @@ AcpiNsCheckPackage ( "Invalid internal return type in table entry: %X", Package->RetInfo.Type)); - return (AE_AML_INTERNAL); + return_ACPI_STATUS (AE_AML_INTERNAL); } - return (Status); + return_ACPI_STATUS (Status); PackageTooSmall: @@ -512,7 +512,7 @@ PackageTooSmall: "Return Package is too small - found %u elements, expected %u", Count, ExpectedCount)); - return (AE_AML_OPERAND_VALUE); + return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } @@ -865,6 +865,8 @@ AcpiNsCheckPackageElements ( UINT32 i; + ACPI_FUNCTION_TRACE (NsCheckPackageElements); + /* * Up to two groups of package elements are supported by the data * structure. All elements in each group must be of the same type. @@ -876,7 +878,7 @@ AcpiNsCheckPackageElements ( Type1, i + StartIndex); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } ThisElement++; @@ -888,11 +890,11 @@ AcpiNsCheckPackageElements ( Type2, (i + Count1 + StartIndex)); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } ThisElement++; } - return (AE_OK); + return_ACPI_STATUS (AE_OK); } diff --git a/source/components/namespace/nsrepair2.c b/source/components/namespace/nsrepair2.c index f62aca29a5ac..57c229a8c5ee 100644 --- a/source/components/namespace/nsrepair2.c +++ b/source/components/namespace/nsrepair2.c @@ -321,16 +321,18 @@ AcpiNsComplexRepairs ( ACPI_STATUS Status; + ACPI_FUNCTION_TRACE (NsComplexRepairs); + /* Check if this name is in the list of repairable names */ Predefined = AcpiNsMatchComplexRepair (Node); if (!Predefined) { - return (ValidateStatus); + return_ACPI_STATUS (ValidateStatus); } Status = Predefined->RepairFunction (Info, ReturnObjectPtr); - return (Status); + return_ACPI_STATUS (Status); } @@ -526,20 +528,21 @@ AcpiNsRepair_CID ( UINT16 OriginalRefCount; UINT32 i; + ACPI_FUNCTION_TRACE (NsRepair_CID); /* Check for _CID as a simple string */ if (ReturnObject->Common.Type == ACPI_TYPE_STRING) { Status = AcpiNsRepair_HID (Info, ReturnObjectPtr); - return (Status); + return_ACPI_STATUS (Status); } /* Exit if not a Package */ if (ReturnObject->Common.Type != ACPI_TYPE_PACKAGE) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } /* Examine each element of the _CID package */ @@ -553,7 +556,7 @@ AcpiNsRepair_CID ( Status = AcpiNsRepair_HID (Info, ElementPtr); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } if (OriginalElement != *ElementPtr) @@ -567,7 +570,7 @@ AcpiNsRepair_CID ( ElementPtr++; } - return (AE_OK); + return_ACPI_STATUS (AE_OK); } @@ -687,9 +690,8 @@ AcpiNsRepair_HID ( ACPI_OPERAND_OBJECT **ReturnObjectPtr) { ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; - ACPI_OPERAND_OBJECT *NewString; - char *Source; char *Dest; + char *Source; ACPI_FUNCTION_NAME (NsRepair_HID); @@ -699,7 +701,7 @@ AcpiNsRepair_HID ( if (ReturnObject->Common.Type != ACPI_TYPE_STRING) { - return (AE_OK); + return_ACPI_STATUS (AE_OK); } if (ReturnObject->String.Length == 0) @@ -711,15 +713,7 @@ AcpiNsRepair_HID ( /* Return AE_OK anyway, let driver handle it */ Info->ReturnFlags |= ACPI_OBJECT_REPAIRED; - return (AE_OK); - } - - /* It is simplest to always create a new string object */ - - NewString = AcpiUtCreateStringObject (ReturnObject->String.Length); - if (!NewString) - { - return (AE_NO_MEMORY); + return_ACPI_STATUS (AE_OK); } /* @@ -732,7 +726,7 @@ AcpiNsRepair_HID ( if (*Source == '*') { Source++; - NewString->String.Length--; + ReturnObject->String.Length--; ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, "%s: Removed invalid leading asterisk\n", Info->FullPathname)); @@ -746,14 +740,13 @@ AcpiNsRepair_HID ( * "NNNN####" where N is an uppercase letter or decimal digit, and * # is a hex digit. */ - for (Dest = NewString->String.Pointer; *Source; Dest++, Source++) + for (Dest = ReturnObject->String.Pointer; *Source; Dest++, Source++) { *Dest = (char) toupper ((int) *Source); } + ReturnObject->String.Pointer[ReturnObject->String.Length] = 0; - AcpiUtRemoveReference (ReturnObject); - *ReturnObjectPtr = NewString; - return (AE_OK); + return_ACPI_STATUS (AE_OK); } |