summaryrefslogtreecommitdiffstats
path: root/source/components
diff options
context:
space:
mode:
Diffstat (limited to 'source/components')
-rw-r--r--source/components/executer/exoparg1.c50
-rw-r--r--source/components/hardware/hwtimer.c15
-rw-r--r--source/components/namespace/nspredef.c18
-rw-r--r--source/components/namespace/nswalk.c18
-rw-r--r--source/components/namespace/nsxfeval.c14
-rw-r--r--source/components/tables/tbfadt.c4
-rw-r--r--source/components/tables/tbxfroot.c10
-rw-r--r--source/components/utilities/utglobal.c1
-rw-r--r--source/components/utilities/utosi.c89
-rw-r--r--source/components/utilities/utxface.c34
10 files changed, 204 insertions, 49 deletions
diff --git a/source/components/executer/exoparg1.c b/source/components/executer/exoparg1.c
index ff8dee2..bcd702a 100644
--- a/source/components/executer/exoparg1.c
+++ b/source/components/executer/exoparg1.c
@@ -1009,10 +1009,17 @@ AcpiExOpcode_1A_0T_1R (
* add another reference to the referenced object, however.
*/
ReturnDesc = *(Operand[0]->Reference.Where);
- if (ReturnDesc)
+ if (!ReturnDesc)
{
- AcpiUtAddReference (ReturnDesc);
+ /*
+ * Element is NULL, do not allow the dereference.
+ * This provides compatibility with other ACPI
+ * implementations.
+ */
+ return_ACPI_STATUS (AE_AML_UNINITIALIZED_ELEMENT);
}
+
+ AcpiUtAddReference (ReturnDesc);
break;
default:
@@ -1030,15 +1037,44 @@ AcpiExOpcode_1A_0T_1R (
ReturnDesc = Operand[0]->Reference.Object;
if (ACPI_GET_DESCRIPTOR_TYPE (ReturnDesc) ==
- ACPI_DESC_TYPE_NAMED)
+ ACPI_DESC_TYPE_NAMED)
{
ReturnDesc = AcpiNsGetAttachedObject (
- (ACPI_NAMESPACE_NODE *) ReturnDesc);
- }
+ (ACPI_NAMESPACE_NODE *) ReturnDesc);
+ if (!ReturnDesc)
+ {
+ break;
+ }
- /* Add another reference to the object! */
+ /*
+ * June 2013:
+ * BufferFields/FieldUnits require additional resolution
+ */
+ switch (ReturnDesc->Common.Type)
+ {
+ case ACPI_TYPE_BUFFER_FIELD:
+ case ACPI_TYPE_LOCAL_REGION_FIELD:
+ case ACPI_TYPE_LOCAL_BANK_FIELD:
+ case ACPI_TYPE_LOCAL_INDEX_FIELD:
- AcpiUtAddReference (ReturnDesc);
+ Status = AcpiExReadDataFromField (WalkState,
+ ReturnDesc, &TempDesc);
+ if (ACPI_FAILURE (Status))
+ {
+ goto Cleanup;
+ }
+
+ ReturnDesc = TempDesc;
+ break;
+
+ default:
+
+ /* Add another reference to the object */
+
+ AcpiUtAddReference (ReturnDesc);
+ break;
+ }
+ }
break;
default:
diff --git a/source/components/hardware/hwtimer.c b/source/components/hardware/hwtimer.c
index 7e4177a..cbfa96b 100644
--- a/source/components/hardware/hwtimer.c
+++ b/source/components/hardware/hwtimer.c
@@ -115,8 +115,14 @@ AcpiGetTimer (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
- Status = AcpiHwRead (Ticks, &AcpiGbl_FADT.XPmTimerBlock);
+ /* ACPI 5.0A: PM Timer is optional */
+ if (!AcpiGbl_FADT.XPmTimerBlock.Address)
+ {
+ return_ACPI_STATUS (AE_SUPPORT);
+ }
+
+ Status = AcpiHwRead (Ticks, &AcpiGbl_FADT.XPmTimerBlock);
return_ACPI_STATUS (Status);
}
@@ -171,6 +177,13 @@ AcpiGetTimerDuration (
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
+ /* ACPI 5.0A: PM Timer is optional */
+
+ if (!AcpiGbl_FADT.XPmTimerBlock.Address)
+ {
+ return_ACPI_STATUS (AE_SUPPORT);
+ }
+
/*
* Compute Tick Delta:
* Handle (max one) timer rollovers on 24-bit versus 32-bit timers.
diff --git a/source/components/namespace/nspredef.c b/source/components/namespace/nspredef.c
index 7122e7a..7b7e3e3 100644
--- a/source/components/namespace/nspredef.c
+++ b/source/components/namespace/nspredef.c
@@ -166,6 +166,16 @@ AcpiNsCheckReturnValue (
}
/*
+ *
+ * 4) If there is no return value and it is optional, just return
+ * AE_OK (_WAK).
+ */
+ if (!(*ReturnObjectPtr))
+ {
+ goto Exit;
+ }
+
+ /*
* For returned Package objects, check the type of all sub-objects.
* Note: Package may have been newly created by call above.
*/
@@ -293,7 +303,13 @@ TypeErrorExit:
AcpiUtGetExpectedReturnTypes (TypeBuffer, ExpectedBtypes);
- if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
+ if (!ReturnObject)
+ {
+ ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
+ "Expected return object of type %s",
+ TypeBuffer));
+ }
+ else if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT)
{
ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
"Return type mismatch - found %s, expected %s",
diff --git a/source/components/namespace/nswalk.c b/source/components/namespace/nswalk.c
index 0b25ffd..577b89b 100644
--- a/source/components/namespace/nswalk.c
+++ b/source/components/namespace/nswalk.c
@@ -165,9 +165,9 @@ AcpiNsGetNextNodeTyped (
* MaxDepth - Depth to which search is to reach
* Flags - Whether to unlock the NS before invoking
* the callback routine
- * PreOrderVisit - Called during tree pre-order visit
+ * DescendingCallback - Called during tree descent
* when an object of "Type" is found
- * PostOrderVisit - Called during tree post-order visit
+ * AscendingCallback - Called during tree ascent
* when an object of "Type" is found
* Context - Passed to user function(s) above
* ReturnValue - from the UserFunction if terminated
@@ -195,8 +195,8 @@ AcpiNsWalkNamespace (
ACPI_HANDLE StartNode,
UINT32 MaxDepth,
UINT32 Flags,
- ACPI_WALK_CALLBACK PreOrderVisit,
- ACPI_WALK_CALLBACK PostOrderVisit,
+ ACPI_WALK_CALLBACK DescendingCallback,
+ ACPI_WALK_CALLBACK AscendingCallback,
void *Context,
void **ReturnValue)
{
@@ -274,22 +274,22 @@ AcpiNsWalkNamespace (
}
/*
- * Invoke the user function, either pre-order or post-order
+ * Invoke the user function, either descending, ascending,
* or both.
*/
if (!NodePreviouslyVisited)
{
- if (PreOrderVisit)
+ if (DescendingCallback)
{
- Status = PreOrderVisit (ChildNode, Level,
+ Status = DescendingCallback (ChildNode, Level,
Context, ReturnValue);
}
}
else
{
- if (PostOrderVisit)
+ if (AscendingCallback)
{
- Status = PostOrderVisit (ChildNode, Level,
+ Status = AscendingCallback (ChildNode, Level,
Context, ReturnValue);
}
}
diff --git a/source/components/namespace/nsxfeval.c b/source/components/namespace/nsxfeval.c
index 6a2649a..e5c1e17 100644
--- a/source/components/namespace/nsxfeval.c
+++ b/source/components/namespace/nsxfeval.c
@@ -574,9 +574,9 @@ AcpiNsResolveReferences (
* PARAMETERS: Type - ACPI_OBJECT_TYPE to search for
* StartObject - Handle in namespace where search begins
* MaxDepth - Depth to which search is to reach
- * PreOrderVisit - Called during tree pre-order visit
+ * DescendingCallback - Called during tree descent
* when an object of "Type" is found
- * PostOrderVisit - Called during tree post-order visit
+ * AscendingCallback - Called during tree ascent
* when an object of "Type" is found
* Context - Passed to user function(s) above
* ReturnValue - Location where return value of
@@ -605,8 +605,8 @@ AcpiWalkNamespace (
ACPI_OBJECT_TYPE Type,
ACPI_HANDLE StartObject,
UINT32 MaxDepth,
- ACPI_WALK_CALLBACK PreOrderVisit,
- ACPI_WALK_CALLBACK PostOrderVisit,
+ ACPI_WALK_CALLBACK DescendingCallback,
+ ACPI_WALK_CALLBACK AscendingCallback,
void *Context,
void **ReturnValue)
{
@@ -620,7 +620,7 @@ AcpiWalkNamespace (
if ((Type > ACPI_TYPE_LOCAL_MAX) ||
(!MaxDepth) ||
- (!PreOrderVisit && !PostOrderVisit))
+ (!DescendingCallback && !AscendingCallback))
{
return_ACPI_STATUS (AE_BAD_PARAMETER);
}
@@ -655,8 +655,8 @@ AcpiWalkNamespace (
}
Status = AcpiNsWalkNamespace (Type, StartObject, MaxDepth,
- ACPI_NS_WALK_UNLOCK, PreOrderVisit,
- PostOrderVisit, Context, ReturnValue);
+ ACPI_NS_WALK_UNLOCK, DescendingCallback,
+ AscendingCallback, Context, ReturnValue);
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
diff --git a/source/components/tables/tbfadt.c b/source/components/tables/tbfadt.c
index 6f41c46..eb4e0e5 100644
--- a/source/components/tables/tbfadt.c
+++ b/source/components/tables/tbfadt.c
@@ -132,7 +132,7 @@ static ACPI_FADT_INFO FadtInfoTable[] =
ACPI_FADT_OFFSET (PmTimerBlock),
ACPI_FADT_OFFSET (PmTimerLength),
ACPI_PM_TIMER_WIDTH,
- ACPI_FADT_REQUIRED},
+ ACPI_FADT_SEPARATE_LENGTH}, /* ACPI 5.0A: Timer is optional */
{"Gpe0Block",
ACPI_FADT_OFFSET (XGpe0Block),
@@ -606,7 +606,7 @@ AcpiTbValidateFadt (
if (FadtInfoTable[i].Type & ACPI_FADT_REQUIRED)
{
/*
- * Field is required (PM1aEvent, PM1aControl, PmTimer).
+ * Field is required (PM1aEvent, PM1aControl).
* Both the address and length must be non-zero.
*/
if (!Address64->Address || !Length)
diff --git a/source/components/tables/tbxfroot.c b/source/components/tables/tbxfroot.c
index 20cc0fa..fa67781 100644
--- a/source/components/tables/tbxfroot.c
+++ b/source/components/tables/tbxfroot.c
@@ -51,12 +51,6 @@
#define _COMPONENT ACPI_TABLES
ACPI_MODULE_NAME ("tbxfroot")
-/* Local prototypes */
-
-static ACPI_STATUS
-AcpiTbValidateRsdp (
- ACPI_TABLE_RSDP *Rsdp);
-
/*******************************************************************************
*
@@ -70,7 +64,7 @@ AcpiTbValidateRsdp (
*
******************************************************************************/
-static ACPI_STATUS
+ACPI_STATUS
AcpiTbValidateRsdp (
ACPI_TABLE_RSDP *Rsdp)
{
@@ -81,7 +75,7 @@ AcpiTbValidateRsdp (
* Note: Sometimes there exists more than one RSDP in memory; the valid
* RSDP has a valid checksum, all others have an invalid checksum.
*/
- if (ACPI_STRNCMP ((char *) Rsdp, ACPI_SIG_RSDP,
+ if (ACPI_STRNCMP ((char *) Rsdp->Signature, ACPI_SIG_RSDP,
sizeof (ACPI_SIG_RSDP)-1) != 0)
{
/* Nope, BAD Signature */
diff --git a/source/components/utilities/utglobal.c b/source/components/utilities/utglobal.c
index 83b0526..56c4e06 100644
--- a/source/components/utilities/utglobal.c
+++ b/source/components/utilities/utglobal.c
@@ -319,7 +319,6 @@ AcpiUtInitGlobals (
AcpiGbl_TraceDbgLayer = 0;
AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING;
AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT;
- AcpiGbl_OsiData = 0;
AcpiGbl_OsiMutex = NULL;
AcpiGbl_RegMethodsExecuted = FALSE;
diff --git a/source/components/utilities/utosi.c b/source/components/utilities/utosi.c
index 21fe51b..c376256 100644
--- a/source/components/utilities/utosi.c
+++ b/source/components/utilities/utosi.c
@@ -81,21 +81,20 @@ static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[] =
/* Feature Group Strings */
- {"Extended Address Space Descriptor", NULL, 0, 0}
+ {"Extended Address Space Descriptor", NULL, ACPI_OSI_FEATURE, 0},
/*
* All "optional" feature group strings (features that are implemented
- * by the host) should be dynamically added by the host via
- * AcpiInstallInterface and should not be manually added here.
- *
- * Examples of optional feature group strings:
- *
- * "Module Device"
- * "Processor Device"
- * "3.0 Thermal Model"
- * "3.0 _SCP Extensions"
- * "Processor Aggregator Device"
+ * by the host) should be dynamically modified to VALID by the host via
+ * AcpiInstallInterface or AcpiUpdateInterfaces. Such optional feature
+ * group strings are set as INVALID by default here.
*/
+
+ {"Module Device", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0},
+ {"Processor Device", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0},
+ {"3.0 Thermal Model", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0},
+ {"3.0 _SCP Extensions", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0},
+ {"Processor Aggregator Device", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0}
};
@@ -172,13 +171,26 @@ AcpiUtInterfaceTerminate (
{
AcpiGbl_SupportedInterfaces = NextInterface->Next;
- /* Only interfaces added at runtime can be freed */
-
if (NextInterface->Flags & ACPI_OSI_DYNAMIC)
{
+ /* Only interfaces added at runtime can be freed */
+
ACPI_FREE (NextInterface->Name);
ACPI_FREE (NextInterface);
}
+ else
+ {
+ /* Interface is in static list. Reset it to invalid or valid. */
+
+ if (NextInterface->Flags & ACPI_OSI_DEFAULT_INVALID)
+ {
+ NextInterface->Flags |= ACPI_OSI_INVALID;
+ }
+ else
+ {
+ NextInterface->Flags &= ~ACPI_OSI_INVALID;
+ }
+ }
NextInterface = AcpiGbl_SupportedInterfaces;
}
@@ -307,6 +319,57 @@ AcpiUtRemoveInterface (
/*******************************************************************************
*
+ * FUNCTION: AcpiUtUpdateInterfaces
+ *
+ * PARAMETERS: Action - Actions to be performed during the
+ * update
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Update _OSI interface strings, disabling or enabling OS vendor
+ * strings or/and feature group strings.
+ * Caller MUST hold AcpiGbl_OsiMutex
+ *
+ ******************************************************************************/
+
+ACPI_STATUS
+AcpiUtUpdateInterfaces (
+ UINT8 Action)
+{
+ ACPI_INTERFACE_INFO *NextInterface;
+
+
+ NextInterface = AcpiGbl_SupportedInterfaces;
+ while (NextInterface)
+ {
+ if (((NextInterface->Flags & ACPI_OSI_FEATURE) &&
+ (Action & ACPI_FEATURE_STRINGS)) ||
+ (!(NextInterface->Flags & ACPI_OSI_FEATURE) &&
+ (Action & ACPI_VENDOR_STRINGS)))
+ {
+ if (Action & ACPI_DISABLE_INTERFACES)
+ {
+ /* Mark the interfaces as invalid */
+
+ NextInterface->Flags |= ACPI_OSI_INVALID;
+ }
+ else
+ {
+ /* Mark the interfaces as valid */
+
+ NextInterface->Flags &= ~ACPI_OSI_INVALID;
+ }
+ }
+
+ NextInterface = NextInterface->Next;
+ }
+
+ return (AE_OK);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: AcpiUtGetInterface
*
* PARAMETERS: InterfaceName - The interface to find
diff --git a/source/components/utilities/utxface.c b/source/components/utilities/utxface.c
index 4506980..021a462 100644
--- a/source/components/utilities/utxface.c
+++ b/source/components/utilities/utxface.c
@@ -499,6 +499,40 @@ ACPI_EXPORT_SYMBOL (AcpiInstallInterfaceHandler)
/*****************************************************************************
*
+ * FUNCTION: AcpiUpdateInterfaces
+ *
+ * PARAMETERS: Action - Actions to be performed during the
+ * update
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Update _OSI interface strings, disabling or enabling OS vendor
+ * string or/and feature group strings.
+ *
+ ****************************************************************************/
+
+ACPI_STATUS
+AcpiUpdateInterfaces (
+ UINT8 Action)
+{
+ ACPI_STATUS Status;
+
+
+ Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ Status = AcpiUtUpdateInterfaces (Action);
+
+ AcpiOsReleaseMutex (AcpiGbl_OsiMutex);
+ return (Status);
+}
+
+
+/*****************************************************************************
+ *
* FUNCTION: AcpiCheckAddressRange
*
* PARAMETERS: SpaceId - Address space ID
OpenPOWER on IntegriCloud