[ACPICA] Update to version 20180531. CORE-15222

This commit is contained in:
Thomas Faber
2018-10-28 15:28:34 +01:00
parent 2deb69c1f8
commit 6847cc3ae0
63 changed files with 3669 additions and 3284 deletions
@@ -373,6 +373,7 @@ AcpiDsGetPackageArguments (
Status = AcpiDsExecuteArguments (Node, Node,
ObjDesc->Package.AmlLength, ObjDesc->Package.AmlStart);
return_ACPI_STATUS (Status);
}
+8 -2
View File
@@ -143,6 +143,7 @@ AcpiDsDumpMethodStack (
ACPI_FUNCTION_TRACE (DsDumpMethodStack);
/* Ignore control codes, they are not errors */
if ((Status & AE_CODE_MASK) == AE_CODE_CONTROL)
@@ -212,8 +213,13 @@ AcpiDsDumpMethodStack (
Op->Common.Next = NULL;
#ifdef ACPI_DISASSEMBLER
AcpiOsPrintf ("Failed at ");
AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX);
if (WalkState->MethodNode != AcpiGbl_RootNode)
{
/* More verbose if not module-level code */
AcpiOsPrintf ("Failed at ");
AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX);
}
#endif
Op->Common.Next = Next;
}
@@ -644,8 +644,8 @@ AcpiDsEvalDataObjectOperands (
if (!Op->Common.Value.Arg)
{
ACPI_ERROR ((AE_INFO,
"Dispatch: Missing child while executing TermArg for %X",
Op->Common.AmlOpcode));
"Missing child while evaluating opcode %4.4X, Op %p",
Op->Common.AmlOpcode, Op));
return_ACPI_STATUS (AE_OK);
}
+98 -63
View File
@@ -47,6 +47,7 @@
#include "amlcode.h"
#include "acdispat.h"
#include "acinterp.h"
#include "acparser.h"
#define _COMPONENT ACPI_NAMESPACE
@@ -100,6 +101,7 @@ AcpiDsBuildInternalPackageObj (
ACPI_PARSE_OBJECT *Parent;
ACPI_OPERAND_OBJECT *ObjDesc = NULL;
ACPI_STATUS Status = AE_OK;
BOOLEAN ModuleLevelCode = FALSE;
UINT16 ReferenceCount;
UINT32 Index;
UINT32 i;
@@ -108,6 +110,13 @@ AcpiDsBuildInternalPackageObj (
ACPI_FUNCTION_TRACE (DsBuildInternalPackageObj);
/* Check if we are executing module level code */
if (WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL)
{
ModuleLevelCode = TRUE;
}
/* Find the parent of a possibly nested package */
Parent = Op->Common.Parent;
@@ -142,25 +151,43 @@ AcpiDsBuildInternalPackageObj (
/*
* Allocate the element array (array of pointers to the individual
* objects) based on the NumElements parameter. Add an extra pointer slot
* so that the list is always null terminated.
* objects) if necessary. the count is based on the NumElements
* parameter. Add an extra pointer slot so that the list is always
* null terminated.
*/
ObjDesc->Package.Elements = ACPI_ALLOCATE_ZEROED (
((ACPI_SIZE) ElementCount + 1) * sizeof (void *));
if (!ObjDesc->Package.Elements)
{
AcpiUtDeleteObjectDesc (ObjDesc);
return_ACPI_STATUS (AE_NO_MEMORY);
ObjDesc->Package.Elements = ACPI_ALLOCATE_ZEROED (
((ACPI_SIZE) ElementCount + 1) * sizeof (void *));
if (!ObjDesc->Package.Elements)
{
AcpiUtDeleteObjectDesc (ObjDesc);
return_ACPI_STATUS (AE_NO_MEMORY);
}
ObjDesc->Package.Count = ElementCount;
}
ObjDesc->Package.Count = ElementCount;
/* First arg is element count. Second arg begins the initializer list */
Arg = Op->Common.Value.Arg;
Arg = Arg->Common.Next;
if (Arg)
/*
* If we are executing module-level code, we will defer the
* full resolution of the package elements in order to support
* forward references from the elements. This provides
* compatibility with other ACPI implementations.
*/
if (ModuleLevelCode)
{
ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
ObjDesc->Package.AmlStart = WalkState->Aml;
ObjDesc->Package.AmlLength = 0;
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_PARSE,
"%s: Deferring resolution of Package elements\n",
ACPI_GET_FUNCTION_NAME));
}
/*
@@ -200,12 +227,17 @@ AcpiDsBuildInternalPackageObj (
ACPI_ERROR ((AE_INFO, "%-48s", "****DS namepath not found"));
}
/*
* Initialize this package element. This function handles the
* resolution of named references within the package.
*/
AcpiDsInitPackageElement (0, ObjDesc->Package.Elements[i],
NULL, &ObjDesc->Package.Elements[i]);
if (!ModuleLevelCode)
{
/*
* Initialize this package element. This function handles the
* resolution of named references within the package.
* Forward references from module-level code are deferred
* until all ACPI tables are loaded.
*/
AcpiDsInitPackageElement (0, ObjDesc->Package.Elements[i],
NULL, &ObjDesc->Package.Elements[i]);
}
}
if (*ObjDescPtr)
@@ -275,15 +307,21 @@ AcpiDsBuildInternalPackageObj (
* NumElements count.
*
* Note: this is not an error, the package is padded out
* with NULLs.
* with NULLs as per the ACPI specification.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"Package List length (%u) smaller than NumElements "
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INFO,
"%s: Package List length (%u) smaller than NumElements "
"count (%u), padded with null elements\n",
i, ElementCount));
ACPI_GET_FUNCTION_NAME, i, ElementCount));
}
/* Module-level packages will be resolved later */
if (!ModuleLevelCode)
{
ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
}
ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjDesc);
return_ACPI_STATUS (Status);
}
@@ -373,11 +411,12 @@ AcpiDsResolvePackageElement (
ACPI_OPERAND_OBJECT **ElementPtr)
{
ACPI_STATUS Status;
ACPI_STATUS Status2;
ACPI_GENERIC_STATE ScopeInfo;
ACPI_OPERAND_OBJECT *Element = *ElementPtr;
ACPI_NAMESPACE_NODE *ResolvedNode;
ACPI_NAMESPACE_NODE *OriginalNode;
char *ExternalPath = NULL;
char *ExternalPath = "";
ACPI_OBJECT_TYPE Type;
@@ -388,6 +427,10 @@ AcpiDsResolvePackageElement (
if (Element->Reference.Resolved)
{
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_PARSE,
"%s: Package element is already resolved\n",
ACPI_GET_FUNCTION_NAME));
return_VOID;
}
@@ -395,21 +438,47 @@ AcpiDsResolvePackageElement (
ScopeInfo.Scope.Node = Element->Reference.Node; /* Prefix node */
Status = AcpiNsLookup (&ScopeInfo,
(char *) Element->Reference.Aml, /* Pointer to AML path */
Status = AcpiNsLookup (&ScopeInfo, (char *) Element->Reference.Aml,
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
NULL, &ResolvedNode);
if (ACPI_FAILURE (Status))
{
Status = AcpiNsExternalizeName (ACPI_UINT32_MAX,
(char *) Element->Reference.Aml,
NULL, &ExternalPath);
if ((Status == AE_NOT_FOUND) && AcpiGbl_IgnorePackageResolutionErrors)
{
/*
* Optionally be silent about the NOT_FOUND case for the referenced
* name. Although this is potentially a serious problem,
* it can generate a lot of noise/errors on platforms whose
* firmware carries around a bunch of unused Package objects.
* To disable these errors, set this global to TRUE:
* AcpiGbl_IgnorePackageResolutionErrors
*
* If the AML actually tries to use such a package, the unresolved
* element(s) will be replaced with NULL elements.
*/
/* Referenced name not found, set the element to NULL */
AcpiUtRemoveReference (*ElementPtr);
*ElementPtr = NULL;
return_VOID;
}
Status2 = AcpiNsExternalizeName (ACPI_UINT32_MAX,
(char *) Element->Reference.Aml, NULL, &ExternalPath);
ACPI_EXCEPTION ((AE_INFO, Status,
"Could not find/resolve named package element: %s", ExternalPath));
"While resolving a named reference package element - %s",
ExternalPath));
if (ACPI_SUCCESS (Status2))
{
ACPI_FREE (ExternalPath);
}
ACPI_FREE (ExternalPath);
/* Could not resolve name, set the element to NULL */
AcpiUtRemoveReference (*ElementPtr);
*ElementPtr = NULL;
return_VOID;
}
@@ -423,24 +492,6 @@ AcpiDsResolvePackageElement (
*ElementPtr = NULL;
return_VOID;
}
#if 0
else if (ResolvedNode->Flags & ANOBJ_TEMPORARY)
{
/*
* A temporary node found here indicates that the reference is
* to a node that was created within this method. We are not
* going to allow it (especially if the package is returned
* from the method) -- the temporary node will be deleted out
* from under the method. (05/2017).
*/
ACPI_ERROR ((AE_INFO,
"Package element refers to a temporary name [%4.4s], "
"inserting a NULL element",
ResolvedNode->Name.Ascii));
*ElementPtr = NULL;
return_VOID;
}
#endif
/*
* Special handling for Alias objects. We need ResolvedNode to point
@@ -479,22 +530,6 @@ AcpiDsResolvePackageElement (
return_VOID;
}
#if 0
/* TBD - alias support */
/*
* Special handling for Alias objects. We need to setup the type
* and the Op->Common.Node to point to the Alias target. Note,
* Alias has at most one level of indirection internally.
*/
Type = Op->Common.Node->Type;
if (Type == ACPI_TYPE_LOCAL_ALIAS)
{
Type = ObjDesc->Common.Type;
Op->Common.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
Op->Common.Node->Object);
}
#endif
switch (Type)
{
/*
+2 -2
View File
@@ -615,8 +615,8 @@ AcpiDsExecEndOp (
case AML_TYPE_CREATE_OBJECT:
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Executing CreateObject (Buffer/Package) Op=%p AMLPtr=%p\n",
Op, Op->Named.Data));
"Executing CreateObject (Buffer/Package) Op=%p Child=%p ParentOpcode=%4.4X\n",
Op, Op->Named.Value.Arg, Op->Common.Parent->Common.AmlOpcode));
switch (Op->Common.Parent->Common.AmlOpcode)
{
+1 -1
View File
@@ -156,7 +156,7 @@ AcpiDsLoad1BeginOp (
UINT32 Flags;
ACPI_FUNCTION_TRACE (DsLoad1BeginOp);
ACPI_FUNCTION_TRACE_PTR (DsLoad1BeginOp, WalkState->Op);
Op = WalkState->Op;
@@ -161,8 +161,7 @@ AcpiDsScopeStackPush (
}
else
{
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
"[\\___] (%s)", "ROOT"));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, ACPI_NAMESPACE_ROOT));
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
@@ -220,15 +219,13 @@ AcpiDsScopeStackPop (
NewScopeInfo = WalkState->ScopeInfo;
if (NewScopeInfo)
{
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
"[%4.4s] (%s)\n",
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "[%4.4s] (%s)\n",
AcpiUtGetNodeName (NewScopeInfo->Scope.Node),
AcpiUtGetTypeName (NewScopeInfo->Common.Value)));
}
else
{
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
"[\\___] (ROOT)\n"));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC, "%s\n", ACPI_NAMESPACE_ROOT));
}
AcpiUtDeleteGenericState (ScopeInfo);
+7 -2
View File
@@ -236,6 +236,7 @@ AcpiEvFixedEventDetect (
UINT32 FixedStatus;
UINT32 FixedEnable;
UINT32 i;
ACPI_STATUS Status;
ACPI_FUNCTION_NAME (EvFixedEventDetect);
@@ -245,8 +246,12 @@ AcpiEvFixedEventDetect (
* Read the fixed feature status and enable registers, as all the cases
* depend on their values. Ignore errors here.
*/
(void) AcpiHwRegisterRead (ACPI_REGISTER_PM1_STATUS, &FixedStatus);
(void) AcpiHwRegisterRead (ACPI_REGISTER_PM1_ENABLE, &FixedEnable);
Status = AcpiHwRegisterRead (ACPI_REGISTER_PM1_STATUS, &FixedStatus);
Status |= AcpiHwRegisterRead (ACPI_REGISTER_PM1_ENABLE, &FixedEnable);
if (ACPI_FAILURE (Status))
{
return (IntStatus);
}
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
"Fixed Event Block: Enable %08X Status %08X\n",
+137 -101
View File
@@ -118,7 +118,7 @@ AcpiEvUpdateGpeEnableMask (
*
* RETURN: Status
*
* DESCRIPTION: Clear a GPE of stale events and enable it.
* DESCRIPTION: Enable a GPE.
*
******************************************************************************/
@@ -132,14 +132,6 @@ AcpiEvEnableGpe (
ACPI_FUNCTION_TRACE (EvEnableGpe);
/* Clear the GPE (of stale events) */
Status = AcpiHwClearGpe (GpeEventInfo);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/* Enable the requested GPE */
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE);
@@ -434,17 +426,12 @@ UINT32
AcpiEvGpeDetect (
ACPI_GPE_XRUPT_INFO *GpeXruptList)
{
ACPI_STATUS Status;
ACPI_GPE_BLOCK_INFO *GpeBlock;
ACPI_NAMESPACE_NODE *GpeDevice;
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
UINT32 GpeNumber;
ACPI_GPE_HANDLER_INFO *GpeHandlerInfo;
UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED;
UINT8 EnabledStatusByte;
UINT64 StatusReg;
UINT64 EnableReg;
ACPI_CPU_FLAGS Flags;
UINT32 i;
UINT32 j;
@@ -500,105 +487,25 @@ AcpiEvGpeDetect (
continue;
}
/* Read the Status Register */
Status = AcpiHwRead (&StatusReg, &GpeRegisterInfo->StatusAddress);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
}
/* Read the Enable Register */
Status = AcpiHwRead (&EnableReg, &GpeRegisterInfo->EnableAddress);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
}
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
"Read registers for GPE %02X-%02X: Status=%02X, Enable=%02X, "
"RunEnable=%02X, WakeEnable=%02X\n",
GpeRegisterInfo->BaseGpeNumber,
GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
(UINT32) StatusReg, (UINT32) EnableReg,
GpeRegisterInfo->EnableForRun,
GpeRegisterInfo->EnableForWake));
/* Check if there is anything active at all in this register */
EnabledStatusByte = (UINT8) (StatusReg & EnableReg);
if (!EnabledStatusByte)
{
/* No active GPEs in this register, move on */
continue;
}
/* Now look at the individual GPEs in this byte register */
for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++)
{
/* Examine one GPE bit */
/* Detect and dispatch one GPE bit */
GpeEventInfo = &GpeBlock->EventInfo[((ACPI_SIZE) i *
ACPI_GPE_REGISTER_WIDTH) + j];
GpeNumber = j + GpeRegisterInfo->BaseGpeNumber;
if (EnabledStatusByte & (1 << j))
{
/* Invoke global event handler if present */
AcpiGpeCount++;
if (AcpiGbl_GlobalEventHandler)
{
AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_GPE,
GpeDevice, GpeNumber,
AcpiGbl_GlobalEventHandlerContext);
}
/* Found an active GPE */
if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
ACPI_GPE_DISPATCH_RAW_HANDLER)
{
/* Dispatch the event to a raw handler */
GpeHandlerInfo = GpeEventInfo->Dispatch.Handler;
/*
* There is no protection around the namespace node
* and the GPE handler to ensure a safe destruction
* because:
* 1. The namespace node is expected to always
* exist after loading a table.
* 2. The GPE handler is expected to be flushed by
* AcpiOsWaitEventsComplete() before the
* destruction.
*/
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
IntStatus |= GpeHandlerInfo->Address (
GpeDevice, GpeNumber, GpeHandlerInfo->Context);
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
}
else
{
/*
* Dispatch the event to a standard handler or
* method.
*/
IntStatus |= AcpiEvGpeDispatch (GpeDevice,
GpeEventInfo, GpeNumber);
}
}
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
IntStatus |= AcpiEvDetectGpe (
GpeDevice, GpeEventInfo, GpeNumber);
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
}
}
GpeBlock = GpeBlock->Next;
}
UnlockAndExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
return (IntStatus);
}
@@ -784,6 +691,137 @@ AcpiEvFinishGpe (
}
/*******************************************************************************
*
* FUNCTION: AcpiEvDetectGpe
*
* PARAMETERS: GpeDevice - Device node. NULL for GPE0/GPE1
* GpeEventInfo - Info for this GPE
* GpeNumber - Number relative to the parent GPE block
*
* RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED
*
* DESCRIPTION: Detect and dispatch a General Purpose Event to either a function
* (e.g. EC) or method (e.g. _Lxx/_Exx) handler.
* NOTE: GPE is W1C, so it is possible to handle a single GPE from both
* task and irq context in parallel as long as the process to
* detect and mask the GPE is atomic.
* However the atomicity of ACPI_GPE_DISPATCH_RAW_HANDLER is
* dependent on the raw handler itself.
*
******************************************************************************/
UINT32
AcpiEvDetectGpe (
ACPI_NAMESPACE_NODE *GpeDevice,
ACPI_GPE_EVENT_INFO *GpeEventInfo,
UINT32 GpeNumber)
{
UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED;
UINT8 EnabledStatusByte;
UINT64 StatusReg;
UINT64 EnableReg;
UINT32 RegisterBit;
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
ACPI_GPE_HANDLER_INFO *GpeHandlerInfo;
ACPI_CPU_FLAGS Flags;
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE (EvGpeDetect);
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
/* Get the info block for the entire GPE register */
GpeRegisterInfo = GpeEventInfo->RegisterInfo;
/* Get the register bitmask for this GPE */
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
/* GPE currently enabled (enable bit == 1)? */
Status = AcpiHwRead (&EnableReg, &GpeRegisterInfo->EnableAddress);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
/* GPE currently active (status bit == 1)? */
Status = AcpiHwRead (&StatusReg, &GpeRegisterInfo->StatusAddress);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
/* Check if there is anything active at all in this GPE */
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
"Read registers for GPE %02X: Status=%02X, Enable=%02X, "
"RunEnable=%02X, WakeEnable=%02X\n",
GpeNumber,
(UINT32) (StatusReg & RegisterBit),
(UINT32) (EnableReg & RegisterBit),
GpeRegisterInfo->EnableForRun,
GpeRegisterInfo->EnableForWake));
EnabledStatusByte = (UINT8) (StatusReg & EnableReg);
if (!(EnabledStatusByte & RegisterBit))
{
goto ErrorExit;
}
/* Invoke global event handler if present */
AcpiGpeCount++;
if (AcpiGbl_GlobalEventHandler)
{
AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_GPE,
GpeDevice, GpeNumber,
AcpiGbl_GlobalEventHandlerContext);
}
/* Found an active GPE */
if (ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) ==
ACPI_GPE_DISPATCH_RAW_HANDLER)
{
/* Dispatch the event to a raw handler */
GpeHandlerInfo = GpeEventInfo->Dispatch.Handler;
/*
* There is no protection around the namespace node
* and the GPE handler to ensure a safe destruction
* because:
* 1. The namespace node is expected to always
* exist after loading a table.
* 2. The GPE handler is expected to be flushed by
* AcpiOsWaitEventsComplete() before the
* destruction.
*/
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
IntStatus |= GpeHandlerInfo->Address (
GpeDevice, GpeNumber, GpeHandlerInfo->Context);
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
}
else
{
/* Dispatch the event to a standard handler or method. */
IntStatus |= AcpiEvGpeDispatch (GpeDevice,
GpeEventInfo, GpeNumber);
}
ErrorExit:
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
return (IntStatus);
}
/*******************************************************************************
*
* FUNCTION: AcpiEvGpeDispatch
@@ -797,8 +835,6 @@ AcpiEvFinishGpe (
* DESCRIPTION: Dispatch a General Purpose Event to either a function (e.g. EC)
* or method (e.g. _Lxx/_Exx) handler.
*
* This function executes at interrupt level.
*
******************************************************************************/
UINT32
+15 -5
View File
@@ -477,7 +477,7 @@ ACPI_STATUS
AcpiEvInitializeGpeBlock (
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Ignored)
void *Context)
{
ACPI_STATUS Status;
ACPI_GPE_EVENT_INFO *GpeEventInfo;
@@ -485,6 +485,8 @@ AcpiEvInitializeGpeBlock (
UINT32 GpeIndex;
UINT32 i;
UINT32 j;
BOOLEAN *IsPollingNeeded = Context;
ACPI_ERROR_ONLY (UINT32 GpeNumber);
ACPI_FUNCTION_TRACE (EvInitializeGpeBlock);
@@ -514,14 +516,14 @@ AcpiEvInitializeGpeBlock (
GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j;
GpeEventInfo = &GpeBlock->EventInfo[GpeIndex];
ACPI_ERROR_ONLY(GpeNumber = GpeBlock->BlockBaseNumber + GpeIndex);
GpeEventInfo->Flags |= ACPI_GPE_INITIALIZED;
/*
* Ignore GPEs that have no corresponding _Lxx/_Exx method
* and GPEs that are used to wake the system
*/
if ((ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == ACPI_GPE_DISPATCH_NONE) ||
(ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == ACPI_GPE_DISPATCH_HANDLER) ||
(ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) == ACPI_GPE_DISPATCH_RAW_HANDLER) ||
if ((ACPI_GPE_DISPATCH_TYPE (GpeEventInfo->Flags) != ACPI_GPE_DISPATCH_METHOD) ||
(GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE))
{
continue;
@@ -532,10 +534,18 @@ AcpiEvInitializeGpeBlock (
{
ACPI_EXCEPTION ((AE_INFO, Status,
"Could not enable GPE 0x%02X",
GpeIndex + GpeBlock->BlockBaseNumber));
GpeNumber));
continue;
}
GpeEventInfo->Flags |= ACPI_GPE_AUTO_ENABLED;
if (IsPollingNeeded &&
ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo))
{
*IsPollingNeeded = TRUE;
}
GpeEnabledCount++;
}
}
+4 -1
View File
@@ -628,9 +628,12 @@ AcpiEvInitializeRegion (
* Node's object was replaced by this Method object and we
* saved the handler in the method object.
*
* Note: Only used for the legacy MLC support. Will
* be removed in the future.
*
* See AcpiNsExecModuleCode
*/
if (!AcpiGbl_ParseTableAsTermList &&
if (!AcpiGbl_ExecuteTablesAsMethods &&
ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL)
{
HandlerObj = ObjDesc->Method.Dispatch.Handler;
+9
View File
@@ -1149,6 +1149,15 @@ AcpiRemoveGpeHandler (
Handler->OriginallyEnabled)
{
(void) AcpiEvAddGpeReference (GpeEventInfo);
if (ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo))
{
/* Poll edge triggered GPEs to handle existing events */
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
(void) AcpiEvDetectGpe (
GpeDevice, GpeEventInfo, GpeNumber);
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
}
}
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
+30 -1
View File
@@ -80,6 +80,7 @@ AcpiUpdateAllGpes (
void)
{
ACPI_STATUS Status;
BOOLEAN IsPollingNeeded = FALSE;
ACPI_FUNCTION_TRACE (AcpiUpdateAllGpes);
@@ -96,7 +97,8 @@ AcpiUpdateAllGpes (
goto UnlockAndExit;
}
Status = AcpiEvWalkGpeList (AcpiEvInitializeGpeBlock, NULL);
Status = AcpiEvWalkGpeList (AcpiEvInitializeGpeBlock,
&IsPollingNeeded);
if (ACPI_SUCCESS (Status))
{
AcpiGbl_AllGpesInitialized = TRUE;
@@ -104,6 +106,13 @@ AcpiUpdateAllGpes (
UnlockAndExit:
(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
if (IsPollingNeeded && AcpiGbl_AllGpesInitialized)
{
/* Poll GPEs to handle already triggered events */
AcpiEvGpeDetect (AcpiGbl_GpeXruptListHead);
}
return_ACPI_STATUS (Status);
}
@@ -151,6 +160,16 @@ AcpiEnableGpe (
ACPI_GPE_DISPATCH_NONE)
{
Status = AcpiEvAddGpeReference (GpeEventInfo);
if (ACPI_SUCCESS (Status) &&
ACPI_GPE_IS_POLLING_NEEDED (GpeEventInfo))
{
/* Poll edge-triggered GPEs to handle existing events */
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
(void) AcpiEvDetectGpe (
GpeDevice, GpeEventInfo, GpeNumber);
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
}
}
else
{
@@ -501,6 +520,16 @@ AcpiSetupGpeForWake (
GpeEventInfo->Flags =
(ACPI_GPE_DISPATCH_NOTIFY | ACPI_GPE_LEVEL_TRIGGERED);
}
else if (GpeEventInfo->Flags & ACPI_GPE_AUTO_ENABLED)
{
/*
* A reference to this GPE has been added during the GPE block
* initialization, so drop it now to prevent the GPE from being
* permanently enabled and clear its ACPI_GPE_AUTO_ENABLED flag.
*/
(void) AcpiEvRemoveGpeReference (GpeEventInfo);
GpeEventInfo->Flags &= ~~ACPI_GPE_AUTO_ENABLED;
}
/*
* If we already have an implicit notify on this GPE, add
@@ -233,6 +233,11 @@ AcpiExLoadTableOp (
return_ACPI_STATUS (Status);
}
/* Complete the initialization/resolution of package objects */
Status = AcpiNsWalkNamespace (ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, 0, AcpiNsInitOnePackage, NULL, NULL, NULL);
/* Parameter Data (optional) */
if (ParameterNode)
@@ -506,6 +511,11 @@ AcpiExLoadOp (
return_ACPI_STATUS (Status);
}
/* Complete the initialization/resolution of package objects */
Status = AcpiNsWalkNamespace (ACPI_TYPE_PACKAGE, ACPI_ROOT_OBJECT,
ACPI_UINT32_MAX, 0, AcpiNsInitOnePackage, NULL, NULL, NULL);
/* Store the DdbHandle into the Target operand */
Status = AcpiExStore (DdbHandle, Target, WalkState);
@@ -558,6 +568,17 @@ AcpiExUnloadTable (
ACPI_WARNING ((AE_INFO,
"Received request to unload an ACPI table"));
/*
* May 2018: Unload is no longer supported for the following reasons:
* 1) A correct implementation on some hosts may not be possible.
* 2) Other ACPI implementations do not correctly/fully support it.
* 3) It requires host device driver support which does not exist.
* (To properly support namespace unload out from underneath.)
* 4) This AML operator has never been seen in the field.
*/
ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED,
"AML Unload operator is not supported"));
/*
* Validate the handle
* Although the handle is partially validated in AcpiExReconfiguration()
@@ -649,6 +649,7 @@ AcpiExConvertToTargetType (
switch (GET_CURRENT_ARG_TYPE (WalkState->OpInfo->RuntimeArgs))
{
case ARGI_SIMPLE_TARGET:
case ARGI_FIXED_TARGET:
case ARGI_INTEGER_REF: /* Handles Increment, Decrement cases */
switch (DestinationType)
+3 -4
View File
@@ -96,15 +96,14 @@ AcpiExDoDebugObject (
return_VOID;
}
/* Null string or newline -- don't emit the line header */
/* Newline -- don't emit the line header */
if (SourceDesc &&
(ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_OPERAND) &&
(SourceDesc->Common.Type == ACPI_TYPE_STRING))
{
if ((SourceDesc->String.Length == 0) ||
((SourceDesc->String.Length == 1) &&
(*SourceDesc->String.Pointer == '\n')))
if ((SourceDesc->String.Length == 1) &&
(*SourceDesc->String.Pointer == '\n'))
{
AcpiOsPrintf ("\n");
return_VOID;
+2 -5
View File
@@ -201,14 +201,11 @@ AcpiExNameSegment (
return_ACPI_STATUS (AE_CTRL_PENDING);
}
ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Bytes from stream:\n"));
for (Index = 0;
(Index < ACPI_NAME_SIZE) && (AcpiUtValidNameChar (*AmlAddress, 0));
Index++)
{
CharBuf[Index] = *AmlAddress++;
ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "%c\n", CharBuf[Index]));
}
@@ -222,9 +219,9 @@ AcpiExNameSegment (
if (NameString)
{
strcat (NameString, CharBuf);
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"Appended to - %s\n", NameString));
"Appending NameSeg %s\n", CharBuf));
strcat (NameString, CharBuf);
}
else
{
@@ -321,6 +321,7 @@ AcpiExResolveOperands (
case ARGI_OBJECT_REF:
case ARGI_DEVICE_REF:
case ARGI_TARGETREF: /* Allows implicit conversion rules before store */
case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */
case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */
case ARGI_STORE_TARGET:
-1
View File
@@ -550,7 +550,6 @@ AcpiHwDisableAllGpes (
Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock, NULL);
Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock, NULL);
return_ACPI_STATUS (Status);
}
+2 -10
View File
@@ -90,16 +90,8 @@ AcpiHwLegacySleep (
return_ACPI_STATUS (Status);
}
/* Clear all fixed and general purpose status bits */
Status = AcpiHwClearAcpiStatus ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/*
* 1) Disable/Clear all GPEs
* 1) Disable all GPEs
* 2) Enable all wakeup GPEs
*/
Status = AcpiHwDisableAllGpes ();
@@ -319,7 +311,7 @@ AcpiHwLegacyWake (
* might get fired there
*
* Restore the GPEs:
* 1) Disable/Clear all GPEs
* 1) Disable all GPEs
* 2) Enable all runtime GPEs
*/
Status = AcpiHwDisableAllGpes ();
+1 -1
View File
@@ -229,7 +229,7 @@ AcpiEnterSleepStateS4bios (
}
/*
* 1) Disable/Clear all GPEs
* 1) Disable all GPEs
* 2) Enable all wakeup GPEs
*/
Status = AcpiHwDisableAllGpes ();
+4
View File
@@ -216,6 +216,10 @@ FlSplitInputPathname (
char **OutDirectoryPath,
char **OutFilename);
char *
FlGetFileBasename (
char *FilePathname);
char *
AdGenerateFilename (
char *Prefix,
@@ -341,6 +341,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3a[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3b[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3c[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort4[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort5[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortAcc[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortHdr[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortMap[];
@@ -45,6 +45,21 @@
#define __ACEVENTS_H__
/*
* Conditions to trigger post enabling GPE polling:
* It is not sufficient to trigger edge-triggered GPE with specific GPE
* chips, software need to poll once after enabling.
*/
#ifdef ACPI_USE_GPE_POLLING
#define ACPI_GPE_IS_POLLING_NEEDED(__gpe__) \
((__gpe__)->RuntimeCount == 1 && \
(__gpe__)->Flags & ACPI_GPE_INITIALIZED && \
((__gpe__)->Flags & ACPI_GPE_XRUPT_TYPE_MASK) == ACPI_GPE_EDGE_TRIGGERED)
#else
#define ACPI_GPE_IS_POLLING_NEEDED(__gpe__) FALSE
#endif
/*
* evevent
*/
@@ -142,6 +157,12 @@ ACPI_STATUS
AcpiEvFinishGpe (
ACPI_GPE_EVENT_INFO *GpeEventInfo);
UINT32
AcpiEvDetectGpe (
ACPI_NAMESPACE_NODE *GpeDevice,
ACPI_GPE_EVENT_INFO *GpeEventInfo,
UINT32 GpeNumber);
/*
* evgpeblk - Upper-level GPE block support
+3 -1
View File
@@ -464,16 +464,18 @@
#define ACPI_WARN_PREDEFINED(plist) AcpiUtPredefinedWarning plist
#define ACPI_INFO_PREDEFINED(plist) AcpiUtPredefinedInfo plist
#define ACPI_BIOS_ERROR_PREDEFINED(plist) AcpiUtPredefinedBiosError plist
#define ACPI_ERROR_ONLY(s) s
#else
/* No error messages */
#define ACPI_ERROR_NAMESPACE(s, e)
#define ACPI_ERROR_NAMESPACE(s, p, e)
#define ACPI_ERROR_METHOD(s, n, p, e)
#define ACPI_WARN_PREDEFINED(plist)
#define ACPI_INFO_PREDEFINED(plist)
#define ACPI_BIOS_ERROR_PREDEFINED(plist)
#define ACPI_ERROR_ONLY(s)
#endif /* ACPI_NO_ERROR_MESSAGES */
+5 -2
View File
@@ -83,11 +83,14 @@
/* Definitions of the predefined namespace names */
#define ACPI_UNKNOWN_NAME (UINT32) 0x3F3F3F3F /* Unknown name is "????" */
#define ACPI_ROOT_NAME (UINT32) 0x5F5F5F5C /* Root name is "\___" */
#define ACPI_PREFIX_MIXED (UINT32) 0x69706341 /* "Acpi" */
#define ACPI_PREFIX_LOWER (UINT32) 0x69706361 /* "acpi" */
/* Root name stuff */
#define ACPI_ROOT_NAME (UINT32) 0x5F5F5F5C /* Root name is "\___" */
#define ACPI_ROOT_PATHNAME "\\___"
#define ACPI_NAMESPACE_ROOT "Namespace Root"
#define ACPI_NS_ROOT_PATH "\\"
#endif /* __ACNAMES_H__ */
@@ -96,6 +96,12 @@ ACPI_STATUS
AcpiNsInitializeDevices (
UINT32 Flags);
ACPI_STATUS
AcpiNsInitOnePackage (
ACPI_HANDLE ObjHandle,
UINT32 Level,
void *Context,
void **ReturnValue);
/*
* nsload - Namespace loading
+7 -7
View File
@@ -253,7 +253,7 @@
#define ARGI_FIELD_OP ARGI_INVALID_OPCODE
#define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_FIND_SET_RIGHT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET)
#define ARGI_IF_OP ARGI_INVALID_OPCODE
#define ARGI_INCREMENT_OP ARGI_LIST1 (ARGI_TARGETREF)
#define ARGI_INDEX_FIELD_OP ARGI_INVALID_OPCODE
@@ -317,12 +317,12 @@
#define ARGI_SUBTRACT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_THERMAL_ZONE_OP ARGI_INVALID_OPCODE
#define ARGI_TIMER_OP ARG_NONE
#define ARGI_TO_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_TO_BUFFER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF)
#define ARGI_TO_DEC_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF)
#define ARGI_TO_HEX_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF)
#define ARGI_TO_INTEGER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_TARGETREF)
#define ARGI_TO_STRING_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_TO_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET)
#define ARGI_TO_BUFFER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
#define ARGI_TO_DEC_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
#define ARGI_TO_HEX_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
#define ARGI_TO_INTEGER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
#define ARGI_TO_STRING_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_FIXED_TARGET)
#define ARGI_UNLOAD_OP ARGI_LIST1 (ARGI_DDBHANDLE)
#define ARGI_VAR_PACKAGE_OP ARGI_LIST1 (ARGI_INTEGER)
#define ARGI_WAIT_OP ARGI_LIST2 (ARGI_EVENT, ARGI_INTEGER)
+3 -1
View File
@@ -115,7 +115,8 @@
#define ACPI_LV_ALLOCATIONS 0x00100000
#define ACPI_LV_FUNCTIONS 0x00200000
#define ACPI_LV_OPTIMIZATIONS 0x00400000
#define ACPI_LV_VERBOSITY2 0x00700000 | ACPI_LV_VERBOSITY1
#define ACPI_LV_PARSE_TREES 0x00800000
#define ACPI_LV_VERBOSITY2 0x00F00000 | ACPI_LV_VERBOSITY1
#define ACPI_LV_ALL ACPI_LV_VERBOSITY2
/* Trace verbosity level 3 [Threading, I/O, and Interrupts] */
@@ -167,6 +168,7 @@
#define ACPI_DB_TABLES ACPI_DEBUG_LEVEL (ACPI_LV_TABLES)
#define ACPI_DB_FUNCTIONS ACPI_DEBUG_LEVEL (ACPI_LV_FUNCTIONS)
#define ACPI_DB_OPTIMIZATIONS ACPI_DEBUG_LEVEL (ACPI_LV_OPTIMIZATIONS)
#define ACPI_DB_PARSE_TREES ACPI_DEBUG_LEVEL (ACPI_LV_PARSE_TREES)
#define ACPI_DB_VALUES ACPI_DEBUG_LEVEL (ACPI_LV_VALUES)
#define ACPI_DB_OBJECTS ACPI_DEBUG_LEVEL (ACPI_LV_OBJECTS)
#define ACPI_DB_ALLOCATIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALLOCATIONS)
+18 -5
View File
@@ -46,7 +46,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
#define ACPI_CA_VERSION 0x20180105
#define ACPI_CA_VERSION 0x20180531
#include "acconfig.h"
#include "actypes.h"
@@ -194,15 +194,18 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE);
/*
* Optionally support group module level code.
* NOTE, this is essentially obsolete and will be removed soon
* (01/2018).
*/
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_GroupModuleLevelCode, FALSE);
/*
* Optionally support module level code by parsing the entire table as
* a TermList. Default is FALSE, do not execute entire table until some
* lock order issues are fixed.
* Optionally support module level code by parsing an entire table as
* a method as it is loaded. Default is TRUE.
* NOTE, this is essentially obsolete and will be removed soon
* (01/2018).
*/
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_ParseTableAsTermList, FALSE);
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_ExecuteTablesAsMethods, TRUE);
/*
* Optionally use 32-bit FADT addresses if and when there is a conflict
@@ -268,6 +271,16 @@ ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ReducedHardware, FALSE);
*/
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_MaxLoopIterations, ACPI_MAX_LOOP_TIMEOUT);
/*
* Optionally ignore AE_NOT_FOUND errors from named reference package elements
* during DSDT/SSDT table loading. This reduces error "noise" in platforms
* whose firmware is carrying around a bunch of unused package objects that
* refer to non-existent named objects. However, If the AML actually tries to
* use such a package, the unresolved element(s) will be replaced with NULL
* elements.
*/
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnorePackageResolutionErrors, FALSE);
/*
* This mechanism is used to trace a specified AML method. The method is
* traced each time it is executed.
@@ -149,6 +149,7 @@
#define ACPI_IORT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU,f)
#define ACPI_IORT3A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU_GSI,f)
#define ACPI_IORT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU_V3,f)
#define ACPI_IORT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_PMCG,f)
#define ACPI_IORTA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_MEMORY_ACCESS,f)
#define ACPI_IORTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_NODE,f)
#define ACPI_IORTM_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_ID_MAPPING,f)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+14 -13
View File
@@ -585,17 +585,17 @@ typedef UINT64 ACPI_INTEGER;
******************************************************************************/
/*
* Initialization sequence
* Initialization sequence options
*/
#define ACPI_FULL_INITIALIZATION 0x00
#define ACPI_NO_ADDRESS_SPACE_INIT 0x01
#define ACPI_NO_HARDWARE_INIT 0x02
#define ACPI_NO_EVENT_INIT 0x04
#define ACPI_NO_HANDLER_INIT 0x08
#define ACPI_NO_ACPI_ENABLE 0x10
#define ACPI_NO_DEVICE_INIT 0x20
#define ACPI_NO_OBJECT_INIT 0x40
#define ACPI_NO_FACS_INIT 0x80
#define ACPI_FULL_INITIALIZATION 0x0000
#define ACPI_NO_FACS_INIT 0x0001
#define ACPI_NO_ACPI_ENABLE 0x0002
#define ACPI_NO_HARDWARE_INIT 0x0004
#define ACPI_NO_EVENT_INIT 0x0008
#define ACPI_NO_HANDLER_INIT 0x0010
#define ACPI_NO_OBJECT_INIT 0x0020
#define ACPI_NO_DEVICE_INIT 0x0040
#define ACPI_NO_ADDRESS_SPACE_INIT 0x0080
/*
* Initialization state
@@ -798,7 +798,7 @@ typedef UINT32 ACPI_EVENT_STATUS;
* | | | | +-- Type of dispatch:to method, handler, notify, or none
* | | | +----- Interrupt type: edge or level triggered
* | | +------- Is a Wake GPE
* | +--------- Is GPE masked by the software GPE masking mechanism
* | +--------- Has been enabled automatically at init time
* +------------ <Reserved>
*/
#define ACPI_GPE_DISPATCH_NONE (UINT8) 0x00
@@ -814,6 +814,8 @@ typedef UINT32 ACPI_EVENT_STATUS;
#define ACPI_GPE_XRUPT_TYPE_MASK (UINT8) 0x08
#define ACPI_GPE_CAN_WAKE (UINT8) 0x10
#define ACPI_GPE_AUTO_ENABLED (UINT8) 0x20
#define ACPI_GPE_INITIALIZED (UINT8) 0x40
/*
* Flags for GPE and Lock interfaces
@@ -1280,7 +1282,6 @@ typedef struct acpi_device_info
UINT8 Flags; /* Miscellaneous info */
UINT8 HighestDstates[4]; /* _SxD values: 0xFF indicates not valid */
UINT8 LowestDstates[5]; /* _SxW values: 0xFF indicates not valid */
UINT32 CurrentStatus; /* _STA value */
UINT64 Address; /* _ADR value */
ACPI_PNP_DEVICE_ID HardwareId; /* _HID value */
ACPI_PNP_DEVICE_ID UniqueId; /* _UID value */
@@ -1295,7 +1296,6 @@ typedef struct acpi_device_info
/* Flags for Valid field above (AcpiGetObjectInfo) */
#define ACPI_VALID_STA 0x0001
#define ACPI_VALID_ADR 0x0002
#define ACPI_VALID_HID 0x0004
#define ACPI_VALID_UID 0x0008
@@ -1403,6 +1403,7 @@ typedef enum
#define ACPI_OSI_WIN_10 0x0D
#define ACPI_OSI_WIN_10_RS1 0x0E
#define ACPI_OSI_WIN_10_RS2 0x0F
#define ACPI_OSI_WIN_10_RS3 0x10
/* Definitions of getopt */
+3 -18
View File
@@ -278,24 +278,9 @@
#define ARGI_DEVICE_REF 0x0D
#define ARGI_REFERENCE 0x0E
#define ARGI_TARGETREF 0x0F /* Target, subject to implicit conversion */
#define ARGI_SIMPLE_TARGET 0x10 /* Name, Local, Arg -- no implicit conversion */
#define ARGI_STORE_TARGET 0x11 /* Target for store is TARGETREF + package objects */
/*
* #define ARGI_FIXED_TARGET 0x10 Target, no implicit conversion
*
* Removed 10/2016. ARGI_FIXED_TARGET was used for these operators:
* FromBCD
* ToBCD
* ToDecimalString
* ToHexString
* ToInteger
* ToBuffer
* The purpose of this type was to disable "implicit result conversion",
* but this was incorrect per the ACPI spec and other ACPI implementations.
* These operators now have the target operand defined as a normal
* ARGI_TARGETREF.
*/
#define ARGI_FIXED_TARGET 0x10 /* Target, no implicit conversion */
#define ARGI_SIMPLE_TARGET 0x11 /* Name, Local, Arg -- no implicit conversion */
#define ARGI_STORE_TARGET 0x12 /* Target for store is TARGETREF + package objects */
/* Multiple/complex types */
@@ -58,11 +58,13 @@
#define ACPI_USE_SYSTEM_CLIBRARY
#define ACPI_USE_DO_WHILE_0
#define ACPI_IGNORE_PACKAGE_RESOLUTION_ERRORS
#ifdef __KERNEL__
#define ACPI_USE_SYSTEM_INTTYPES
#define ACPI_USE_GPE_POLLING
/* Kernel specific ACPICA configuration */
@@ -184,6 +184,7 @@ AcpiNsDumpPathname (
}
#endif
/*******************************************************************************
*
* FUNCTION: AcpiNsDumpOneObject
@@ -242,6 +243,7 @@ AcpiNsDumpOneObject (
}
Type = ThisNode->Type;
Info->Count++;
/* Check if the owner matches */
@@ -706,6 +708,7 @@ AcpiNsDumpObjects (
return;
}
Info.Count = 0;
Info.DebugLevel = ACPI_LV_TABLES;
Info.OwnerId = OwnerId;
Info.DisplayType = DisplayType;
@@ -714,6 +717,7 @@ AcpiNsDumpObjects (
ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES,
AcpiNsDumpOneObject, NULL, (void *) &Info, NULL);
AcpiOsPrintf ("\nNamespace node count: %u\n\n", Info.Count);
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
}
+2 -3
View File
@@ -99,9 +99,8 @@ AcpiNsDumpOneDevice (
}
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_TABLES,
" HID: %s, ADR: %8.8X%8.8X, Status: %X\n",
Info->HardwareId.Value, ACPI_FORMAT_UINT64 (Info->Address),
Info->CurrentStatus));
" HID: %s, ADR: %8.8X%8.8X\n",
Info->HardwareId.Value, ACPI_FORMAT_UINT64 (Info->Address)));
ACPI_FREE (Info);
}
+30 -5
View File
@@ -199,6 +199,7 @@ AcpiNsEvaluate (
*/
switch (AcpiNsGetType (Info->Node))
{
case ACPI_TYPE_ANY:
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_EVENT:
case ACPI_TYPE_MUTEX:
@@ -206,13 +207,13 @@ AcpiNsEvaluate (
case ACPI_TYPE_THERMAL:
case ACPI_TYPE_LOCAL_SCOPE:
/*
* 1) Disallow evaluation of certain object types. For these,
* object evaluation is undefined and not supported.
* 1) Disallow evaluation of these object types. For these,
* object evaluation is undefined.
*/
ACPI_ERROR ((AE_INFO,
"%s: Evaluation of object type [%s] is not supported",
Info->FullPathname,
AcpiUtGetTypeName (Info->Node->Type)));
"%s: This object type [%s] "
"never contains data and cannot be evaluated",
Info->FullPathname, AcpiUtGetTypeName (Info->Node->Type)));
Status = AE_TYPE;
goto Cleanup;
@@ -319,6 +320,16 @@ AcpiNsEvaluate (
Status = AE_OK;
}
else if (ACPI_FAILURE(Status))
{
/* If ReturnObject exists, delete it */
if (Info->ReturnObject)
{
AcpiUtRemoveReference (Info->ReturnObject);
Info->ReturnObject = NULL;
}
}
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
"*** Completed evaluation of object %s ***\n",
@@ -347,6 +358,17 @@ Cleanup:
* DESCRIPTION: Execute all elements of the global module-level code list.
* Each element is executed as a single control method.
*
* NOTE: With this option enabled, each block of detected executable AML
* code that is outside of any control method is wrapped with a temporary
* control method object and placed on a global list. The methods on this
* list are executed below.
*
* This function executes the module-level code for all tables only after
* all of the tables have been loaded. It is a legacy option and is
* not compatible with other ACPI implementations. See AcpiNsLoadTable.
*
* This function will be removed when the legacy option is removed.
*
******************************************************************************/
void
@@ -367,6 +389,9 @@ AcpiNsExecModuleCodeList (
Next = AcpiGbl_ModuleCodeList;
if (!Next)
{
ACPI_DEBUG_PRINT ((ACPI_DB_INIT_NAMES,
"Legacy MLC block list is empty\n"));
return_VOID;
}
+63 -16
View File
@@ -298,6 +298,65 @@ ErrorExit:
}
/*******************************************************************************
*
* FUNCTION: AcpiNsInitOnePackage
*
* PARAMETERS: ObjHandle - Node
* Level - Current nesting level
* Context - Not used
* ReturnValue - Not used
*
* RETURN: Status
*
* DESCRIPTION: Callback from AcpiWalkNamespace. Invoked for every package
* within the namespace. Used during dynamic load of an SSDT.
*
******************************************************************************/
ACPI_STATUS
AcpiNsInitOnePackage (
ACPI_HANDLE ObjHandle,
UINT32 Level,
void *Context,
void **ReturnValue)
{
ACPI_STATUS Status;
ACPI_OPERAND_OBJECT *ObjDesc;
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
ObjDesc = AcpiNsGetAttachedObject (Node);
if (!ObjDesc)
{
return (AE_OK);
}
/* Exit if package is already initialized */
if (ObjDesc->Package.Flags & AOPOBJ_DATA_VALID)
{
return (AE_OK);
}
Status = AcpiDsGetPackageArguments (ObjDesc);
if (ACPI_FAILURE (Status))
{
return (AE_OK);
}
Status = AcpiUtWalkPackageTree (ObjDesc, NULL, AcpiDsInitPackageElement,
NULL);
if (ACPI_FAILURE (Status))
{
return (AE_OK);
}
ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiNsInitOneObject
@@ -310,7 +369,7 @@ ErrorExit:
* RETURN: Status
*
* DESCRIPTION: Callback from AcpiWalkNamespace. Invoked for every object
* within the namespace.
* within the namespace.
*
* Currently, the only objects that require initialization are:
* 1) Methods
@@ -425,22 +484,10 @@ AcpiNsInitOneObject (
case ACPI_TYPE_PACKAGE:
Info->PackageInit++;
Status = AcpiDsGetPackageArguments (ObjDesc);
if (ACPI_FAILURE (Status))
{
break;
}
/* Complete the initialization/resolution of the package object */
/*
* Resolve all named references in package objects (and all
* sub-packages). This action has been deferred until the entire
* namespace has been loaded, in order to support external and
* forward references from individual package elements (05/2017).
*/
Status = AcpiUtWalkPackageTree (ObjDesc, NULL,
AcpiDsInitPackageElement, NULL);
ObjDesc->Package.Flags |= AOPOBJ_DATA_VALID;
Info->PackageInit++;
Status = AcpiNsInitOnePackage (ObjHandle, Level, NULL, NULL);
break;
default:
+9 -15
View File
@@ -162,23 +162,17 @@ Unlock:
"**** Completed Table Object Initialization\n"));
/*
* Execute any module-level code that was detected during the table load
* phase. Although illegal since ACPI 2.0, there are many machines that
* contain this type of code. Each block of detected executable AML code
* outside of any control method is wrapped with a temporary control
* method object and placed on a global list. The methods on this list
* are executed below.
* This case handles the legacy option that groups all module-level
* code blocks together and defers execution until all of the tables
* are loaded. Execute all of these blocks at this time.
* Execute any module-level code that was detected during the table
* load phase.
*
* This case executes the module-level code for each table immediately
* after the table has been loaded. This provides compatibility with
* other ACPI implementations. Optionally, the execution can be deferred
* until later, see AcpiInitializeObjects.
* Note: this option is deprecated and will be eliminated in the
* future. Use of this option can cause problems with AML code that
* depends upon in-order immediate execution of module-level code.
*/
if (!AcpiGbl_ParseTableAsTermList && !AcpiGbl_GroupModuleLevelCode)
{
AcpiNsExecModuleCodeList ();
}
AcpiNsExecModuleCodeList ();
return_ACPI_STATUS (Status);
}
@@ -403,6 +403,9 @@ AcpiNsGetNormalizedPathname (
(void) AcpiNsBuildNormalizedPath (Node, NameBuffer, Size, NoTrailing);
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES, "%s: Path \"%s\"\n",
ACPI_GET_FUNCTION_NAME, NameBuffer));
return_PTR (NameBuffer);
}
+28 -6
View File
@@ -63,8 +63,17 @@
*
* RETURN: Status
*
* DESCRIPTION: Load ACPI/AML table by executing the entire table as a
* TermList.
* DESCRIPTION: Load ACPI/AML table by executing the entire table as a single
* large control method.
*
* NOTE: The point of this is to execute any module-level code in-place
* as the table is parsed. Some AML code depends on this behavior.
*
* It is a run-time option at this time, but will eventually become
* the default.
*
* Note: This causes the table to only have a single-pass parse.
* However, this is compatible with other ACPI implementations.
*
******************************************************************************/
@@ -124,8 +133,9 @@ AcpiNsExecuteTable (
goto Cleanup;
}
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"Create table code block: %p\n", MethodObj));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_PARSE,
"%s: Create table pseudo-method for [%4.4s] @%p, method %p\n",
ACPI_GET_FUNCTION_NAME, Table->Signature, Table, MethodObj));
MethodObj->Method.AmlStart = AmlStart;
MethodObj->Method.AmlLength = AmlLength;
@@ -294,9 +304,21 @@ AcpiNsParseTable (
ACPI_FUNCTION_TRACE (NsParseTable);
if (AcpiGbl_ParseTableAsTermList)
if (AcpiGbl_ExecuteTablesAsMethods)
{
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start load pass\n"));
/*
* This case executes the AML table as one large control method.
* The point of this is to execute any module-level code in-place
* as the table is parsed. Some AML code depends on this behavior.
*
* It is a run-time option at this time, but will eventually become
* the default.
*
* Note: This causes the table to only have a single-pass parse.
* However, this is compatible with other ACPI implementations.
*/
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_PARSE,
"%s: **** Start table execution pass\n", ACPI_GET_FUNCTION_NAME));
Status = AcpiNsExecuteTable (TableIndex, StartNode);
if (ACPI_FAILURE (Status))
+5 -17
View File
@@ -268,7 +268,7 @@ AcpiNsCopyDeviceId (
* namespace node and possibly by running several standard
* control methods (Such as in the case of a device.)
*
* For Device and Processor objects, run the Device _HID, _UID, _CID, _STA,
* For Device and Processor objects, run the Device _HID, _UID, _CID,
* _CLS, _ADR, _SxW, and _SxD methods.
*
* Note: Allocates the return buffer, must be freed by the caller.
@@ -277,8 +277,9 @@ AcpiNsCopyDeviceId (
* discovery namespace traversal. Therefore, no complex methods can be
* executed, especially those that access operation regions. Therefore, do
* not add any additional methods that could cause problems in this area.
* this was the fate of the _SUB method which was found to cause such
* problems and was removed (11/2015).
* Because of this reason support for the following methods has been removed:
* 1) _SUB method was removed (11/2015)
* 2) _STA method was removed (02/2018)
*
******************************************************************************/
@@ -409,26 +410,13 @@ AcpiGetObjectInfo (
{
/*
* Get extra info for ACPI Device/Processor objects only:
* Run the _STA, _ADR and, SxW, and _SxD methods.
* Run the _ADR and, SxW, and _SxD methods.
*
* Notes: none of these methods are required, so they may or may
* not be present for this device. The Info->Valid bitfield is used
* to indicate which methods were found and run successfully.
*
* For _STA, if the method does not exist, then (as per the ACPI
* specification), the returned CurrentStatus flags will indicate
* that the device is present/functional/enabled. Otherwise, the
* CurrentStatus flags reflect the value returned from _STA.
*/
/* Execute the Device._STA method */
Status = AcpiUtExecute_STA (Node, &Info->CurrentStatus);
if (ACPI_SUCCESS (Status))
{
Valid |= ACPI_VALID_STA;
}
/* Execute the Device._ADR method */
Status = AcpiUtEvaluateNumericObject (METHOD_NAME__ADR, Node,
+6 -4
View File
@@ -943,6 +943,9 @@ AcpiPsGetNextArg (
if (Arg->Common.AmlOpcode == AML_INT_METHODCALL_OP)
{
/* Free method call op and corresponding namestring sub-ob */
AcpiPsFreeOp (Arg->Common.Value.Arg);
AcpiPsFreeOp (Arg);
Arg = NULL;
WalkState->ArgCount = 1;
@@ -959,10 +962,9 @@ AcpiPsGetNextArg (
case ARGP_DATAOBJ:
case ARGP_TERMARG:
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"**** TermArg/DataObj: %s (%2.2X)\n",
AcpiUtGetArgumentTypeName (ArgType), ArgType));
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"**** TermArg/DataObj: %s (%2.2X)\n",
AcpiUtGetArgumentTypeName (ArgType), ArgType));
/* Single complex argument, nothing returned */
+61 -5
View File
@@ -175,14 +175,22 @@ AcpiPsGetArguments (
}
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"Final argument count: %u pass %u\n",
"Final argument count: %8.8X pass %u\n",
WalkState->ArgCount, WalkState->PassNumber));
/*
* Handle executable code at "module-level". This refers to
* executable opcodes that appear outside of any control method.
* This case handles the legacy option that groups all module-level
* code blocks together and defers execution until all of the tables
* are loaded. Execute all of these blocks at this time.
* Execute any module-level code that was detected during the table
* load phase.
*
* Note: this option is deprecated and will be eliminated in the
* future. Use of this option can cause problems with AML code that
* depends upon in-order immediate execution of module-level code.
*/
if ((WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS2) &&
if (AcpiGbl_GroupModuleLevelCode &&
(WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS2) &&
((WalkState->ParseFlags & ACPI_PARSE_DISASSEMBLE) == 0))
{
/*
@@ -332,6 +340,16 @@ AcpiPsGetArguments (
* object to the global list. Note, the mutex field of the method
* object is used to link multiple module-level code objects.
*
* NOTE: In this legacy option, each block of detected executable AML
* code that is outside of any control method is wrapped with a temporary
* control method object and placed on a global list below.
*
* This function executes the module-level code for all tables only after
* all of the tables have been loaded. It is a legacy option and is
* not compatible with other ACPI implementations. See AcpiNsLoadTable.
*
* This function will be removed when the legacy option is removed.
*
******************************************************************************/
static void
@@ -539,6 +557,19 @@ AcpiPsParseLoop (
{
return_ACPI_STATUS (Status);
}
if (WalkState->Opcode == AML_SCOPE_OP)
{
/*
* If the scope op fails to parse, skip the body of the
* scope op because the parse failure indicates that the
* device may not exist.
*/
WalkState->ParserState.Aml = WalkState->Aml + 1;
WalkState->ParserState.Aml =
AcpiPsGetNextPackageEnd(&WalkState->ParserState);
WalkState->Aml = WalkState->ParserState.Aml;
ACPI_ERROR ((AE_INFO, "Skipping Scope block"));
}
continue;
}
@@ -581,7 +612,32 @@ AcpiPsParseLoop (
{
return_ACPI_STATUS (Status);
}
if ((WalkState->ControlState) &&
((WalkState->ControlState->Control.Opcode == AML_IF_OP) ||
(WalkState->ControlState->Control.Opcode == AML_WHILE_OP)))
{
/*
* If the if/while op fails to parse, we will skip parsing
* the body of the op.
*/
ParserState->Aml =
WalkState->ControlState->Control.AmlPredicateStart + 1;
ParserState->Aml =
AcpiPsGetNextPackageEnd (ParserState);
WalkState->Aml = ParserState->Aml;
ACPI_ERROR ((AE_INFO, "Skipping While/If block"));
if (*WalkState->Aml == AML_ELSE_OP)
{
ACPI_ERROR ((AE_INFO, "Skipping Else block"));
WalkState->ParserState.Aml = WalkState->Aml + 1;
WalkState->ParserState.Aml =
AcpiPsGetNextPackageEnd (ParserState);
WalkState->Aml = ParserState->Aml;
}
ACPI_FREE(AcpiUtPopGenericState (&WalkState->ControlState));
}
Op = NULL;
continue;
}
}
@@ -589,7 +645,7 @@ AcpiPsParseLoop (
/* Check for arguments that need to be processed */
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
"Parseloop: argument count: %u\n", WalkState->ArgCount));
"Parseloop: argument count: %8.8X\n", WalkState->ArgCount));
if (WalkState->ArgCount)
{
+32 -3
View File
@@ -46,6 +46,7 @@
#include "acparser.h"
#include "amlcode.h"
#include "acconvert.h"
#include "acnamesp.h"
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("psobject")
@@ -74,7 +75,7 @@ static ACPI_STATUS
AcpiPsGetAmlOpcode (
ACPI_WALK_STATE *WalkState)
{
UINT32 AmlOffset;
ACPI_ERROR_ONLY (UINT32 AmlOffset);
ACPI_FUNCTION_TRACE_PTR (PsGetAmlOpcode, WalkState);
@@ -109,8 +110,8 @@ AcpiPsGetAmlOpcode (
if (WalkState->PassNumber == 2)
{
AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml,
WalkState->ParserState.AmlStart);
ACPI_ERROR_ONLY(AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml,
WalkState->ParserState.AmlStart));
ACPI_ERROR ((AE_INFO,
"Unknown opcode 0x%.2X at table offset 0x%.4X, ignoring",
@@ -614,6 +615,20 @@ AcpiPsCompleteOp (
{
if (*Op)
{
/*
* These Opcodes need to be removed from the namespace because they
* get created even if these opcodes cannot be created due to
* errors.
*/
if (((*Op)->Common.AmlOpcode == AML_REGION_OP) ||
((*Op)->Common.AmlOpcode == AML_DATA_REGION_OP))
{
AcpiNsDeleteChildren ((*Op)->Common.Node);
AcpiNsRemoveNode ((*Op)->Common.Node);
(*Op)->Common.Node = NULL;
AcpiPsDeleteParseTree (*Op);
}
Status2 = AcpiPsCompleteThisOp (WalkState, *Op);
if (ACPI_FAILURE (Status2))
{
@@ -639,6 +654,20 @@ AcpiPsCompleteOp (
#endif
WalkState->PrevOp = NULL;
WalkState->PrevArgTypes = WalkState->ArgTypes;
if (WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL)
{
/*
* There was something that went wrong while executing code at the
* module-level. We need to skip parsing whatever caused the
* error and keep going. One runtime error during the table load
* should not cause the entire table to not be loaded. This is
* because there could be correct AML beyond the parts that caused
* the runtime error.
*/
ACPI_ERROR ((AE_INFO, "Ignore error and continue table load"));
return_ACPI_STATUS (AE_OK);
}
return_ACPI_STATUS (Status);
}
+1 -1
View File
@@ -468,7 +468,7 @@ AcpiPsParseAml (
if (!WalkState->ParserState.Aml)
{
return_ACPI_STATUS (AE_NULL_OBJECT);
return_ACPI_STATUS (AE_BAD_ADDRESS);
}
/* Create and initialize a new thread state */
+1
View File
@@ -330,6 +330,7 @@ AcpiPsGetChild (
case AML_BUFFER_OP:
case AML_PACKAGE_OP:
case AML_VARIABLE_PACKAGE_OP:
case AML_METHOD_OP:
case AML_IF_OP:
case AML_WHILE_OP:
+27 -2
View File
@@ -61,6 +61,8 @@
*
******************************************************************************/
#include "amlcode.h"
void
AcpiPsDeleteParseTree (
ACPI_PARSE_OBJECT *SubtreeRoot)
@@ -68,19 +70,40 @@ AcpiPsDeleteParseTree (
ACPI_PARSE_OBJECT *Op = SubtreeRoot;
ACPI_PARSE_OBJECT *Next = NULL;
ACPI_PARSE_OBJECT *Parent = NULL;
UINT32 Level = 0;
ACPI_FUNCTION_TRACE_PTR (PsDeleteParseTree, SubtreeRoot);
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE_TREES,
" root %p\n", SubtreeRoot));
/* Visit all nodes in the subtree */
while (Op)
{
/* Check if we are not ascending */
if (Op != Parent)
{
/* This is the descending case */
if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_PARSE_TREES, _COMPONENT))
{
/* This debug option will print the entire parse tree */
AcpiOsPrintf (" %*.s%s %p", (Level * 4), " ",
AcpiPsGetOpcodeName (Op->Common.AmlOpcode), Op);
if (Op->Named.AmlOpcode == AML_INT_NAMEPATH_OP)
{
AcpiOsPrintf (" %4.4s", Op->Common.Value.String);
}
if (Op->Named.AmlOpcode == AML_STRING_OP)
{
AcpiOsPrintf (" %s", Op->Common.Value.String);
}
AcpiOsPrintf ("\n");
}
/* Look for an argument or child of the current op */
Next = AcpiPsGetArg (Op, 0);
@@ -89,6 +112,7 @@ AcpiPsDeleteParseTree (
/* Still going downward in tree (Op is not completed yet) */
Op = Next;
Level++;
continue;
}
}
@@ -113,6 +137,7 @@ AcpiPsDeleteParseTree (
}
else
{
Level--;
Op = Parent;
}
}
+1 -1
View File
@@ -660,7 +660,7 @@ AcpiRsDumpByteList (
UINT16 Length,
UINT8 *Data)
{
UINT8 i;
UINT16 i;
for (i = 0; i < Length; i++)
+12 -6
View File
@@ -1082,12 +1082,18 @@ AcpiTbLoadTable (
Status = AcpiNsLoadTable (TableIndex, ParentNode);
/* Execute any module-level code that was found in the table */
if (!AcpiGbl_ParseTableAsTermList && AcpiGbl_GroupModuleLevelCode)
{
AcpiNsExecModuleCodeList ();
}
/*
* This case handles the legacy option that groups all module-level
* code blocks together and defers execution until all of the tables
* are loaded. Execute all of these blocks at this time.
* Execute any module-level code that was detected during the table
* load phase.
*
* Note: this option is deprecated and will be eliminated in the
* future. Use of this option can cause problems with AML code that
* depends upon in-order immediate execution of module-level code.
*/
AcpiNsExecModuleCodeList ();
/*
* Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is
+4 -4
View File
@@ -128,7 +128,7 @@ AcpiTbInstallTableWithOverride (
* DESCRIPTION: This function is called to verify and install an ACPI table.
* When this function is called by "Load" or "LoadTable" opcodes,
* or by AcpiLoadTable() API, the "Reload" parameter is set.
* After sucessfully returning from this function, table is
* After successfully returning from this function, table is
* "INSTALLED" but not "VALIDATED".
*
******************************************************************************/
@@ -248,11 +248,11 @@ AcpiTbOverrideTable (
ACPI_TABLE_DESC *OldTableDesc)
{
ACPI_STATUS Status;
char *OverrideType;
ACPI_TABLE_DESC NewTableDesc;
ACPI_TABLE_HEADER *Table;
ACPI_PHYSICAL_ADDRESS Address;
UINT32 Length;
ACPI_ERROR_ONLY (char *OverrideType);
/* (1) Attempt logical override (returns a logical address) */
@@ -262,7 +262,7 @@ AcpiTbOverrideTable (
{
AcpiTbAcquireTempTable (&NewTableDesc, ACPI_PTR_TO_PHYSADDR (Table),
ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL);
OverrideType = "Logical";
ACPI_ERROR_ONLY (OverrideType = "Logical");
goto FinishOverride;
}
@@ -274,7 +274,7 @@ AcpiTbOverrideTable (
{
AcpiTbAcquireTempTable (&NewTableDesc, Address,
ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL);
OverrideType = "Physical";
ACPI_ERROR_ONLY (OverrideType = "Physical");
goto FinishOverride;
}
+8 -5
View File
@@ -111,13 +111,16 @@ AcpiLoadTables (
"While loading namespace from ACPI tables"));
}
if (AcpiGbl_ParseTableAsTermList || !AcpiGbl_GroupModuleLevelCode)
if (AcpiGbl_ExecuteTablesAsMethods || !AcpiGbl_GroupModuleLevelCode)
{
/*
* Initialize the objects that remain uninitialized. This
* runs the executable AML that may be part of the
* declaration of these objects:
* OperationRegions, BufferFields, Buffers, and Packages.
* If the module-level code support is enabled, initialize the objects
* in the namespace that remain uninitialized. This runs the executable
* AML that may be part of the declaration of these name objects:
* OperationRegions, BufferFields, Buffers, and Packages.
*
* Note: The module-level code is optional at this time, but will
* become the default in the future.
*/
Status = AcpiNsInitializeObjects ();
if (ACPI_FAILURE (Status))
+2 -2
View File
@@ -97,7 +97,7 @@ AcpiUtDumpBuffer (
{
/* Print current offset */
AcpiOsPrintf ("%6.4X: ", (BaseOffset + i));
AcpiOsPrintf ("%8.4X: ", (BaseOffset + i));
/* Print 16 hex chars */
@@ -279,7 +279,7 @@ AcpiUtDumpBufferToFile (
{
/* Print current offset */
fprintf (File, "%6.4X: ", (BaseOffset + i));
fprintf (File, "%8.4X: ", (BaseOffset + i));
/* Print 16 hex chars */
+3 -2
View File
@@ -307,8 +307,9 @@ AcpiOsAcquireObject (
Cache->CurrentDepth--;
ACPI_MEM_TRACKING (Cache->Hits++);
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
"Object %p from %s cache\n", Object, Cache->ListName));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EXEC,
"%s: Object %p from %s cache\n",
ACPI_GET_FUNCTION_NAME, Object, Cache->ListName));
Status = AcpiUtReleaseMutex (ACPI_MTX_CACHES);
if (ACPI_FAILURE (Status))
+8 -8
View File
@@ -346,8 +346,8 @@ AcpiUtDeleteInternalObj (
/* Now the object can be safely deleted */
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Deleting Object %p [%s]\n",
Object, AcpiUtGetObjectTypeName (Object)));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ALLOCATIONS, "%s: Deleting Object %p [%s]\n",
ACPI_GET_FUNCTION_NAME, Object, AcpiUtGetObjectTypeName (Object)));
AcpiUtDeleteObjectDesc (Object);
return_VOID;
@@ -473,9 +473,9 @@ AcpiUtUpdateRefCount (
Object));
}
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
"Obj %p Type %.2X Refs %.2X [Decremented]\n",
Object, Object->Common.Type, NewCount));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ALLOCATIONS,
"%s: Obj %p Type %.2X Refs %.2X [Decremented]\n",
ACPI_GET_FUNCTION_NAME, Object, Object->Common.Type, NewCount));
/* Actually delete the object on a reference count of zero */
@@ -798,9 +798,9 @@ AcpiUtRemoveReference (
return;
}
ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS,
"Obj %p Current Refs=%X [To Be Decremented]\n",
Object, Object->Common.ReferenceCount));
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ALLOCATIONS,
"%s: Obj %p Current Refs=%X [To Be Decremented]\n",
ACPI_GET_FUNCTION_NAME, Object, Object->Common.ReferenceCount));
/*
* Decrement the reference count, and only actually delete the object
+5 -5
View File
@@ -244,20 +244,20 @@ AcpiUtPrefixedNamespaceError (
{
case AE_ALREADY_EXISTS:
AcpiOsPrintf (ACPI_MSG_BIOS_ERROR);
AcpiOsPrintf ("\n" ACPI_MSG_BIOS_ERROR);
Message = "Failure creating";
break;
case AE_NOT_FOUND:
AcpiOsPrintf (ACPI_MSG_BIOS_ERROR);
Message = "Failure looking up";
AcpiOsPrintf ("\n" ACPI_MSG_BIOS_ERROR);
Message = "Could not resolve";
break;
default:
AcpiOsPrintf (ACPI_MSG_ERROR);
Message = "Failure looking up";
AcpiOsPrintf ("\n" ACPI_MSG_ERROR);
Message = "Failure resolving";
break;
}
@@ -108,6 +108,7 @@ static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[] =
{"Windows 2015", NULL, 0, ACPI_OSI_WIN_10}, /* Windows 10 - Added 03/2015 */
{"Windows 2016", NULL, 0, ACPI_OSI_WIN_10_RS1}, /* Windows 10 version 1607 - Added 12/2017 */
{"Windows 2017", NULL, 0, ACPI_OSI_WIN_10_RS2}, /* Windows 10 version 1703 - Added 12/2017 */
{"Windows 2017.2", NULL, 0, ACPI_OSI_WIN_10_RS3}, /* Windows 10 version 1709 - Added 02/2018 */
/* Feature Group Strings */
@@ -616,6 +616,7 @@ vsnprintf (
case 'X':
Type |= ACPI_FORMAT_UPPER;
/* FALLTHROUGH */
case 'x':
+1 -1
View File
@@ -195,7 +195,7 @@ AcpiUtRepairName (
* Special case for the root node. This can happen if we get an
* error during the execution of module-level code.
*/
if (ACPI_COMPARE_NAME (Name, "\\___"))
if (ACPI_COMPARE_NAME (Name, ACPI_ROOT_PATHNAME))
{
return;
}
+20 -32
View File
@@ -273,43 +273,31 @@ AcpiInitializeObjects (
ACPI_FUNCTION_TRACE (AcpiInitializeObjects);
#ifdef ACPI_EXEC_APP
/*
* This call implements the "initialization file" option for AcpiExec.
* This is the precise point that we want to perform the overrides.
*/
AeDoObjectOverrides ();
#endif
/*
* Execute any module-level code that was detected during the table load
* phase. Although illegal since ACPI 2.0, there are many machines that
* contain this type of code. Each block of detected executable AML code
* outside of any control method is wrapped with a temporary control
* method object and placed on a global list. The methods on this list
* are executed below.
* This case handles the legacy option that groups all module-level
* code blocks together and defers execution until all of the tables
* are loaded. Execute all of these blocks at this time.
* Execute any module-level code that was detected during the table
* load phase.
*
* This case executes the module-level code for all tables only after
* all of the tables have been loaded. It is a legacy option and is
* not compatible with other ACPI implementations. See AcpiNsLoadTable.
* Note: this option is deprecated and will be eliminated in the
* future. Use of this option can cause problems with AML code that
* depends upon in-order immediate execution of module-level code.
*/
if (!AcpiGbl_ParseTableAsTermList && AcpiGbl_GroupModuleLevelCode)
{
AcpiNsExecModuleCodeList ();
AcpiNsExecModuleCodeList ();
/*
* Initialize the objects that remain uninitialized. This
* runs the executable AML that may be part of the
* declaration of these objects:
* OperationRegions, BufferFields, Buffers, and Packages.
*/
if (!(Flags & ACPI_NO_OBJECT_INIT))
/*
* Initialize the objects that remain uninitialized. This
* runs the executable AML that may be part of the
* declaration of these objects:
* OperationRegions, BufferFields, Buffers, and Packages.
*/
if (!(Flags & ACPI_NO_OBJECT_INIT))
{
Status = AcpiNsInitializeObjects ();
if (ACPI_FAILURE (Status))
{
Status = AcpiNsInitializeObjects ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
return_ACPI_STATUS (Status);
}
}