Upgrade ACPICA to 20181213: a lot of bug-fixes

This commit is contained in:
Fredrik Holmqvist 2018-12-19 21:19:25 +01:00
parent 339eef5131
commit 08c9948c20
90 changed files with 4695 additions and 3675 deletions

View File

@ -65,6 +65,7 @@ local executer_src =
exresnte.c
exresolv.c
exresop.c
exserial.c
exstore.c
exstoren.c
exstorob.c

View File

@ -481,6 +481,7 @@ AcpiDsGetPackageArguments (
Status = AcpiDsExecuteArguments (Node, Node,
ObjDesc->Package.AmlLength, ObjDesc->Package.AmlStart);
return_ACPI_STATUS (Status);
}

View File

@ -251,6 +251,7 @@ AcpiDsDumpMethodStack (
ACPI_FUNCTION_TRACE (DsDumpMethodStack);
/* Ignore control codes, they are not errors */
if ((Status & AE_CODE_MASK) == AE_CODE_CONTROL)
@ -320,8 +321,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;
}

View File

@ -157,6 +157,10 @@
#include "acnamesp.h"
#include "acparser.h"
#ifdef ACPI_EXEC_APP
#include "aecommon.h"
#endif
#define _COMPONENT ACPI_DISPATCHER
ACPI_MODULE_NAME ("dsfield")
@ -430,6 +434,13 @@ AcpiDsGetFieldNames (
UINT64 Position;
ACPI_PARSE_OBJECT *Child;
#ifdef ACPI_EXEC_APP
UINT64 Value = 0;
ACPI_OPERAND_OBJECT *ResultDesc;
ACPI_OPERAND_OBJECT *ObjDesc;
char *NamePath;
#endif
ACPI_FUNCTION_TRACE_PTR (DsGetFieldNames, Info);
@ -564,6 +575,18 @@ AcpiDsGetFieldNames (
{
return_ACPI_STATUS (Status);
}
#ifdef ACPI_EXEC_APP
NamePath = AcpiNsGetExternalPathname (Info->FieldNode);
ObjDesc = AcpiUtCreateIntegerObject (Value);
if (ACPI_SUCCESS (AeLookupInitFileEntry (NamePath, &Value)))
{
AcpiExWriteDataToField (ObjDesc,
AcpiNsGetAttachedObject (Info->FieldNode),
&ResultDesc);
}
AcpiUtRemoveReference (ObjDesc);
ACPI_FREE (NamePath);
#endif
}
}
@ -756,6 +779,9 @@ AcpiDsInitFieldObjects (
Flags |= ACPI_NS_TEMPORARY;
}
#ifdef ACPI_EXEC_APP
Flags |= ACPI_NS_OVERRIDE_IF_FOUND;
#endif
/*
* Walk the list of entries in the FieldList
* Note: FieldList can be of zero length. In this case, Arg will be NULL.

View File

@ -720,6 +720,8 @@ AcpiDsCallControlMethod (
goto Cleanup;
}
NextWalkState->MethodNestingDepth = ThisWalkState->MethodNestingDepth + 1;
/*
* Delete the operands on the previous walkstate operand stack
* (they were copied to new objects)
@ -738,6 +740,16 @@ AcpiDsCallControlMethod (
"**** Begin nested execution of [%4.4s] **** WalkState=%p\n",
MethodNode->Name.Ascii, NextWalkState));
ThisWalkState->MethodPathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
ThisWalkState->MethodIsNested = TRUE;
/* Optional object evaluation log */
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EVALUATION,
"%-26s: %*s%s\n", " Nested method call",
NextWalkState->MethodNestingDepth * 3, " ",
&ThisWalkState->MethodPathname[1]));
/* Invoke an internal method if necessary */
if (ObjDesc->Method.InfoFlags & ACPI_METHOD_INTERNAL_ONLY)

View File

@ -161,7 +161,6 @@
ACPI_MODULE_NAME ("dsobject")
#ifndef ACPI_NO_METHOD_EXECUTION
/*******************************************************************************
*
* FUNCTION: AcpiDsBuildInternalObject
@ -460,7 +459,6 @@ AcpiDsCreateNode (
return_ACPI_STATUS (Status);
}
#endif /* ACPI_NO_METHOD_EXECUTION */
/*******************************************************************************
@ -571,9 +569,7 @@ AcpiDsInitObjectFromOp (
/* Truncate value if we are executing from a 32-bit ACPI table */
#ifndef ACPI_NO_METHOD_EXECUTION
(void) AcpiExTruncateFor32bitTable (ObjDesc);
#endif
break;
case AML_REVISION_OP:
@ -594,7 +590,6 @@ AcpiDsInitObjectFromOp (
ObjDesc->Integer.Value = Op->Common.Value.Integer;
#ifndef ACPI_NO_METHOD_EXECUTION
if (AcpiExTruncateFor32bitTable (ObjDesc))
{
/* Warn if we found a 64-bit constant in a 32-bit table */
@ -604,7 +599,6 @@ AcpiDsInitObjectFromOp (
ACPI_FORMAT_UINT64 (Op->Common.Value.Integer),
(UINT32) ObjDesc->Integer.Value));
}
#endif
break;
default:
@ -642,12 +636,10 @@ AcpiDsInitObjectFromOp (
ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_FIRST_LOCAL_OP;
ObjDesc->Reference.Class = ACPI_REFCLASS_LOCAL;
#ifndef ACPI_NO_METHOD_EXECUTION
Status = AcpiDsMethodDataGetNode (ACPI_REFCLASS_LOCAL,
ObjDesc->Reference.Value, WalkState,
ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE,
&ObjDesc->Reference.Object));
#endif
break;
case AML_TYPE_METHOD_ARGUMENT:
@ -657,12 +649,10 @@ AcpiDsInitObjectFromOp (
ObjDesc->Reference.Value = ((UINT32) Opcode) - AML_FIRST_ARG_OP;
ObjDesc->Reference.Class = ACPI_REFCLASS_ARG;
#ifndef ACPI_NO_METHOD_EXECUTION
Status = AcpiDsMethodDataGetNode (ACPI_REFCLASS_ARG,
ObjDesc->Reference.Value, WalkState,
ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE,
&ObjDesc->Reference.Object));
#endif
break;
default: /* Object name or Debug object */

View File

@ -586,6 +586,9 @@ AcpiDsEvalRegionOperands (
ObjDesc, ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
ObjDesc->Region.Length));
Status = AcpiUtAddAddressRange (ObjDesc->Region.SpaceId,
ObjDesc->Region.Address, ObjDesc->Region.Length, Node);
/* Now the address and length are valid for this opregion */
ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID;
@ -752,8 +755,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);
}

View File

