diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2012-03-20 18:17:33 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2012-03-20 18:17:33 +0000 |
commit | b81dc021b3e3311e46f9e81de4f09855536e8147 (patch) | |
tree | 3fa3a8ab860459d0b2c9768eed9142052be1ced3 /source/components | |
parent | 5437485bdb98c4b00f15969e013c454426e9c862 (diff) | |
download | src-b81dc021b3e3311e46f9e81de4f09855536e8147.tar.gz src-b81dc021b3e3311e46f9e81de4f09855536e8147.zip |
Notes
Diffstat (limited to 'source/components')
-rw-r--r-- | source/components/debugger/dbcmds.c | 4 | ||||
-rw-r--r-- | source/components/hardware/hwesleep.c | 40 | ||||
-rw-r--r-- | source/components/hardware/hwsleep.c | 32 | ||||
-rw-r--r-- | source/components/hardware/hwxfsleep.c | 28 | ||||
-rw-r--r-- | source/components/namespace/nsdump.c | 16 | ||||
-rw-r--r-- | source/components/namespace/nsdumpdv.c | 2 | ||||
-rw-r--r-- | source/components/namespace/nspredef.c | 2 | ||||
-rw-r--r-- | source/components/namespace/nsrepair.c | 161 | ||||
-rw-r--r-- | source/components/namespace/nsutils.c | 2 | ||||
-rw-r--r-- | source/components/tables/tbfadt.c | 11 | ||||
-rw-r--r-- | source/components/tables/tbinstal.c | 4 | ||||
-rw-r--r-- | source/components/tables/tbutils.c | 19 |
12 files changed, 167 insertions, 154 deletions
diff --git a/source/components/debugger/dbcmds.c b/source/components/debugger/dbcmds.c index cf214a161c07..ba6181bb39a0 100644 --- a/source/components/debugger/dbcmds.c +++ b/source/components/debugger/dbcmds.c @@ -174,14 +174,14 @@ AcpiDbSleep ( } AcpiOsPrintf ("**** Going to sleep ****\n"); - Status = AcpiEnterSleepState (SleepState); + Status = AcpiEnterSleepState (SleepState, ACPI_NO_OPTIONAL_METHODS); if (ACPI_FAILURE (Status)) { goto ErrorExit; } AcpiOsPrintf ("**** Prepare to return from sleep ****\n"); - Status = AcpiLeaveSleepStatePrep (SleepState); + Status = AcpiLeaveSleepStatePrep (SleepState, ACPI_NO_OPTIONAL_METHODS); if (ACPI_FAILURE (Status)) { goto ErrorExit; diff --git a/source/components/hardware/hwesleep.c b/source/components/hardware/hwesleep.c index e95647e5cd19..ce7b792dbb6d 100644 --- a/source/components/hardware/hwesleep.c +++ b/source/components/hardware/hwesleep.c @@ -53,7 +53,7 @@ * * FUNCTION: AcpiHwExecuteSleepMethod * - * PARAMETERS: MethodName - Pathname of method to execute + * PARAMETERS: MethodPathname - Pathname of method to execute * IntegerArgument - Argument to pass to the method * * RETURN: None @@ -65,7 +65,7 @@ void AcpiHwExecuteSleepMethod ( - char *MethodName, + char *MethodPathname, UINT32 IntegerArgument) { ACPI_OBJECT_LIST ArgList; @@ -83,11 +83,11 @@ AcpiHwExecuteSleepMethod ( Arg.Type = ACPI_TYPE_INTEGER; Arg.Integer.Value = (UINT64) IntegerArgument; - Status = AcpiEvaluateObject (NULL, MethodName, &ArgList, NULL); + Status = AcpiEvaluateObject (NULL, MethodPathname, &ArgList, NULL); if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND) { ACPI_EXCEPTION ((AE_INFO, Status, "While executing method %s", - MethodName)); + MethodPathname)); } return_VOID; @@ -99,6 +99,7 @@ AcpiHwExecuteSleepMethod ( * FUNCTION: AcpiHwExtendedSleep * * PARAMETERS: SleepState - Which sleep state to enter + * Flags - ACPI_EXECUTE_GTS to run optional method * * RETURN: Status * @@ -110,7 +111,8 @@ AcpiHwExecuteSleepMethod ( ACPI_STATUS AcpiHwExtendedSleep ( - UINT8 SleepState) + UINT8 SleepState, + UINT8 Flags) { ACPI_STATUS Status; UINT8 SleepTypeValue; @@ -138,9 +140,12 @@ AcpiHwExtendedSleep ( AcpiGbl_SystemAwakeAndRunning = FALSE; - /* Execute the _GTS method (Going To Sleep) */ + /* Optionally execute _GTS (Going To Sleep) */ - AcpiHwExecuteSleepMethod (METHOD_NAME__GTS, SleepState); + if (Flags & ACPI_EXECUTE_GTS) + { + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__GTS, SleepState); + } /* Flush caches, as per ACPI specification */ @@ -186,6 +191,7 @@ AcpiHwExtendedSleep ( * FUNCTION: AcpiHwExtendedWakePrep * * PARAMETERS: SleepState - Which sleep state we just exited + * Flags - ACPI_EXECUTE_BFS to run optional method * * RETURN: Status * @@ -196,7 +202,8 @@ AcpiHwExtendedSleep ( ACPI_STATUS AcpiHwExtendedWakePrep ( - UINT8 SleepState) + UINT8 SleepState, + UINT8 Flags) { ACPI_STATUS Status; UINT8 SleepTypeValue; @@ -216,7 +223,12 @@ AcpiHwExtendedWakePrep ( &AcpiGbl_FADT.SleepControl); } - AcpiHwExecuteSleepMethod (METHOD_NAME__BFS, SleepState); + /* Optionally execute _BFS (Back From Sleep) */ + + if (Flags & ACPI_EXECUTE_BFS) + { + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__BFS, SleepState); + } return_ACPI_STATUS (AE_OK); } @@ -226,6 +238,7 @@ AcpiHwExtendedWakePrep ( * FUNCTION: AcpiHwExtendedWake * * PARAMETERS: SleepState - Which sleep state we just exited + * Flags - Reserved, set to zero * * RETURN: Status * @@ -236,7 +249,8 @@ AcpiHwExtendedWakePrep ( ACPI_STATUS AcpiHwExtendedWake ( - UINT8 SleepState) + UINT8 SleepState, + UINT8 Flags) { ACPI_FUNCTION_TRACE (HwExtendedWake); @@ -247,8 +261,8 @@ AcpiHwExtendedWake ( /* Execute the wake methods */ - AcpiHwExecuteSleepMethod (METHOD_NAME__SST, ACPI_SST_WAKING); - AcpiHwExecuteSleepMethod (METHOD_NAME__WAK, SleepState); + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WAKING); + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__WAK, SleepState); /* * Some BIOS code assumes that WAK_STS will be cleared on resume @@ -258,6 +272,6 @@ AcpiHwExtendedWake ( (void) AcpiWrite (ACPI_X_WAKE_STATUS, &AcpiGbl_FADT.SleepStatus); AcpiGbl_SystemAwakeAndRunning = TRUE; - AcpiHwExecuteSleepMethod (METHOD_NAME__SST, ACPI_SST_WORKING); + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING); return_ACPI_STATUS (AE_OK); } diff --git a/source/components/hardware/hwsleep.c b/source/components/hardware/hwsleep.c index 0d311435555a..1953ff846e80 100644 --- a/source/components/hardware/hwsleep.c +++ b/source/components/hardware/hwsleep.c @@ -55,6 +55,7 @@ * FUNCTION: AcpiHwLegacySleep * * PARAMETERS: SleepState - Which sleep state to enter + * Flags - ACPI_EXECUTE_GTS to run optional method * * RETURN: Status * @@ -65,7 +66,8 @@ ACPI_STATUS AcpiHwLegacySleep ( - UINT8 SleepState) + UINT8 SleepState, + UINT8 Flags) { ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo; ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo; @@ -128,9 +130,12 @@ AcpiHwLegacySleep ( return_ACPI_STATUS (Status); } - /* Execute the _GTS method (Going To Sleep) */ + /* Optionally execute _GTS (Going To Sleep) */ - AcpiHwExecuteSleepMethod (METHOD_NAME__GTS, SleepState); + if (Flags & ACPI_EXECUTE_GTS) + { + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__GTS, SleepState); + } /* Get current value of PM1A control */ @@ -228,6 +233,7 @@ AcpiHwLegacySleep ( * FUNCTION: AcpiHwLegacyWakePrep * * PARAMETERS: SleepState - Which sleep state we just exited + * Flags - ACPI_EXECUTE_BFS to run optional method * * RETURN: Status * @@ -239,7 +245,8 @@ AcpiHwLegacySleep ( ACPI_STATUS AcpiHwLegacyWakePrep ( - UINT8 SleepState) + UINT8 SleepState, + UINT8 Flags) { ACPI_STATUS Status; ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo; @@ -289,7 +296,12 @@ AcpiHwLegacyWakePrep ( } } - AcpiHwExecuteSleepMethod (METHOD_NAME__BFS, SleepState); + /* Optionally execute _BFS (Back From Sleep) */ + + if (Flags & ACPI_EXECUTE_BFS) + { + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__BFS, SleepState); + } return_ACPI_STATUS (Status); } @@ -299,6 +311,7 @@ AcpiHwLegacyWakePrep ( * FUNCTION: AcpiHwLegacyWake * * PARAMETERS: SleepState - Which sleep state we just exited + * Flags - Reserved, set to zero * * RETURN: Status * @@ -309,7 +322,8 @@ AcpiHwLegacyWakePrep ( ACPI_STATUS AcpiHwLegacyWake ( - UINT8 SleepState) + UINT8 SleepState, + UINT8 Flags) { ACPI_STATUS Status; @@ -320,7 +334,7 @@ AcpiHwLegacyWake ( /* Ensure EnterSleepStatePrep -> EnterSleepState ordering */ AcpiGbl_SleepTypeA = ACPI_SLEEP_TYPE_INVALID; - AcpiHwExecuteSleepMethod (METHOD_NAME__SST, ACPI_SST_WAKING); + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WAKING); /* * GPEs must be enabled before _WAK is called as GPEs @@ -346,7 +360,7 @@ AcpiHwLegacyWake ( * Now we can execute _WAK, etc. Some machines require that the GPEs * are enabled before the wake methods are executed. */ - AcpiHwExecuteSleepMethod (METHOD_NAME__WAK, SleepState); + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__WAK, SleepState); /* * Some BIOS code assumes that WAK_STS will be cleared on resume @@ -377,7 +391,7 @@ AcpiHwLegacyWake ( return_ACPI_STATUS (Status); } - AcpiHwExecuteSleepMethod (METHOD_NAME__SST, ACPI_SST_WORKING); + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING); return_ACPI_STATUS (Status); } diff --git a/source/components/hardware/hwxfsleep.c b/source/components/hardware/hwxfsleep.c index 39bf122a072e..b7cbbc813e65 100644 --- a/source/components/hardware/hwxfsleep.c +++ b/source/components/hardware/hwxfsleep.c @@ -52,6 +52,7 @@ static ACPI_STATUS AcpiHwSleepDispatch ( UINT8 SleepState, + UINT8 Flags, UINT32 FunctionId); /* @@ -252,6 +253,7 @@ ACPI_EXPORT_SYMBOL (AcpiEnterSleepStateS4bios) static ACPI_STATUS AcpiHwSleepDispatch ( UINT8 SleepState, + UINT8 Flags, UINT32 FunctionId) { ACPI_STATUS Status; @@ -267,13 +269,13 @@ AcpiHwSleepDispatch ( if (AcpiGbl_ReducedHardware || AcpiGbl_FADT.SleepControl.Address) { - Status = SleepFunctions->ExtendedFunction (SleepState); + Status = SleepFunctions->ExtendedFunction (SleepState, Flags); } else { /* Legacy sleep */ - Status = SleepFunctions->LegacyFunction (SleepState); + Status = SleepFunctions->LegacyFunction (SleepState, Flags); } return (Status); @@ -283,7 +285,7 @@ AcpiHwSleepDispatch ( * For the case where reduced-hardware-only code is being generated, * we know that only the extended sleep registers are available */ - Status = SleepFunctions->ExtendedFunction (SleepState); + Status = SleepFunctions->ExtendedFunction (SleepState, Flags); return (Status); #endif /* !ACPI_REDUCED_HARDWARE */ @@ -318,8 +320,6 @@ AcpiEnterSleepStatePrep ( ACPI_FUNCTION_TRACE (AcpiEnterSleepStatePrep); - /* _PSW methods could be run here to enable wake-on keyboard, LAN, etc. */ - Status = AcpiGetSleepTypeData (SleepState, &AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB); if (ACPI_FAILURE (Status)) @@ -334,7 +334,7 @@ AcpiEnterSleepStatePrep ( Arg.Type = ACPI_TYPE_INTEGER; Arg.Integer.Value = SleepState; - Status = AcpiEvaluateObject (NULL, METHOD_NAME__PTS, &ArgList, NULL); + Status = AcpiEvaluateObject (NULL, METHOD_PATHNAME__PTS, &ArgList, NULL); if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND) { return_ACPI_STATUS (Status); @@ -367,7 +367,7 @@ AcpiEnterSleepStatePrep ( * Set the system indicators to show the desired sleep state. * _SST is an optional method (return no error if not found) */ - AcpiHwExecuteSleepMethod (METHOD_NAME__SST, SstValue); + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, SstValue); return_ACPI_STATUS (AE_OK); } @@ -379,6 +379,7 @@ ACPI_EXPORT_SYMBOL (AcpiEnterSleepStatePrep) * FUNCTION: AcpiEnterSleepState * * PARAMETERS: SleepState - Which sleep state to enter + * Flags - ACPI_EXECUTE_GTS to run optional method * * RETURN: Status * @@ -389,7 +390,8 @@ ACPI_EXPORT_SYMBOL (AcpiEnterSleepStatePrep) ACPI_STATUS AcpiEnterSleepState ( - UINT8 SleepState) + UINT8 SleepState, + UINT8 Flags) { ACPI_STATUS Status; @@ -405,7 +407,7 @@ AcpiEnterSleepState ( return_ACPI_STATUS (AE_AML_OPERAND_VALUE); } - Status = AcpiHwSleepDispatch (SleepState, ACPI_SLEEP_FUNCTION_ID); + Status = AcpiHwSleepDispatch (SleepState, Flags, ACPI_SLEEP_FUNCTION_ID); return_ACPI_STATUS (Status); } @@ -417,6 +419,7 @@ ACPI_EXPORT_SYMBOL (AcpiEnterSleepState) * FUNCTION: AcpiLeaveSleepStatePrep * * PARAMETERS: SleepState - Which sleep state we are exiting + * Flags - ACPI_EXECUTE_BFS to run optional method * * RETURN: Status * @@ -429,7 +432,8 @@ ACPI_EXPORT_SYMBOL (AcpiEnterSleepState) ACPI_STATUS AcpiLeaveSleepStatePrep ( - UINT8 SleepState) + UINT8 SleepState, + UINT8 Flags) { ACPI_STATUS Status; @@ -437,7 +441,7 @@ AcpiLeaveSleepStatePrep ( ACPI_FUNCTION_TRACE (AcpiLeaveSleepStatePrep); - Status = AcpiHwSleepDispatch (SleepState, ACPI_WAKE_PREP_FUNCTION_ID); + Status = AcpiHwSleepDispatch (SleepState, Flags, ACPI_WAKE_PREP_FUNCTION_ID); return_ACPI_STATUS (Status); } @@ -467,7 +471,7 @@ AcpiLeaveSleepState ( ACPI_FUNCTION_TRACE (AcpiLeaveSleepState); - Status = AcpiHwSleepDispatch (SleepState, ACPI_WAKE_FUNCTION_ID); + Status = AcpiHwSleepDispatch (SleepState, 0, ACPI_WAKE_FUNCTION_ID); return_ACPI_STATUS (Status); } diff --git a/source/components/namespace/nsdump.c b/source/components/namespace/nsdump.c index edc16257d4dd..6b7c50577918 100644 --- a/source/components/namespace/nsdump.c +++ b/source/components/namespace/nsdump.c @@ -270,7 +270,21 @@ AcpiNsDumpOneObject ( if (!ObjDesc) { - /* No attached object, we are done */ + /* No attached object. Some types should always have an object */ + + switch (Type) + { + case ACPI_TYPE_INTEGER: + case ACPI_TYPE_PACKAGE: + case ACPI_TYPE_BUFFER: + case ACPI_TYPE_STRING: + case ACPI_TYPE_METHOD: + AcpiOsPrintf ("<No attached object>"); + break; + + default: + break; + } AcpiOsPrintf ("\n"); return (AE_OK); diff --git a/source/components/namespace/nsdumpdv.c b/source/components/namespace/nsdumpdv.c index dde0a8d09abc..9d30886608a3 100644 --- a/source/components/namespace/nsdumpdv.c +++ b/source/components/namespace/nsdumpdv.c @@ -141,7 +141,7 @@ AcpiNsDumpRootDevices ( return; } - Status = AcpiGetHandle (NULL, ACPI_NS_SYSTEM_BUS, &SysBusHandle); + Status = AcpiGetHandle (NULL, METHOD_NAME__SB_, &SysBusHandle); if (ACPI_FAILURE (Status)) { return; diff --git a/source/components/namespace/nspredef.c b/source/components/namespace/nspredef.c index 19662680125c..3a61aa3666e8 100644 --- a/source/components/namespace/nspredef.c +++ b/source/components/namespace/nspredef.c @@ -681,7 +681,7 @@ AcpiNsCheckPackage ( { /* Create the new outer package and populate it */ - Status = AcpiNsRepairPackageList (Data, ReturnObjectPtr); + Status = AcpiNsWrapWithPackage (Data, *Elements, ReturnObjectPtr); if (ACPI_FAILURE (Status)) { return (Status); diff --git a/source/components/namespace/nsrepair.c b/source/components/namespace/nsrepair.c index d820834e881e..06898a31e41c 100644 --- a/source/components/namespace/nsrepair.c +++ b/source/components/namespace/nsrepair.c @@ -74,11 +74,10 @@ * Buffer -> String * Buffer -> Package of Integers * Package -> Package of one Package + * An incorrect standalone object is wrapped with required outer package * * Additional possible repairs: - * * Required package elements that are NULL replaced by Integer/String/Buffer - * Incorrect standalone package wrapped with required outer package * ******************************************************************************/ @@ -100,11 +99,6 @@ AcpiNsConvertToBuffer ( ACPI_OPERAND_OBJECT *OriginalObject, ACPI_OPERAND_OBJECT **ReturnObject); -static ACPI_STATUS -AcpiNsConvertToPackage ( - ACPI_OPERAND_OBJECT *OriginalObject, - ACPI_OPERAND_OBJECT **ReturnObject); - /******************************************************************************* * @@ -172,10 +166,24 @@ AcpiNsRepairObject ( } if (ExpectedBtypes & ACPI_RTYPE_PACKAGE) { - Status = AcpiNsConvertToPackage (ReturnObject, &NewObject); + /* + * A package is expected. We will wrap the existing object with a + * new package object. It is often the case that if a variable-length + * package is required, but there is only a single object needed, the + * BIOS will return that object instead of wrapping it with a Package + * object. Note: after the wrapping, the package will be validated + * for correct contents (expected object type or types). + */ + Status = AcpiNsWrapWithPackage (Data, ReturnObject, &NewObject); if (ACPI_SUCCESS (Status)) { - goto ObjectRepaired; + /* + * The original object just had its reference count + * incremented for being inserted into the new package. + */ + *ReturnObjectPtr = NewObject; /* New Package object */ + Data->Flags |= ACPI_OBJECT_REPAIRED; + return (AE_OK); } } @@ -188,24 +196,27 @@ ObjectRepaired: /* Object was successfully repaired */ - /* - * If the original object is a package element, we need to: - * 1. Set the reference count of the new object to match the - * reference count of the old object. - * 2. Decrement the reference count of the original object. - */ if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT) { - NewObject->Common.ReferenceCount = - ReturnObject->Common.ReferenceCount; - - if (ReturnObject->Common.ReferenceCount > 1) + /* + * The original object is a package element. We need to + * decrement the reference count of the original object, + * for removing it from the package. + * + * However, if the original object was just wrapped with a + * package object as part of the repair, we don't need to + * change the reference count. + */ + if (!(Data->Flags & ACPI_OBJECT_WRAPPED)) { - ReturnObject->Common.ReferenceCount--; + if (ReturnObject->Common.ReferenceCount > 1) + { + ReturnObject->Common.ReferenceCount--; + } } ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, - "%s: Converted %s to expected %s at index %u\n", + "%s: Converted %s to expected %s at Package index %u\n", Data->Pathname, AcpiUtGetObjectTypeName (ReturnObject), AcpiUtGetObjectTypeName (NewObject), PackageIndex)); } @@ -498,71 +509,6 @@ AcpiNsConvertToBuffer ( /******************************************************************************* * - * FUNCTION: AcpiNsConvertToPackage - * - * PARAMETERS: OriginalObject - Object to be converted - * ReturnObject - Where the new converted object is returned - * - * RETURN: Status. AE_OK if conversion was successful. - * - * DESCRIPTION: Attempt to convert a Buffer object to a Package. Each byte of - * the buffer is converted to a single integer package element. - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiNsConvertToPackage ( - ACPI_OPERAND_OBJECT *OriginalObject, - ACPI_OPERAND_OBJECT **ReturnObject) -{ - ACPI_OPERAND_OBJECT *NewObject; - ACPI_OPERAND_OBJECT **Elements; - UINT32 Length; - UINT8 *Buffer; - - - switch (OriginalObject->Common.Type) - { - case ACPI_TYPE_BUFFER: - - /* Buffer-to-Package conversion */ - - Length = OriginalObject->Buffer.Length; - NewObject = AcpiUtCreatePackageObject (Length); - if (!NewObject) - { - return (AE_NO_MEMORY); - } - - /* Convert each buffer byte to an integer package element */ - - Elements = NewObject->Package.Elements; - Buffer = OriginalObject->Buffer.Pointer; - - while (Length--) - { - *Elements = AcpiUtCreateIntegerObject ((UINT64) *Buffer); - if (!*Elements) - { - AcpiUtRemoveReference (NewObject); - return (AE_NO_MEMORY); - } - Elements++; - Buffer++; - } - break; - - default: - return (AE_AML_OPERAND_TYPE); - } - - *ReturnObject = NewObject; - return (AE_OK); -} - - -/******************************************************************************* - * * FUNCTION: AcpiNsRepairNullElement * * PARAMETERS: Data - Pointer to validation data structure @@ -745,42 +691,43 @@ AcpiNsRemoveNullElements ( /******************************************************************************* * - * FUNCTION: AcpiNsRepairPackageList + * FUNCTION: AcpiNsWrapWithPackage * * PARAMETERS: Data - Pointer to validation data structure - * ObjDescPtr - Pointer to the object to repair. The new - * package object is returned here, - * overwriting the old object. + * OriginalObject - Pointer to the object to repair. + * ObjDescPtr - The new package object is returned here * * RETURN: Status, new object in *ObjDescPtr * - * DESCRIPTION: Repair a common problem with objects that are defined to return - * a variable-length Package of Packages. If the variable-length - * is one, some BIOS code mistakenly simply declares a single - * Package instead of a Package with one sub-Package. This - * function attempts to repair this error by wrapping a Package - * object around the original Package, creating the correct - * Package with one sub-Package. + * DESCRIPTION: Repair a common problem with objects that are defined to + * return a variable-length Package of sub-objects. If there is + * only one sub-object, some BIOS code mistakenly simply declares + * the single object instead of a Package with one sub-object. + * This function attempts to repair this error by wrapping a + * Package object around the original object, creating the + * correct and expected Package with one sub-object. * * Names that can be repaired in this manner include: - * _ALR, _CSD, _HPX, _MLS, _PRT, _PSS, _TRT, TSS + * _ALR, _CSD, _HPX, _MLS, _PLD, _PRT, _PSS, _TRT, _TSS, + * _BCL, _DOD, _FIX, _Sx * ******************************************************************************/ ACPI_STATUS -AcpiNsRepairPackageList ( +AcpiNsWrapWithPackage ( ACPI_PREDEFINED_DATA *Data, + ACPI_OPERAND_OBJECT *OriginalObject, ACPI_OPERAND_OBJECT **ObjDescPtr) { ACPI_OPERAND_OBJECT *PkgObjDesc; - ACPI_FUNCTION_NAME (NsRepairPackageList); + ACPI_FUNCTION_NAME (NsWrapWithPackage); /* * Create the new outer package and populate it. The new package will - * have a single element, the lone subpackage. + * have a single element, the lone sub-object. */ PkgObjDesc = AcpiUtCreatePackageObject (1); if (!PkgObjDesc) @@ -788,15 +735,15 @@ AcpiNsRepairPackageList ( return (AE_NO_MEMORY); } - PkgObjDesc->Package.Elements[0] = *ObjDescPtr; + PkgObjDesc->Package.Elements[0] = OriginalObject; + + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Wrapped %s with expected Package object\n", + Data->Pathname, AcpiUtGetObjectTypeName (OriginalObject))); /* Return the new object in the object pointer */ *ObjDescPtr = PkgObjDesc; - Data->Flags |= ACPI_OBJECT_REPAIRED; - - ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, - "%s: Repaired incorrectly formed Package\n", Data->Pathname)); - + Data->Flags |= ACPI_OBJECT_REPAIRED | ACPI_OBJECT_WRAPPED; return (AE_OK); } diff --git a/source/components/namespace/nsutils.c b/source/components/namespace/nsutils.c index 3b07f83a9e33..43f734e81902 100644 --- a/source/components/namespace/nsutils.c +++ b/source/components/namespace/nsutils.c @@ -405,7 +405,7 @@ AcpiNsBuildInternalName ( if (!AcpiNsValidPathSeparator (*ExternalName) && (*ExternalName != 0)) { - return_ACPI_STATUS (AE_BAD_PARAMETER); + return_ACPI_STATUS (AE_BAD_PATHNAME); } /* Move on the next segment */ diff --git a/source/components/tables/tbfadt.c b/source/components/tables/tbfadt.c index ae4052099fe5..e8773204478c 100644 --- a/source/components/tables/tbfadt.c +++ b/source/components/tables/tbfadt.c @@ -400,10 +400,6 @@ AcpiTbConvertFadt ( UINT32 i; - /* Update the local FADT table header length */ - - AcpiGbl_FADT.Header.Length = sizeof (ACPI_TABLE_FADT); - /* * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary. * Later code will always use the X 64-bit field. @@ -437,6 +433,13 @@ AcpiTbConvertFadt ( } /* + * Now we can update the local FADT length to the length of the + * current FADT version as defined by the ACPI specification. + * Thus, we will have a common FADT internally. + */ + AcpiGbl_FADT.Header.Length = sizeof (ACPI_TABLE_FADT); + + /* * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X" * generic address structures as necessary. Later code will always use * the 64-bit address structures. diff --git a/source/components/tables/tbinstal.c b/source/components/tables/tbinstal.c index 5c6bd876f819..f100ab43f721 100644 --- a/source/components/tables/tbinstal.c +++ b/source/components/tables/tbinstal.c @@ -510,8 +510,10 @@ AcpiTbDeleteTable ( ACPI_FREE (TableDesc->Pointer); break; + /* Not mapped or allocated, there is nothing we can do */ + default: - break; + return; } TableDesc->Pointer = NULL; diff --git a/source/components/tables/tbutils.c b/source/components/tables/tbutils.c index bfdcf0c29832..e8b5705e96e7 100644 --- a/source/components/tables/tbutils.c +++ b/source/components/tables/tbutils.c @@ -492,8 +492,9 @@ AcpiTbInstallTable ( * * NOTE: If the table is overridden, then FinalTable will contain a * mapped pointer to the full new table. If the table is not overridden, - * then the table will be fully mapped elsewhere (in verify table). - * In any case, we must unmap the header that was mapped above. + * or if there has been a physical override, then the table will be + * fully mapped later (in verify table). In any case, we must + * unmap the header that was mapped above. */ FinalTable = AcpiTbTableOverride (Table, TableDesc); if (!FinalTable) @@ -510,6 +511,20 @@ AcpiTbInstallTable ( AcpiUtSetIntegerWidth (FinalTable->Revision); } + /* + * If we have a physical override during this early loading of the ACPI + * tables, unmap the table for now. It will be mapped again later when + * it is actually used. This supports very early loading of ACPI tables, + * before virtual memory is fully initialized and running within the + * host OS. Note: A logical override has the ACPI_TABLE_ORIGIN_OVERRIDE + * flag set and will not be deleted below. + */ + if (FinalTable != Table) + { + AcpiTbDeleteTable (TableDesc); + } + + UnmapAndExit: /* Always unmap the table header that we mapped above */ |