@ -155,6 +155,7 @@
#include "amlcode.h"
#include "acdispat.h"
#include "acinterp.h"
#include "acparser.h"
#define _COMPONENT ACPI_NAMESPACE
@ -208,6 +209,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;
@ -216,6 +218,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;
@ -250,25 +259,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));
}
/*
@ -281,6 +308,32 @@ AcpiDsBuildInternalPackageObj (
{
if (Arg->Common.AmlOpcode == AML_INT_RETURN_VALUE_OP)
{
if (!Arg->Common.Node)
{
/*
* This is the case where an expression has returned a value.
* The use of expressions (TermArgs) within individual
* package elements is not supported by the AML interpreter,
* even though the ASL grammar supports it. Example:
*
* Name (INT1, 0x1234)
*
* Name (PKG3, Package () {
* Add (INT1, 0xAAAA0000)
* })
*
* 1) No known AML interpreter supports this type of construct
* 2) This fixes a fault if the construct is encountered
*/
ACPI_EXCEPTION ((AE_INFO, AE_SUPPORT,
"Expressions within package elements are not supported"));
/* Cleanup the return object, it is not needed */
AcpiUtRemoveReference (WalkState->Results->Results.ObjDesc[0]);
return_ACPI_STATUS (AE_SUPPORT);
}
if (Arg->Common.Node->Type == ACPI_TYPE_METHOD)
{
/*
@ -308,12 +361,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)
@ -383,15 +441,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);
}
@ -481,11 +545,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;
@ -496,6 +561,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;
}
@ -503,21 +572,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;
}
@ -531,24 +626,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
@ -587,22 +664,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)
{
/*

View File

@ -209,7 +209,6 @@ AcpiDsClearImplicitReturn (
}
#ifndef ACPI_NO_METHOD_EXECUTION
/*******************************************************************************
*
* FUNCTION: AcpiDsDoImplicitReturn
@ -583,7 +582,6 @@ AcpiDsClearOperands (
WalkState->NumOperands = 0;
return_VOID;
}
#endif
/*******************************************************************************

View File

@ -723,8 +723,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)
{

View File

@ -221,12 +221,10 @@ AcpiDsInitCallbacks (
/* Execution pass */
#ifndef ACPI_NO_METHOD_EXECUTION
WalkState->ParseFlags |= ACPI_PARSE_EXECUTE |
ACPI_PARSE_DELETE_TREE;
WalkState->DescendingCallback = AcpiDsExecBeginOp;
WalkState->AscendingCallback = AcpiDsExecEndOp;
#endif
break;
default:
@ -264,7 +262,7 @@ AcpiDsLoad1BeginOp (
UINT32 Flags;
ACPI_FUNCTION_TRACE (DsLoad1BeginOp);
ACPI_FUNCTION_TRACE_PTR (DsLoad1BeginOp, WalkState->Op);
Op = WalkState->Op;
@ -517,7 +515,7 @@ AcpiDsLoad1BeginOp (
/* Initialize the op */
#if (defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY))
#ifdef ACPI_CONSTANT_EVAL_ONLY
Op->Named.Path = Path;
#endif
@ -580,7 +578,6 @@ AcpiDsLoad1EndOp (
ObjectType = WalkState->OpInfo->ObjectType;
#ifndef ACPI_NO_METHOD_EXECUTION
if (WalkState->OpInfo->Flags & AML_FIELD)
{
/*
@ -626,7 +623,6 @@ AcpiDsLoad1EndOp (
}
}
}
#endif
if (Op->Common.AmlOpcode == AML_NAME_OP)
{

View File

@ -448,6 +448,15 @@ AcpiDsLoad2BeginOp (
}
#endif
/*
* For name creation opcodes, the full namepath prefix must
* exist, except for the final (new) nameseg.
*/
if (WalkState->OpInfo->Flags & AML_NAMED)
{
Flags |= ACPI_NS_PREFIX_MUST_EXIST;
}
/* Add new entry or lookup existing entry */
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
@ -520,10 +529,8 @@ AcpiDsLoad2EndOp (
ACPI_NAMESPACE_NODE *Node;
ACPI_PARSE_OBJECT *Arg;
ACPI_NAMESPACE_NODE *NewNode;
#ifndef ACPI_NO_METHOD_EXECUTION
UINT32 i;
UINT8 RegionSpace;
#endif
ACPI_FUNCTION_TRACE (DsLoad2EndOp);
@ -613,7 +620,6 @@ AcpiDsLoad2EndOp (
switch (WalkState->OpInfo->Type)
{
#ifndef ACPI_NO_METHOD_EXECUTION
case AML_TYPE_CREATE_FIELD:
/*
@ -709,13 +715,11 @@ AcpiDsLoad2EndOp (
}
break;
#endif /* ACPI_NO_METHOD_EXECUTION */
case AML_TYPE_NAMED_COMPLEX:
switch (Op->Common.AmlOpcode)
{
#ifndef ACPI_NO_METHOD_EXECUTION
case AML_REGION_OP:
case AML_DATA_REGION_OP:
@ -800,7 +804,6 @@ AcpiDsLoad2EndOp (
}
break;
#endif /* ACPI_NO_METHOD_EXECUTION */
default:

View File

@ -269,8 +269,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,
@ -328,15 +327,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);

View File

@ -733,7 +733,7 @@ AcpiDsCreateWalkState (
/* Init the method args/local */
#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
#ifndef ACPI_CONSTANT_EVAL_ONLY
AcpiDsMethodDataInit (WalkState);
#endif

View File

@ -344,6 +344,7 @@ AcpiEvFixedEventDetect (
UINT32 FixedStatus;
UINT32 FixedEnable;
UINT32 i;
ACPI_STATUS Status;
ACPI_FUNCTION_NAME (EvFixedEventDetect);
@ -353,8 +354,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",

View File

@ -226,7 +226,7 @@ AcpiEvUpdateGpeEnableMask (
*
* RETURN: Status
*
* DESCRIPTION: Clear a GPE of stale events and enable it.
* DESCRIPTION: Enable a GPE.
*
******************************************************************************/
@ -240,14 +240,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);
@ -542,17 +534,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;
@ -608,105 +595,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);
}
@ -892,6 +799,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
@ -905,8 +943,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

View File

@ -585,7 +585,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;
@ -593,6 +593,8 @@ AcpiEvInitializeGpeBlock (
UINT32 GpeIndex;
UINT32 i;
UINT32 j;
BOOLEAN *IsPollingNeeded = Context;
ACPI_ERROR_ONLY (UINT32 GpeNumber);
ACPI_FUNCTION_TRACE (EvInitializeGpeBlock);
@ -622,14 +624,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;
@ -640,10 +642,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++;
}
}

View File

@ -838,6 +838,20 @@ AcpiEvExecuteRegMethods (
ACPI_FUNCTION_TRACE (EvExecuteRegMethods);
/*
* These address spaces do not need a call to _REG, since the ACPI
* specification defines them as: "must always be accessible". Since
* they never change state (never become unavailable), no need to ever
* call _REG on them. Also, a DataTable is not a "real" address space,
* so do not call _REG. September 2018.
*/
if ((SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) ||
(SpaceId == ACPI_ADR_SPACE_SYSTEM_IO) ||
(SpaceId == ACPI_ADR_SPACE_DATA_TABLE))
{
return_VOID;
}
Info.SpaceId = SpaceId;
Info.Function = Function;
Info.RegRunCount = 0;
@ -904,8 +918,8 @@ AcpiEvRegRun (
}
/*
* We only care about regions.and objects that are allowed to have address
* space handlers
* We only care about regions and objects that are allowed to have
* address space handlers
*/
if ((Node->Type != ACPI_TYPE_REGION) &&
(Node != AcpiGbl_RootNode))

View File

@ -158,12 +158,6 @@
#define _COMPONENT ACPI_EVENTS
ACPI_MODULE_NAME ("evrgnini")
/* Local prototypes */
static BOOLEAN
AcpiEvIsPciRootBridge (
ACPI_NAMESPACE_NODE *Node);
/*******************************************************************************
*
@ -490,7 +484,7 @@ AcpiEvPciConfigRegionSetup (
*
******************************************************************************/
static BOOLEAN
BOOLEAN
AcpiEvIsPciRootBridge (
ACPI_NAMESPACE_NODE *Node)
{
@ -736,9 +730,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;

View File

@ -1257,6 +1257,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);

View File

@ -188,6 +188,7 @@ AcpiUpdateAllGpes (
void)
{
ACPI_STATUS Status;
BOOLEAN IsPollingNeeded = FALSE;
ACPI_FUNCTION_TRACE (AcpiUpdateAllGpes);
@ -204,7 +205,8 @@ AcpiUpdateAllGpes (
goto UnlockAndExit;
}
Status = AcpiEvWalkGpeList (AcpiEvInitializeGpeBlock, NULL);
Status = AcpiEvWalkGpeList (AcpiEvInitializeGpeBlock,
&IsPollingNeeded);
if (ACPI_SUCCESS (Status))
{
AcpiGbl_AllGpesInitialized = TRUE;
@ -212,6 +214,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);
}
@ -259,6 +268,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
{
@ -609,6 +628,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

View File

@ -354,7 +354,6 @@ AcpiRemoveAddressSpaceHandler (
* DetachRegion removed the previous head.
*/
RegionObj = HandlerObj->AddressSpace.RegionList;
}
/* Remove this Handler object from the list */

View File

@ -342,6 +342,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)
@ -615,6 +620,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);
@ -667,6 +677,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()

View File

@ -496,7 +496,7 @@ AcpiExConvertToAscii (
/* HexLength: 2 ascii hex chars per data byte */
HexLength = ACPI_MUL_2 (DataWidth);
HexLength = (DataWidth * 2);
for (i = 0, j = (HexLength-1); i < HexLength; i++, j--)
{
/* Get one hex digit, most significant digits first */
@ -539,7 +539,8 @@ AcpiExConvertToAscii (
*
* RETURN: Status
*
* DESCRIPTION: Convert an ACPI Object to a string
* DESCRIPTION: Convert an ACPI Object to a string. Supports both implicit
* and explicit conversions and related rules.
*
******************************************************************************/
@ -574,9 +575,11 @@ AcpiExConvertToString (
switch (Type)
{
case ACPI_EXPLICIT_CONVERT_DECIMAL:
/* Make room for maximum decimal number */
/*
* From ToDecimalString, integer source.
*
* Make room for the maximum decimal number size
*/
StringLength = ACPI_MAX_DECIMAL_DIGITS;
Base = 10;
break;
@ -620,8 +623,10 @@ AcpiExConvertToString (
{
case ACPI_EXPLICIT_CONVERT_DECIMAL: /* Used by ToDecimalString */
/*
* From ACPI: "If Data is a buffer, it is converted to a string of
* decimal values separated by commas."
* Explicit conversion from the ToDecimalString ASL operator.
*
* From ACPI: "If the input is a buffer, it is converted to a
* a string of decimal values separated by commas."
*/
Base = 10;
@ -648,20 +653,29 @@ AcpiExConvertToString (
case ACPI_IMPLICIT_CONVERT_HEX:
/*
* Implicit buffer-to-string conversion
*
* From the ACPI spec:
*"The entire contents of the buffer are converted to a string of
* "The entire contents of the buffer are converted to a string of
* two-character hexadecimal numbers, each separated by a space."
*
* Each hex number is prefixed with 0x (11/2018)
*/
Separator = ' ';
StringLength = (ObjDesc->Buffer.Length * 3);
StringLength = (ObjDesc->Buffer.Length * 5);
break;
case ACPI_EXPLICIT_CONVERT_HEX: /* Used by ToHexString */
case ACPI_EXPLICIT_CONVERT_HEX:
/*
* Explicit conversion from the ToHexString ASL operator.
*
* From ACPI: "If Data is a buffer, it is converted to a string of
* hexadecimal values separated by commas."
*
* Each hex number is prefixed with 0x (11/2018)
*/
StringLength = (ObjDesc->Buffer.Length * 3);
Separator = ',';
StringLength = (ObjDesc->Buffer.Length * 5);
break;
default:
@ -692,9 +706,20 @@ AcpiExConvertToString (
*/
for (i = 0; i < ObjDesc->Buffer.Length; i++)
{
if (Base == 16)
{
/* Emit 0x prefix for explict/implicit hex conversion */
*NewBuf++ = '0';
*NewBuf++ = 'x';
}
NewBuf += AcpiExConvertToAscii (
(UINT64) ObjDesc->Buffer.Pointer[i], Base, NewBuf, 1);
*NewBuf++ = Separator; /* each separated by a comma or space */
/* Each digit is separated by either a comma or space */
*NewBuf++ = Separator;
}
/*
@ -757,6 +782,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)

View File

@ -161,7 +161,6 @@
ACPI_MODULE_NAME ("excreate")
#ifndef ACPI_NO_METHOD_EXECUTION
/*******************************************************************************
*
* FUNCTION: AcpiExCreateAlias
@ -573,7 +572,6 @@ AcpiExCreatePowerResource (
AcpiUtRemoveReference (ObjDesc);
return_ACPI_STATUS (Status);
}
#endif
/*******************************************************************************

View File

@ -204,15 +204,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;

View File

@ -1,6 +1,6 @@
/******************************************************************************
*
* Module Name: exfield - ACPI AML (p-code) execution - field manipulation
* Module Name: exfield - AML execution - FieldUnit read/write
*
*****************************************************************************/
@ -159,72 +159,68 @@
#define _COMPONENT ACPI_EXECUTER
ACPI_MODULE_NAME ("exfield")
/* Local prototypes */
static UINT32
AcpiExGetSerialAccessLength (
UINT32 AccessorType,
UINT32 AccessLength);
/*
* This table maps the various Attrib protocols to the byte transfer
* length. Used for the generic serial bus.
*/
#define ACPI_INVALID_PROTOCOL_ID 0x80
#define ACPI_MAX_PROTOCOL_ID 0x0F
const UINT8 AcpiProtocolLengths[] =
{
ACPI_INVALID_PROTOCOL_ID, /* 0 - reserved */
ACPI_INVALID_PROTOCOL_ID, /* 1 - reserved */
0x00, /* 2 - ATTRIB_QUICK */
ACPI_INVALID_PROTOCOL_ID, /* 3 - reserved */
0x01, /* 4 - ATTRIB_SEND_RECEIVE */
ACPI_INVALID_PROTOCOL_ID, /* 5 - reserved */
0x01, /* 6 - ATTRIB_BYTE */
ACPI_INVALID_PROTOCOL_ID, /* 7 - reserved */
0x02, /* 8 - ATTRIB_WORD */
ACPI_INVALID_PROTOCOL_ID, /* 9 - reserved */
0xFF, /* A - ATTRIB_BLOCK */
0xFF, /* B - ATTRIB_BYTES */
0x02, /* C - ATTRIB_PROCESS_CALL */
0xFF, /* D - ATTRIB_BLOCK_PROCESS_CALL */
0xFF, /* E - ATTRIB_RAW_BYTES */
0xFF /* F - ATTRIB_RAW_PROCESS_BYTES */
};
/*******************************************************************************
*
* FUNCTION: AcpiExGetSerialAccessLength
* FUNCTION: AcpiExGetProtocolBufferLength
*
* PARAMETERS: AccessorType - The type of the protocol indicated by region
* PARAMETERS: ProtocolId - The type of the protocol indicated by region
* field access attributes
* AccessLength - The access length of the region field
* ReturnLength - Where the protocol byte transfer length is
* returned
*
* RETURN: Decoded access length
* RETURN: Status and decoded byte transfer length
*
* DESCRIPTION: This routine returns the length of the GenericSerialBus
* protocol bytes
*
******************************************************************************/
static UINT32
AcpiExGetSerialAccessLength (
UINT32 AccessorType,
UINT32 AccessLength)
ACPI_STATUS
AcpiExGetProtocolBufferLength (
UINT32 ProtocolId,
UINT32 *ReturnLength)
{
UINT32 Length;
switch (AccessorType)
if ((ProtocolId > ACPI_MAX_PROTOCOL_ID) ||
(AcpiProtocolLengths[ProtocolId] == ACPI_INVALID_PROTOCOL_ID))
{
case AML_FIELD_ATTRIB_QUICK:
ACPI_ERROR ((AE_INFO,
"Invalid Field/AccessAs protocol ID: 0x%4.4X", ProtocolId));
Length = 0;
break;
case AML_FIELD_ATTRIB_SEND_RCV:
case AML_FIELD_ATTRIB_BYTE:
Length = 1;
break;
case AML_FIELD_ATTRIB_WORD:
case AML_FIELD_ATTRIB_WORD_CALL:
Length = 2;
break;
case AML_FIELD_ATTRIB_MULTIBYTE:
case AML_FIELD_ATTRIB_RAW_BYTES:
case AML_FIELD_ATTRIB_RAW_PROCESS:
Length = AccessLength;
break;
case AML_FIELD_ATTRIB_BLOCK:
case AML_FIELD_ATTRIB_BLOCK_CALL:
default:
Length = ACPI_GSBUS_BUFFER_SIZE - 2;
break;
return (AE_AML_PROTOCOL);
}
return (Length);
*ReturnLength = AcpiProtocolLengths[ProtocolId];
return (AE_OK);
}
@ -251,10 +247,8 @@ AcpiExReadDataFromField (
{
ACPI_STATUS Status;
ACPI_OPERAND_OBJECT *BufferDesc;
ACPI_SIZE Length;
void *Buffer;
UINT32 Function;
UINT16 AccessorType;
UINT32 BufferLength;
ACPI_FUNCTION_TRACE_PTR (ExReadDataFromField, ObjDesc);
@ -287,63 +281,14 @@ AcpiExReadDataFromField (
}
}
else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS ||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS ||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI))
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS ||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS ||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI))
{
/*
* This is an SMBus, GSBus or IPMI read. We must create a buffer to
* hold the data and then directly access the region handler.
*
* Note: SMBus and GSBus protocol value is passed in upper 16-bits
* of Function
*/
if (ObjDesc->Field.RegionObj->Region.SpaceId ==
ACPI_ADR_SPACE_SMBUS)
{
Length = ACPI_SMBUS_BUFFER_SIZE;
Function = ACPI_READ | (ObjDesc->Field.Attribute << 16);
}
else if (ObjDesc->Field.RegionObj->Region.SpaceId ==
ACPI_ADR_SPACE_GSBUS)
{
AccessorType = ObjDesc->Field.Attribute;
Length = AcpiExGetSerialAccessLength (
AccessorType, ObjDesc->Field.AccessLength);
/* SMBus, GSBus, IPMI serial */
/*
* Add additional 2 bytes for the GenericSerialBus data buffer:
*
* Status; (Byte 0 of the data buffer)
* Length; (Byte 1 of the data buffer)
* Data[x-1]: (Bytes 2-x of the arbitrary length data buffer)
*/
Length += 2;
Function = ACPI_READ | (AccessorType << 16);
}
else /* IPMI */
{
Length = ACPI_IPMI_BUFFER_SIZE;
Function = ACPI_READ;
}
BufferDesc = AcpiUtCreateBufferObject (Length);
if (!BufferDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Lock entire transaction if requested */
AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
/* Call the region handler for the read */
Status = AcpiExAccessRegion (ObjDesc, 0,
ACPI_CAST_PTR (UINT64, BufferDesc->Buffer.Pointer), Function);
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
goto Exit;
Status = AcpiExReadSerialBus (ObjDesc, RetBufferDesc);
return_ACPI_STATUS (Status);
}
/*
@ -356,14 +301,14 @@ AcpiExReadDataFromField (
*
* Note: Field.length is in bits.
*/
Length = (ACPI_SIZE) ACPI_ROUND_BITS_UP_TO_BYTES (
BufferLength = (ACPI_SIZE) ACPI_ROUND_BITS_UP_TO_BYTES (
ObjDesc->Field.BitLength);
if (Length > AcpiGbl_IntegerByteWidth)
if (BufferLength > AcpiGbl_IntegerByteWidth)
{
/* Field is too large for an Integer, create a Buffer instead */
BufferDesc = AcpiUtCreateBufferObject (Length);
BufferDesc = AcpiUtCreateBufferObject (BufferLength);
if (!BufferDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
@ -380,47 +325,22 @@ AcpiExReadDataFromField (
return_ACPI_STATUS (AE_NO_MEMORY);
}
Length = AcpiGbl_IntegerByteWidth;
BufferLength = AcpiGbl_IntegerByteWidth;
Buffer = &BufferDesc->Integer.Value;
}
if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO))
{
/*
* For GPIO (GeneralPurposeIo), the Address will be the bit offset
* from the previous Connection() operator, making it effectively a
* pin number index. The BitLength is the length of the field, which
* is thus the number of pins.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"GPIO FieldRead [FROM]: Pin %u Bits %u\n",
ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength));
/* General Purpose I/O */
/* Lock entire transaction if requested */
AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
/* Perform the write */
Status = AcpiExAccessRegion (
ObjDesc, 0, (UINT64 *) Buffer, ACPI_READ);
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
if (ACPI_FAILURE (Status))
{
AcpiUtRemoveReference (BufferDesc);
}
else
{
*RetBufferDesc = BufferDesc;
}
return_ACPI_STATUS (Status);
Status = AcpiExReadGpio (ObjDesc, Buffer);
goto Exit;
}
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"FieldRead [TO]: Obj %p, Type %X, Buf %p, ByteLen %X\n",
ObjDesc, ObjDesc->Common.Type, Buffer, (UINT32) Length));
ObjDesc, ObjDesc->Common.Type, Buffer, BufferLength));
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"FieldRead [FROM]: BitLen %X, BitOff %X, ByteOff %X\n",
ObjDesc->CommonField.BitLength,
@ -433,7 +353,7 @@ AcpiExReadDataFromField (
/* Read from the field */
Status = AcpiExExtractFromField (ObjDesc, Buffer, (UINT32) Length);
Status = AcpiExExtractFromField (ObjDesc, Buffer, BufferLength);
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
@ -472,11 +392,8 @@ AcpiExWriteDataToField (
ACPI_OPERAND_OBJECT **ResultDesc)
{
ACPI_STATUS Status;
UINT32 Length;
UINT32 BufferLength;
void *Buffer;
ACPI_OPERAND_OBJECT *BufferDesc;
UINT32 Function;
UINT16 AccessorType;
ACPI_FUNCTION_TRACE_PTR (ExWriteDataToField, ObjDesc);
@ -505,131 +422,21 @@ AcpiExWriteDataToField (
}
}
else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS ||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS ||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI))
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO))
{
/*
* This is an SMBus, GSBus or IPMI write. We will bypass the entire
* field mechanism and handoff the buffer directly to the handler.
* For these address spaces, the buffer is bi-directional; on a
* write, return data is returned in the same buffer.
*
* Source must be a buffer of sufficient size:
* ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or
* ACPI_IPMI_BUFFER_SIZE.
*
* Note: SMBus and GSBus protocol type is passed in upper 16-bits
* of Function
*/
if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER)
{
ACPI_ERROR ((AE_INFO,
"SMBus/IPMI/GenericSerialBus write requires "
"Buffer, found type %s",
AcpiUtGetObjectTypeName (SourceDesc)));
/* General Purpose I/O */
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
if (ObjDesc->Field.RegionObj->Region.SpaceId ==
ACPI_ADR_SPACE_SMBUS)
{
Length = ACPI_SMBUS_BUFFER_SIZE;
Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16);
}
else if (ObjDesc->Field.RegionObj->Region.SpaceId ==
ACPI_ADR_SPACE_GSBUS)
{
AccessorType = ObjDesc->Field.Attribute;
Length = AcpiExGetSerialAccessLength (
AccessorType, ObjDesc->Field.AccessLength);
/*
* Add additional 2 bytes for the GenericSerialBus data buffer:
*
* Status; (Byte 0 of the data buffer)
* Length; (Byte 1 of the data buffer)
* Data[x-1]: (Bytes 2-x of the arbitrary length data buffer)
*/
Length += 2;
Function = ACPI_WRITE | (AccessorType << 16);
}
else /* IPMI */
{
Length = ACPI_IPMI_BUFFER_SIZE;
Function = ACPI_WRITE;
}
if (SourceDesc->Buffer.Length < Length)
{
ACPI_ERROR ((AE_INFO,
"SMBus/IPMI/GenericSerialBus write requires "
"Buffer of length %u, found length %u",
Length, SourceDesc->Buffer.Length));
return_ACPI_STATUS (AE_AML_BUFFER_LIMIT);
}
/* Create the bi-directional buffer */
BufferDesc = AcpiUtCreateBufferObject (Length);
if (!BufferDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
Buffer = BufferDesc->Buffer.Pointer;
memcpy (Buffer, SourceDesc->Buffer.Pointer, Length);
/* Lock entire transaction if requested */
AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
/*
* Perform the write (returns status and perhaps data in the
* same buffer)
*/
Status = AcpiExAccessRegion (
ObjDesc, 0, (UINT64 *) Buffer, Function);
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
*ResultDesc = BufferDesc;
Status = AcpiExWriteGpio (SourceDesc, ObjDesc, ResultDesc);
return_ACPI_STATUS (Status);
}
else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO))
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS ||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS ||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI))
{
/*
* For GPIO (GeneralPurposeIo), we will bypass the entire field
* mechanism and handoff the bit address and bit width directly to
* the handler. The Address will be the bit offset
* from the previous Connection() operator, making it effectively a
* pin number index. The BitLength is the length of the field, which
* is thus the number of pins.
*/
if (SourceDesc->Common.Type != ACPI_TYPE_INTEGER)
{
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
/* SMBus, GSBus, IPMI serial */
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"GPIO FieldWrite [FROM]: (%s:%X), Val %.8X [TO]: Pin %u Bits %u\n",
AcpiUtGetTypeName (SourceDesc->Common.Type),
SourceDesc->Common.Type, (UINT32) SourceDesc->Integer.Value,
ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength));
Buffer = &SourceDesc->Integer.Value;
/* Lock entire transaction if requested */
AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
/* Perform the write */
Status = AcpiExAccessRegion (
ObjDesc, 0, (UINT64 *) Buffer, ACPI_WRITE);
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
Status = AcpiExWriteSerialBus (SourceDesc, ObjDesc, ResultDesc);
return_ACPI_STATUS (Status);
}
@ -640,30 +447,29 @@ AcpiExWriteDataToField (
case ACPI_TYPE_INTEGER:
Buffer = &SourceDesc->Integer.Value;
Length = sizeof (SourceDesc->Integer.Value);
BufferLength = sizeof (SourceDesc->Integer.Value);
break;
case ACPI_TYPE_BUFFER:
Buffer = SourceDesc->Buffer.Pointer;
Length = SourceDesc->Buffer.Length;
BufferLength = SourceDesc->Buffer.Length;
break;
case ACPI_TYPE_STRING:
Buffer = SourceDesc->String.Pointer;
Length = SourceDesc->String.Length;
BufferLength = SourceDesc->String.Length;
break;
default:
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"FieldWrite [FROM]: Obj %p (%s:%X), Buf %p, ByteLen %X\n",
SourceDesc, AcpiUtGetTypeName (SourceDesc->Common.Type),
SourceDesc->Common.Type, Buffer, Length));
SourceDesc->Common.Type, Buffer, BufferLength));
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"FieldWrite [TO]: Obj %p (%s:%X), BitLen %X, BitOff %X, ByteOff %X\n",
@ -679,8 +485,7 @@ AcpiExWriteDataToField (
/* Write to the field */
Status = AcpiExInsertIntoField (ObjDesc, Buffer, Length);
Status = AcpiExInsertIntoField (ObjDesc, Buffer, BufferLength);
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
return_ACPI_STATUS (Status);
}

View File

@ -309,14 +309,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]));
}
@ -330,9 +327,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
{

View File

@ -460,9 +460,9 @@ AcpiExOpcode_2A_1T_1R (
* NOTE: A length of zero is ok, and will create a zero-length, null
* terminated string.
*/
while ((Length < Operand[0]->Buffer.Length) &&
(Length < Operand[1]->Integer.Value) &&
(Operand[0]->Buffer.Pointer[Length]))
while ((Length < Operand[0]->Buffer.Length) && /* Length of input buffer */
(Length < Operand[1]->Integer.Value) && /* Length operand */
(Operand[0]->Buffer.Pointer[Length])) /* Null terminator */
{
Length++;
}

View File

@ -429,6 +429,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:

View File

@ -0,0 +1,508 @@
/******************************************************************************
*
* Module Name: exserial - FieldUnit support for serial address spaces
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2018, Intel Corp.
* All rights reserved.
*
* 2. License
*
* 2.1. This is your license from Intel Corp. under its intellectual property
* rights. You may have additional license terms from the party that provided
* you this software, covering your right to use that party's intellectual
* property rights.
*
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
* copy of the source code appearing in this file ("Covered Code") an
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
* base code distributed originally by Intel ("Original Intel Code") to copy,
* make derivatives, distribute, use and display any portion of the Covered
* Code in any form, with the right to sublicense such rights; and
*
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
* license (with the right to sublicense), under only those claims of Intel
* patents that are infringed by the Original Intel Code, to make, use, sell,
* offer to sell, and import the Covered Code and derivative works thereof
* solely to the minimum extent necessary to exercise the above copyright
* license, and in no event shall the patent license extend to any additions
* to or modifications of the Original Intel Code. No other license or right
* is granted directly or by implication, estoppel or otherwise;
*
* The above copyright and patent license is granted only if the following
* conditions are met:
*
* 3. Conditions
*
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification with rights to further distribute source must include
* the above Copyright Notice, the above License, this list of Conditions,
* and the following Disclaimer and Export Compliance provision. In addition,
* Licensee must cause all Covered Code to which Licensee contributes to
* contain a file documenting the changes Licensee made to create that Covered
* Code and the date of any change. Licensee must include in that file the
* documentation of any changes made by any predecessor Licensee. Licensee
* must include a prominent statement that the modification is derived,
* directly or indirectly, from Original Intel Code.
*
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
* Redistribution of source code of any substantial portion of the Covered
* Code or modification without rights to further distribute source must
* include the following Disclaimer and Export Compliance provision in the
* documentation and/or other materials provided with distribution. In
* addition, Licensee may not authorize further sublicense of source of any
* portion of the Covered Code, and must include terms to the effect that the
* license from Licensee to its licensee is limited to the intellectual
* property embodied in the software Licensee provides to its licensee, and
* not to intellectual property embodied in modifications its licensee may
* make.
*
* 3.3. Redistribution of Executable. Redistribution in executable form of any
* substantial portion of the Covered Code or modification must reproduce the
* above Copyright Notice, and the following Disclaimer and Export Compliance
* provision in the documentation and/or other materials provided with the
* distribution.
*
* 3.4. Intel retains all right, title, and interest in and to the Original
* Intel Code.
*
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
* Intel shall be used in advertising or otherwise to promote the sale, use or
* other dealings in products derived from or relating to the Covered Code
* without prior written authorization from Intel.
*
* 4. Disclaimer and Export Compliance
*
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
* LIMITED REMEDY.
*
* 4.3. Licensee shall not export, either directly or indirectly, any of this
* software or system incorporating such software without first obtaining any
* required license or other approval from the U. S. Department of Commerce or
* any other agency or department of the United States Government. In the
* event Licensee exports any such software from the United States or
* re-exports any such software from a foreign destination, Licensee shall
* ensure that the distribution and export/re-export of the software is in
* compliance with all laws, regulations, orders, or other restrictions of the
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
* any of its subsidiaries will export/re-export any technical data, process,
* software, or service, directly or indirectly, to any country for which the
* United States government or any agency thereof requires an export license,
* other governmental approval, or letter of assurance, without first obtaining
* such license, approval or letter.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#include "acpi.h"
#include "accommon.h"
#include "acdispat.h"
#include "acinterp.h"
#include "amlcode.h"
#define _COMPONENT ACPI_EXECUTER
ACPI_MODULE_NAME ("exserial")
/*******************************************************************************
*
* FUNCTION: AcpiExReadGpio
*
* PARAMETERS: ObjDesc - The named field to read
* Buffer - Where the return data is returnd
*
* RETURN: Status
*
* DESCRIPTION: Read from a named field that references a Generic Serial Bus
* field
*
******************************************************************************/
ACPI_STATUS
AcpiExReadGpio (
ACPI_OPERAND_OBJECT *ObjDesc,
void *Buffer)
{
ACPI_STATUS Status;
ACPI_FUNCTION_TRACE_PTR (ExReadGpio, ObjDesc);
/*
* For GPIO (GeneralPurposeIo), the Address will be the bit offset
* from the previous Connection() operator, making it effectively a
* pin number index. The BitLength is the length of the field, which
* is thus the number of pins.
*/
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"GPIO FieldRead [FROM]: Pin %u Bits %u\n",
ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength));
/* Lock entire transaction if requested */
AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
/* Perform the read */
Status = AcpiExAccessRegion (
ObjDesc, 0, (UINT64 *) Buffer, ACPI_READ);
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
return_ACPI_STATUS (Status);
}
/*******************************************************************************
*
* FUNCTION: AcpiExWriteGpio
*
* PARAMETERS: SourceDesc - Contains data to write. Expect to be
* an Integer object.
* ObjDesc - The named field
* ResultDesc - Where the return value is returned, if any
*
* RETURN: Status
*
* DESCRIPTION: Write to a named field that references a General Purpose I/O
* field.
*
******************************************************************************/
ACPI_STATUS
AcpiExWriteGpio (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **ReturnBuffer)
{
ACPI_STATUS Status;
void *Buffer;
ACPI_FUNCTION_TRACE_PTR (ExWriteGpio, ObjDesc);
/*
* For GPIO (GeneralPurposeIo), we will bypass the entire field
* mechanism and handoff the bit address and bit width directly to
* the handler. The Address will be the bit offset
* from the previous Connection() operator, making it effectively a
* pin number index. The BitLength is the length of the field, which
* is thus the number of pins.
*/
if (SourceDesc->Common.Type != ACPI_TYPE_INTEGER)
{
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"GPIO FieldWrite [FROM]: (%s:%X), Value %.8X [TO]: Pin %u Bits %u\n",
AcpiUtGetTypeName (SourceDesc->Common.Type),
SourceDesc->Common.Type, (UINT32) SourceDesc->Integer.Value,
ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength));
Buffer = &SourceDesc->Integer.Value;
/* Lock entire transaction if requested */
AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
/* Perform the write */
Status = AcpiExAccessRegion (
ObjDesc, 0, (UINT64 *) Buffer, ACPI_WRITE);
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
return_ACPI_STATUS (Status);
}
/*******************************************************************************
*
* FUNCTION: AcpiExReadSerialBus
*
* PARAMETERS: ObjDesc - The named field to read
* ReturnBuffer - Where the return value is returned, if any
*
* RETURN: Status
*
* DESCRIPTION: Read from a named field that references a serial bus
* (SMBus, IPMI, or GSBus).
*
******************************************************************************/
ACPI_STATUS
AcpiExReadSerialBus (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **ReturnBuffer)
{
ACPI_STATUS Status;
UINT32 BufferLength;
ACPI_OPERAND_OBJECT *BufferDesc;
UINT32 Function;
UINT16 AccessorType;
ACPI_FUNCTION_TRACE_PTR (ExReadSerialBus, ObjDesc);
/*
* This is an SMBus, GSBus or IPMI read. We must create a buffer to
* hold the data and then directly access the region handler.
*
* Note: SMBus and GSBus protocol value is passed in upper 16-bits
* of Function
*
* Common buffer format:
* Status; (Byte 0 of the data buffer)
* Length; (Byte 1 of the data buffer)
* Data[x-1]: (Bytes 2-x of the arbitrary length data buffer)
*/
switch (ObjDesc->Field.RegionObj->Region.SpaceId)
{
case ACPI_ADR_SPACE_SMBUS:
BufferLength = ACPI_SMBUS_BUFFER_SIZE;
Function = ACPI_READ | (ObjDesc->Field.Attribute << 16);
break;
case ACPI_ADR_SPACE_IPMI:
BufferLength = ACPI_IPMI_BUFFER_SIZE;
Function = ACPI_READ;
break;
case ACPI_ADR_SPACE_GSBUS:
AccessorType = ObjDesc->Field.Attribute;
if (AccessorType == AML_FIELD_ATTRIB_RAW_PROCESS_BYTES)
{
ACPI_ERROR ((AE_INFO,
"Invalid direct read using bidirectional write-then-read protocol"));
return_ACPI_STATUS (AE_AML_PROTOCOL);
}
Status = AcpiExGetProtocolBufferLength (AccessorType, &BufferLength);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR ((AE_INFO,
"Invalid protocol ID for GSBus: 0x%4.4X", AccessorType));
return_ACPI_STATUS (Status);
}
/* Add header length to get the full size of the buffer */
BufferLength += ACPI_SERIAL_HEADER_SIZE;
Function = ACPI_READ | (AccessorType << 16);
break;
default:
return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID);
}
/* Create the local transfer buffer that is returned to the caller */
BufferDesc = AcpiUtCreateBufferObject (BufferLength);
if (!BufferDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Lock entire transaction if requested */
AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
/* Call the region handler for the write-then-read */
Status = AcpiExAccessRegion (ObjDesc, 0,
ACPI_CAST_PTR (UINT64, BufferDesc->Buffer.Pointer), Function);
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
*ReturnBuffer = BufferDesc;
return_ACPI_STATUS (Status);
}
/*******************************************************************************
*
* FUNCTION: AcpiExWriteSerialBus
*
* PARAMETERS: SourceDesc - Contains data to write
* ObjDesc - The named field
* ReturnBuffer - Where the return value is returned, if any
*
* RETURN: Status
*
* DESCRIPTION: Write to a named field that references a serial bus
* (SMBus, IPMI, GSBus).
*
******************************************************************************/
ACPI_STATUS
AcpiExWriteSerialBus (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **ReturnBuffer)
{
ACPI_STATUS Status;
UINT32 BufferLength;
UINT32 DataLength;
void *Buffer;
ACPI_OPERAND_OBJECT *BufferDesc;
UINT32 Function;
UINT16 AccessorType;
ACPI_FUNCTION_TRACE_PTR (ExWriteSerialBus, ObjDesc);
/*
* This is an SMBus, GSBus or IPMI write. We will bypass the entire
* field mechanism and handoff the buffer directly to the handler.
* For these address spaces, the buffer is bidirectional; on a
* write, return data is returned in the same buffer.
*
* Source must be a buffer of sufficient size, these are fixed size:
* ACPI_SMBUS_BUFFER_SIZE, or ACPI_IPMI_BUFFER_SIZE.
*
* Note: SMBus and GSBus protocol type is passed in upper 16-bits
* of Function
*
* Common buffer format:
* Status; (Byte 0 of the data buffer)
* Length; (Byte 1 of the data buffer)
* Data[x-1]: (Bytes 2-x of the arbitrary length data buffer)
*/
if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER)
{
ACPI_ERROR ((AE_INFO,
"SMBus/IPMI/GenericSerialBus write requires "
"Buffer, found type %s",
AcpiUtGetObjectTypeName (SourceDesc)));
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
}
switch (ObjDesc->Field.RegionObj->Region.SpaceId)
{
case ACPI_ADR_SPACE_SMBUS:
BufferLength = ACPI_SMBUS_BUFFER_SIZE;
Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16);
break;
case ACPI_ADR_SPACE_IPMI:
BufferLength = ACPI_IPMI_BUFFER_SIZE;
Function = ACPI_WRITE;
break;
case ACPI_ADR_SPACE_GSBUS:
AccessorType = ObjDesc->Field.Attribute;
Status = AcpiExGetProtocolBufferLength (AccessorType, &BufferLength);
if (ACPI_FAILURE (Status))
{
ACPI_ERROR ((AE_INFO,
"Invalid protocol ID for GSBus: 0x%4.4X", AccessorType));
return_ACPI_STATUS (Status);
}
/* Add header length to get the full size of the buffer */
BufferLength += ACPI_SERIAL_HEADER_SIZE;
Function = ACPI_WRITE | (AccessorType << 16);
break;
default:
return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID);
}
/* Create the transfer/bidirectional/return buffer */
BufferDesc = AcpiUtCreateBufferObject (BufferLength);
if (!BufferDesc)
{
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Copy the input buffer data to the transfer buffer */
Buffer = BufferDesc->Buffer.Pointer;
DataLength = (BufferLength < SourceDesc->Buffer.Length ?
BufferLength : SourceDesc->Buffer.Length);
memcpy (Buffer, SourceDesc->Buffer.Pointer, DataLength);
/* Lock entire transaction if requested */
AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
/*
* Perform the write (returns status and perhaps data in the
* same buffer)
*/
Status = AcpiExAccessRegion (
ObjDesc, 0, (UINT64 *) Buffer, Function);
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
*ReturnBuffer = BufferDesc;
return_ACPI_STATUS (Status);
}

View File

@ -181,7 +181,6 @@ AcpiExDigitsNeeded (
UINT32 Base);
#ifndef ACPI_NO_METHOD_EXECUTION
/*******************************************************************************
*
* FUNCTION: AcpiExEnterInterpreter
@ -615,4 +614,3 @@ AcpiIsValidSpaceId (
return (TRUE);
}
#endif

View File

@ -658,7 +658,6 @@ AcpiHwDisableAllGpes (
Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock, NULL);
Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock, NULL);
return_ACPI_STATUS (Status);
}

View File

@ -724,13 +724,20 @@ AcpiHwRegisterRead (
case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
Status = AcpiHwRead (&Value64, &AcpiGbl_FADT.XPm2ControlBlock);
Value = (UINT32) Value64;
if (ACPI_SUCCESS (Status))
{
Value = (UINT32) Value64;
}
break;
case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
Status = AcpiHwRead (&Value64, &AcpiGbl_FADT.XPmTimerBlock);
Value = (UINT32) Value64;
if (ACPI_SUCCESS (Status))
{
Value = (UINT32) Value64;
}
break;
case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */

View File

@ -198,25 +198,22 @@ AcpiHwLegacySleep (
return_ACPI_STATUS (Status);
}
/* Clear all fixed and general purpose status bits */
/* Disable all GPEs */
Status = AcpiHwClearAcpiStatus ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
/*
* 1) Disable/Clear all GPEs
* 2) Enable all wakeup GPEs
*/
Status = AcpiHwDisableAllGpes ();
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
}
Status = AcpiHwClearAcpiStatus();
if (ACPI_FAILURE(Status))
{
return_ACPI_STATUS(Status);
}
AcpiGbl_SystemAwakeAndRunning = FALSE;
/* Enable all wakeup GPEs */
Status = AcpiHwEnableAllWakeupGpes ();
if (ACPI_FAILURE (Status))
{
@ -427,7 +424,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 ();

View File

@ -184,17 +184,17 @@ AcpiHwSleepDispatch (
static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[] =
{
{ACPI_STRUCT_INIT (legacy_function,
{ACPI_STRUCT_INIT (LegacyFunction,
ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacySleep)),
ACPI_STRUCT_INIT (extended_function,
ACPI_STRUCT_INIT (ExtendedFunction,
AcpiHwExtendedSleep) },
{ACPI_STRUCT_INIT (legacy_function,
{ACPI_STRUCT_INIT (LegacyFunction,
ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep)),
ACPI_STRUCT_INIT (extended_function,
ACPI_STRUCT_INIT (ExtendedFunction,
AcpiHwExtendedWakePrep) },
{ACPI_STRUCT_INIT (legacy_function,
{ACPI_STRUCT_INIT (Legacy_function,
ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake)),
ACPI_STRUCT_INIT (extended_function,
ACPI_STRUCT_INIT (ExtendedFunction,
AcpiHwExtendedWake) }
};
@ -337,7 +337,7 @@ AcpiEnterSleepStateS4bios (
}
/*
* 1) Disable/Clear all GPEs
* 1) Disable all GPEs
* 2) Enable all wakeup GPEs
*/
Status = AcpiHwDisableAllGpes ();

View File

@ -421,6 +421,7 @@ AcpiNsLookup (
ACPI_OBJECT_TYPE ThisSearchType;
UINT32 SearchParentFlag = ACPI_NS_SEARCH_PARENT;
UINT32 LocalFlags;
ACPI_INTERPRETER_MODE LocalInterpreterMode;
ACPI_FUNCTION_TRACE (NsLookup);
@ -670,6 +671,7 @@ AcpiNsLookup (
*/
ThisSearchType = ACPI_TYPE_ANY;
CurrentNode = ThisNode;
while (NumSegments && CurrentNode)
{
NumSegments--;
@ -704,6 +706,16 @@ AcpiNsLookup (
}
}
/* Handle opcodes that create a new NameSeg via a full NamePath */
LocalInterpreterMode = InterpreterMode;
if ((Flags & ACPI_NS_PREFIX_MUST_EXIST) && (NumSegments > 0))
{
/* Every element of the path must exist (except for the final NameSeg) */
LocalInterpreterMode = ACPI_IMODE_EXECUTE;
}
/* Extract one ACPI name from the front of the pathname */
ACPI_MOVE_32_TO_32 (&SimpleName, Path);
@ -711,11 +723,18 @@ AcpiNsLookup (
/* Try to find the single (4 character) ACPI name */
Status = AcpiNsSearchAndEnter (SimpleName, WalkState, CurrentNode,
InterpreterMode, ThisSearchType, LocalFlags, &ThisNode);
LocalInterpreterMode, ThisSearchType, LocalFlags, &ThisNode);
if (ACPI_FAILURE (Status))
{
if (Status == AE_NOT_FOUND)
{
#if !defined ACPI_ASL_COMPILER /* Note: iASL reports this error by itself, not needed here */
if (Flags & ACPI_NS_PREFIX_MUST_EXIST)
{
AcpiOsPrintf (ACPI_MSG_BIOS_ERROR
"Object does not exist: %4.4s\n", &SimpleName);
}
#endif
/* Name not found in ACPI namespace */
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
@ -724,6 +743,15 @@ AcpiNsLookup (
CurrentNode));
}
#ifdef ACPI_EXEC_APP
if ((Status == AE_ALREADY_EXISTS) &&
(ThisNode->Flags & ANOBJ_NODE_EARLY_INIT))
{
ThisNode->Flags &= ~ANOBJ_NODE_EARLY_INIT;
Status = AE_OK;
}
#endif
#ifdef ACPI_ASL_COMPILER
/*
* If this ACPI name already exists within the namespace as an
@ -781,13 +809,6 @@ AcpiNsLookup (
else
{
#ifdef ACPI_ASL_COMPILER
if (!AcpiGbl_DisasmFlag && (ThisNode->Flags & ANOBJ_IS_EXTERNAL))
{
ThisNode->Flags &= ~IMPLICIT_EXTERNAL;
}
#endif
/*
* Sanity typecheck of the target object:
*
@ -852,6 +873,13 @@ AcpiNsLookup (
}
}
#ifdef ACPI_EXEC_APP
if (Flags & ACPI_NS_EARLY_INIT)
{
ThisNode->Flags |= ANOBJ_NODE_EARLY_INIT;
}
#endif
*ReturnNode = ThisNode;
return_ACPI_STATUS (AE_OK);
}

View File

@ -293,6 +293,7 @@ AcpiNsDumpPathname (
}
#endif
/*******************************************************************************
*
* FUNCTION: AcpiNsDumpOneObject
@ -351,6 +352,7 @@ AcpiNsDumpOneObject (
}
Type = ThisNode->Type;
Info->Count++;
/* Check if the owner matches */
@ -815,6 +817,7 @@ AcpiNsDumpObjects (
return;
}
Info.Count = 0;
Info.DebugLevel = ACPI_LV_TABLES;
Info.OwnerId = OwnerId;
Info.DisplayType = DisplayType;
@ -823,6 +826,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);
}

View File

@ -208,9 +208,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);
}

View File

@ -259,6 +259,12 @@ AcpiNsEvaluate (
return_ACPI_STATUS (AE_NO_MEMORY);
}
/* Optional object evaluation log */
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EVALUATION,
"%-26s: %s (%s)\n", " Enter evaluation",
&Info->FullPathname[1], AcpiUtGetTypeName (Info->Node->Type)));
/* Count the number of arguments being passed in */
Info->ParamCount = 0;
@ -308,6 +314,7 @@ AcpiNsEvaluate (
*/
switch (AcpiNsGetType (Info->Node))
{
case ACPI_TYPE_ANY:
case ACPI_TYPE_DEVICE:
case ACPI_TYPE_EVENT:
case ACPI_TYPE_MUTEX:
@ -315,13 +322,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;
@ -428,12 +435,28 @@ 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",
Info->RelativePathname));
Cleanup:
/* Optional object evaluation log */
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EVALUATION,
"%-26s: %s\n", " Exit evaluation",
&Info->FullPathname[1]));
/*
* Namespace was unlocked by the handling AcpiNs* function, so we
* just free the pathname and return
@ -456,6 +479,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
@ -476,6 +510,9 @@ AcpiNsExecModuleCodeList (
Next = AcpiGbl_ModuleCodeList;
if (!Next)
{
ACPI_DEBUG_PRINT ((ACPI_DB_INIT_NAMES,
"Legacy MLC block list is empty\n"));
return_VOID;
}

View File

@ -406,6 +406,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
@ -418,7 +477,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
@ -533,22 +592,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:

View File

@ -173,7 +173,6 @@ AcpiNsDeleteSubtree (
#endif
#ifndef ACPI_NO_METHOD_EXECUTION
/*******************************************************************************
*
* FUNCTION: AcpiNsLoadTable
@ -270,23 +269,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);
}
@ -483,4 +476,3 @@ AcpiNsUnloadNamespace (
return_ACPI_STATUS (Status);
}
#endif
#endif

View File

@ -511,6 +511,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);
}

View File

@ -171,8 +171,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.
*
******************************************************************************/
@ -232,8 +241,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;
@ -251,8 +261,18 @@ AcpiNsExecuteTable (
goto Cleanup;
}
/* Optional object evaluation log */
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EVALUATION,
"%-26s: (Definition Block level)\n", "Module-level evaluation"));
Status = AcpiPsExecuteTable (Info);
/* Optional object evaluation log */
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EVALUATION,
"%-26s: (Definition Block level)\n", "Module-level complete"));
Cleanup:
if (Info)
{
@ -402,9 +422,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))

View File

@ -545,7 +545,6 @@ AcpiNsSearchAndEnter (
(WalkState && WalkState->Opcode == AML_SCOPE_OP))
{
NewNode->Flags |= ANOBJ_IS_EXTERNAL;
NewNode->Flags |= IMPLICIT_EXTERNAL;
}
#endif

View File

@ -376,7 +376,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.
@ -385,8 +385,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)
*
******************************************************************************/
@ -517,26 +518,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,

View File

@ -1051,6 +1051,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;
@ -1067,10 +1070,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 */

View File

@ -164,6 +164,7 @@
#include "acdispat.h"
#include "amlcode.h"
#include "acconvert.h"
#include "acnamesp.h"
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("psloop")
@ -283,14 +284,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_ExecuteTablesAsMethods &&
(WalkState->PassNumber <= ACPI_IMODE_LOAD_PASS2) &&
((WalkState->ParseFlags & ACPI_PARSE_DISASSEMBLE) == 0))
{
/*
@ -440,6 +449,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
@ -547,6 +566,7 @@ AcpiPsParseLoop (
ACPI_PARSE_OBJECT *Op = NULL; /* current op */
ACPI_PARSE_STATE *ParserState;
UINT8 *AmlOpStart = NULL;
UINT8 OpcodeLength;
ACPI_FUNCTION_TRACE_PTR (PsParseLoop, WalkState);
@ -560,7 +580,7 @@ AcpiPsParseLoop (
ParserState = &WalkState->ParserState;
WalkState->ArgTypes = 0;
#if (!defined (ACPI_NO_METHOD_EXECUTION) && !defined (ACPI_CONSTANT_EVAL_ONLY))
#ifndef ACPI_CONSTANT_EVAL_ONLY
if (WalkState->WalkType & ACPI_WALK_METHOD_RESTART)
{
@ -627,6 +647,18 @@ AcpiPsParseLoop (
Status = AcpiPsCreateOp (WalkState, AmlOpStart, &Op);
if (ACPI_FAILURE (Status))
{
/*
* ACPI_PARSE_MODULE_LEVEL means that we are loading a table by
* executing it as a control method. However, if we encounter
* an error while loading the table, we need to keep trying to
* load the table rather than aborting the table load. Set the
* status to AE_OK to proceed with the table load.
*/
if ((WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL) &&
((Status == AE_ALREADY_EXISTS) || (Status == AE_NOT_FOUND)))
{
Status = AE_OK;
}
if (Status == AE_CTRL_PARSE_CONTINUE)
{
continue;
@ -647,6 +679,32 @@ AcpiPsParseLoop (
{
return_ACPI_STATUS (Status);
}
if (AcpiNsOpensScope (
AcpiPsGetOpcodeInfo (WalkState->Opcode)->ObjectType))
{
/*
* If the scope/device op fails to parse, skip the body of
* the scope op because the parse failure indicates that
* the device may not exist.
*/
ACPI_INFO (("Skipping parse of AML opcode: %s (0x%4.4X)",
AcpiPsGetOpcodeName (WalkState->Opcode), WalkState->Opcode));
/*
* Determine the opcode length before skipping the opcode.
* An opcode can be 1 byte or 2 bytes in length.
*/
OpcodeLength = 1;
if ((WalkState->Opcode & 0xFF00) == AML_EXTENDED_OPCODE)
{
OpcodeLength = 2;
}
WalkState->ParserState.Aml = WalkState->Aml + OpcodeLength;
WalkState->ParserState.Aml =
AcpiPsGetNextPackageEnd(&WalkState->ParserState);
WalkState->Aml = WalkState->ParserState.Aml;
}
continue;
}
@ -689,7 +747,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;
}
}
@ -697,7 +780,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)
{
@ -778,6 +861,22 @@ AcpiPsParseLoop (
{
Status = AE_OK;
}
else if ((WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL) &&
(ACPI_AML_EXCEPTION(Status) || Status == AE_ALREADY_EXISTS ||
Status == AE_NOT_FOUND))
{
/*
* ACPI_PARSE_MODULE_LEVEL flag means that we are currently
* loading a table by executing it as a control method.
* However, if we encounter an error while loading the table,
* we need to keep trying to load the table rather than
* aborting the table load (setting the status to AE_OK
* continues the table load). If we get a failure at this
* point, it means that the dispatcher got an error while
* trying to execute the Op.
*/
Status = AE_OK;
}
}
Status = AcpiPsCompleteOp (WalkState, &Op, Status);

View File

@ -154,6 +154,7 @@
#include "acparser.h"
#include "amlcode.h"
#include "acconvert.h"
#include "acnamesp.h"
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("psobject")
@ -182,7 +183,7 @@ static ACPI_STATUS
AcpiPsGetAmlOpcode (
ACPI_WALK_STATE *WalkState)
{
UINT32 AmlOffset;
ACPI_ERROR_ONLY (UINT32 AmlOffset);
ACPI_FUNCTION_TRACE_PTR (PsGetAmlOpcode, WalkState);
@ -217,8 +218,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",
@ -722,6 +723,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))
{
@ -747,6 +762,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_INFO (("Ignoring error and continuing table load"));
return_ACPI_STATUS (AE_OK);
}
return_ACPI_STATUS (Status);
}

View File

@ -576,7 +576,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 */
@ -637,6 +637,18 @@ AcpiPsParseAml (
"Completed one call to walk loop, %s State=%p\n",
AcpiFormatException (Status), WalkState));
if (WalkState->MethodPathname && WalkState->MethodIsNested)
{
/* Optional object evaluation log */
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_EVALUATION, "%-26s: %*s%s\n",
" Exit nested method",
(WalkState->MethodNestingDepth + 1) * 3, " ",
&WalkState->MethodPathname[1]));
ACPI_FREE (WalkState->MethodPathname);
WalkState->MethodIsNested = FALSE;
}
if (Status == AE_CTRL_TRANSFER)
{
/*

View File

@ -438,6 +438,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:

View File

@ -169,6 +169,8 @@
*
******************************************************************************/
#include "amlcode.h"
void
AcpiPsDeleteParseTree (
ACPI_PARSE_OBJECT *SubtreeRoot)
@ -176,19 +178,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);
@ -197,6 +220,7 @@ AcpiPsDeleteParseTree (
/* Still going downward in tree (Op is not completed yet) */
Op = Next;
Level++;
continue;
}
}
@ -221,6 +245,7 @@ AcpiPsDeleteParseTree (
}
else
{
Level--;
Op = Parent;
}
}

View File

@ -307,6 +307,9 @@ AcpiPsExecuteMethod (
goto Cleanup;
}
WalkState->MethodPathname = Info->FullPathname;
WalkState->MethodIsNested = FALSE;
if (Info->ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL)
{
WalkState->ParseFlags |= ACPI_PARSE_MODULE_LEVEL;
@ -437,6 +440,9 @@ AcpiPsExecuteTable (
goto Cleanup;
}
WalkState->MethodPathname = Info->FullPathname;
WalkState->MethodIsNested = FALSE;
if (Info->ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL)
{
WalkState->ParseFlags |= ACPI_PARSE_MODULE_LEVEL;

View File

@ -711,9 +711,9 @@ AcpiTbVerifyTempTable (
{
if (Status != AE_CTRL_TERMINATE)
{
ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY,
ACPI_EXCEPTION ((AE_INFO, Status,
"%4.4s 0x%8.8X%8.8X"
" Table is duplicated",
" Table is already loaded",
AcpiUtValidNameseg (TableDesc->Signature.Ascii) ?
TableDesc->Signature.Ascii : "????",
ACPI_FORMAT_UINT64 (TableDesc->Address)));
@ -1190,12 +1190,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

View File

@ -236,7 +236,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".
*
******************************************************************************/
@ -356,11 +356,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) */
@ -370,7 +370,7 @@ AcpiTbOverrideTable (
{
AcpiTbAcquireTempTable (&NewTableDesc, ACPI_PTR_TO_PHYSADDR (Table),
ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL);
OverrideType = "Logical";
ACPI_ERROR_ONLY (OverrideType = "Logical");
goto FinishOverride;
}
@ -382,7 +382,7 @@ AcpiTbOverrideTable (
{
AcpiTbAcquireTempTable (&NewTableDesc, Address,
ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL);
OverrideType = "Physical";
ACPI_ERROR_ONLY (OverrideType = "Physical");
goto FinishOverride;
}

View File

@ -219,13 +219,16 @@ AcpiLoadTables (
"While loading namespace from ACPI tables"));
}
if (AcpiGbl_ParseTableAsTermList || !AcpiGbl_GroupModuleLevelCode)
if (AcpiGbl_ExecuteTablesAsMethods)
{
/*
* 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))

View File

@ -205,7 +205,7 @@ AcpiUtDumpBuffer (
{
/* Print current offset */
AcpiOsPrintf ("%6.4X: ", (BaseOffset + i));
AcpiOsPrintf ("%8.4X: ", (BaseOffset + i));
/* Print 16 hex chars */
@ -387,7 +387,7 @@ AcpiUtDumpBufferToFile (
{
/* Print current offset */
fprintf (File, "%6.4X: ", (BaseOffset + i));
fprintf (File, "%8.4X: ", (BaseOffset + i));
/* Print 16 hex chars */

View File

@ -415,8 +415,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))

View File

@ -454,8 +454,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;
@ -520,6 +520,7 @@ AcpiUtUpdateRefCount (
UINT16 OriginalCount;
UINT16 NewCount = 0;
ACPI_CPU_FLAGS LockFlags;
char *Message;
ACPI_FUNCTION_NAME (UtUpdateRefCount);
@ -560,6 +561,7 @@ AcpiUtUpdateRefCount (
"Obj %p Type %.2X [%s] Refs %.2X [Incremented]\n",
Object, Object->Common.Type,
AcpiUtGetObjectTypeName (Object), NewCount));
Message = "Incremement";
break;
case REF_DECREMENT:
@ -581,9 +583,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 */
@ -591,6 +593,7 @@ AcpiUtUpdateRefCount (
{
AcpiUtDeleteInternalObj (Object);
}
Message = "Decrement";
break;
default:
@ -608,8 +611,8 @@ AcpiUtUpdateRefCount (
if (NewCount > ACPI_MAX_REFERENCE_COUNT)
{
ACPI_WARNING ((AE_INFO,
"Large Reference Count (0x%X) in object %p, Type=0x%.2X",
NewCount, Object, Object->Common.Type));
"Large Reference Count (0x%X) in object %p, Type=0x%.2X Operation=%s",
NewCount, Object, Object->Common.Type, Message));
}
}
@ -906,9 +909,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

View File

@ -359,13 +359,13 @@ AcpiUtPrefixedNamespaceError (
case AE_NOT_FOUND:
AcpiOsPrintf (ACPI_MSG_BIOS_ERROR);
Message = "Failure looking up";
Message = "Could not resolve";
break;
default:
AcpiOsPrintf (ACPI_MSG_ERROR);
Message = "Failure looking up";
Message = "Failure resolving";
break;
}

View File

@ -235,10 +235,7 @@ const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] =
{"_REV", ACPI_TYPE_INTEGER, ACPI_CAST_PTR (char, 2)},
{"_OS_", ACPI_TYPE_STRING, ACPI_OS_NAME},
{"_GL_", ACPI_TYPE_MUTEX, ACPI_CAST_PTR (char, 1)},
#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
{"_OSI", ACPI_TYPE_METHOD, ACPI_CAST_PTR (char, 1)},
#endif
/* Table terminator */

View File

@ -217,7 +217,8 @@ AcpiUtIsAmlTable (
if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT) ||
ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_PSDT) ||
ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_SSDT) ||
ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_OSDT))
ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_OSDT) ||
ACPI_IS_OEM_SIG (Table->Signature))
{
return (TRUE);
}

View File

@ -216,6 +216,9 @@ 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 */
{"Windows 2018", NULL, 0, ACPI_OSI_WIN_10_RS4}, /* Windows 10 version 1803 - Added 11/2018 */
{"Windows 2018.2", NULL, 0, ACPI_OSI_WIN_10_RS5}, /* Windows 10 version 1809 - Added 11/2018 */
/* Feature Group Strings */

View File

@ -303,7 +303,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;
}

View File

@ -419,15 +419,39 @@ BOOLEAN
AcpiUtDetectHexPrefix (
char **String)
{
char *InitialPosition = *String;
AcpiUtRemoveHexPrefix (String);
if (*String != InitialPosition)
{
return (TRUE); /* String is past leading 0x */
}
return (FALSE); /* Not a hex string */
}
/*******************************************************************************
*
* FUNCTION: AcpiUtRemoveHexPrefix
*
* PARAMETERS: String - Pointer to input ASCII string
*
* RETURN: none
*
* DESCRIPTION: Remove a hex "0x" prefix
*
******************************************************************************/
void
AcpiUtRemoveHexPrefix (
char **String)
{
if ((**String == ACPI_ASCII_ZERO) &&
(tolower ((int) *(*String + 1)) == 'x'))
{
*String += 2; /* Go past the leading 0x */
return (TRUE);
}
return (FALSE); /* Not a hex string */
}

View File

@ -383,7 +383,7 @@ AcpiUtImplicitStrtoul64 (
* implicit conversions, and the "0x" prefix is "not allowed".
* However, allow a "0x" prefix as an ACPI extension.
*/
AcpiUtDetectHexPrefix (&String);
AcpiUtRemoveHexPrefix (&String);
if (!AcpiUtRemoveLeadingZeros (&String))
{

View File

@ -381,43 +381,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);
}
}

View File

@ -324,6 +324,10 @@ FlSplitInputPathname (
char **OutDirectoryPath,
char **OutFilename);
char *
FlGetFileBasename (
char *FilePathname);
char *
AdGenerateFilename (
char *Prefix,

View File

@ -233,7 +233,7 @@
/* Maximum object reference count (detects object deletion issues) */
#define ACPI_MAX_REFERENCE_COUNT 0x800
#define ACPI_MAX_REFERENCE_COUNT 0x4000
/* Default page size for use in mapping memory for operation regions */
@ -318,11 +318,21 @@
#define ACPI_RSDP_CHECKSUM_LENGTH 20
#define ACPI_RSDP_XCHECKSUM_LENGTH 36
/* SMBus, GSBus and IPMI bidirectional buffer size */
/*
* SMBus, GSBus and IPMI buffer sizes. All have a 2-byte header,
* containing both Status and Length.
*/
#define ACPI_SERIAL_HEADER_SIZE 2 /* Common for below. Status and Length fields */
#define ACPI_SMBUS_DATA_SIZE 32
#define ACPI_SMBUS_BUFFER_SIZE ACPI_SERIAL_HEADER_SIZE + ACPI_SMBUS_DATA_SIZE
#define ACPI_IPMI_DATA_SIZE 64
#define ACPI_IPMI_BUFFER_SIZE ACPI_SERIAL_HEADER_SIZE + ACPI_IPMI_DATA_SIZE
#define ACPI_MAX_GSBUS_DATA_SIZE 255
#define ACPI_MAX_GSBUS_BUFFER_SIZE ACPI_SERIAL_HEADER_SIZE + ACPI_MAX_GSBUS_DATA_SIZE
#define ACPI_SMBUS_BUFFER_SIZE 34
#define ACPI_GSBUS_BUFFER_SIZE 34
#define ACPI_IPMI_BUFFER_SIZE 66
/* _SxD and _SxW control methods */

View File

@ -449,6 +449,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[];
@ -560,6 +561,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaServer[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2a[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm211[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm23[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm23a[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc[];
extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc0[];
@ -579,7 +582,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric[][2];
* dmtable and ahtable
*/
extern const ACPI_DMTABLE_DATA AcpiDmTableData[];
extern const AH_TABLE Gbl_AcpiSupportedTables[];
extern const AH_TABLE AcpiGbl_SupportedTables[];
UINT8
AcpiDmGenerateChecksum (

View File

@ -153,6 +153,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
*/
@ -250,6 +265,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
@ -446,6 +467,10 @@ ACPI_STATUS
AcpiEvInitializeRegion (
ACPI_OPERAND_OBJECT *RegionObj);
BOOLEAN
AcpiEvIsPciRootBridge (
ACPI_NAMESPACE_NODE *Node);
/*
* evsci - SCI (System Control Interrupt) handling/dispatch

View File

@ -204,6 +204,13 @@ typedef struct acpi_exception_info
#define AE_OK (ACPI_STATUS) 0x0000
#define ACPI_ENV_EXCEPTION(Status) (Status & AE_CODE_ENVIRONMENTAL)
#define ACPI_AML_EXCEPTION(Status) (Status & AE_CODE_AML)
#define ACPI_PROG_EXCEPTION(Status) (Status & AE_CODE_PROGRAMMER)
#define ACPI_TABLE_EXCEPTION(Status) (Status & AE_CODE_ACPI_TABLES)
#define ACPI_CNTL_EXCEPTION(Status) (Status & AE_CODE_CONTROL)
/*
* Environmental exceptions
*/
@ -313,8 +320,10 @@ typedef struct acpi_exception_info
#define AE_AML_LOOP_TIMEOUT EXCEP_AML (0x0021)
#define AE_AML_UNINITIALIZED_NODE EXCEP_AML (0x0022)
#define AE_AML_TARGET_TYPE EXCEP_AML (0x0023)
#define AE_AML_PROTOCOL EXCEP_AML (0x0024)
#define AE_AML_BUFFER_LENGTH EXCEP_AML (0x0025)
#define AE_CODE_AML_MAX 0x0023
#define AE_CODE_AML_MAX 0x0025
/*
@ -445,7 +454,9 @@ static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Aml[] =
EXCEP_TXT ("AE_AML_ILLEGAL_ADDRESS", "A memory, I/O, or PCI configuration address is invalid"),
EXCEP_TXT ("AE_AML_LOOP_TIMEOUT", "An AML While loop exceeded the maximum execution time"),
EXCEP_TXT ("AE_AML_UNINITIALIZED_NODE", "A namespace node is uninitialized or unresolved"),
EXCEP_TXT ("AE_AML_TARGET_TYPE", "A target operand of an incorrect type was encountered")
EXCEP_TXT ("AE_AML_TARGET_TYPE", "A target operand of an incorrect type was encountered"),
EXCEP_TXT ("AE_AML_PROTOCOL", "Violation of a fixed ACPI protocol"),
EXCEP_TXT ("AE_AML_BUFFER_LENGTH", "The length of the buffer is invalid/incorrect")
};
static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Ctrl[] =

View File

@ -317,11 +317,7 @@ ACPI_GLOBAL (BOOLEAN, AcpiGbl_DisableMemTracking);
*
****************************************************************************/
#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
#define NUM_PREDEFINED_NAMES 10
#else
#define NUM_PREDEFINED_NAMES 9
#endif
ACPI_GLOBAL (ACPI_NAMESPACE_NODE, AcpiGbl_RootNodeStruct);
ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_RootNode);

View File

@ -285,6 +285,11 @@ AcpiExTracePoint (
* exfield - ACPI AML (p-code) execution - field manipulation
*/
ACPI_STATUS
AcpiExGetProtocolBufferLength (
UINT32 ProtocolId,
UINT32 *ReturnLength);
ACPI_STATUS
AcpiExCommonBufferSetup (
ACPI_OPERAND_OBJECT *ObjDesc,
UINT32 BufferLength,
@ -494,6 +499,32 @@ AcpiExPrepFieldValue (
ACPI_CREATE_FIELD_INFO *Info);
/*
* exserial - FieldUnit support for serial address spaces
*/
ACPI_STATUS
AcpiExReadSerialBus (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **ReturnBuffer);
ACPI_STATUS
AcpiExWriteSerialBus (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **ReturnBuffer);
ACPI_STATUS
AcpiExReadGpio (
ACPI_OPERAND_OBJECT *ObjDesc,
void *Buffer);
ACPI_STATUS
AcpiExWriteGpio (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **ReturnBuffer);
/*
* exsystem - Interface to OS services
*/

View File

@ -327,8 +327,8 @@ typedef struct acpi_namespace_node
#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */
#define ANOBJ_EVALUATED 0x20 /* Set on first evaluation of node */
#define ANOBJ_ALLOCATED_BUFFER 0x40 /* Method AML buffer is dynamic (InstallMethod) */
#define ANOBJ_NODE_EARLY_INIT 0x80 /* AcpiExec only: Node was create via init file (-fi) */
#define IMPLICIT_EXTERNAL 0x02 /* iASL only: This object created implicitly via External */
#define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */
#define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */
#define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* iASL only: Method has at least one return value */
@ -597,9 +597,9 @@ typedef struct acpi_simple_repair_info
typedef struct acpi_reg_walk_info
{
ACPI_ADR_SPACE_TYPE SpaceId;
UINT32 Function;
UINT32 RegRunCount;
ACPI_ADR_SPACE_TYPE SpaceId;
} ACPI_REG_WALK_INFO;

View File

@ -572,16 +572,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 */

View File

@ -191,11 +191,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__ */

View File

@ -168,14 +168,16 @@
/* Flags for AcpiNsLookup, AcpiNsSearchAndEnter */
#define ACPI_NS_NO_UPSEARCH 0
#define ACPI_NS_SEARCH_PARENT 0x01
#define ACPI_NS_DONT_OPEN_SCOPE 0x02
#define ACPI_NS_NO_PEER_SEARCH 0x04
#define ACPI_NS_ERROR_IF_FOUND 0x08
#define ACPI_NS_PREFIX_IS_SCOPE 0x10
#define ACPI_NS_EXTERNAL 0x20
#define ACPI_NS_TEMPORARY 0x40
#define ACPI_NS_OVERRIDE_IF_FOUND 0x80
#define ACPI_NS_SEARCH_PARENT 0x0001
#define ACPI_NS_DONT_OPEN_SCOPE 0x0002
#define ACPI_NS_NO_PEER_SEARCH 0x0004
#define ACPI_NS_ERROR_IF_FOUND 0x0008
#define ACPI_NS_PREFIX_IS_SCOPE 0x0010
#define ACPI_NS_EXTERNAL 0x0020
#define ACPI_NS_TEMPORARY 0x0040
#define ACPI_NS_OVERRIDE_IF_FOUND 0x0080
#define ACPI_NS_EARLY_INIT 0x0100
#define ACPI_NS_PREFIX_MUST_EXIST 0x0200
/* Flags for AcpiNsWalkNamespace */
@ -204,6 +206,12 @@ ACPI_STATUS
AcpiNsInitializeDevices (
UINT32 Flags);
ACPI_STATUS
AcpiNsInitOnePackage (
ACPI_HANDLE ObjHandle,
UINT32 Level,
void *Context,
void **ReturnValue);
/*
* nsload - Namespace loading

View File

@ -361,7 +361,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
@ -425,12 +425,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)

View File

@ -216,14 +216,16 @@
#define ACPI_LV_RESOURCES 0x00010000
#define ACPI_LV_USER_REQUESTS 0x00020000
#define ACPI_LV_PACKAGE 0x00040000
#define ACPI_LV_VERBOSITY1 0x0007FF40 | ACPI_LV_ALL_EXCEPTIONS
#define ACPI_LV_EVALUATION 0x00080000
#define ACPI_LV_VERBOSITY1 0x000FFF40 | ACPI_LV_ALL_EXCEPTIONS
/* Trace verbosity level 2 [Function tracing and memory allocation] */
#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] */
@ -275,6 +277,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)
@ -283,6 +286,7 @@
#define ACPI_DB_INTERRUPTS ACPI_DEBUG_LEVEL (ACPI_LV_INTERRUPTS)
#define ACPI_DB_USER_REQUESTS ACPI_DEBUG_LEVEL (ACPI_LV_USER_REQUESTS)
#define ACPI_DB_PACKAGE ACPI_DEBUG_LEVEL (ACPI_LV_PACKAGE)
#define ACPI_DB_EVALUATION ACPI_DEBUG_LEVEL (ACPI_LV_EVALUATION)
#define ACPI_DB_MUTEX ACPI_DEBUG_LEVEL (ACPI_LV_MUTEX)
#define ACPI_DB_EVENTS ACPI_DEBUG_LEVEL (ACPI_LV_EVENTS)
@ -290,7 +294,7 @@
/* Defaults for DebugLevel, debug and normal */
#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR)
#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_EVALUATION | ACPI_LV_REPAIR)
#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR)
#define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL)

View File

@ -154,7 +154,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
#define ACPI_CA_VERSION 0x20180105
#define ACPI_CA_VERSION 0x20181213
#include "acconfig.h"
#include "actypes.h"
@ -301,16 +301,12 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CopyDsdtLocally, FALSE);
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE);
/*
* Optionally support group module level code.
* 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_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.
*/
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
@ -376,6 +372,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.

View File

@ -205,6 +205,8 @@ typedef struct acpi_walk_state
ACPI_PARSE_STATE ParserState; /* Current state of parser */
UINT32 PrevArgTypes;
UINT32 ArgCount; /* push for fixed or var args */
UINT16 MethodNestingDepth;
UINT8 MethodIsNested;
struct acpi_namespace_node Arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */
struct acpi_namespace_node LocalVariables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
@ -219,7 +221,8 @@ typedef struct acpi_walk_state
struct acpi_namespace_node *MethodCallNode; /* Called method Node*/
ACPI_PARSE_OBJECT *MethodCallOp; /* MethodCall Op if running a method */
union acpi_operand_object *MethodDesc; /* Method descriptor if running a method */
struct acpi_namespace_node *MethodNode; /* Method node if running a method. */
struct acpi_namespace_node *MethodNode; /* Method node if running a method */
char *MethodPathname; /* Full pathname of running method */
ACPI_PARSE_OBJECT *Op; /* Current parser op */
const ACPI_OPCODE_INFO *OpInfo; /* Info on current opcode */
ACPI_PARSE_OBJECT *Origin; /* Start of walk [Obsolete] */

View File

@ -194,6 +194,7 @@
#define ACPI_STAO_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_STAO,f)
#define ACPI_TCPA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_HDR,f)
#define ACPI_TPM2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM2,f)
#define ACPI_TPM23_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM23,f)
#define ACPI_UEFI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_UEFI,f)
#define ACPI_WAET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WAET,f)
#define ACPI_WDAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDAT,f)
@ -257,6 +258,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)
@ -336,6 +338,7 @@
#define ACPI_TCPA_SERVER_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_SERVER,f)
#define ACPI_TPM2A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TPM2_TRAILER,f)
#define ACPI_TPM211_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TPM2_ARM_SMC,f)
#define ACPI_TPM23A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TPM23_TRAILER,f)
#define ACPI_VRTC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_VRTC_ENTRY,f)
#define ACPI_WDAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WDAT_ENTRY,f)

View File

@ -182,6 +182,7 @@
#define ACPI_SIG_XSDT "XSDT" /* Extended System Description Table */
#define ACPI_SIG_SSDT "SSDT" /* Secondary System Description Table */
#define ACPI_RSDP_NAME "RSDP" /* Short name for RSDP, not signature */
#define ACPI_OEM_NAME "OEM" /* Short name for OEM, not signature */
/*

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

View File

@ -678,6 +678,10 @@ typedef UINT64 ACPI_INTEGER;
#define ACPI_VALIDATE_RSDP_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8))
#define ACPI_MAKE_RSDP_SIG(dest) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8))
/* Support for OEMx signature (x can be any character) */
#define ACPI_IS_OEM_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_OEM_NAME, 3) &&\
strnlen (a, ACPI_NAME_SIZE) == ACPI_NAME_SIZE)
/*
* Algorithm to obtain access bit width.
* Can be used with AccessWidth of ACPI_GENERIC_ADDRESS and AccessSize of
@ -693,17 +697,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
@ -906,7 +910,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
@ -922,6 +926,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
@ -1388,7 +1394,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 */
@ -1403,7 +1408,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
@ -1511,6 +1515,9 @@ 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
#define ACPI_OSI_WIN_10_RS4 0x11
#define ACPI_OSI_WIN_10_RS5 0x12
/* Definitions of getopt */

View File

@ -362,6 +362,10 @@ BOOLEAN
AcpiUtDetectHexPrefix (
char **String);
void
AcpiUtRemoveHexPrefix (
char **String);
BOOLEAN
AcpiUtDetectOctalPrefix (
char **String);

View File

@ -386,24 +386,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 */
@ -609,16 +594,16 @@ typedef enum
*/
typedef enum
{
AML_FIELD_ATTRIB_QUICK = 0x02,
AML_FIELD_ATTRIB_SEND_RCV = 0x04,
AML_FIELD_ATTRIB_BYTE = 0x06,
AML_FIELD_ATTRIB_WORD = 0x08,
AML_FIELD_ATTRIB_BLOCK = 0x0A,
AML_FIELD_ATTRIB_MULTIBYTE = 0x0B,
AML_FIELD_ATTRIB_WORD_CALL = 0x0C,
AML_FIELD_ATTRIB_BLOCK_CALL = 0x0D,
AML_FIELD_ATTRIB_RAW_BYTES = 0x0E,
AML_FIELD_ATTRIB_RAW_PROCESS = 0x0F
AML_FIELD_ATTRIB_QUICK = 0x02,
AML_FIELD_ATTRIB_SEND_RECEIVE = 0x04,
AML_FIELD_ATTRIB_BYTE = 0x06,
AML_FIELD_ATTRIB_WORD = 0x08,
AML_FIELD_ATTRIB_BLOCK = 0x0A,
AML_FIELD_ATTRIB_BYTES = 0x0B,
AML_FIELD_ATTRIB_PROCESS_CALL = 0x0C,
AML_FIELD_ATTRIB_BLOCK_PROCESS_CALL = 0x0D,
AML_FIELD_ATTRIB_RAW_BYTES = 0x0E,
AML_FIELD_ATTRIB_RAW_PROCESS_BYTES = 0x0F
} AML_ACCESS_ATTRIBUTE;