mirror of
https://github.com/reactos/reactos.git
synced 2025-07-04 04:41:24 +00:00
[ACPICA]
- Update to version 20151218 CORE-10765 svn path=/trunk/; revision=70472
This commit is contained in:
parent
7655453180
commit
e6491c8051
160 changed files with 2955 additions and 2735 deletions
|
@ -61,6 +61,7 @@ list(APPEND ACPICA_SOURCE
|
|||
acpica/executer/exstoren.c
|
||||
acpica/executer/exstorob.c
|
||||
acpica/executer/exsystem.c
|
||||
acpica/executer/extrace.c
|
||||
acpica/executer/exutils.c
|
||||
acpica/hardware/hwacpi.c
|
||||
acpica/hardware/hwesleep.c
|
||||
|
|
|
@ -286,8 +286,8 @@ AcpiDsGetBufferFieldArguments (
|
|||
ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
|
||||
Node = ObjDesc->BufferField.Node;
|
||||
|
||||
ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_BUFFER_FIELD,
|
||||
Node, NULL));
|
||||
ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (
|
||||
ACPI_TYPE_BUFFER_FIELD, Node, NULL));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BufferField Arg Init\n",
|
||||
AcpiUtGetNodeName (Node)));
|
||||
|
@ -335,8 +335,8 @@ AcpiDsGetBankFieldArguments (
|
|||
ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
|
||||
Node = ObjDesc->BankField.Node;
|
||||
|
||||
ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_LOCAL_BANK_FIELD,
|
||||
Node, NULL));
|
||||
ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (
|
||||
ACPI_TYPE_LOCAL_BANK_FIELD, Node, NULL));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BankField Arg Init\n",
|
||||
AcpiUtGetNodeName (Node)));
|
||||
|
@ -384,7 +384,8 @@ AcpiDsGetBufferArguments (
|
|||
if (!Node)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"No pointer back to namespace node in buffer object %p", ObjDesc));
|
||||
"No pointer back to namespace node in buffer object %p",
|
||||
ObjDesc));
|
||||
return_ACPI_STATUS (AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
|
@ -487,9 +488,11 @@ AcpiDsGetRegionArguments (
|
|||
|
||||
Node = ObjDesc->Region.Node;
|
||||
|
||||
ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_REGION, Node, NULL));
|
||||
ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (
|
||||
ACPI_TYPE_REGION, Node, NULL));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] OpRegion Arg Init at AML %p\n",
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"[%4.4s] OpRegion Arg Init at AML %p\n",
|
||||
AcpiUtGetNodeName (Node), ExtraDesc->Extra.AmlStart));
|
||||
|
||||
/* Execute the argument AML */
|
||||
|
@ -502,7 +505,6 @@ AcpiDsGetRegionArguments (
|
|||
}
|
||||
|
||||
Status = AcpiUtAddAddressRange (ObjDesc->Region.SpaceId,
|
||||
ObjDesc->Region.Address, ObjDesc->Region.Length,
|
||||
Node);
|
||||
ObjDesc->Region.Address, ObjDesc->Region.Length, Node);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#include "amlcode.h"
|
||||
#include "acdispat.h"
|
||||
#include "acinterp.h"
|
||||
#include "acdebug.h"
|
||||
|
||||
#define _COMPONENT ACPI_DISPATCHER
|
||||
ACPI_MODULE_NAME ("dscontrol")
|
||||
|
@ -191,9 +192,12 @@ AcpiDsExecBeginControlOp (
|
|||
* Save a pointer to the predicate for multiple executions
|
||||
* of a loop
|
||||
*/
|
||||
ControlState->Control.AmlPredicateStart = WalkState->ParserState.Aml - 1;
|
||||
ControlState->Control.PackageEnd = WalkState->ParserState.PkgEnd;
|
||||
ControlState->Control.Opcode = Op->Common.AmlOpcode;
|
||||
ControlState->Control.AmlPredicateStart =
|
||||
WalkState->ParserState.Aml - 1;
|
||||
ControlState->Control.PackageEnd =
|
||||
WalkState->ParserState.PkgEnd;
|
||||
ControlState->Control.Opcode =
|
||||
Op->Common.AmlOpcode;
|
||||
|
||||
|
||||
/* Push the control state on this walk's control stack */
|
||||
|
@ -304,7 +308,8 @@ AcpiDsExecEndControlOp (
|
|||
* another time
|
||||
*/
|
||||
Status = AE_CTRL_PENDING;
|
||||
WalkState->AmlLastWhile = ControlState->Control.AmlPredicateStart;
|
||||
WalkState->AmlLastWhile =
|
||||
ControlState->Control.AmlPredicateStart;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -348,7 +353,8 @@ AcpiDsExecEndControlOp (
|
|||
* an arg or local), resolve it now because it may
|
||||
* cease to exist at the end of the method.
|
||||
*/
|
||||
Status = AcpiExResolveToValue (&WalkState->Operands [0], WalkState);
|
||||
Status = AcpiExResolveToValue (
|
||||
&WalkState->Operands [0], WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
|
@ -377,11 +383,15 @@ AcpiDsExecEndControlOp (
|
|||
* Allow references created by the Index operator to return
|
||||
* unchanged.
|
||||
*/
|
||||
if ((ACPI_GET_DESCRIPTOR_TYPE (WalkState->Results->Results.ObjDesc[0]) == ACPI_DESC_TYPE_OPERAND) &&
|
||||
((WalkState->Results->Results.ObjDesc [0])->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
|
||||
((WalkState->Results->Results.ObjDesc [0])->Reference.Class != ACPI_REFCLASS_INDEX))
|
||||
if ((ACPI_GET_DESCRIPTOR_TYPE (WalkState->Results->Results.ObjDesc[0]) ==
|
||||
ACPI_DESC_TYPE_OPERAND) &&
|
||||
((WalkState->Results->Results.ObjDesc [0])->Common.Type ==
|
||||
ACPI_TYPE_LOCAL_REFERENCE) &&
|
||||
((WalkState->Results->Results.ObjDesc [0])->Reference.Class !=
|
||||
ACPI_REFCLASS_INDEX))
|
||||
{
|
||||
Status = AcpiExResolveToValue (&WalkState->Results->Results.ObjDesc [0], WalkState);
|
||||
Status = AcpiExResolveToValue (
|
||||
&WalkState->Results->Results.ObjDesc [0], WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
|
@ -399,7 +409,7 @@ AcpiDsExecEndControlOp (
|
|||
AcpiUtRemoveReference (WalkState->Operands [0]);
|
||||
}
|
||||
|
||||
WalkState->Operands [0] = NULL;
|
||||
WalkState->Operands[0] = NULL;
|
||||
WalkState->NumOperands = 0;
|
||||
WalkState->ReturnDesc = NULL;
|
||||
}
|
||||
|
@ -422,15 +432,7 @@ AcpiDsExecEndControlOp (
|
|||
|
||||
case AML_BREAK_POINT_OP:
|
||||
|
||||
/*
|
||||
* Set the single-step flag. This will cause the debugger (if present)
|
||||
* to break to the console within the AML debugger at the start of the
|
||||
* next AML instruction.
|
||||
*/
|
||||
ACPI_DEBUGGER_EXEC (
|
||||
AcpiGbl_CmSingleStep = TRUE);
|
||||
ACPI_DEBUGGER_EXEC (
|
||||
AcpiOsPrintf ("**break** Executed AML BreakPoint opcode\n"));
|
||||
AcpiDbSignalBreakPoint (WalkState);
|
||||
|
||||
/* Call to the OSL in case OS wants a piece of the action */
|
||||
|
||||
|
@ -459,7 +461,8 @@ AcpiDsExecEndControlOp (
|
|||
|
||||
/* Was: WalkState->AmlLastWhile = WalkState->ControlState->Control.AmlPredicateStart; */
|
||||
|
||||
WalkState->AmlLastWhile = WalkState->ControlState->Control.PackageEnd;
|
||||
WalkState->AmlLastWhile =
|
||||
WalkState->ControlState->Control.PackageEnd;
|
||||
|
||||
/* Return status depending on opcode */
|
||||
|
||||
|
|
|
@ -247,6 +247,7 @@ AcpiDsDumpMethodStack (
|
|||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"\n**** Exception %s during execution of method ",
|
||||
AcpiFormatException (Status)));
|
||||
|
||||
AcpiDsPrintNodePathname (WalkState->MethodNode, NULL);
|
||||
|
||||
/* Display stack of executing methods */
|
||||
|
@ -292,8 +293,8 @@ AcpiDsDumpMethodStack (
|
|||
{
|
||||
/*
|
||||
* This method has called another method
|
||||
* NOTE: the method call parse subtree is already deleted at this
|
||||
* point, so we cannot disassemble the method invocation.
|
||||
* NOTE: the method call parse subtree is already deleted at
|
||||
* this point, so we cannot disassemble the method invocation.
|
||||
*/
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Call to method "));
|
||||
AcpiDsPrintNodePathname (PreviousMethod, NULL);
|
||||
|
|
|
@ -187,6 +187,7 @@ AcpiDsCreateExternalRegion (
|
|||
* insert the name into the namespace.
|
||||
*/
|
||||
AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_REGION, 0, 0);
|
||||
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_REGION,
|
||||
ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, WalkState, Node);
|
||||
if (ACPI_FAILURE (Status))
|
||||
|
@ -296,9 +297,9 @@ AcpiDsCreateBufferField (
|
|||
|
||||
/* Enter the NameString into the namespace */
|
||||
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
|
||||
ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS1,
|
||||
Flags, WalkState, &Node);
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo,
|
||||
Arg->Common.Value.String, ACPI_TYPE_ANY,
|
||||
ACPI_IMODE_LOAD_PASS1, Flags, WalkState, &Node);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
|
||||
|
@ -339,8 +340,8 @@ AcpiDsCreateBufferField (
|
|||
}
|
||||
|
||||
/*
|
||||
* Remember location in AML stream of the field unit opcode and operands --
|
||||
* since the buffer and index operands must be evaluated.
|
||||
* Remember location in AML stream of the field unit opcode and operands
|
||||
* -- since the buffer and index operands must be evaluated.
|
||||
*/
|
||||
SecondDesc = ObjDesc->Common.NextObject;
|
||||
SecondDesc->Extra.AmlStart = Op->Named.Data;
|
||||
|
@ -413,8 +414,8 @@ AcpiDsGetFieldNames (
|
|||
{
|
||||
case AML_INT_RESERVEDFIELD_OP:
|
||||
|
||||
Position = (UINT64) Info->FieldBitPosition
|
||||
+ (UINT64) Arg->Common.Value.Size;
|
||||
Position = (UINT64) Info->FieldBitPosition +
|
||||
(UINT64) Arg->Common.Value.Size;
|
||||
|
||||
if (Position > ACPI_UINT32_MAX)
|
||||
{
|
||||
|
@ -447,11 +448,13 @@ AcpiDsGetFieldNames (
|
|||
|
||||
/* AccessAttribute (AttribQuick, AttribByte, etc.) */
|
||||
|
||||
Info->Attribute = (UINT8) ((Arg->Common.Value.Integer >> 8) & 0xFF);
|
||||
Info->Attribute = (UINT8)
|
||||
((Arg->Common.Value.Integer >> 8) & 0xFF);
|
||||
|
||||
/* AccessLength (for serial/buffer protocols) */
|
||||
|
||||
Info->AccessLength = (UINT8) ((Arg->Common.Value.Integer >> 16) & 0xFF);
|
||||
Info->AccessLength = (UINT8)
|
||||
((Arg->Common.Value.Integer >> 16) & 0xFF);
|
||||
break;
|
||||
|
||||
case AML_INT_CONNECTION_OP:
|
||||
|
@ -525,8 +528,8 @@ AcpiDsGetFieldNames (
|
|||
|
||||
/* Keep track of bit position for the next field */
|
||||
|
||||
Position = (UINT64) Info->FieldBitPosition
|
||||
+ (UINT64) Arg->Common.Value.Size;
|
||||
Position = (UINT64) Info->FieldBitPosition +
|
||||
(UINT64) Arg->Common.Value.Size;
|
||||
|
||||
if (Position > ACPI_UINT32_MAX)
|
||||
{
|
||||
|
@ -543,7 +546,8 @@ AcpiDsGetFieldNames (
|
|||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Invalid opcode in field list: 0x%X", Arg->Common.AmlOpcode));
|
||||
"Invalid opcode in field list: 0x%X",
|
||||
Arg->Common.AmlOpcode));
|
||||
return_ACPI_STATUS (AE_AML_BAD_OPCODE);
|
||||
}
|
||||
|
||||
|
@ -826,11 +830,12 @@ AcpiDsCreateBankField (
|
|||
|
||||
/*
|
||||
* Use Info.DataRegisterNode to store BankField Op
|
||||
* It's safe because DataRegisterNode will never be used when create bank field
|
||||
* We store AmlStart and AmlLength in the BankField Op for late evaluation
|
||||
* Used in AcpiExPrepFieldValue(Info)
|
||||
* It's safe because DataRegisterNode will never be used when create
|
||||
* bank field \we store AmlStart and AmlLength in the BankField Op for
|
||||
* late evaluation. Used in AcpiExPrepFieldValue(Info)
|
||||
*
|
||||
* TBD: Or, should we add a field in ACPI_CREATE_FIELD_INFO, like "void *ParentOp"?
|
||||
* TBD: Or, should we add a field in ACPI_CREATE_FIELD_INFO, like
|
||||
* "void *ParentOp"?
|
||||
*/
|
||||
Info.DataRegisterNode = (ACPI_NAMESPACE_NODE*) Op;
|
||||
|
||||
|
|
|
@ -331,17 +331,19 @@ AcpiDsInitializeObjects (
|
|||
|
||||
if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT))
|
||||
{
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "\nInitializing Namespace objects:\n"));
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
|
||||
"\nInitializing Namespace objects:\n"));
|
||||
}
|
||||
|
||||
/* Summary of objects initialized */
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
|
||||
"Table [%4.4s:%8.8s] (id %.2X) - %4u Objects with %3u Devices, "
|
||||
"Table [%4.4s: %-8.8s] (id %.2X) - %4u Objects with %3u Devices, "
|
||||
"%3u Regions, %4u Methods (%u/%u/%u Serial/Non/Cvt)\n",
|
||||
Table->Signature, Table->OemTableId, OwnerId, Info.ObjectCount, Info.DeviceCount,
|
||||
Info.OpRegionCount, Info.MethodCount, Info.SerialMethodCount,
|
||||
Info.NonSerialMethodCount, Info.SerializedMethodCount));
|
||||
Table->Signature, Table->OemTableId, OwnerId, Info.ObjectCount,
|
||||
Info.DeviceCount,Info.OpRegionCount, Info.MethodCount,
|
||||
Info.SerialMethodCount, Info.NonSerialMethodCount,
|
||||
Info.SerializedMethodCount));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "%u Methods, %u Regions\n",
|
||||
Info.MethodCount, Info.OpRegionCount));
|
||||
|
|
|
@ -199,8 +199,8 @@ AcpiDsAutoSerializeMethod (
|
|||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
Status = AcpiDsInitAmlWalk (WalkState, Op, Node, ObjDesc->Method.AmlStart,
|
||||
ObjDesc->Method.AmlLength, NULL, 0);
|
||||
Status = AcpiDsInitAmlWalk (WalkState, Op, Node,
|
||||
ObjDesc->Method.AmlStart, ObjDesc->Method.AmlLength, NULL, 0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiDsDeleteWalkState (WalkState);
|
||||
|
@ -472,10 +472,12 @@ AcpiDsBeginMethodExecution (
|
|||
*/
|
||||
if (WalkState &&
|
||||
(!(ObjDesc->Method.InfoFlags & ACPI_METHOD_IGNORE_SYNC_LEVEL)) &&
|
||||
(WalkState->Thread->CurrentSyncLevel > ObjDesc->Method.Mutex->Mutex.SyncLevel))
|
||||
(WalkState->Thread->CurrentSyncLevel >
|
||||
ObjDesc->Method.Mutex->Mutex.SyncLevel))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Cannot acquire Mutex for method [%4.4s], current SyncLevel is too large (%u)",
|
||||
"Cannot acquire Mutex for method [%4.4s]"
|
||||
", current SyncLevel is too large (%u)",
|
||||
AcpiUtGetNodeName (MethodNode),
|
||||
WalkState->Thread->CurrentSyncLevel));
|
||||
|
||||
|
@ -488,14 +490,15 @@ AcpiDsBeginMethodExecution (
|
|||
*/
|
||||
if (!WalkState ||
|
||||
!ObjDesc->Method.Mutex->Mutex.ThreadId ||
|
||||
(WalkState->Thread->ThreadId != ObjDesc->Method.Mutex->Mutex.ThreadId))
|
||||
(WalkState->Thread->ThreadId !=
|
||||
ObjDesc->Method.Mutex->Mutex.ThreadId))
|
||||
{
|
||||
/*
|
||||
* Acquire the method mutex. This releases the interpreter if we
|
||||
* block (and reacquires it before it returns)
|
||||
*/
|
||||
Status = AcpiExSystemWaitMutex (ObjDesc->Method.Mutex->Mutex.OsMutex,
|
||||
ACPI_WAIT_FOREVER);
|
||||
Status = AcpiExSystemWaitMutex (
|
||||
ObjDesc->Method.Mutex->Mutex.OsMutex, ACPI_WAIT_FOREVER);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -508,8 +511,22 @@ AcpiDsBeginMethodExecution (
|
|||
ObjDesc->Method.Mutex->Mutex.OriginalSyncLevel =
|
||||
WalkState->Thread->CurrentSyncLevel;
|
||||
|
||||
ObjDesc->Method.Mutex->Mutex.ThreadId = WalkState->Thread->ThreadId;
|
||||
WalkState->Thread->CurrentSyncLevel = ObjDesc->Method.SyncLevel;
|
||||
ObjDesc->Method.Mutex->Mutex.ThreadId =
|
||||
WalkState->Thread->ThreadId;
|
||||
|
||||
/*
|
||||
* Update the current SyncLevel only if this is not an auto-
|
||||
* serialized method. In the auto case, we have to ignore
|
||||
* the sync level for the method mutex (created for the
|
||||
* auto-serialization) because we have no idea of what the
|
||||
* sync level should be. Therefore, just ignore it.
|
||||
*/
|
||||
if (!(ObjDesc->Method.InfoFlags &
|
||||
ACPI_METHOD_IGNORE_SYNC_LEVEL))
|
||||
{
|
||||
WalkState->Thread->CurrentSyncLevel =
|
||||
ObjDesc->Method.SyncLevel;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -587,7 +604,8 @@ AcpiDsCallControlMethod (
|
|||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsCallControlMethod, ThisWalkState);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Calling method %p, currentstate=%p\n",
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Calling method %p, currentstate=%p\n",
|
||||
ThisWalkState->PrevOp, ThisWalkState));
|
||||
|
||||
/*
|
||||
|
@ -607,8 +625,8 @@ AcpiDsCallControlMethod (
|
|||
|
||||
/* Init for new method, possibly wait on method mutex */
|
||||
|
||||
Status = AcpiDsBeginMethodExecution (MethodNode, ObjDesc,
|
||||
ThisWalkState);
|
||||
Status = AcpiDsBeginMethodExecution (
|
||||
MethodNode, ObjDesc, ThisWalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -616,8 +634,8 @@ AcpiDsCallControlMethod (
|
|||
|
||||
/* Begin method parse/execution. Create a new walk state */
|
||||
|
||||
NextWalkState = AcpiDsCreateWalkState (ObjDesc->Method.OwnerId,
|
||||
NULL, ObjDesc, Thread);
|
||||
NextWalkState = AcpiDsCreateWalkState (
|
||||
ObjDesc->Method.OwnerId, NULL, ObjDesc, Thread);
|
||||
if (!NextWalkState)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
|
@ -842,7 +860,8 @@ AcpiDsTerminateControlMethod (
|
|||
WalkState->Thread->CurrentSyncLevel =
|
||||
MethodDesc->Method.Mutex->Mutex.OriginalSyncLevel;
|
||||
|
||||
AcpiOsReleaseMutex (MethodDesc->Method.Mutex->Mutex.OsMutex);
|
||||
AcpiOsReleaseMutex (
|
||||
MethodDesc->Method.Mutex->Mutex.OsMutex);
|
||||
MethodDesc->Method.Mutex->Mutex.ThreadId = 0;
|
||||
}
|
||||
}
|
||||
|
@ -872,7 +891,8 @@ AcpiDsTerminateControlMethod (
|
|||
if (MethodDesc->Method.InfoFlags & ACPI_METHOD_MODIFIED_NAMESPACE)
|
||||
{
|
||||
AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId);
|
||||
MethodDesc->Method.InfoFlags &= ~ACPI_METHOD_MODIFIED_NAMESPACE;
|
||||
MethodDesc->Method.InfoFlags &=
|
||||
~ACPI_METHOD_MODIFIED_NAMESPACE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -920,7 +940,8 @@ AcpiDsTerminateControlMethod (
|
|||
if (WalkState)
|
||||
{
|
||||
ACPI_INFO ((AE_INFO,
|
||||
"Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error",
|
||||
"Marking method %4.4s as Serialized "
|
||||
"because of AE_ALREADY_EXISTS error",
|
||||
WalkState->MethodNode->Name.Ascii));
|
||||
}
|
||||
|
||||
|
@ -935,7 +956,9 @@ AcpiDsTerminateControlMethod (
|
|||
* marking the method permanently as Serialized when the last
|
||||
* thread exits here.
|
||||
*/
|
||||
MethodDesc->Method.InfoFlags &= ~ACPI_METHOD_SERIALIZED_PENDING;
|
||||
MethodDesc->Method.InfoFlags &=
|
||||
~ACPI_METHOD_SERIALIZED_PENDING;
|
||||
|
||||
MethodDesc->Method.InfoFlags |=
|
||||
(ACPI_METHOD_SERIALIZED | ACPI_METHOD_IGNORE_SYNC_LEVEL);
|
||||
MethodDesc->Method.SyncLevel = 0;
|
||||
|
|
|
@ -182,7 +182,9 @@ AcpiDsMethodDataInit (
|
|||
|
||||
for (i = 0; i < ACPI_METHOD_NUM_ARGS; i++)
|
||||
{
|
||||
ACPI_MOVE_32_TO_32 (&WalkState->Arguments[i].Name, NAMEOF_ARG_NTE);
|
||||
ACPI_MOVE_32_TO_32 (&WalkState->Arguments[i].Name,
|
||||
NAMEOF_ARG_NTE);
|
||||
|
||||
WalkState->Arguments[i].Name.Integer |= (i << 24);
|
||||
WalkState->Arguments[i].DescriptorType = ACPI_DESC_TYPE_NAMED;
|
||||
WalkState->Arguments[i].Type = ACPI_TYPE_ANY;
|
||||
|
@ -193,7 +195,8 @@ AcpiDsMethodDataInit (
|
|||
|
||||
for (i = 0; i < ACPI_METHOD_NUM_LOCALS; i++)
|
||||
{
|
||||
ACPI_MOVE_32_TO_32 (&WalkState->LocalVariables[i].Name, NAMEOF_LOCAL_NTE);
|
||||
ACPI_MOVE_32_TO_32 (&WalkState->LocalVariables[i].Name,
|
||||
NAMEOF_LOCAL_NTE);
|
||||
|
||||
WalkState->LocalVariables[i].Name.Integer |= (i << 24);
|
||||
WalkState->LocalVariables[i].DescriptorType = ACPI_DESC_TYPE_NAMED;
|
||||
|
@ -293,7 +296,8 @@ AcpiDsMethodDataInitArgs (
|
|||
|
||||
if (!Params)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "No param list passed to method\n"));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"No parameter list passed to method\n"));
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
@ -308,8 +312,8 @@ AcpiDsMethodDataInitArgs (
|
|||
* Store the argument in the method/walk descriptor.
|
||||
* Do not copy the arg in order to implement call by reference
|
||||
*/
|
||||
Status = AcpiDsMethodDataSetValue (ACPI_REFCLASS_ARG, Index,
|
||||
Params[Index], WalkState);
|
||||
Status = AcpiDsMethodDataSetValue (
|
||||
ACPI_REFCLASS_ARG, Index, Params[Index], WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -699,7 +703,8 @@ AcpiDsStoreObjectToLocal (
|
|||
NewObjDesc = ObjDesc;
|
||||
if (ObjDesc->Common.ReferenceCount > 1)
|
||||
{
|
||||
Status = AcpiUtCopyIobjectToIobject (ObjDesc, &NewObjDesc, WalkState);
|
||||
Status = AcpiUtCopyIobjectToIobject (
|
||||
ObjDesc, &NewObjDesc, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -736,9 +741,12 @@ AcpiDsStoreObjectToLocal (
|
|||
* If we have a valid reference object that came from RefOf(),
|
||||
* do the indirect store
|
||||
*/
|
||||
if ((ACPI_GET_DESCRIPTOR_TYPE (CurrentObjDesc) == ACPI_DESC_TYPE_OPERAND) &&
|
||||
(CurrentObjDesc->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
|
||||
(CurrentObjDesc->Reference.Class == ACPI_REFCLASS_REFOF))
|
||||
if ((ACPI_GET_DESCRIPTOR_TYPE (CurrentObjDesc) ==
|
||||
ACPI_DESC_TYPE_OPERAND) &&
|
||||
(CurrentObjDesc->Common.Type ==
|
||||
ACPI_TYPE_LOCAL_REFERENCE) &&
|
||||
(CurrentObjDesc->Reference.Class ==
|
||||
ACPI_REFCLASS_REFOF))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Arg (%p) is an ObjRef(Node), storing in node %p\n",
|
||||
|
@ -759,6 +767,7 @@ AcpiDsStoreObjectToLocal (
|
|||
{
|
||||
AcpiUtRemoveReference (NewObjDesc);
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -300,8 +300,8 @@ AcpiDsBuildInternalObject (
|
|||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
Status = AcpiDsInitObjectFromOp (WalkState, Op, Op->Common.AmlOpcode,
|
||||
&ObjDesc);
|
||||
Status = AcpiDsInitObjectFromOp (
|
||||
WalkState, Op, Op->Common.AmlOpcode, &ObjDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiUtRemoveReference (ObjDesc);
|
||||
|
@ -408,8 +408,8 @@ AcpiDsBuildInternalBufferObj (
|
|||
}
|
||||
else
|
||||
{
|
||||
ObjDesc->Buffer.Pointer = ACPI_ALLOCATE_ZEROED (
|
||||
ObjDesc->Buffer.Length);
|
||||
ObjDesc->Buffer.Pointer =
|
||||
ACPI_ALLOCATE_ZEROED (ObjDesc->Buffer.Length);
|
||||
if (!ObjDesc->Buffer.Pointer)
|
||||
{
|
||||
AcpiUtDeleteObjectDesc (ObjDesc);
|
||||
|
@ -540,8 +540,8 @@ AcpiDsBuildInternalPackageObj (
|
|||
* invocation, so we special case it here
|
||||
*/
|
||||
Arg->Common.AmlOpcode = AML_INT_NAMEPATH_OP;
|
||||
Status = AcpiDsBuildInternalObject (WalkState, Arg,
|
||||
&ObjDesc->Package.Elements[i]);
|
||||
Status = AcpiDsBuildInternalObject (
|
||||
WalkState, Arg, &ObjDesc->Package.Elements[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -553,8 +553,8 @@ AcpiDsBuildInternalPackageObj (
|
|||
}
|
||||
else
|
||||
{
|
||||
Status = AcpiDsBuildInternalObject (WalkState, Arg,
|
||||
&ObjDesc->Package.Elements[i]);
|
||||
Status = AcpiDsBuildInternalObject (
|
||||
WalkState, Arg, &ObjDesc->Package.Elements[i]);
|
||||
}
|
||||
|
||||
if (*ObjDescPtr)
|
||||
|
@ -611,7 +611,8 @@ AcpiDsBuildInternalPackageObj (
|
|||
}
|
||||
|
||||
ACPI_INFO ((AE_INFO,
|
||||
"Actual Package length (%u) is larger than NumElements field (%u), truncated",
|
||||
"Actual Package length (%u) is larger than "
|
||||
"NumElements field (%u), truncated",
|
||||
i, ElementCount));
|
||||
}
|
||||
else if (i < ElementCount)
|
||||
|
@ -621,7 +622,8 @@ AcpiDsBuildInternalPackageObj (
|
|||
* Note: this is not an error, the package is padded out with NULLs.
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Package List length (%u) smaller than NumElements count (%u), padded with null elements\n",
|
||||
"Package List length (%u) smaller than NumElements "
|
||||
"count (%u), padded with null elements\n",
|
||||
i, ElementCount));
|
||||
}
|
||||
|
||||
|
@ -677,8 +679,8 @@ AcpiDsCreateNode (
|
|||
|
||||
/* Build an internal object for the argument(s) */
|
||||
|
||||
Status = AcpiDsBuildInternalObject (WalkState, Op->Common.Value.Arg,
|
||||
&ObjDesc);
|
||||
Status = AcpiDsBuildInternalObject (
|
||||
WalkState, Op->Common.Value.Arg, &ObjDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -750,8 +752,8 @@ AcpiDsInitObjectFromOp (
|
|||
/*
|
||||
* Defer evaluation of Buffer TermArg operand
|
||||
*/
|
||||
ObjDesc->Buffer.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
|
||||
WalkState->Operands[0]);
|
||||
ObjDesc->Buffer.Node = ACPI_CAST_PTR (
|
||||
ACPI_NAMESPACE_NODE, WalkState->Operands[0]);
|
||||
ObjDesc->Buffer.AmlStart = Op->Named.Data;
|
||||
ObjDesc->Buffer.AmlLength = Op->Named.Length;
|
||||
break;
|
||||
|
@ -760,8 +762,8 @@ AcpiDsInitObjectFromOp (
|
|||
/*
|
||||
* Defer evaluation of Package TermArg operand
|
||||
*/
|
||||
ObjDesc->Package.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
|
||||
WalkState->Operands[0]);
|
||||
ObjDesc->Package.Node = ACPI_CAST_PTR (
|
||||
ACPI_NAMESPACE_NODE, WalkState->Operands[0]);
|
||||
ObjDesc->Package.AmlStart = Op->Named.Data;
|
||||
ObjDesc->Package.AmlLength = Op->Named.Length;
|
||||
break;
|
||||
|
|
|
@ -331,8 +331,8 @@ AcpiDsInitBufferField (
|
|||
* For FieldFlags, use LOCK_RULE = 0 (NO_LOCK),
|
||||
* UPDATE_RULE = 0 (UPDATE_PRESERVE)
|
||||
*/
|
||||
Status = AcpiExPrepCommonFieldObject (ObjDesc, FieldFlags, 0,
|
||||
BitOffset, BitCount);
|
||||
Status = AcpiExPrepCommonFieldObject (
|
||||
ObjDesc, FieldFlags, 0, BitOffset, BitCount);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
|
@ -429,8 +429,8 @@ AcpiDsEvalBufferFieldOperands (
|
|||
|
||||
/* Resolve the operands */
|
||||
|
||||
Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
|
||||
ACPI_WALK_OPERANDS, WalkState);
|
||||
Status = AcpiExResolveOperands (
|
||||
Op->Common.AmlOpcode, ACPI_WALK_OPERANDS, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "(%s) bad operand(s), status 0x%X",
|
||||
|
@ -515,8 +515,8 @@ AcpiDsEvalRegionOperands (
|
|||
|
||||
/* Resolve the length and address operands to numbers */
|
||||
|
||||
Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
|
||||
ACPI_WALK_OPERANDS, WalkState);
|
||||
Status = AcpiExResolveOperands (
|
||||
Op->Common.AmlOpcode, ACPI_WALK_OPERANDS, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -548,14 +548,12 @@ AcpiDsEvalRegionOperands (
|
|||
AcpiUtRemoveReference (OperandDesc);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
|
||||
ObjDesc,
|
||||
ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
|
||||
ObjDesc, ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
|
||||
ObjDesc->Region.Length));
|
||||
|
||||
/* Now the address and length are valid for this opregion */
|
||||
|
||||
ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID;
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
@ -618,8 +616,8 @@ AcpiDsEvalTableRegionOperands (
|
|||
* Resolve the Signature string, OemId string,
|
||||
* and OemTableId string operands
|
||||
*/
|
||||
Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
|
||||
ACPI_WALK_OPERANDS, WalkState);
|
||||
Status = AcpiExResolveOperands (
|
||||
Op->Common.AmlOpcode, ACPI_WALK_OPERANDS, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
|
@ -750,13 +748,15 @@ AcpiDsEvalDataObjectOperands (
|
|||
{
|
||||
case AML_BUFFER_OP:
|
||||
|
||||
Status = AcpiDsBuildInternalBufferObj (WalkState, Op, Length, &ObjDesc);
|
||||
Status = AcpiDsBuildInternalBufferObj (
|
||||
WalkState, Op, Length, &ObjDesc);
|
||||
break;
|
||||
|
||||
case AML_PACKAGE_OP:
|
||||
case AML_VAR_PACKAGE_OP:
|
||||
|
||||
Status = AcpiDsBuildInternalPackageObj (WalkState, Op, Length, &ObjDesc);
|
||||
Status = AcpiDsBuildInternalPackageObj (
|
||||
WalkState, Op, Length, &ObjDesc);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -338,7 +338,8 @@ AcpiDsIsResultUsed (
|
|||
* If we are executing the predicate AND this is the predicate op,
|
||||
* we will use the return value
|
||||
*/
|
||||
if ((WalkState->ControlState->Common.State == ACPI_CONTROL_PREDICATE_EXECUTING) &&
|
||||
if ((WalkState->ControlState->Common.State ==
|
||||
ACPI_CONTROL_PREDICATE_EXECUTING) &&
|
||||
(WalkState->ControlState->Control.PredicateOp == Op))
|
||||
{
|
||||
goto ResultUsed;
|
||||
|
@ -595,8 +596,8 @@ AcpiDsCreateOperand (
|
|||
|
||||
/* Get the entire name string from the AML stream */
|
||||
|
||||
Status = AcpiExGetNameString (ACPI_TYPE_ANY, Arg->Common.Value.Buffer,
|
||||
&NameString, &NameLength);
|
||||
Status = AcpiExGetNameString (ACPI_TYPE_ANY,
|
||||
Arg->Common.Value.Buffer, &NameString, &NameLength);
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
|
@ -616,7 +617,8 @@ AcpiDsCreateOperand (
|
|||
*/
|
||||
if ((WalkState->DeferredNode) &&
|
||||
(WalkState->DeferredNode->Type == ACPI_TYPE_BUFFER_FIELD) &&
|
||||
(ArgIndex == (UINT32) ((WalkState->Opcode == AML_CREATE_FIELD_OP) ? 3 : 2)))
|
||||
(ArgIndex == (UINT32)
|
||||
((WalkState->Opcode == AML_CREATE_FIELD_OP) ? 3 : 2)))
|
||||
{
|
||||
ObjDesc = ACPI_CAST_PTR (
|
||||
ACPI_OPERAND_OBJECT, WalkState->DeferredNode);
|
||||
|
@ -632,6 +634,7 @@ AcpiDsCreateOperand (
|
|||
*/
|
||||
ParentOp = Arg->Common.Parent;
|
||||
OpInfo = AcpiPsGetOpcodeInfo (ParentOp->Common.AmlOpcode);
|
||||
|
||||
if ((OpInfo->Flags & AML_NSNODE) &&
|
||||
(ParentOp->Common.AmlOpcode != AML_INT_METHODCALL_OP) &&
|
||||
(ParentOp->Common.AmlOpcode != AML_REGION_OP) &&
|
||||
|
@ -650,8 +653,7 @@ AcpiDsCreateOperand (
|
|||
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, NameString,
|
||||
ACPI_TYPE_ANY, InterpreterMode,
|
||||
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
|
||||
WalkState,
|
||||
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, WalkState,
|
||||
ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ObjDesc));
|
||||
/*
|
||||
* The only case where we pass through (ignore) a NOT_FOUND
|
||||
|
@ -714,7 +716,8 @@ AcpiDsCreateOperand (
|
|||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
ACPI_DEBUGGER_EXEC (AcpiDbDisplayArgumentObject (ObjDesc, WalkState));
|
||||
|
||||
AcpiDbDisplayArgumentObject (ObjDesc, WalkState);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -747,13 +750,14 @@ AcpiDsCreateOperand (
|
|||
return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
|
||||
}
|
||||
|
||||
if ((OpInfo->Flags & AML_HAS_RETVAL) || (Arg->Common.Flags & ACPI_PARSEOP_IN_STACK))
|
||||
if ((OpInfo->Flags & AML_HAS_RETVAL) ||
|
||||
(Arg->Common.Flags & ACPI_PARSEOP_IN_STACK))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Argument previously created, already stacked\n"));
|
||||
|
||||
ACPI_DEBUGGER_EXEC (AcpiDbDisplayArgumentObject (
|
||||
WalkState->Operands [WalkState->NumOperands - 1], WalkState));
|
||||
AcpiDbDisplayArgumentObject (
|
||||
WalkState->Operands [WalkState->NumOperands - 1], WalkState);
|
||||
|
||||
/*
|
||||
* Use value that was already previously returned
|
||||
|
@ -800,7 +804,7 @@ AcpiDsCreateOperand (
|
|||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_DEBUGGER_EXEC (AcpiDbDisplayArgumentObject (ObjDesc, WalkState));
|
||||
AcpiDbDisplayArgumentObject (ObjDesc, WalkState);
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
|
@ -970,7 +974,8 @@ AcpiDsEvaluateNamePath (
|
|||
|
||||
AcpiUtRemoveReference (*Operand);
|
||||
|
||||
Status = AcpiUtCopyIobjectToIobject (*Operand, &NewObjDesc, WalkState);
|
||||
Status = AcpiUtCopyIobjectToIobject (
|
||||
*Operand, &NewObjDesc, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Exit;
|
||||
|
|
|
@ -261,12 +261,13 @@ AcpiDsGetPredicateValue (
|
|||
|
||||
Cleanup:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Completed a predicate eval=%X Op=%p\n",
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Completed a predicate eval=%X Op=%p\n",
|
||||
WalkState->ControlState->Common.Value, WalkState->Op));
|
||||
|
||||
/* Break to debugger to display result */
|
||||
|
||||
ACPI_DEBUGGER_EXEC (AcpiDbDisplayResultObject (LocalObjDesc, WalkState));
|
||||
AcpiDbDisplayResultObject (LocalObjDesc, WalkState);
|
||||
|
||||
/*
|
||||
* Delete the predicate result object (we know that
|
||||
|
@ -358,10 +359,12 @@ AcpiDsExecBeginOp (
|
|||
(WalkState->ControlState->Common.State ==
|
||||
ACPI_CONTROL_CONDITIONAL_EXECUTING))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Exec predicate Op=%p State=%p\n",
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Exec predicate Op=%p State=%p\n",
|
||||
Op, WalkState));
|
||||
|
||||
WalkState->ControlState->Common.State = ACPI_CONTROL_PREDICATE_EXECUTING;
|
||||
WalkState->ControlState->Common.State =
|
||||
ACPI_CONTROL_PREDICATE_EXECUTING;
|
||||
|
||||
/* Save start of predicate */
|
||||
|
||||
|
@ -409,8 +412,8 @@ AcpiDsExecBeginOp (
|
|||
}
|
||||
else
|
||||
{
|
||||
Status = AcpiDsScopeStackPush (Op->Named.Node,
|
||||
Op->Named.Node->Type, WalkState);
|
||||
Status = AcpiDsScopeStackPush (
|
||||
Op->Named.Node, Op->Named.Node->Type, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -490,8 +493,11 @@ AcpiDsExecEndOp (
|
|||
|
||||
/* Call debugger for single step support (DEBUG build only) */
|
||||
|
||||
ACPI_DEBUGGER_EXEC (Status = AcpiDbSingleStep (WalkState, Op, OpClass));
|
||||
ACPI_DEBUGGER_EXEC (if (ACPI_FAILURE (Status)) {return_ACPI_STATUS (Status);});
|
||||
Status = AcpiDbSingleStep (WalkState, Op, OpClass);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Decode the Opcode Class */
|
||||
|
||||
|
@ -606,7 +612,8 @@ AcpiDsExecEndOp (
|
|||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Method Reference in a Package, Op=%p\n", Op));
|
||||
|
||||
Op->Common.Node = (ACPI_NAMESPACE_NODE *) Op->Asl.Value.Arg->Asl.Node;
|
||||
Op->Common.Node = (ACPI_NAMESPACE_NODE *)
|
||||
Op->Asl.Value.Arg->Asl.Node;
|
||||
AcpiUtAddReference (Op->Asl.Value.Arg->Asl.Node->Object);
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
@ -688,12 +695,12 @@ AcpiDsExecEndOp (
|
|||
* Put the Node on the object stack (Contains the ACPI Name
|
||||
* of this object)
|
||||
*/
|
||||
WalkState->Operands[0] = (void *) Op->Common.Parent->Common.Node;
|
||||
WalkState->Operands[0] = (void *)
|
||||
Op->Common.Parent->Common.Node;
|
||||
WalkState->NumOperands = 1;
|
||||
|
||||
Status = AcpiDsCreateNode (WalkState,
|
||||
Op->Common.Parent->Common.Node,
|
||||
Op->Common.Parent);
|
||||
Op->Common.Parent->Common.Node, Op->Common.Parent);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
break;
|
||||
|
@ -786,7 +793,8 @@ AcpiDsExecEndOp (
|
|||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Unimplemented opcode, class=0x%X type=0x%X Opcode=0x%X Op=%p",
|
||||
"Unimplemented opcode, class=0x%X "
|
||||
"type=0x%X Opcode=0x%X Op=%p",
|
||||
OpClass, OpType, Op->Common.AmlOpcode, Op));
|
||||
|
||||
Status = AE_NOT_IMPLEMENTED;
|
||||
|
@ -821,8 +829,7 @@ Cleanup:
|
|||
{
|
||||
/* Break to debugger to display result */
|
||||
|
||||
ACPI_DEBUGGER_EXEC (AcpiDbDisplayResultObject (WalkState->ResultObj,
|
||||
WalkState));
|
||||
AcpiDbDisplayResultObject (WalkState->ResultObj,WalkState);
|
||||
|
||||
/*
|
||||
* Delete the result op if and only if:
|
||||
|
|
|
@ -260,7 +260,8 @@ AcpiDsLoad1BeginOp (
|
|||
ObjectType = WalkState->OpInfo->ObjectType;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"State=%p Op=%p [%s]\n", WalkState, Op, AcpiUtGetTypeName (ObjectType)));
|
||||
"State=%p Op=%p [%s]\n", WalkState, Op,
|
||||
AcpiUtGetTypeName (ObjectType)));
|
||||
|
||||
switch (WalkState->Opcode)
|
||||
{
|
||||
|
@ -444,7 +445,8 @@ AcpiDsLoad1BeginOp (
|
|||
|
||||
if (AcpiNsOpensScope (ObjectType))
|
||||
{
|
||||
Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState);
|
||||
Status = AcpiDsScopeStackPush (
|
||||
Node, ObjectType, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -566,7 +568,8 @@ AcpiDsLoad1EndOp (
|
|||
if (Op->Common.AmlOpcode == AML_REGION_OP)
|
||||
{
|
||||
Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
|
||||
(ACPI_ADR_SPACE_TYPE) ((Op->Common.Value.Arg)->Common.Value.Integer),
|
||||
(ACPI_ADR_SPACE_TYPE)
|
||||
((Op->Common.Value.Arg)->Common.Value.Integer),
|
||||
WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
|
@ -628,7 +631,8 @@ AcpiDsLoad1EndOp (
|
|||
WalkState->Operands[0] = ACPI_CAST_PTR (void, Op->Named.Node);
|
||||
WalkState->NumOperands = 1;
|
||||
|
||||
Status = AcpiDsCreateOperands (WalkState, Op->Common.Value.Arg);
|
||||
Status = AcpiDsCreateOperands (
|
||||
WalkState, Op->Common.Value.Arg);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Status = AcpiExCreateMethod (Op->Named.Data,
|
||||
|
|
|
@ -579,8 +579,8 @@ AcpiDsLoad2EndOp (
|
|||
{
|
||||
case AML_INDEX_FIELD_OP:
|
||||
|
||||
Status = AcpiDsCreateIndexField (Op, (ACPI_HANDLE) Arg->Common.Node,
|
||||
WalkState);
|
||||
Status = AcpiDsCreateIndexField (
|
||||
Op, (ACPI_HANDLE) Arg->Common.Node, WalkState);
|
||||
break;
|
||||
|
||||
case AML_BANK_FIELD_OP:
|
||||
|
@ -690,8 +690,8 @@ AcpiDsLoad2EndOp (
|
|||
* Executing a method: initialize the region and unlock
|
||||
* the interpreter
|
||||
*/
|
||||
Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
|
||||
RegionSpace, WalkState);
|
||||
Status = AcpiExCreateRegion (Op->Named.Data,
|
||||
Op->Named.Length, RegionSpace, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -700,8 +700,8 @@ AcpiDsLoad2EndOp (
|
|||
AcpiExExitInterpreter ();
|
||||
}
|
||||
|
||||
Status = AcpiEvInitializeRegion (AcpiNsGetAttachedObject (Node),
|
||||
FALSE);
|
||||
Status = AcpiEvInitializeRegion (
|
||||
AcpiNsGetAttachedObject (Node), FALSE);
|
||||
if (WalkState->MethodNode)
|
||||
{
|
||||
AcpiExEnterInterpreter ();
|
||||
|
@ -744,12 +744,14 @@ AcpiDsLoad2EndOp (
|
|||
WalkState->Operands[0] = ACPI_CAST_PTR (void, Op->Named.Node);
|
||||
WalkState->NumOperands = 1;
|
||||
|
||||
Status = AcpiDsCreateOperands (WalkState, Op->Common.Value.Arg);
|
||||
Status = AcpiDsCreateOperands (
|
||||
WalkState, Op->Common.Value.Arg);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Status = AcpiExCreateMethod (Op->Named.Data,
|
||||
Op->Named.Length, WalkState);
|
||||
Status = AcpiExCreateMethod (
|
||||
Op->Named.Data, Op->Named.Length, WalkState);
|
||||
}
|
||||
|
||||
WalkState->Operands[0] = NULL;
|
||||
WalkState->NumOperands = 0;
|
||||
|
||||
|
|
|
@ -154,6 +154,7 @@ AcpiDsScopeStackClear (
|
|||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Popped object type (%s)\n",
|
||||
AcpiUtGetTypeName (ScopeInfo->Common.Value)));
|
||||
|
||||
AcpiUtDeleteGenericState (ScopeInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -371,8 +371,8 @@ AcpiDsResultStackPop (
|
|||
|
||||
if (WalkState->Results == NULL)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Result stack underflow - State=%p\n",
|
||||
WalkState));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Result stack underflow - State=%p\n", WalkState));
|
||||
return (AE_AML_NO_OPERAND);
|
||||
}
|
||||
|
||||
|
@ -779,7 +779,8 @@ AcpiDsInitAmlWalk (
|
|||
|
||||
/* Push start scope on scope stack and make it current */
|
||||
|
||||
Status = AcpiDsScopeStackPush (MethodNode, ACPI_TYPE_METHOD, WalkState);
|
||||
Status = AcpiDsScopeStackPush (
|
||||
MethodNode, ACPI_TYPE_METHOD, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
|
|
@ -212,6 +212,7 @@ AcpiEvRemoveGlobalLockHandler (
|
|||
|
||||
ACPI_FUNCTION_TRACE (EvRemoveGlobalLockHandler);
|
||||
|
||||
|
||||
AcpiGbl_GlobalLockPresent = FALSE;
|
||||
Status = AcpiRemoveFixedEventHandler (ACPI_EVENT_GLOBAL,
|
||||
AcpiEvGlobalLockHandler);
|
||||
|
@ -374,8 +375,8 @@ AcpiEvAcquireGlobalLock (
|
|||
* Wait for handshake with the global lock interrupt handler.
|
||||
* This interface releases the interpreter if we must wait.
|
||||
*/
|
||||
Status = AcpiExSystemWaitSemaphore (AcpiGbl_GlobalLockSemaphore,
|
||||
ACPI_WAIT_FOREVER);
|
||||
Status = AcpiExSystemWaitSemaphore (
|
||||
AcpiGbl_GlobalLockSemaphore, ACPI_WAIT_FOREVER);
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GlobalLockPendingLock);
|
||||
|
||||
|
|
|
@ -176,8 +176,8 @@ AcpiEvUpdateGpeEnableMask (
|
|||
{
|
||||
ACPI_SET_BIT (GpeRegisterInfo->EnableForRun, (UINT8) RegisterBit);
|
||||
}
|
||||
GpeRegisterInfo->EnableMask = GpeRegisterInfo->EnableForRun;
|
||||
|
||||
GpeRegisterInfo->EnableMask = GpeRegisterInfo->EnableForRun;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
@ -660,8 +660,8 @@ AcpiEvAsynchExecuteGpeMethod (
|
|||
Notify = GpeEventInfo->Dispatch.NotifyList;
|
||||
while (ACPI_SUCCESS (Status) && Notify)
|
||||
{
|
||||
Status = AcpiEvQueueNotifyRequest (Notify->DeviceNode,
|
||||
ACPI_NOTIFY_DEVICE_WAKE);
|
||||
Status = AcpiEvQueueNotifyRequest (
|
||||
Notify->DeviceNode, ACPI_NOTIFY_DEVICE_WAKE);
|
||||
|
||||
Notify = Notify->Next;
|
||||
}
|
||||
|
@ -850,8 +850,8 @@ AcpiEvGpeDispatch (
|
|||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Unable to clear GPE %02X", GpeNumber));
|
||||
(void) AcpiHwLowSetGpe (GpeEventInfo,
|
||||
ACPI_GPE_CONDITIONAL_ENABLE);
|
||||
(void) AcpiHwLowSetGpe (
|
||||
GpeEventInfo, ACPI_GPE_CONDITIONAL_ENABLE);
|
||||
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -265,6 +265,7 @@ AcpiEvDeleteGpeBlock (
|
|||
{
|
||||
GpeBlock->Next->Previous = GpeBlock->Previous;
|
||||
}
|
||||
|
||||
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
|
||||
}
|
||||
|
||||
|
|
|
@ -457,6 +457,7 @@ AcpiEvDeleteGpeHandlers (
|
|||
ACPI_FREE (Notify);
|
||||
Notify = Next;
|
||||
}
|
||||
|
||||
GpeEventInfo->Dispatch.NotifyList = NULL;
|
||||
GpeEventInfo->Flags &= ~ACPI_GPE_DISPATCH_MASK;
|
||||
}
|
||||
|
|
|
@ -132,6 +132,7 @@ AcpiEvInstallHandler (
|
|||
void *Context,
|
||||
void **ReturnValue);
|
||||
|
||||
|
||||
/* These are the address spaces that will get default handlers */
|
||||
|
||||
UINT8 AcpiGbl_DefaultAddressSpaces[ACPI_NUM_DEFAULT_SPACES] =
|
||||
|
@ -247,7 +248,7 @@ AcpiEvHasDefaultHandler (
|
|||
ObjDesc = AcpiNsGetAttachedObject (Node);
|
||||
if (ObjDesc)
|
||||
{
|
||||
HandlerObj = ObjDesc->Device.Handler;
|
||||
HandlerObj = ObjDesc->CommonNotify.Handler;
|
||||
|
||||
/* Walk the linked list of handlers for this object */
|
||||
|
||||
|
@ -348,35 +349,27 @@ AcpiEvInstallHandler (
|
|||
{
|
||||
/* Check if this Device already has a handler for this address space */
|
||||
|
||||
NextHandlerObj = ObjDesc->Device.Handler;
|
||||
while (NextHandlerObj)
|
||||
NextHandlerObj = AcpiEvFindRegionHandler (
|
||||
HandlerObj->AddressSpace.SpaceId, ObjDesc->CommonNotify.Handler);
|
||||
if (NextHandlerObj)
|
||||
{
|
||||
/* Found a handler, is it for the same address space? */
|
||||
|
||||
if (NextHandlerObj->AddressSpace.SpaceId ==
|
||||
HandlerObj->AddressSpace.SpaceId)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
|
||||
"Found handler for region [%s] in device %p(%p) "
|
||||
"handler %p\n",
|
||||
"Found handler for region [%s] in device %p(%p) handler %p\n",
|
||||
AcpiUtGetRegionName (HandlerObj->AddressSpace.SpaceId),
|
||||
ObjDesc, NextHandlerObj, HandlerObj));
|
||||
|
||||
/*
|
||||
* Since the object we found it on was a device, then it
|
||||
* means that someone has already installed a handler for
|
||||
* the branch of the namespace from this device on. Just
|
||||
* bail out telling the walk routine to not traverse this
|
||||
* branch. This preserves the scoping rule for handlers.
|
||||
* Since the object we found it on was a device, then it means
|
||||
* that someone has already installed a handler for the branch
|
||||
* of the namespace from this device on. Just bail out telling
|
||||
* the walk routine to not traverse this branch. This preserves
|
||||
* the scoping rule for handlers.
|
||||
*/
|
||||
return (AE_CTRL_DEPTH);
|
||||
}
|
||||
|
||||
/* Walk the linked list of handlers attached to this device */
|
||||
|
||||
NextHandlerObj = NextHandlerObj->AddressSpace.Next;
|
||||
}
|
||||
|
||||
/*
|
||||
* As long as the device didn't have a handler for this space we
|
||||
* don't care about it. We just ignore it and proceed.
|
||||
|
@ -407,6 +400,46 @@ AcpiEvInstallHandler (
|
|||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvFindRegionHandler
|
||||
*
|
||||
* PARAMETERS: SpaceId - The address space ID
|
||||
* HandlerObj - Head of the handler object list
|
||||
*
|
||||
* RETURN: Matching handler object. NULL if space ID not matched
|
||||
*
|
||||
* DESCRIPTION: Search a handler object list for a match on the address
|
||||
* space ID.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_OPERAND_OBJECT *
|
||||
AcpiEvFindRegionHandler (
|
||||
ACPI_ADR_SPACE_TYPE SpaceId,
|
||||
ACPI_OPERAND_OBJECT *HandlerObj)
|
||||
{
|
||||
|
||||
/* Walk the handler list for this device */
|
||||
|
||||
while (HandlerObj)
|
||||
{
|
||||
/* Same SpaceId indicates a handler is installed */
|
||||
|
||||
if (HandlerObj->AddressSpace.SpaceId == SpaceId)
|
||||
{
|
||||
return (HandlerObj);
|
||||
}
|
||||
|
||||
/* Next handler object */
|
||||
|
||||
HandlerObj = HandlerObj->AddressSpace.Next;
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvInstallSpaceHandler
|
||||
|
@ -434,7 +467,7 @@ AcpiEvInstallSpaceHandler (
|
|||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_OPERAND_OBJECT *HandlerObj;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_OBJECT_TYPE Type;
|
||||
UINT8 Flags = 0;
|
||||
|
||||
|
@ -443,8 +476,8 @@ AcpiEvInstallSpaceHandler (
|
|||
|
||||
|
||||
/*
|
||||
* This registration is valid for only the types below and the root. This
|
||||
* is where the default handlers get placed.
|
||||
* This registration is valid for only the types below and the root.
|
||||
* The root node is where the default handlers get installed.
|
||||
*/
|
||||
if ((Node->Type != ACPI_TYPE_DEVICE) &&
|
||||
(Node->Type != ACPI_TYPE_PROCESSOR) &&
|
||||
|
@ -517,18 +550,13 @@ AcpiEvInstallSpaceHandler (
|
|||
if (ObjDesc)
|
||||
{
|
||||
/*
|
||||
* The attached device object already exists. Make sure the handler
|
||||
* is not already installed.
|
||||
* The attached device object already exists. Now make sure
|
||||
* the handler is not already installed.
|
||||
*/
|
||||
HandlerObj = ObjDesc->Device.Handler;
|
||||
HandlerObj = AcpiEvFindRegionHandler (SpaceId,
|
||||
ObjDesc->CommonNotify.Handler);
|
||||
|
||||
/* Walk the handler list for this device */
|
||||
|
||||
while (HandlerObj)
|
||||
{
|
||||
/* Same SpaceId indicates a handler already installed */
|
||||
|
||||
if (HandlerObj->AddressSpace.SpaceId == SpaceId)
|
||||
if (HandlerObj)
|
||||
{
|
||||
if (HandlerObj->AddressSpace.Handler == Handler)
|
||||
{
|
||||
|
@ -546,18 +574,15 @@ AcpiEvInstallSpaceHandler (
|
|||
|
||||
Status = AE_ALREADY_EXISTS;
|
||||
}
|
||||
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/* Walk the linked list of handlers */
|
||||
|
||||
HandlerObj = HandlerObj->AddressSpace.Next;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
|
||||
"Creating object on Device %p while installing handler\n", Node));
|
||||
"Creating object on Device %p while installing handler\n",
|
||||
Node));
|
||||
|
||||
/* ObjDesc does not exist, create one */
|
||||
|
||||
|
@ -596,7 +621,8 @@ AcpiEvInstallSpaceHandler (
|
|||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
|
||||
"Installing address handler for region %s(%X) on Device %4.4s %p(%p)\n",
|
||||
"Installing address handler for region %s(%X) "
|
||||
"on Device %4.4s %p(%p)\n",
|
||||
AcpiUtGetRegionName (SpaceId), SpaceId,
|
||||
AcpiUtGetNodeName (Node), Node, ObjDesc));
|
||||
|
||||
|
@ -625,29 +651,27 @@ AcpiEvInstallSpaceHandler (
|
|||
|
||||
/* Install at head of Device.AddressSpace list */
|
||||
|
||||
HandlerObj->AddressSpace.Next = ObjDesc->Device.Handler;
|
||||
HandlerObj->AddressSpace.Next = ObjDesc->CommonNotify.Handler;
|
||||
|
||||
/*
|
||||
* The Device object is the first reference on the HandlerObj.
|
||||
* Each region that uses the handler adds a reference.
|
||||
*/
|
||||
ObjDesc->Device.Handler = HandlerObj;
|
||||
ObjDesc->CommonNotify.Handler = HandlerObj;
|
||||
|
||||
/*
|
||||
* Walk the namespace finding all of the regions this
|
||||
* handler will manage.
|
||||
* Walk the namespace finding all of the regions this handler will
|
||||
* manage.
|
||||
*
|
||||
* Start at the device and search the branch toward
|
||||
* the leaf nodes until either the leaf is encountered or
|
||||
* a device is detected that has an address handler of the
|
||||
* same type.
|
||||
* Start at the device and search the branch toward the leaf nodes
|
||||
* until either the leaf is encountered or a device is detected that
|
||||
* has an address handler of the same type.
|
||||
*
|
||||
* In either case, back up and search down the remainder
|
||||
* of the branch
|
||||
* In either case, back up and search down the remainder of the branch
|
||||
*/
|
||||
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX,
|
||||
ACPI_NS_WALK_UNLOCK, AcpiEvInstallHandler, NULL,
|
||||
HandlerObj, NULL);
|
||||
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node,
|
||||
ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK,
|
||||
AcpiEvInstallHandler, NULL, HandlerObj, NULL);
|
||||
|
||||
UnlockAndExit:
|
||||
return_ACPI_STATUS (Status);
|
||||
|
|
|
@ -147,6 +147,7 @@ BOOLEAN
|
|||
AcpiEvIsNotifyObject (
|
||||
ACPI_NAMESPACE_NODE *Node)
|
||||
{
|
||||
|
||||
switch (Node->Type)
|
||||
{
|
||||
case ACPI_TYPE_DEVICE:
|
||||
|
@ -255,8 +256,8 @@ AcpiEvQueueNotifyRequest (
|
|||
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type),
|
||||
NotifyValue, AcpiUtGetNotifyName (NotifyValue, ACPI_TYPE_ANY), Node));
|
||||
|
||||
Status = AcpiOsExecute (OSL_NOTIFY_HANDLER, AcpiEvNotifyDispatch,
|
||||
Info);
|
||||
Status = AcpiOsExecute (OSL_NOTIFY_HANDLER,
|
||||
AcpiEvNotifyDispatch, Info);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiUtDeleteGenericState (Info);
|
||||
|
|
|
@ -171,6 +171,7 @@ AcpiEvInitializeOpRegions (
|
|||
|
||||
/* Run the _REG methods for OpRegions in each default address space */
|
||||
|
||||
AcpiGbl_RegMethodsEnabled = TRUE;
|
||||
for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++)
|
||||
{
|
||||
/*
|
||||
|
@ -181,13 +182,11 @@ AcpiEvInitializeOpRegions (
|
|||
if (AcpiEvHasDefaultHandler (AcpiGbl_RootNode,
|
||||
AcpiGbl_DefaultAddressSpaces[i]))
|
||||
{
|
||||
Status = AcpiEvExecuteRegMethods (AcpiGbl_RootNode,
|
||||
AcpiGbl_DefaultAddressSpaces[i]);
|
||||
AcpiEvExecuteRegMethods (AcpiGbl_RootNode,
|
||||
AcpiGbl_DefaultAddressSpaces[i], ACPI_REG_CONNECT);
|
||||
}
|
||||
}
|
||||
|
||||
AcpiGbl_RegMethodsExecuted = TRUE;
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
@ -210,6 +209,12 @@ AcpiEvInitializeOpRegions (
|
|||
* DESCRIPTION: Dispatch an address space or operation region access to
|
||||
* a previously installed handler.
|
||||
*
|
||||
* NOTE: During early initialization, we always install the default region
|
||||
* handlers for Memory, I/O and PCI_Config. This ensures that these operation
|
||||
* region address spaces are always available as per the ACPI specification.
|
||||
* This is especially needed in order to support the execution of
|
||||
* module-level AML code during loading of the ACPI tables.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
|
@ -414,7 +419,7 @@ AcpiEvAddressSpaceDispatch (
|
|||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiEvDetachRegion(
|
||||
AcpiEvDetachRegion (
|
||||
ACPI_OPERAND_OBJECT *RegionObj,
|
||||
BOOLEAN AcpiNsIsLocked)
|
||||
{
|
||||
|
@ -593,6 +598,13 @@ AcpiEvAttachRegion (
|
|||
ACPI_FUNCTION_TRACE (EvAttachRegion);
|
||||
|
||||
|
||||
/* Install the region's handler */
|
||||
|
||||
if (RegionObj->Region.Handler)
|
||||
{
|
||||
return_ACPI_STATUS (AE_ALREADY_EXISTS);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
|
||||
"Adding Region [%4.4s] %p to address handler %p [%s]\n",
|
||||
AcpiUtGetNodeName (RegionObj->Region.Node),
|
||||
|
@ -603,14 +615,6 @@ AcpiEvAttachRegion (
|
|||
|
||||
RegionObj->Region.Next = HandlerObj->AddressSpace.RegionList;
|
||||
HandlerObj->AddressSpace.RegionList = RegionObj;
|
||||
|
||||
/* Install the region's handler */
|
||||
|
||||
if (RegionObj->Region.Handler)
|
||||
{
|
||||
return_ACPI_STATUS (AE_ALREADY_EXISTS);
|
||||
}
|
||||
|
||||
RegionObj->Region.Handler = HandlerObj;
|
||||
AcpiUtAddReference (HandlerObj);
|
||||
|
||||
|
@ -618,6 +622,58 @@ AcpiEvAttachRegion (
|
|||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvAssociateRegMethod
|
||||
*
|
||||
* PARAMETERS: RegionObj - Region object
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Find and associate _REG method to a region
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiEvAssociateRegMethod (
|
||||
ACPI_OPERAND_OBJECT *RegionObj)
|
||||
{
|
||||
ACPI_NAME *RegNamePtr = (ACPI_NAME *) METHOD_NAME__REG;
|
||||
ACPI_NAMESPACE_NODE *MethodNode;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_OPERAND_OBJECT *RegionObj2;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvAssociateRegMethod);
|
||||
|
||||
|
||||
RegionObj2 = AcpiNsGetSecondaryObject (RegionObj);
|
||||
if (!RegionObj2)
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
Node = RegionObj->Region.Node->Parent;
|
||||
|
||||
/* Find any "_REG" method associated with this region definition */
|
||||
|
||||
Status = AcpiNsSearchOneScope (
|
||||
*RegNamePtr, Node, ACPI_TYPE_METHOD, &MethodNode);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
/*
|
||||
* The _REG method is optional and there can be only one per region
|
||||
* definition. This will be executed when the handler is attached
|
||||
* or removed
|
||||
*/
|
||||
RegionObj2->Extra.Method_REG = MethodNode;
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvExecuteRegMethod
|
||||
|
@ -651,7 +707,19 @@ AcpiEvExecuteRegMethod (
|
|||
return_ACPI_STATUS (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
if (RegionObj2->Extra.Method_REG == NULL)
|
||||
if (RegionObj2->Extra.Method_REG == NULL ||
|
||||
RegionObj->Region.Handler == NULL ||
|
||||
!AcpiGbl_RegMethodsEnabled)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* _REG(DISCONNECT) should be paired with _REG(CONNECT) */
|
||||
|
||||
if ((Function == ACPI_REG_CONNECT &&
|
||||
RegionObj->Common.Flags & AOPOBJ_REG_CONNECTED) ||
|
||||
(Function == ACPI_REG_DISCONNECT &&
|
||||
!(RegionObj->Common.Flags & AOPOBJ_REG_CONNECTED)))
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
@ -703,6 +771,20 @@ AcpiEvExecuteRegMethod (
|
|||
Status = AcpiNsEvaluate (Info);
|
||||
AcpiUtRemoveReference (Args[1]);
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup2;
|
||||
}
|
||||
|
||||
if (Function == ACPI_REG_CONNECT)
|
||||
{
|
||||
RegionObj->Common.Flags |= AOPOBJ_REG_CONNECTED;
|
||||
}
|
||||
else
|
||||
{
|
||||
RegionObj->Common.Flags &= ~AOPOBJ_REG_CONNECTED;
|
||||
}
|
||||
|
||||
Cleanup2:
|
||||
AcpiUtRemoveReference (Args[0]);
|
||||
|
||||
|
@ -718,26 +800,28 @@ Cleanup1:
|
|||
*
|
||||
* PARAMETERS: Node - Namespace node for the device
|
||||
* SpaceId - The address space ID
|
||||
* Function - Passed to _REG: On (1) or Off (0)
|
||||
*
|
||||
* RETURN: Status
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Run all _REG methods for the input Space ID;
|
||||
* Note: assumes namespace is locked, or system init time.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
void
|
||||
AcpiEvExecuteRegMethods (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_ADR_SPACE_TYPE SpaceId)
|
||||
ACPI_ADR_SPACE_TYPE SpaceId,
|
||||
UINT32 Function)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_REG_WALK_INFO Info;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvExecuteRegMethods);
|
||||
|
||||
Info.SpaceId = SpaceId;
|
||||
Info.Function = Function;
|
||||
Info.RegRunCount = 0;
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES,
|
||||
|
@ -750,7 +834,7 @@ AcpiEvExecuteRegMethods (
|
|||
* regions and _REG methods. (i.e. handlers must be installed for all
|
||||
* regions of this Space ID before we can run any _REG methods)
|
||||
*/
|
||||
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX,
|
||||
(void) AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX,
|
||||
ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL, &Info, NULL);
|
||||
|
||||
/* Special case for EC: handle "orphan" _REG methods with no region */
|
||||
|
@ -764,7 +848,7 @@ AcpiEvExecuteRegMethods (
|
|||
" Executed %u _REG methods for SpaceId %s\n",
|
||||
Info.RegRunCount, AcpiUtGetRegionName (Info.SpaceId)));
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
||||
|
@ -831,7 +915,7 @@ AcpiEvRegRun (
|
|||
}
|
||||
|
||||
Info->RegRunCount++;
|
||||
Status = AcpiEvExecuteRegMethod (ObjDesc, ACPI_REG_CONNECT);
|
||||
Status = AcpiEvExecuteRegMethod (ObjDesc, Info->Function);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
|
|
@ -639,9 +639,6 @@ AcpiEvInitializeRegion (
|
|||
ACPI_ADR_SPACE_TYPE SpaceId;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_NAMESPACE_NODE *MethodNode;
|
||||
ACPI_NAME *RegNamePtr = (ACPI_NAME *) METHOD_NAME__REG;
|
||||
ACPI_OPERAND_OBJECT *RegionObj2;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_U32 (EvInitializeRegion, AcpiNsLocked);
|
||||
|
@ -657,39 +654,15 @@ AcpiEvInitializeRegion (
|
|||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
RegionObj2 = AcpiNsGetSecondaryObject (RegionObj);
|
||||
if (!RegionObj2)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NOT_EXIST);
|
||||
}
|
||||
AcpiEvAssociateRegMethod (RegionObj);
|
||||
RegionObj->Common.Flags |= AOPOBJ_OBJECT_INITIALIZED;
|
||||
|
||||
Node = RegionObj->Region.Node->Parent;
|
||||
SpaceId = RegionObj->Region.SpaceId;
|
||||
|
||||
/* Setup defaults */
|
||||
|
||||
RegionObj->Region.Handler = NULL;
|
||||
RegionObj2->Extra.Method_REG = NULL;
|
||||
RegionObj->Common.Flags &= ~(AOPOBJ_SETUP_COMPLETE);
|
||||
RegionObj->Common.Flags |= AOPOBJ_OBJECT_INITIALIZED;
|
||||
|
||||
/* Find any "_REG" method associated with this region definition */
|
||||
|
||||
Status = AcpiNsSearchOneScope (
|
||||
*RegNamePtr, Node, ACPI_TYPE_METHOD, &MethodNode);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
/*
|
||||
* The _REG method is optional and there can be only one per region
|
||||
* definition. This will be executed when the handler is attached
|
||||
* or removed
|
||||
*/
|
||||
RegionObj2->Extra.Method_REG = MethodNode;
|
||||
}
|
||||
|
||||
/*
|
||||
* The following loop depends upon the root Node having no parent
|
||||
* ie: AcpiGbl_RootNode->ParentEntry being set to NULL
|
||||
* ie: AcpiGbl_RootNode->Parent being set to NULL
|
||||
*/
|
||||
while (Node)
|
||||
{
|
||||
|
@ -704,18 +677,10 @@ AcpiEvInitializeRegion (
|
|||
switch (Node->Type)
|
||||
{
|
||||
case ACPI_TYPE_DEVICE:
|
||||
|
||||
HandlerObj = ObjDesc->Device.Handler;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_PROCESSOR:
|
||||
|
||||
HandlerObj = ObjDesc->Processor.Handler;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_THERMAL:
|
||||
|
||||
HandlerObj = ObjDesc->ThermalZone.Handler;
|
||||
HandlerObj = ObjDesc->CommonNotify.Handler;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_METHOD:
|
||||
|
@ -739,11 +704,8 @@ AcpiEvInitializeRegion (
|
|||
break;
|
||||
}
|
||||
|
||||
while (HandlerObj)
|
||||
{
|
||||
/* Is this handler of the correct type? */
|
||||
|
||||
if (HandlerObj->AddressSpace.SpaceId == SpaceId)
|
||||
HandlerObj = AcpiEvFindRegionHandler (SpaceId, HandlerObj);
|
||||
if (HandlerObj)
|
||||
{
|
||||
/* Found correct handler */
|
||||
|
||||
|
@ -780,11 +742,6 @@ AcpiEvInitializeRegion (
|
|||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Try next handler in the list */
|
||||
|
||||
HandlerObj = HandlerObj->AddressSpace.Next;
|
||||
}
|
||||
}
|
||||
|
||||
/* This node does not have the handler we need; Pop up one level */
|
||||
|
|
|
@ -1074,8 +1074,8 @@ AcpiInstallGpeHandler (
|
|||
ACPI_FUNCTION_TRACE (AcpiInstallGpeHandler);
|
||||
|
||||
|
||||
Status = AcpiEvInstallGpeHandler (GpeDevice, GpeNumber, Type, FALSE,
|
||||
Address, Context);
|
||||
Status = AcpiEvInstallGpeHandler (GpeDevice, GpeNumber, Type,
|
||||
FALSE, Address, Context);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
@ -1115,8 +1115,8 @@ AcpiInstallGpeRawHandler (
|
|||
ACPI_FUNCTION_TRACE (AcpiInstallGpeRawHandler);
|
||||
|
||||
|
||||
Status = AcpiEvInstallGpeHandler (GpeDevice, GpeNumber, Type, TRUE,
|
||||
Address, Context);
|
||||
Status = AcpiEvInstallGpeHandler (GpeDevice, GpeNumber, Type,
|
||||
TRUE, Address, Context);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ AcpiEnable (
|
|||
|
||||
/* ACPI tables must be present */
|
||||
|
||||
if (!AcpiTbTablesLoaded ())
|
||||
if (AcpiGbl_FadtIndex == ACPI_INVALID_TABLE_INDEX)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
|
||||
}
|
||||
|
@ -164,7 +164,8 @@ AcpiEnable (
|
|||
|
||||
if (AcpiHwGetMode() == ACPI_SYS_MODE_ACPI)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "System is already in ACPI mode\n"));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
|
||||
"System is already in ACPI mode\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -234,7 +235,8 @@ AcpiDisable (
|
|||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "ACPI mode disabled\n"));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
|
||||
"ACPI mode disabled\n"));
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
|
|
|
@ -186,48 +186,16 @@ AcpiInstallAddressSpaceHandler (
|
|||
|
||||
/* Install the handler for all Regions for this Space ID */
|
||||
|
||||
Status = AcpiEvInstallSpaceHandler (Node, SpaceId, Handler, Setup, Context);
|
||||
Status = AcpiEvInstallSpaceHandler (
|
||||
Node, SpaceId, Handler, Setup, Context);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/*
|
||||
* For the default SpaceIDs, (the IDs for which there are default region handlers
|
||||
* installed) Only execute the _REG methods if the global initialization _REG
|
||||
* methods have already been run (via AcpiInitializeObjects). In other words,
|
||||
* we will defer the execution of the _REG methods for these SpaceIDs until
|
||||
* execution of AcpiInitializeObjects. This is done because we need the handlers
|
||||
* for the default spaces (mem/io/pci/table) to be installed before we can run
|
||||
* any control methods (or _REG methods). There is known BIOS code that depends
|
||||
* on this.
|
||||
*
|
||||
* For all other SpaceIDs, we can safely execute the _REG methods immediately.
|
||||
* This means that for IDs like EmbeddedController, this function should be called
|
||||
* only after AcpiEnableSubsystem has been called.
|
||||
*/
|
||||
switch (SpaceId)
|
||||
{
|
||||
case ACPI_ADR_SPACE_SYSTEM_MEMORY:
|
||||
case ACPI_ADR_SPACE_SYSTEM_IO:
|
||||
case ACPI_ADR_SPACE_PCI_CONFIG:
|
||||
case ACPI_ADR_SPACE_DATA_TABLE:
|
||||
|
||||
if (!AcpiGbl_RegMethodsExecuted)
|
||||
{
|
||||
/* We will defer execution of the _REG methods for this space */
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/* Run all _REG methods for this address space */
|
||||
|
||||
Status = AcpiEvExecuteRegMethods (Node, SpaceId);
|
||||
AcpiEvExecuteRegMethods (Node, SpaceId, ACPI_REG_CONNECT);
|
||||
|
||||
|
||||
UnlockAndExit:
|
||||
|
@ -306,8 +274,8 @@ AcpiRemoveAddressSpaceHandler (
|
|||
|
||||
/* Find the address handler the user requested */
|
||||
|
||||
HandlerObj = ObjDesc->Device.Handler;
|
||||
LastObjPtr = &ObjDesc->Device.Handler;
|
||||
HandlerObj = ObjDesc->CommonNotify.Handler;
|
||||
LastObjPtr = &ObjDesc->CommonNotify.Handler;
|
||||
while (HandlerObj)
|
||||
{
|
||||
/* We have a handler, see if user requested this one */
|
||||
|
|
|
@ -336,8 +336,7 @@ AcpiExLoadTableOp (
|
|||
/* Store the parameter data into the optional parameter object */
|
||||
|
||||
Status = AcpiExStore (Operand[5],
|
||||
ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, ParameterNode),
|
||||
WalkState);
|
||||
ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, ParameterNode), WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
(void) AcpiExUnloadTable (DdbHandle);
|
||||
|
@ -469,8 +468,8 @@ AcpiExLoadOp (
|
|||
}
|
||||
|
||||
/*
|
||||
* If the Region Address and Length have not been previously evaluated,
|
||||
* evaluate them now and save the results.
|
||||
* If the Region Address and Length have not been previously
|
||||
* evaluated, evaluate them now and save the results.
|
||||
*/
|
||||
if (!(ObjDesc->Common.Flags & AOPOBJ_DATA_VALID))
|
||||
{
|
||||
|
@ -555,7 +554,8 @@ AcpiExLoadOp (
|
|||
|
||||
/* Get the actual table length from the table header */
|
||||
|
||||
TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ObjDesc->Buffer.Pointer);
|
||||
TableHeader = ACPI_CAST_PTR (
|
||||
ACPI_TABLE_HEADER, ObjDesc->Buffer.Pointer);
|
||||
Length = TableHeader->Length;
|
||||
|
||||
/* Table cannot extend beyond the buffer */
|
||||
|
@ -570,8 +570,8 @@ AcpiExLoadOp (
|
|||
}
|
||||
|
||||
/*
|
||||
* Copy the table from the buffer because the buffer could be modified
|
||||
* or even deleted in the future
|
||||
* Copy the table from the buffer because the buffer could be
|
||||
* modified or even deleted in the future
|
||||
*/
|
||||
Table = ACPI_ALLOCATE (Length);
|
||||
if (!Table)
|
||||
|
@ -609,7 +609,8 @@ AcpiExLoadOp (
|
|||
* Note: Now table is "INSTALLED", it must be validated before
|
||||
* loading.
|
||||
*/
|
||||
Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[TableIndex]);
|
||||
Status = AcpiTbValidateTable (
|
||||
&AcpiGbl_RootTableList.Tables[TableIndex]);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
|
|
@ -323,9 +323,7 @@ AcpiExConvertToBuffer (
|
|||
/* Copy the integer to the buffer, LSB first */
|
||||
|
||||
NewBuf = ReturnDesc->Buffer.Pointer;
|
||||
memcpy (NewBuf,
|
||||
&ObjDesc->Integer.Value,
|
||||
AcpiGbl_IntegerByteWidth);
|
||||
memcpy (NewBuf, &ObjDesc->Integer.Value, AcpiGbl_IntegerByteWidth);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
@ -338,8 +336,8 @@ AcpiExConvertToBuffer (
|
|||
* ASL/AML code that depends on the null being transferred to the new
|
||||
* buffer.
|
||||
*/
|
||||
ReturnDesc = AcpiUtCreateBufferObject (
|
||||
(ACPI_SIZE) ObjDesc->String.Length + 1);
|
||||
ReturnDesc = AcpiUtCreateBufferObject ((ACPI_SIZE)
|
||||
ObjDesc->String.Length + 1);
|
||||
if (!ReturnDesc)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
|
@ -462,7 +460,8 @@ AcpiExConvertToAscii (
|
|||
{
|
||||
/* Get one hex digit, most significant digits first */
|
||||
|
||||
String[k] = (UINT8) AcpiUtHexToAsciiChar (Integer, ACPI_MUL_4 (j));
|
||||
String[k] = (UINT8)
|
||||
AcpiUtHexToAsciiChar (Integer, ACPI_MUL_4 (j));
|
||||
k++;
|
||||
}
|
||||
break;
|
||||
|
@ -563,8 +562,8 @@ AcpiExConvertToString (
|
|||
|
||||
/* Convert integer to string */
|
||||
|
||||
StringLength = AcpiExConvertToAscii (ObjDesc->Integer.Value, Base,
|
||||
NewBuf, AcpiGbl_IntegerByteWidth);
|
||||
StringLength = AcpiExConvertToAscii (
|
||||
ObjDesc->Integer.Value, Base, NewBuf, AcpiGbl_IntegerByteWidth);
|
||||
|
||||
/* Null terminate at the correct place */
|
||||
|
||||
|
@ -653,8 +652,7 @@ AcpiExConvertToString (
|
|||
for (i = 0; i < ObjDesc->Buffer.Length; i++)
|
||||
{
|
||||
NewBuf += AcpiExConvertToAscii (
|
||||
(UINT64) ObjDesc->Buffer.Pointer[i], Base,
|
||||
NewBuf, 1);
|
||||
(UINT64) ObjDesc->Buffer.Pointer[i], Base, NewBuf, 1);
|
||||
*NewBuf++ = Separator; /* each separated by a comma or space */
|
||||
}
|
||||
|
||||
|
@ -757,8 +755,7 @@ AcpiExConvertToTargetType (
|
|||
* These types require an Integer operand. We can convert
|
||||
* a Buffer or a String to an Integer if necessary.
|
||||
*/
|
||||
Status = AcpiExConvertToInteger (SourceDesc, ResultDesc,
|
||||
16);
|
||||
Status = AcpiExConvertToInteger (SourceDesc, ResultDesc, 16);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
@ -780,7 +777,8 @@ AcpiExConvertToTargetType (
|
|||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Bad destination type during conversion: 0x%X",
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Bad destination type during conversion: 0x%X",
|
||||
DestinationType));
|
||||
Status = AE_AML_INTERNAL;
|
||||
break;
|
||||
|
|
|
@ -273,7 +273,8 @@ AcpiExCreateEvent (
|
|||
|
||||
/* Attach object to the Node */
|
||||
|
||||
Status = AcpiNsAttachObject ((ACPI_NAMESPACE_NODE *) WalkState->Operands[0],
|
||||
Status = AcpiNsAttachObject (
|
||||
(ACPI_NAMESPACE_NODE *) WalkState->Operands[0],
|
||||
ObjDesc, ACPI_TYPE_EVENT);
|
||||
|
||||
Cleanup:
|
||||
|
@ -333,7 +334,8 @@ AcpiExCreateMutex (
|
|||
ObjDesc->Mutex.SyncLevel = (UINT8) WalkState->Operands[1]->Integer.Value;
|
||||
ObjDesc->Mutex.Node = (ACPI_NAMESPACE_NODE *) WalkState->Operands[0];
|
||||
|
||||
Status = AcpiNsAttachObject (ObjDesc->Mutex.Node, ObjDesc, ACPI_TYPE_MUTEX);
|
||||
Status = AcpiNsAttachObject (
|
||||
ObjDesc->Mutex.Node, ObjDesc, ACPI_TYPE_MUTEX);
|
||||
|
||||
|
||||
Cleanup:
|
||||
|
@ -401,7 +403,8 @@ AcpiExCreateRegion (
|
|||
* a table load for this exception. Instead, if the region is
|
||||
* actually used at runtime, abort the executing method.
|
||||
*/
|
||||
ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId));
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Invalid/unknown Address Space ID: 0x%2.2X", SpaceId));
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Region Type - %s (0x%X)\n",
|
||||
|
@ -420,9 +423,10 @@ AcpiExCreateRegion (
|
|||
* Remember location in AML stream of address & length
|
||||
* operands since they need to be evaluated at run time.
|
||||
*/
|
||||
RegionObj2 = ObjDesc->Common.NextObject;
|
||||
RegionObj2 = AcpiNsGetSecondaryObject (ObjDesc);
|
||||
RegionObj2->Extra.AmlStart = AmlStart;
|
||||
RegionObj2->Extra.AmlLength = AmlLength;
|
||||
RegionObj2->Extra.Method_REG = NULL;
|
||||
if (WalkState->ScopeInfo)
|
||||
{
|
||||
RegionObj2->Extra.ScopeNode = WalkState->ScopeInfo->Scope.Node;
|
||||
|
@ -438,6 +442,10 @@ AcpiExCreateRegion (
|
|||
ObjDesc->Region.Address = 0;
|
||||
ObjDesc->Region.Length = 0;
|
||||
ObjDesc->Region.Node = Node;
|
||||
ObjDesc->Region.Handler = NULL;
|
||||
ObjDesc->Common.Flags &=
|
||||
~(AOPOBJ_SETUP_COMPLETE | AOPOBJ_REG_CONNECTED |
|
||||
AOPOBJ_OBJECT_INITIALIZED);
|
||||
|
||||
/* Install the new region object in the parent Node */
|
||||
|
||||
|
@ -606,7 +614,8 @@ AcpiExCreateMethod (
|
|||
* flag, and SyncLevel for efficiency.
|
||||
*/
|
||||
MethodFlags = (UINT8) Operand[1]->Integer.Value;
|
||||
ObjDesc->Method.ParamCount = (UINT8) (MethodFlags & AML_METHOD_ARG_COUNT);
|
||||
ObjDesc->Method.ParamCount = (UINT8)
|
||||
(MethodFlags & AML_METHOD_ARG_COUNT);
|
||||
|
||||
/*
|
||||
* Get the SyncLevel. If method is serialized, a mutex will be
|
||||
|
|
|
@ -115,26 +115,13 @@
|
|||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acinterp.h"
|
||||
#include "acparser.h"
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_EXECUTER
|
||||
ACPI_MODULE_NAME ("exdebug")
|
||||
|
||||
|
||||
static ACPI_OPERAND_OBJECT *AcpiGbl_TraceMethodObject = NULL;
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
#ifdef ACPI_DEBUG_OUTPUT
|
||||
static const char *
|
||||
AcpiExGetTraceEventName (
|
||||
ACPI_TRACE_EVENT_TYPE Type);
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef ACPI_NO_ERROR_MESSAGES
|
||||
/*******************************************************************************
|
||||
*
|
||||
|
@ -181,13 +168,20 @@ AcpiExDoDebugObject (
|
|||
return_VOID;
|
||||
}
|
||||
|
||||
/*
|
||||
* We will emit the current timer value (in microseconds) with each
|
||||
* debug output. Only need the lower 26 bits. This allows for 67
|
||||
* million microseconds or 67 seconds before rollover.
|
||||
*/
|
||||
Timer = ((UINT32) AcpiOsGetTimer () / 10); /* (100 nanoseconds to microseconds) */
|
||||
Timer &= 0x03FFFFFF;
|
||||
/* Null string or 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')))
|
||||
{
|
||||
AcpiOsPrintf ("\n");
|
||||
return_VOID;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Print line header as long as we are not in the middle of an
|
||||
|
@ -195,14 +189,31 @@ AcpiExDoDebugObject (
|
|||
*/
|
||||
if (!((Level > 0) && Index == 0))
|
||||
{
|
||||
AcpiOsPrintf ("[ACPI Debug %.8u] %*s", Timer, Level, " ");
|
||||
if (AcpiGbl_DisplayDebugTimer)
|
||||
{
|
||||
/*
|
||||
* We will emit the current timer value (in microseconds) with each
|
||||
* debug output. Only need the lower 26 bits. This allows for 67
|
||||
* million microseconds or 67 seconds before rollover.
|
||||
*
|
||||
* Convert 100 nanosecond units to microseconds
|
||||
*/
|
||||
Timer = ((UINT32) AcpiOsGetTimer () / 10);
|
||||
Timer &= 0x03FFFFFF;
|
||||
|
||||
AcpiOsPrintf ("[ACPI Debug T=0x%8.8X] %*s", Timer, Level, " ");
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("[ACPI Debug] %*s", Level, " ");
|
||||
}
|
||||
}
|
||||
|
||||
/* Display the index for package output only */
|
||||
|
||||
if (Index > 0)
|
||||
{
|
||||
AcpiOsPrintf ("(%.2u) ", Index-1);
|
||||
AcpiOsPrintf ("(%.2u) ", Index - 1);
|
||||
}
|
||||
|
||||
if (!SourceDesc)
|
||||
|
@ -212,8 +223,14 @@ AcpiExDoDebugObject (
|
|||
}
|
||||
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_OPERAND)
|
||||
{
|
||||
/* No object type prefix needed for integers and strings */
|
||||
|
||||
if ((SourceDesc->Common.Type != ACPI_TYPE_INTEGER) &&
|
||||
(SourceDesc->Common.Type != ACPI_TYPE_STRING))
|
||||
{
|
||||
AcpiOsPrintf ("%s ", AcpiUtGetObjectTypeName (SourceDesc));
|
||||
}
|
||||
|
||||
if (!AcpiUtValidInternalObject (SourceDesc))
|
||||
{
|
||||
|
@ -223,7 +240,7 @@ AcpiExDoDebugObject (
|
|||
}
|
||||
else if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc) == ACPI_DESC_TYPE_NAMED)
|
||||
{
|
||||
AcpiOsPrintf ("%s: %p\n",
|
||||
AcpiOsPrintf ("%s (Node %p)\n",
|
||||
AcpiUtGetTypeName (((ACPI_NAMESPACE_NODE *) SourceDesc)->Type),
|
||||
SourceDesc);
|
||||
return_VOID;
|
||||
|
@ -263,13 +280,12 @@ AcpiExDoDebugObject (
|
|||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
AcpiOsPrintf ("[0x%.2X] \"%s\"\n",
|
||||
SourceDesc->String.Length, SourceDesc->String.Pointer);
|
||||
AcpiOsPrintf ("\"%s\"\n", SourceDesc->String.Pointer);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
|
||||
AcpiOsPrintf ("[Contains 0x%.2X Elements]\n",
|
||||
AcpiOsPrintf ("(Contains 0x%.2X Elements):\n",
|
||||
SourceDesc->Package.Count);
|
||||
|
||||
/* Output the entire contents of the package */
|
||||
|
@ -277,7 +293,7 @@ AcpiExDoDebugObject (
|
|||
for (i = 0; i < SourceDesc->Package.Count; i++)
|
||||
{
|
||||
AcpiExDoDebugObject (SourceDesc->Package.Elements[i],
|
||||
Level+4, i+1);
|
||||
Level + 4, i + 1);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -338,7 +354,7 @@ AcpiExDoDebugObject (
|
|||
default:
|
||||
|
||||
AcpiExDoDebugObject ((SourceDesc->Reference.Node)->Object,
|
||||
Level+4, 0);
|
||||
Level + 4, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -348,9 +364,11 @@ AcpiExDoDebugObject (
|
|||
if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Object) ==
|
||||
ACPI_DESC_TYPE_NAMED)
|
||||
{
|
||||
AcpiExDoDebugObject (((ACPI_NAMESPACE_NODE *)
|
||||
SourceDesc->Reference.Object)->Object,
|
||||
Level+4, 0);
|
||||
/* Reference object is a namespace node */
|
||||
|
||||
AcpiExDoDebugObject (ACPI_CAST_PTR (ACPI_OPERAND_OBJECT,
|
||||
SourceDesc->Reference.Object),
|
||||
Level + 4, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -375,8 +393,15 @@ AcpiExDoDebugObject (
|
|||
case ACPI_TYPE_PACKAGE:
|
||||
|
||||
AcpiOsPrintf ("Package[%u] = ", Value);
|
||||
if (!(*SourceDesc->Reference.Where))
|
||||
{
|
||||
AcpiOsPrintf ("[Uninitialized Package Element]\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiExDoDebugObject (*SourceDesc->Reference.Where,
|
||||
Level+4, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -391,7 +416,7 @@ AcpiExDoDebugObject (
|
|||
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("%p\n", SourceDesc);
|
||||
AcpiOsPrintf ("(Descriptor %p)\n", SourceDesc);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -399,362 +424,3 @@ AcpiExDoDebugObject (
|
|||
return_VOID;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExInterpreterTraceEnabled
|
||||
*
|
||||
* PARAMETERS: Name - Whether method name should be matched,
|
||||
* this should be checked before starting
|
||||
* the tracer
|
||||
*
|
||||
* RETURN: TRUE if interpreter trace is enabled.
|
||||
*
|
||||
* DESCRIPTION: Check whether interpreter trace is enabled
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static BOOLEAN
|
||||
AcpiExInterpreterTraceEnabled (
|
||||
char *Name)
|
||||
{
|
||||
|
||||
/* Check if tracing is enabled */
|
||||
|
||||
if (!(AcpiGbl_TraceFlags & ACPI_TRACE_ENABLED))
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if tracing is filtered:
|
||||
*
|
||||
* 1. If the tracer is started, AcpiGbl_TraceMethodObject should have
|
||||
* been filled by the trace starter
|
||||
* 2. If the tracer is not started, AcpiGbl_TraceMethodName should be
|
||||
* matched if it is specified
|
||||
* 3. If the tracer is oneshot style, AcpiGbl_TraceMethodName should
|
||||
* not be cleared by the trace stopper during the first match
|
||||
*/
|
||||
if (AcpiGbl_TraceMethodObject)
|
||||
{
|
||||
return (TRUE);
|
||||
}
|
||||
if (Name &&
|
||||
(AcpiGbl_TraceMethodName &&
|
||||
strcmp (AcpiGbl_TraceMethodName, Name)))
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
if ((AcpiGbl_TraceFlags & ACPI_TRACE_ONESHOT) &&
|
||||
!AcpiGbl_TraceMethodName)
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExGetTraceEventName
|
||||
*
|
||||
* PARAMETERS: Type - Trace event type
|
||||
*
|
||||
* RETURN: Trace event name.
|
||||
*
|
||||
* DESCRIPTION: Used to obtain the full trace event name.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef ACPI_DEBUG_OUTPUT
|
||||
|
||||
static const char *
|
||||
AcpiExGetTraceEventName (
|
||||
ACPI_TRACE_EVENT_TYPE Type)
|
||||
{
|
||||
switch (Type)
|
||||
{
|
||||
case ACPI_TRACE_AML_METHOD:
|
||||
|
||||
return "Method";
|
||||
|
||||
case ACPI_TRACE_AML_OPCODE:
|
||||
|
||||
return "Opcode";
|
||||
|
||||
case ACPI_TRACE_AML_REGION:
|
||||
|
||||
return "Region";
|
||||
|
||||
default:
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExTracePoint
|
||||
*
|
||||
* PARAMETERS: Type - Trace event type
|
||||
* Begin - TRUE if before execution
|
||||
* Aml - Executed AML address
|
||||
* Pathname - Object path
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Internal interpreter execution trace.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExTracePoint (
|
||||
ACPI_TRACE_EVENT_TYPE Type,
|
||||
BOOLEAN Begin,
|
||||
UINT8 *Aml,
|
||||
char *Pathname)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_NAME (ExTracePoint);
|
||||
|
||||
|
||||
if (Pathname)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_TRACE_POINT,
|
||||
"%s %s [0x%p:%s] execution.\n",
|
||||
AcpiExGetTraceEventName (Type), Begin ? "Begin" : "End",
|
||||
Aml, Pathname));
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_TRACE_POINT,
|
||||
"%s %s [0x%p] execution.\n",
|
||||
AcpiExGetTraceEventName (Type), Begin ? "Begin" : "End",
|
||||
Aml));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExStartTraceMethod
|
||||
*
|
||||
* PARAMETERS: MethodNode - Node of the method
|
||||
* ObjDesc - The method object
|
||||
* WalkState - current state, NULL if not yet executing
|
||||
* a method.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Start control method execution trace
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExStartTraceMethod (
|
||||
ACPI_NAMESPACE_NODE *MethodNode,
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
char *Pathname = NULL;
|
||||
BOOLEAN Enabled = FALSE;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (ExStartTraceMethod);
|
||||
|
||||
|
||||
if (MethodNode)
|
||||
{
|
||||
Pathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
|
||||
}
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
Enabled = AcpiExInterpreterTraceEnabled (Pathname);
|
||||
if (Enabled && !AcpiGbl_TraceMethodObject)
|
||||
{
|
||||
AcpiGbl_TraceMethodObject = ObjDesc;
|
||||
AcpiGbl_OriginalDbgLevel = AcpiDbgLevel;
|
||||
AcpiGbl_OriginalDbgLayer = AcpiDbgLayer;
|
||||
AcpiDbgLevel = ACPI_TRACE_LEVEL_ALL;
|
||||
AcpiDbgLayer = ACPI_TRACE_LAYER_ALL;
|
||||
|
||||
if (AcpiGbl_TraceDbgLevel)
|
||||
{
|
||||
AcpiDbgLevel = AcpiGbl_TraceDbgLevel;
|
||||
}
|
||||
if (AcpiGbl_TraceDbgLayer)
|
||||
{
|
||||
AcpiDbgLayer = AcpiGbl_TraceDbgLayer;
|
||||
}
|
||||
}
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
|
||||
Exit:
|
||||
if (Enabled)
|
||||
{
|
||||
ACPI_TRACE_POINT (ACPI_TRACE_AML_METHOD, TRUE,
|
||||
ObjDesc ? ObjDesc->Method.AmlStart : NULL, Pathname);
|
||||
}
|
||||
if (Pathname)
|
||||
{
|
||||
ACPI_FREE (Pathname);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExStopTraceMethod
|
||||
*
|
||||
* PARAMETERS: MethodNode - Node of the method
|
||||
* ObjDesc - The method object
|
||||
* WalkState - current state, NULL if not yet executing
|
||||
* a method.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Stop control method execution trace
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExStopTraceMethod (
|
||||
ACPI_NAMESPACE_NODE *MethodNode,
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
char *Pathname = NULL;
|
||||
BOOLEAN Enabled;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (ExStopTraceMethod);
|
||||
|
||||
|
||||
if (MethodNode)
|
||||
{
|
||||
Pathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
|
||||
}
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto ExitPath;
|
||||
}
|
||||
|
||||
Enabled = AcpiExInterpreterTraceEnabled (NULL);
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
|
||||
if (Enabled)
|
||||
{
|
||||
ACPI_TRACE_POINT (ACPI_TRACE_AML_METHOD, FALSE,
|
||||
ObjDesc ? ObjDesc->Method.AmlStart : NULL, Pathname);
|
||||
}
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto ExitPath;
|
||||
}
|
||||
|
||||
/* Check whether the tracer should be stopped */
|
||||
|
||||
if (AcpiGbl_TraceMethodObject == ObjDesc)
|
||||
{
|
||||
/* Disable further tracing if type is one-shot */
|
||||
|
||||
if (AcpiGbl_TraceFlags & ACPI_TRACE_ONESHOT)
|
||||
{
|
||||
AcpiGbl_TraceMethodName = NULL;
|
||||
}
|
||||
|
||||
AcpiDbgLevel = AcpiGbl_OriginalDbgLevel;
|
||||
AcpiDbgLayer = AcpiGbl_OriginalDbgLayer;
|
||||
AcpiGbl_TraceMethodObject = NULL;
|
||||
}
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
|
||||
ExitPath:
|
||||
if (Pathname)
|
||||
{
|
||||
ACPI_FREE (Pathname);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExStartTraceOpcode
|
||||
*
|
||||
* PARAMETERS: Op - The parser opcode object
|
||||
* WalkState - current state, NULL if not yet executing
|
||||
* a method.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Start opcode execution trace
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExStartTraceOpcode (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_NAME (ExStartTraceOpcode);
|
||||
|
||||
|
||||
if (AcpiExInterpreterTraceEnabled (NULL) &&
|
||||
(AcpiGbl_TraceFlags & ACPI_TRACE_OPCODE))
|
||||
{
|
||||
ACPI_TRACE_POINT (ACPI_TRACE_AML_OPCODE, TRUE,
|
||||
Op->Common.Aml, Op->Common.AmlOpName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExStopTraceOpcode
|
||||
*
|
||||
* PARAMETERS: Op - The parser opcode object
|
||||
* WalkState - current state, NULL if not yet executing
|
||||
* a method.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Stop opcode execution trace
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExStopTraceOpcode (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_NAME (ExStopTraceOpcode);
|
||||
|
||||
|
||||
if (AcpiExInterpreterTraceEnabled (NULL) &&
|
||||
(AcpiGbl_TraceFlags & ACPI_TRACE_OPCODE))
|
||||
{
|
||||
ACPI_TRACE_POINT (ACPI_TRACE_AML_OPCODE, FALSE,
|
||||
Op->Common.Aml, Op->Common.AmlOpName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -525,7 +525,8 @@ AcpiExDumpObject (
|
|||
|
||||
case ACPI_EXD_BUFFER:
|
||||
|
||||
ACPI_DUMP_BUFFER (ObjDesc->Buffer.Pointer, ObjDesc->Buffer.Length);
|
||||
ACPI_DUMP_BUFFER (
|
||||
ObjDesc->Buffer.Pointer, ObjDesc->Buffer.Length);
|
||||
break;
|
||||
|
||||
case ACPI_EXD_PACKAGE:
|
||||
|
@ -544,7 +545,8 @@ AcpiExDumpObject (
|
|||
case ACPI_EXD_REFERENCE:
|
||||
|
||||
ReferenceName = AcpiUtGetReferenceName (ObjDesc);
|
||||
AcpiExOutString ("Class Name", ACPI_CAST_PTR (char, ReferenceName));
|
||||
AcpiExOutString (
|
||||
"Class Name", ACPI_CAST_PTR (char, ReferenceName));
|
||||
AcpiExDumpReferenceObj (ObjDesc);
|
||||
break;
|
||||
|
||||
|
@ -573,7 +575,8 @@ AcpiExDumpObject (
|
|||
|
||||
if ((Next == Start) || (Next == Data))
|
||||
{
|
||||
AcpiOsPrintf ("\n**** Error: Object list appears to be circular linked");
|
||||
AcpiOsPrintf (
|
||||
"\n**** Error: Object list appears to be circular linked");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -591,7 +594,8 @@ AcpiExDumpObject (
|
|||
if (Next)
|
||||
{
|
||||
AcpiOsPrintf ("(%s %2.2X)",
|
||||
AcpiUtGetObjectTypeName (Next), Next->Common.Type);
|
||||
AcpiUtGetObjectTypeName (Next),
|
||||
Next->AddressSpace.SpaceId);
|
||||
|
||||
while (Next->AddressSpace.Next)
|
||||
{
|
||||
|
@ -603,11 +607,13 @@ AcpiExDumpObject (
|
|||
|
||||
Next = Next->AddressSpace.Next;
|
||||
AcpiOsPrintf ("->%p(%s %2.2X)", Next,
|
||||
AcpiUtGetObjectTypeName (Next), Next->Common.Type);
|
||||
AcpiUtGetObjectTypeName (Next),
|
||||
Next->AddressSpace.SpaceId);
|
||||
|
||||
if ((Next == Start) || (Next == Data))
|
||||
{
|
||||
AcpiOsPrintf ("\n**** Error: Handler list appears to be circular linked");
|
||||
AcpiOsPrintf (
|
||||
"\n**** Error: Handler list appears to be circular linked");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -641,7 +647,8 @@ AcpiExDumpObject (
|
|||
|
||||
if ((Next == Start) || (Next == Data))
|
||||
{
|
||||
AcpiOsPrintf ("\n**** Error: Region list appears to be circular linked");
|
||||
AcpiOsPrintf (
|
||||
"\n**** Error: Region list appears to be circular linked");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -749,7 +756,8 @@ AcpiExDumpOperand (
|
|||
{
|
||||
case ACPI_TYPE_LOCAL_REFERENCE:
|
||||
|
||||
AcpiOsPrintf ("Reference: [%s] ", AcpiUtGetReferenceName (ObjDesc));
|
||||
AcpiOsPrintf ("Reference: [%s] ",
|
||||
AcpiUtGetReferenceName (ObjDesc));
|
||||
|
||||
switch (ObjDesc->Reference.Class)
|
||||
{
|
||||
|
@ -777,7 +785,8 @@ AcpiExDumpOperand (
|
|||
|
||||
case ACPI_REFCLASS_NAME:
|
||||
|
||||
AcpiOsPrintf ("- [%4.4s]\n", ObjDesc->Reference.Node->Name.Ascii);
|
||||
AcpiOsPrintf ("- [%4.4s]\n",
|
||||
ObjDesc->Reference.Node->Name.Ascii);
|
||||
break;
|
||||
|
||||
case ACPI_REFCLASS_ARG:
|
||||
|
@ -808,8 +817,8 @@ AcpiExDumpOperand (
|
|||
Length = 128;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("Buffer Contents: (displaying length 0x%.2X)\n",
|
||||
Length);
|
||||
AcpiOsPrintf (
|
||||
"Buffer Contents: (displaying length 0x%.2X)\n", Length);
|
||||
ACPI_DUMP_BUFFER (ObjDesc->Buffer.Pointer, Length);
|
||||
}
|
||||
break;
|
||||
|
@ -835,7 +844,8 @@ AcpiExDumpOperand (
|
|||
{
|
||||
for (Index = 0; Index < ObjDesc->Package.Count; Index++)
|
||||
{
|
||||
AcpiExDumpOperand (ObjDesc->Package.Elements[Index], Depth+1);
|
||||
AcpiExDumpOperand (
|
||||
ObjDesc->Package.Elements[Index], Depth + 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -888,7 +898,7 @@ AcpiExDumpOperand (
|
|||
ObjDesc->Field.BaseByteOffset,
|
||||
ObjDesc->Field.StartFieldBitOffset);
|
||||
|
||||
AcpiExDumpOperand (ObjDesc->Field.RegionObj, Depth+1);
|
||||
AcpiExDumpOperand (ObjDesc->Field.RegionObj, Depth + 1);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
||||
|
@ -914,7 +924,7 @@ AcpiExDumpOperand (
|
|||
}
|
||||
else
|
||||
{
|
||||
AcpiExDumpOperand (ObjDesc->BufferField.BufferObj, Depth+1);
|
||||
AcpiExDumpOperand (ObjDesc->BufferField.BufferObj, Depth + 1);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1214,7 +1224,8 @@ AcpiExDumpPackageObj (
|
|||
AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length);
|
||||
if (ObjDesc->Buffer.Length)
|
||||
{
|
||||
AcpiUtDebugDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
|
||||
AcpiUtDebugDumpBuffer (
|
||||
ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
|
||||
ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT);
|
||||
}
|
||||
else
|
||||
|
@ -1230,7 +1241,8 @@ AcpiExDumpPackageObj (
|
|||
|
||||
for (i = 0; i < ObjDesc->Package.Count; i++)
|
||||
{
|
||||
AcpiExDumpPackageObj (ObjDesc->Package.Elements[i], Level+1, i);
|
||||
AcpiExDumpPackageObj (
|
||||
ObjDesc->Package.Elements[i], Level + 1, i);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1328,7 +1340,8 @@ DumpObject:
|
|||
ObjDesc = ObjDesc->Common.NextObject;
|
||||
if (ObjDesc->Common.Type > ACPI_TYPE_LOCAL_MAX)
|
||||
{
|
||||
AcpiOsPrintf ("Secondary object is not a known object type: %2.2X\n",
|
||||
AcpiOsPrintf (
|
||||
"Secondary object is not a known object type: %2.2X\n",
|
||||
ObjDesc->Common.Type);
|
||||
|
||||
return_VOID;
|
||||
|
|
|
@ -256,28 +256,31 @@ AcpiExReadDataFromField (
|
|||
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.
|
||||
* 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
|
||||
* Note: SMBus and GSBus protocol value is passed in upper 16-bits
|
||||
* of Function
|
||||
*/
|
||||
if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS)
|
||||
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)
|
||||
else if (ObjDesc->Field.RegionObj->Region.SpaceId ==
|
||||
ACPI_ADR_SPACE_GSBUS)
|
||||
{
|
||||
AccessorType = ObjDesc->Field.Attribute;
|
||||
Length = AcpiExGetSerialAccessLength (AccessorType,
|
||||
ObjDesc->Field.AccessLength);
|
||||
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)
|
||||
* Data[x-1]: (Bytes 2-x of the arbitrary length data buffer)
|
||||
*/
|
||||
Length += 2;
|
||||
Function = ACPI_READ | (AccessorType << 16);
|
||||
|
@ -301,8 +304,8 @@ AcpiExReadDataFromField (
|
|||
/* Call the region handler for the read */
|
||||
|
||||
Status = AcpiExAccessRegion (ObjDesc, 0,
|
||||
ACPI_CAST_PTR (UINT64, BufferDesc->Buffer.Pointer),
|
||||
Function);
|
||||
ACPI_CAST_PTR (UINT64, BufferDesc->Buffer.Pointer), Function);
|
||||
|
||||
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -317,7 +320,9 @@ AcpiExReadDataFromField (
|
|||
*
|
||||
* Note: Field.length is in bits.
|
||||
*/
|
||||
Length = (ACPI_SIZE) ACPI_ROUND_BITS_UP_TO_BYTES (ObjDesc->Field.BitLength);
|
||||
Length = (ACPI_SIZE) ACPI_ROUND_BITS_UP_TO_BYTES (
|
||||
ObjDesc->Field.BitLength);
|
||||
|
||||
if (Length > AcpiGbl_IntegerByteWidth)
|
||||
{
|
||||
/* Field is too large for an Integer, create a Buffer instead */
|
||||
|
@ -362,8 +367,9 @@ AcpiExReadDataFromField (
|
|||
|
||||
/* Perform the write */
|
||||
|
||||
Status = AcpiExAccessRegion (ObjDesc, 0,
|
||||
(UINT64 *) Buffer, ACPI_READ);
|
||||
Status = AcpiExAccessRegion (
|
||||
ObjDesc, 0, (UINT64 *) Buffer, ACPI_READ);
|
||||
|
||||
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
|
@ -468,42 +474,47 @@ AcpiExWriteDataToField (
|
|||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI))
|
||||
{
|
||||
/*
|
||||
* 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.
|
||||
* 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.
|
||||
* 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
|
||||
* 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",
|
||||
"SMBus/IPMI/GenericSerialBus write requires "
|
||||
"Buffer, found type %s",
|
||||
AcpiUtGetObjectTypeName (SourceDesc)));
|
||||
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS)
|
||||
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)
|
||||
else if (ObjDesc->Field.RegionObj->Region.SpaceId ==
|
||||
ACPI_ADR_SPACE_GSBUS)
|
||||
{
|
||||
AccessorType = ObjDesc->Field.Attribute;
|
||||
Length = AcpiExGetSerialAccessLength (AccessorType,
|
||||
ObjDesc->Field.AccessLength);
|
||||
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)
|
||||
* Data[x-1]: (Bytes 2-x of the arbitrary length data buffer)
|
||||
*/
|
||||
Length += 2;
|
||||
Function = ACPI_WRITE | (AccessorType << 16);
|
||||
|
@ -517,7 +528,8 @@ AcpiExWriteDataToField (
|
|||
if (SourceDesc->Buffer.Length < Length)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"SMBus/IPMI/GenericSerialBus write requires Buffer of length %u, found length %u",
|
||||
"SMBus/IPMI/GenericSerialBus write requires "
|
||||
"Buffer of length %u, found length %u",
|
||||
Length, SourceDesc->Buffer.Length));
|
||||
|
||||
return_ACPI_STATUS (AE_AML_BUFFER_LIMIT);
|
||||
|
@ -542,8 +554,8 @@ AcpiExWriteDataToField (
|
|||
* Perform the write (returns status and perhaps data in the
|
||||
* same buffer)
|
||||
*/
|
||||
Status = AcpiExAccessRegion (ObjDesc, 0,
|
||||
(UINT64 *) Buffer, Function);
|
||||
Status = AcpiExAccessRegion (
|
||||
ObjDesc, 0, (UINT64 *) Buffer, Function);
|
||||
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
|
||||
|
||||
*ResultDesc = BufferDesc;
|
||||
|
@ -579,8 +591,8 @@ AcpiExWriteDataToField (
|
|||
|
||||
/* Perform the write */
|
||||
|
||||
Status = AcpiExAccessRegion (ObjDesc, 0,
|
||||
(UINT64 *) Buffer, ACPI_WRITE);
|
||||
Status = AcpiExAccessRegion (
|
||||
ObjDesc, 0, (UINT64 *) Buffer, ACPI_WRITE);
|
||||
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
|
|
@ -192,7 +192,8 @@ AcpiExSetupRegion (
|
|||
|
||||
if (!AcpiIsValidSpaceId (SpaceId))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId));
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Invalid/unknown Address Space ID: 0x%2.2X", SpaceId));
|
||||
return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID);
|
||||
}
|
||||
|
||||
|
@ -270,7 +271,8 @@ AcpiExSetupRegion (
|
|||
* byte, and a field with Dword access specified.
|
||||
*/
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Field [%4.4s] access width (%u bytes) too large for region [%4.4s] (length %u)",
|
||||
"Field [%4.4s] access width (%u bytes) "
|
||||
"too large for region [%4.4s] (length %u)",
|
||||
AcpiUtGetNodeName (ObjDesc->CommonField.Node),
|
||||
ObjDesc->CommonField.AccessByteWidth,
|
||||
AcpiUtGetNodeName (RgnDesc->Region.Node),
|
||||
|
@ -282,7 +284,8 @@ AcpiExSetupRegion (
|
|||
* exceeds region length, indicate an error
|
||||
*/
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Field [%4.4s] Base+Offset+Width %u+%u+%u is beyond end of region [%4.4s] (length %u)",
|
||||
"Field [%4.4s] Base+Offset+Width %u+%u+%u "
|
||||
"is beyond end of region [%4.4s] (length %u)",
|
||||
AcpiUtGetNodeName (ObjDesc->CommonField.Node),
|
||||
ObjDesc->CommonField.BaseByteOffset,
|
||||
FieldDatumByteOffset, ObjDesc->CommonField.AccessByteWidth,
|
||||
|
@ -584,8 +587,8 @@ AcpiExFieldDatumIo (
|
|||
* For simple RegionFields, we just directly access the owning
|
||||
* Operation Region.
|
||||
*/
|
||||
Status = AcpiExAccessRegion (ObjDesc, FieldDatumByteOffset, Value,
|
||||
ReadWrite);
|
||||
Status = AcpiExAccessRegion (
|
||||
ObjDesc, FieldDatumByteOffset, Value, ReadWrite);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
||||
|
@ -608,8 +611,7 @@ AcpiExFieldDatumIo (
|
|||
FieldDatumByteOffset));
|
||||
|
||||
Status = AcpiExInsertIntoField (ObjDesc->IndexField.IndexObj,
|
||||
&FieldDatumByteOffset,
|
||||
sizeof (FieldDatumByteOffset));
|
||||
&FieldDatumByteOffset, sizeof (FieldDatumByteOffset));
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -622,8 +624,8 @@ AcpiExFieldDatumIo (
|
|||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Read from Data Register\n"));
|
||||
|
||||
Status = AcpiExExtractFromField (ObjDesc->IndexField.DataObj,
|
||||
Value, sizeof (UINT64));
|
||||
Status = AcpiExExtractFromField (
|
||||
ObjDesc->IndexField.DataObj, Value, sizeof (UINT64));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -633,8 +635,8 @@ AcpiExFieldDatumIo (
|
|||
"Write to Data Register: Value %8.8X%8.8X\n",
|
||||
ACPI_FORMAT_UINT64 (*Value)));
|
||||
|
||||
Status = AcpiExInsertIntoField (ObjDesc->IndexField.DataObj,
|
||||
Value, sizeof (UINT64));
|
||||
Status = AcpiExInsertIntoField (
|
||||
ObjDesc->IndexField.DataObj, Value, sizeof (UINT64));
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -722,8 +724,8 @@ AcpiExWriteWithUpdateRule (
|
|||
* Read the current contents of the byte/word/dword containing
|
||||
* the field, and merge with the new field value.
|
||||
*/
|
||||
Status = AcpiExFieldDatumIo (ObjDesc, FieldDatumByteOffset,
|
||||
&CurrentValue, ACPI_READ);
|
||||
Status = AcpiExFieldDatumIo (
|
||||
ObjDesc, FieldDatumByteOffset, &CurrentValue, ACPI_READ);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -751,13 +753,15 @@ AcpiExWriteWithUpdateRule (
|
|||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Unknown UpdateRule value: 0x%X",
|
||||
(ObjDesc->CommonField.FieldFlags & AML_FIELD_UPDATE_RULE_MASK)));
|
||||
(ObjDesc->CommonField.FieldFlags &
|
||||
AML_FIELD_UPDATE_RULE_MASK)));
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
|
||||
}
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Mask %8.8X%8.8X, DatumOffset %X, Width %X, Value %8.8X%8.8X, MergedValue %8.8X%8.8X\n",
|
||||
"Mask %8.8X%8.8X, DatumOffset %X, Width %X, "
|
||||
"Value %8.8X%8.8X, MergedValue %8.8X%8.8X\n",
|
||||
ACPI_FORMAT_UINT64 (Mask),
|
||||
FieldDatumByteOffset,
|
||||
ObjDesc->CommonField.AccessByteWidth,
|
||||
|
@ -766,8 +770,8 @@ AcpiExWriteWithUpdateRule (
|
|||
|
||||
/* Write the merged value */
|
||||
|
||||
Status = AcpiExFieldDatumIo (ObjDesc, FieldDatumByteOffset,
|
||||
&MergedValue, ACPI_WRITE);
|
||||
Status = AcpiExFieldDatumIo (
|
||||
ObjDesc, FieldDatumByteOffset, &MergedValue, ACPI_WRITE);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
@ -878,8 +882,8 @@ AcpiExExtractFromField (
|
|||
/* Get next input datum from the field */
|
||||
|
||||
FieldOffset += ObjDesc->CommonField.AccessByteWidth;
|
||||
Status = AcpiExFieldDatumIo (ObjDesc, FieldOffset,
|
||||
&RawDatum, ACPI_READ);
|
||||
Status = AcpiExFieldDatumIo (
|
||||
ObjDesc, FieldOffset, &RawDatum, ACPI_READ);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -977,6 +981,7 @@ AcpiExInsertIntoField (
|
|||
NewBuffer = NULL;
|
||||
RequiredLength = ACPI_ROUND_BITS_UP_TO_BYTES (
|
||||
ObjDesc->CommonField.BitLength);
|
||||
|
||||
/*
|
||||
* We must have a buffer that is at least as long as the field
|
||||
* we are writing to. This is because individual fields are
|
||||
|
@ -1054,8 +1059,8 @@ AcpiExInsertIntoField (
|
|||
/* Write merged datum to the target field */
|
||||
|
||||
MergedDatum &= Mask;
|
||||
Status = AcpiExWriteWithUpdateRule (ObjDesc, Mask,
|
||||
MergedDatum, FieldOffset);
|
||||
Status = AcpiExWriteWithUpdateRule (
|
||||
ObjDesc, Mask, MergedDatum, FieldOffset);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Exit;
|
||||
|
@ -1112,8 +1117,8 @@ AcpiExInsertIntoField (
|
|||
/* Write the last datum to the field */
|
||||
|
||||
MergedDatum &= Mask;
|
||||
Status = AcpiExWriteWithUpdateRule (ObjDesc,
|
||||
Mask, MergedDatum, FieldOffset);
|
||||
Status = AcpiExWriteWithUpdateRule (
|
||||
ObjDesc, Mask, MergedDatum, FieldOffset);
|
||||
|
||||
Exit:
|
||||
/* Free temporary buffer if we used one */
|
||||
|
|
|
@ -180,9 +180,9 @@ AcpiExGetObjectReference (
|
|||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown Reference Class 0x%2.2X",
|
||||
ACPI_ERROR ((AE_INFO, "Invalid Reference Class 0x%2.2X",
|
||||
ObjDesc->Reference.Class));
|
||||
return_ACPI_STATUS (AE_AML_INTERNAL);
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -338,6 +338,7 @@ AcpiExDoConcatenate (
|
|||
ACPI_OPERAND_OBJECT *LocalOperand1 = Operand1;
|
||||
ACPI_OPERAND_OBJECT *ReturnDesc;
|
||||
char *NewBuf;
|
||||
const char *TypeString;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
|
@ -359,9 +360,42 @@ AcpiExDoConcatenate (
|
|||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
/*
|
||||
* Per the ACPI spec, Concatenate only supports int/str/buf.
|
||||
* However, we support all objects here as an extension.
|
||||
* This improves the usefulness of the Printf() macro.
|
||||
* 12/2015.
|
||||
*/
|
||||
switch (Operand1->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_INTEGER:
|
||||
case ACPI_TYPE_STRING:
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
Status = AcpiExConvertToString (Operand1, &LocalOperand1,
|
||||
ACPI_IMPLICIT_CONVERT_HEX);
|
||||
Status = AcpiExConvertToString (
|
||||
Operand1, &LocalOperand1, ACPI_IMPLICIT_CONVERT_HEX);
|
||||
break;
|
||||
|
||||
default:
|
||||
/*
|
||||
* Just emit a string containing the object type.
|
||||
*/
|
||||
TypeString = AcpiUtGetTypeName (Operand1->Common.Type);
|
||||
|
||||
LocalOperand1 = AcpiUtCreateStringObject (
|
||||
((ACPI_SIZE) strlen (TypeString) + 9)); /* 9 For "[Object]" */
|
||||
if (!LocalOperand1)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
strcpy (LocalOperand1->String.Pointer, "[");
|
||||
strcat (LocalOperand1->String.Pointer, TypeString);
|
||||
strcat (LocalOperand1->String.Pointer, " Object]");
|
||||
Status = AE_OK;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
@ -401,8 +435,8 @@ AcpiExDoConcatenate (
|
|||
/* Result of two Integers is a Buffer */
|
||||
/* Need enough buffer space for two integers */
|
||||
|
||||
ReturnDesc = AcpiUtCreateBufferObject ((ACPI_SIZE)
|
||||
ACPI_MUL_2 (AcpiGbl_IntegerByteWidth));
|
||||
ReturnDesc = AcpiUtCreateBufferObject (
|
||||
(ACPI_SIZE) ACPI_MUL_2 (AcpiGbl_IntegerByteWidth));
|
||||
if (!ReturnDesc)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
|
@ -419,8 +453,7 @@ AcpiExDoConcatenate (
|
|||
/* Copy the second integer (LSB first) after the first */
|
||||
|
||||
memcpy (NewBuf + AcpiGbl_IntegerByteWidth,
|
||||
&LocalOperand1->Integer.Value,
|
||||
AcpiGbl_IntegerByteWidth);
|
||||
&LocalOperand1->Integer.Value, AcpiGbl_IntegerByteWidth);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
@ -441,8 +474,7 @@ AcpiExDoConcatenate (
|
|||
/* Concatenate the strings */
|
||||
|
||||
strcpy (NewBuf, Operand0->String.Pointer);
|
||||
strcpy (NewBuf + Operand0->String.Length,
|
||||
LocalOperand1->String.Pointer);
|
||||
strcat (NewBuf, LocalOperand1->String.Pointer);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
@ -708,8 +740,8 @@ AcpiExDoLogicalOp (
|
|||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
Status = AcpiExConvertToString (Operand1, &LocalOperand1,
|
||||
ACPI_IMPLICIT_CONVERT_HEX);
|
||||
Status = AcpiExConvertToString (
|
||||
Operand1, &LocalOperand1, ACPI_IMPLICIT_CONVERT_HEX);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
|
|
@ -281,8 +281,7 @@ AcpiExAcquireMutexObject (
|
|||
}
|
||||
else
|
||||
{
|
||||
Status = AcpiExSystemWaitMutex (ObjDesc->Mutex.OsMutex,
|
||||
Timeout);
|
||||
Status = AcpiExSystemWaitMutex (ObjDesc->Mutex.OsMutex, Timeout);
|
||||
}
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
|
@ -345,33 +344,48 @@ AcpiExAcquireMutex (
|
|||
}
|
||||
|
||||
/*
|
||||
* Current sync level must be less than or equal to the sync level of the
|
||||
* mutex. This mechanism provides some deadlock prevention
|
||||
* Current sync level must be less than or equal to the sync level
|
||||
* of the mutex. This mechanism provides some deadlock prevention.
|
||||
*/
|
||||
if (WalkState->Thread->CurrentSyncLevel > ObjDesc->Mutex.SyncLevel)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Cannot acquire Mutex [%4.4s], current SyncLevel is too large (%u)",
|
||||
"Cannot acquire Mutex [%4.4s], "
|
||||
"current SyncLevel is too large (%u)",
|
||||
AcpiUtGetNodeName (ObjDesc->Mutex.Node),
|
||||
WalkState->Thread->CurrentSyncLevel));
|
||||
return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Acquiring: Mutex SyncLevel %u, Thread SyncLevel %u, "
|
||||
"Depth %u TID %p\n",
|
||||
ObjDesc->Mutex.SyncLevel, WalkState->Thread->CurrentSyncLevel,
|
||||
ObjDesc->Mutex.AcquisitionDepth, WalkState->Thread));
|
||||
|
||||
Status = AcpiExAcquireMutexObject ((UINT16) TimeDesc->Integer.Value,
|
||||
ObjDesc, WalkState->Thread->ThreadId);
|
||||
|
||||
if (ACPI_SUCCESS (Status) && ObjDesc->Mutex.AcquisitionDepth == 1)
|
||||
{
|
||||
/* Save Thread object, original/current sync levels */
|
||||
|
||||
ObjDesc->Mutex.OwnerThread = WalkState->Thread;
|
||||
ObjDesc->Mutex.OriginalSyncLevel = WalkState->Thread->CurrentSyncLevel;
|
||||
WalkState->Thread->CurrentSyncLevel = ObjDesc->Mutex.SyncLevel;
|
||||
ObjDesc->Mutex.OriginalSyncLevel =
|
||||
WalkState->Thread->CurrentSyncLevel;
|
||||
WalkState->Thread->CurrentSyncLevel =
|
||||
ObjDesc->Mutex.SyncLevel;
|
||||
|
||||
/* Link the mutex to the current thread for force-unlock at method exit */
|
||||
|
||||
AcpiExLinkMutex (ObjDesc, WalkState->Thread);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Acquired: Mutex SyncLevel %u, Thread SyncLevel %u, Depth %u\n",
|
||||
ObjDesc->Mutex.SyncLevel, WalkState->Thread->CurrentSyncLevel,
|
||||
ObjDesc->Mutex.AcquisitionDepth));
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
@ -467,9 +481,9 @@ AcpiExReleaseMutex (
|
|||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
UINT8 PreviousSyncLevel;
|
||||
ACPI_THREAD_STATE *OwnerThread;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (ExReleaseMutex);
|
||||
|
@ -527,7 +541,8 @@ AcpiExReleaseMutex (
|
|||
if (ObjDesc->Mutex.SyncLevel != OwnerThread->CurrentSyncLevel)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Cannot release Mutex [%4.4s], SyncLevel mismatch: mutex %u current %u",
|
||||
"Cannot release Mutex [%4.4s], SyncLevel mismatch: "
|
||||
"mutex %u current %u",
|
||||
AcpiUtGetNodeName (ObjDesc->Mutex.Node),
|
||||
ObjDesc->Mutex.SyncLevel, WalkState->Thread->CurrentSyncLevel));
|
||||
return_ACPI_STATUS (AE_AML_MUTEX_ORDER);
|
||||
|
@ -541,6 +556,13 @@ AcpiExReleaseMutex (
|
|||
PreviousSyncLevel =
|
||||
OwnerThread->AcquiredMutexList->Mutex.OriginalSyncLevel;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Releasing: Object SyncLevel %u, Thread SyncLevel %u, "
|
||||
"Prev SyncLevel %u, Depth %u TID %p\n",
|
||||
ObjDesc->Mutex.SyncLevel, WalkState->Thread->CurrentSyncLevel,
|
||||
PreviousSyncLevel, ObjDesc->Mutex.AcquisitionDepth,
|
||||
WalkState->Thread));
|
||||
|
||||
Status = AcpiExReleaseMutexObject (ObjDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
|
@ -554,6 +576,12 @@ AcpiExReleaseMutex (
|
|||
OwnerThread->CurrentSyncLevel = PreviousSyncLevel;
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Released: Object SyncLevel %u, Thread SyncLevel, %u, "
|
||||
"Prev SyncLevel %u, Depth %u\n",
|
||||
ObjDesc->Mutex.SyncLevel, WalkState->Thread->CurrentSyncLevel,
|
||||
PreviousSyncLevel, ObjDesc->Mutex.AcquisitionDepth));
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
@ -584,7 +612,7 @@ AcpiExReleaseAllMutexes (
|
|||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (ExReleaseAllMutexes);
|
||||
ACPI_FUNCTION_TRACE (ExReleaseAllMutexes);
|
||||
|
||||
|
||||
/* Traverse the list of owned mutexes, releasing each one */
|
||||
|
@ -592,14 +620,10 @@ AcpiExReleaseAllMutexes (
|
|||
while (Next)
|
||||
{
|
||||
ObjDesc = Next;
|
||||
Next = ObjDesc->Mutex.Next;
|
||||
|
||||
ObjDesc->Mutex.Prev = NULL;
|
||||
ObjDesc->Mutex.Next = NULL;
|
||||
ObjDesc->Mutex.AcquisitionDepth = 0;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Force-releasing held mutex: %p\n", ObjDesc));
|
||||
"Mutex [%4.4s] force-release, SyncLevel %u Depth %u\n",
|
||||
ObjDesc->Mutex.Node->Name.Ascii, ObjDesc->Mutex.SyncLevel,
|
||||
ObjDesc->Mutex.AcquisitionDepth));
|
||||
|
||||
/* Release the mutex, special case for Global Lock */
|
||||
|
||||
|
@ -614,13 +638,20 @@ AcpiExReleaseAllMutexes (
|
|||
AcpiOsReleaseMutex (ObjDesc->Mutex.OsMutex);
|
||||
}
|
||||
|
||||
/* Mark mutex unowned */
|
||||
|
||||
ObjDesc->Mutex.OwnerThread = NULL;
|
||||
ObjDesc->Mutex.ThreadId = 0;
|
||||
|
||||
/* Update Thread SyncLevel (Last mutex is the important one) */
|
||||
|
||||
Thread->CurrentSyncLevel = ObjDesc->Mutex.OriginalSyncLevel;
|
||||
|
||||
/* Mark mutex unowned */
|
||||
|
||||
Next = ObjDesc->Mutex.Next;
|
||||
|
||||
ObjDesc->Mutex.Prev = NULL;
|
||||
ObjDesc->Mutex.Next = NULL;
|
||||
ObjDesc->Mutex.AcquisitionDepth = 0;
|
||||
ObjDesc->Mutex.OwnerThread = NULL;
|
||||
ObjDesc->Mutex.ThreadId = 0;
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
|
|
@ -232,6 +232,7 @@ AcpiExAllocateNameString (
|
|||
return_PTR (NameString);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExNameSegment
|
||||
|
@ -261,8 +262,8 @@ AcpiExNameSegment (
|
|||
|
||||
|
||||
/*
|
||||
* If first character is a digit, then we know that we aren't looking at a
|
||||
* valid name segment
|
||||
* If first character is a digit, then we know that we aren't looking
|
||||
* at a valid name segment
|
||||
*/
|
||||
CharBuf[0] = *AmlAddress;
|
||||
|
||||
|
@ -466,7 +467,8 @@ AcpiExGetNameString (
|
|||
AmlAddress++;
|
||||
NumSegments = *AmlAddress;
|
||||
|
||||
NameString = AcpiExAllocateNameString (PrefixCount, NumSegments);
|
||||
NameString = AcpiExAllocateNameString (
|
||||
PrefixCount, NumSegments);
|
||||
if (!NameString)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
|
|
|
@ -581,28 +581,30 @@ AcpiExOpcode_1A_1T_1R (
|
|||
*/
|
||||
case AML_COPY_OP: /* Copy (Source, Target) */
|
||||
|
||||
Status = AcpiUtCopyIobjectToIobject (Operand[0], &ReturnDesc,
|
||||
WalkState);
|
||||
Status = AcpiUtCopyIobjectToIobject (
|
||||
Operand[0], &ReturnDesc, WalkState);
|
||||
break;
|
||||
|
||||
case AML_TO_DECSTRING_OP: /* ToDecimalString (Data, Result) */
|
||||
|
||||
Status = AcpiExConvertToString (Operand[0], &ReturnDesc,
|
||||
ACPI_EXPLICIT_CONVERT_DECIMAL);
|
||||
Status = AcpiExConvertToString (
|
||||
Operand[0], &ReturnDesc, ACPI_EXPLICIT_CONVERT_DECIMAL);
|
||||
if (ReturnDesc == Operand[0])
|
||||
{
|
||||
/* No conversion performed, add ref to handle return value */
|
||||
|
||||
AcpiUtAddReference (ReturnDesc);
|
||||
}
|
||||
break;
|
||||
|
||||
case AML_TO_HEXSTRING_OP: /* ToHexString (Data, Result) */
|
||||
|
||||
Status = AcpiExConvertToString (Operand[0], &ReturnDesc,
|
||||
ACPI_EXPLICIT_CONVERT_HEX);
|
||||
Status = AcpiExConvertToString (
|
||||
Operand[0], &ReturnDesc, ACPI_EXPLICIT_CONVERT_HEX);
|
||||
if (ReturnDesc == Operand[0])
|
||||
{
|
||||
/* No conversion performed, add ref to handle return value */
|
||||
|
||||
AcpiUtAddReference (ReturnDesc);
|
||||
}
|
||||
break;
|
||||
|
@ -613,17 +615,19 @@ AcpiExOpcode_1A_1T_1R (
|
|||
if (ReturnDesc == Operand[0])
|
||||
{
|
||||
/* No conversion performed, add ref to handle return value */
|
||||
|
||||
AcpiUtAddReference (ReturnDesc);
|
||||
}
|
||||
break;
|
||||
|
||||
case AML_TO_INTEGER_OP: /* ToInteger (Data, Result) */
|
||||
|
||||
Status = AcpiExConvertToInteger (Operand[0], &ReturnDesc,
|
||||
ACPI_ANY_BASE);
|
||||
Status = AcpiExConvertToInteger (
|
||||
Operand[0], &ReturnDesc, ACPI_ANY_BASE);
|
||||
if (ReturnDesc == Operand[0])
|
||||
{
|
||||
/* No conversion performed, add ref to handle return value */
|
||||
|
||||
AcpiUtAddReference (ReturnDesc);
|
||||
}
|
||||
break;
|
||||
|
@ -774,11 +778,11 @@ AcpiExOpcode_1A_0T_1R (
|
|||
*/
|
||||
if (WalkState->Opcode == AML_INCREMENT_OP)
|
||||
{
|
||||
ReturnDesc->Integer.Value = TempDesc->Integer.Value +1;
|
||||
ReturnDesc->Integer.Value = TempDesc->Integer.Value + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ReturnDesc->Integer.Value = TempDesc->Integer.Value -1;
|
||||
ReturnDesc->Integer.Value = TempDesc->Integer.Value - 1;
|
||||
}
|
||||
|
||||
/* Finished with this Integer object */
|
||||
|
@ -792,7 +796,7 @@ AcpiExOpcode_1A_0T_1R (
|
|||
Status = AcpiExStore (ReturnDesc, Operand[0], WalkState);
|
||||
break;
|
||||
|
||||
case AML_TYPE_OP: /* ObjectType (SourceObject) */
|
||||
case AML_OBJECT_TYPE_OP: /* ObjectType (SourceObject) */
|
||||
/*
|
||||
* Note: The operand is not resolved at this point because we want to
|
||||
* get the associated object, not its value. For example, we don't
|
||||
|
@ -826,8 +830,8 @@ AcpiExOpcode_1A_0T_1R (
|
|||
|
||||
/* Get the base object */
|
||||
|
||||
Status = AcpiExResolveMultiple (WalkState,
|
||||
Operand[0], &Type, &TempDesc);
|
||||
Status = AcpiExResolveMultiple (
|
||||
WalkState, Operand[0], &Type, &TempDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
|
@ -873,8 +877,10 @@ AcpiExOpcode_1A_0T_1R (
|
|||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Operand must be Buffer/Integer/String/Package - found type %s",
|
||||
"Operand must be Buffer/Integer/String/Package"
|
||||
" - found type %s",
|
||||
AcpiUtGetTypeName (Type)));
|
||||
|
||||
Status = AE_AML_OPERAND_TYPE;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
@ -899,7 +905,8 @@ AcpiExOpcode_1A_0T_1R (
|
|||
|
||||
case AML_REF_OF_OP: /* RefOf (SourceObject) */
|
||||
|
||||
Status = AcpiExGetObjectReference (Operand[0], &ReturnDesc, WalkState);
|
||||
Status = AcpiExGetObjectReference (
|
||||
Operand[0], &ReturnDesc, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
|
@ -1097,6 +1104,7 @@ AcpiExOpcode_1A_0T_1R (
|
|||
ACPI_ERROR ((AE_INFO,
|
||||
"Unknown Index TargetType 0x%X in reference object %p",
|
||||
Operand[0]->Reference.TargetType, Operand[0]));
|
||||
|
||||
Status = AE_AML_OPERAND_TYPE;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
@ -1127,8 +1135,8 @@ AcpiExOpcode_1A_0T_1R (
|
|||
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
||||
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
||||
|
||||
Status = AcpiExReadDataFromField (WalkState,
|
||||
ReturnDesc, &TempDesc);
|
||||
Status = AcpiExReadDataFromField (
|
||||
WalkState, ReturnDesc, &TempDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
|
@ -1163,6 +1171,7 @@ AcpiExOpcode_1A_0T_1R (
|
|||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
|
||||
WalkState->Opcode));
|
||||
|
||||
Status = AE_AML_BAD_OPCODE;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
|
|
@ -275,7 +275,8 @@ AcpiExOpcode_2A_2T_1R (
|
|||
|
||||
/* Quotient to ReturnDesc1, remainder to ReturnDesc2 */
|
||||
|
||||
Status = AcpiUtDivide (Operand[0]->Integer.Value,
|
||||
Status = AcpiUtDivide (
|
||||
Operand[0]->Integer.Value,
|
||||
Operand[1]->Integer.Value,
|
||||
&ReturnDesc1->Integer.Value,
|
||||
&ReturnDesc2->Integer.Value);
|
||||
|
@ -289,6 +290,7 @@ AcpiExOpcode_2A_2T_1R (
|
|||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
|
||||
WalkState->Opcode));
|
||||
|
||||
Status = AE_AML_BAD_OPCODE;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
@ -373,7 +375,8 @@ AcpiExOpcode_2A_1T_1R (
|
|||
goto Cleanup;
|
||||
}
|
||||
|
||||
ReturnDesc->Integer.Value = AcpiExDoMathOp (WalkState->Opcode,
|
||||
ReturnDesc->Integer.Value = AcpiExDoMathOp (
|
||||
WalkState->Opcode,
|
||||
Operand[0]->Integer.Value,
|
||||
Operand[1]->Integer.Value);
|
||||
goto StoreResultToTarget;
|
||||
|
@ -392,7 +395,8 @@ AcpiExOpcode_2A_1T_1R (
|
|||
|
||||
/* ReturnDesc will contain the remainder */
|
||||
|
||||
Status = AcpiUtDivide (Operand[0]->Integer.Value,
|
||||
Status = AcpiUtDivide (
|
||||
Operand[0]->Integer.Value,
|
||||
Operand[1]->Integer.Value,
|
||||
NULL,
|
||||
&ReturnDesc->Integer.Value);
|
||||
|
@ -400,8 +404,8 @@ AcpiExOpcode_2A_1T_1R (
|
|||
|
||||
case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */
|
||||
|
||||
Status = AcpiExDoConcatenate (Operand[0], Operand[1],
|
||||
&ReturnDesc, WalkState);
|
||||
Status = AcpiExDoConcatenate (
|
||||
Operand[0], Operand[1], &ReturnDesc, WalkState);
|
||||
break;
|
||||
|
||||
case AML_TO_STRING_OP: /* ToString (Buffer, Length, Result) (ACPI 2.0) */
|
||||
|
@ -448,8 +452,8 @@ AcpiExOpcode_2A_1T_1R (
|
|||
|
||||
/* ConcatenateResTemplate (Buffer, Buffer, Result) (ACPI 2.0) */
|
||||
|
||||
Status = AcpiExConcatTemplate (Operand[0], Operand[1],
|
||||
&ReturnDesc, WalkState);
|
||||
Status = AcpiExConcatTemplate (
|
||||
Operand[0], Operand[1], &ReturnDesc, WalkState);
|
||||
break;
|
||||
|
||||
case AML_INDEX_OP: /* Index (Source Index Result) */
|
||||
|
@ -672,6 +676,7 @@ AcpiExOpcode_2A_0T_1R (
|
|||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
|
||||
WalkState->Opcode));
|
||||
|
||||
Status = AE_AML_BAD_OPCODE;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
|
|
@ -178,7 +178,8 @@ AcpiExOpcode_3A_0T_0R (
|
|||
case AML_FATAL_OP: /* Fatal (FatalType FatalCode FatalArg) */
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"FatalOp: Type %X Code %X Arg %X <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
|
||||
"FatalOp: Type %X Code %X Arg %X "
|
||||
"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n",
|
||||
(UINT32) Operand[0]->Integer.Value,
|
||||
(UINT32) Operand[1]->Integer.Value,
|
||||
(UINT32) Operand[2]->Integer.Value));
|
||||
|
@ -215,6 +216,7 @@ AcpiExOpcode_3A_0T_0R (
|
|||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
|
||||
WalkState->Opcode));
|
||||
|
||||
Status = AE_AML_BAD_OPCODE;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
@ -287,8 +289,8 @@ AcpiExOpcode_3A_1T_1R (
|
|||
|
||||
else if ((Index + Length) > Operand[0]->String.Length)
|
||||
{
|
||||
Length = (ACPI_SIZE) Operand[0]->String.Length -
|
||||
(ACPI_SIZE) Index;
|
||||
Length =
|
||||
(ACPI_SIZE) Operand[0]->String.Length - (ACPI_SIZE) Index;
|
||||
}
|
||||
|
||||
/* Strings always have a sub-pointer, not so for buffers */
|
||||
|
@ -334,8 +336,8 @@ AcpiExOpcode_3A_1T_1R (
|
|||
{
|
||||
/* We have a buffer, copy the portion requested */
|
||||
|
||||
memcpy (Buffer, Operand[0]->String.Pointer + Index,
|
||||
Length);
|
||||
memcpy (Buffer,
|
||||
Operand[0]->String.Pointer + Index, Length);
|
||||
}
|
||||
|
||||
/* Set the length of the new String/Buffer */
|
||||
|
@ -352,6 +354,7 @@ AcpiExOpcode_3A_1T_1R (
|
|||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
|
||||
WalkState->Opcode));
|
||||
|
||||
Status = AE_AML_BAD_OPCODE;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
@ -369,12 +372,12 @@ Cleanup:
|
|||
AcpiUtRemoveReference (ReturnDesc);
|
||||
WalkState->ResultObj = NULL;
|
||||
}
|
||||
|
||||
/* Set the return object and exit */
|
||||
|
||||
else
|
||||
{
|
||||
/* Set the return object and exit */
|
||||
|
||||
WalkState->ResultObj = ReturnDesc;
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
|
|
@ -205,8 +205,8 @@ AcpiExDoMatch (
|
|||
* True if equal: (P[i] == M)
|
||||
* Change to: (M == P[i])
|
||||
*/
|
||||
Status = AcpiExDoLogicalOp (AML_LEQUAL_OP, MatchObj, PackageObj,
|
||||
&LogicalResult);
|
||||
Status = AcpiExDoLogicalOp (
|
||||
AML_LEQUAL_OP, MatchObj, PackageObj, &LogicalResult);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (FALSE);
|
||||
|
@ -218,8 +218,8 @@ AcpiExDoMatch (
|
|||
* True if less than or equal: (P[i] <= M) (P[i] NotGreater than M)
|
||||
* Change to: (M >= P[i]) (M NotLess than P[i])
|
||||
*/
|
||||
Status = AcpiExDoLogicalOp (AML_LLESS_OP, MatchObj, PackageObj,
|
||||
&LogicalResult);
|
||||
Status = AcpiExDoLogicalOp (
|
||||
AML_LLESS_OP, MatchObj, PackageObj, &LogicalResult);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (FALSE);
|
||||
|
@ -232,8 +232,8 @@ AcpiExDoMatch (
|
|||
* True if less than: (P[i] < M)
|
||||
* Change to: (M > P[i])
|
||||
*/
|
||||
Status = AcpiExDoLogicalOp (AML_LGREATER_OP, MatchObj, PackageObj,
|
||||
&LogicalResult);
|
||||
Status = AcpiExDoLogicalOp (
|
||||
AML_LGREATER_OP, MatchObj, PackageObj, &LogicalResult);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (FALSE);
|
||||
|
@ -245,8 +245,8 @@ AcpiExDoMatch (
|
|||
* True if greater than or equal: (P[i] >= M) (P[i] NotLess than M)
|
||||
* Change to: (M <= P[i]) (M NotGreater than P[i])
|
||||
*/
|
||||
Status = AcpiExDoLogicalOp (AML_LGREATER_OP, MatchObj, PackageObj,
|
||||
&LogicalResult);
|
||||
Status = AcpiExDoLogicalOp (
|
||||
AML_LGREATER_OP, MatchObj, PackageObj, &LogicalResult);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (FALSE);
|
||||
|
@ -259,8 +259,8 @@ AcpiExDoMatch (
|
|||
* True if greater than: (P[i] > M)
|
||||
* Change to: (M < P[i])
|
||||
*/
|
||||
Status = AcpiExDoLogicalOp (AML_LLESS_OP, MatchObj, PackageObj,
|
||||
&LogicalResult);
|
||||
Status = AcpiExDoLogicalOp (
|
||||
AML_LLESS_OP, MatchObj, PackageObj, &LogicalResult);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (FALSE);
|
||||
|
@ -403,6 +403,7 @@ AcpiExOpcode_6A_0T_1R (
|
|||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
|
||||
WalkState->Opcode));
|
||||
|
||||
Status = AE_AML_BAD_OPCODE;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Module Name: exprep - ACPI AML (p-code) execution - field prep utilities
|
||||
* Module Name: exprep - ACPI AML field prep utilities
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
@ -141,6 +141,7 @@ AcpiExGenerateAccess (
|
|||
UINT32 FieldBitLength,
|
||||
UINT32 RegionLength);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExGenerateAccess
|
||||
|
@ -185,9 +186,12 @@ AcpiExGenerateAccess (
|
|||
|
||||
/* Round Field start offset and length to "minimal" byte boundaries */
|
||||
|
||||
FieldByteOffset = ACPI_DIV_8 (ACPI_ROUND_DOWN (FieldBitOffset, 8));
|
||||
FieldByteEndOffset = ACPI_DIV_8 (ACPI_ROUND_UP (FieldBitLength +
|
||||
FieldBitOffset, 8));
|
||||
FieldByteOffset = ACPI_DIV_8 (
|
||||
ACPI_ROUND_DOWN (FieldBitOffset, 8));
|
||||
|
||||
FieldByteEndOffset = ACPI_DIV_8 (
|
||||
ACPI_ROUND_UP (FieldBitLength + FieldBitOffset, 8));
|
||||
|
||||
FieldByteLength = FieldByteEndOffset - FieldByteOffset;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
|
@ -213,7 +217,8 @@ AcpiExGenerateAccess (
|
|||
* are done. (This does not optimize for the perfectly aligned
|
||||
* case yet).
|
||||
*/
|
||||
if (ACPI_ROUND_UP (FieldByteEndOffset, AccessByteWidth) <= RegionLength)
|
||||
if (ACPI_ROUND_UP (FieldByteEndOffset, AccessByteWidth) <=
|
||||
RegionLength)
|
||||
{
|
||||
FieldStartOffset =
|
||||
ACPI_ROUND_DOWN (FieldByteOffset, AccessByteWidth) /
|
||||
|
@ -237,7 +242,8 @@ AcpiExGenerateAccess (
|
|||
if (Accesses <= 1)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Entire field can be accessed with one operation of size %u\n",
|
||||
"Entire field can be accessed "
|
||||
"with one operation of size %u\n",
|
||||
AccessByteWidth));
|
||||
return_VALUE (AccessByteWidth);
|
||||
}
|
||||
|
@ -255,7 +261,8 @@ AcpiExGenerateAccess (
|
|||
else
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"AccessWidth %u end is NOT within region\n", AccessByteWidth));
|
||||
"AccessWidth %u end is NOT within region\n",
|
||||
AccessByteWidth));
|
||||
if (AccessByteWidth == 1)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
|
@ -283,6 +290,7 @@ AcpiExGenerateAccess (
|
|||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Cannot access field in one operation, using width 8\n"));
|
||||
|
||||
return_VALUE (8);
|
||||
}
|
||||
#endif /* ACPI_UNDER_DEVELOPMENT */
|
||||
|
@ -367,6 +375,7 @@ AcpiExDecodeFieldAccess (
|
|||
ACPI_ERROR ((AE_INFO,
|
||||
"Unknown field access type 0x%X",
|
||||
Access));
|
||||
|
||||
return_UINT32 (0);
|
||||
}
|
||||
|
||||
|
@ -446,8 +455,8 @@ AcpiExPrepCommonFieldObject (
|
|||
* For all other access types (Byte, Word, Dword, Qword), the Bitwidth is
|
||||
* the same (equivalent) as the ByteAlignment.
|
||||
*/
|
||||
AccessBitWidth = AcpiExDecodeFieldAccess (ObjDesc, FieldFlags,
|
||||
&ByteAlignment);
|
||||
AccessBitWidth = AcpiExDecodeFieldAccess (
|
||||
ObjDesc, FieldFlags, &ByteAlignment);
|
||||
if (!AccessBitWidth)
|
||||
{
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
|
||||
|
@ -576,8 +585,10 @@ AcpiExPrepFieldValue (
|
|||
}
|
||||
}
|
||||
|
||||
ObjDesc->Field.ResourceBuffer = SecondDesc->Buffer.Pointer;
|
||||
ObjDesc->Field.ResourceLength = (UINT16) SecondDesc->Buffer.Length;
|
||||
ObjDesc->Field.ResourceBuffer =
|
||||
SecondDesc->Buffer.Pointer;
|
||||
ObjDesc->Field.ResourceLength =
|
||||
(UINT16) SecondDesc->Buffer.Length;
|
||||
}
|
||||
else if (Info->ResourceBuffer)
|
||||
{
|
||||
|
@ -599,7 +610,8 @@ AcpiExPrepFieldValue (
|
|||
|
||||
if (AccessByteWidth < 256)
|
||||
{
|
||||
ObjDesc->CommonField.AccessByteWidth = (UINT8) AccessByteWidth;
|
||||
ObjDesc->CommonField.AccessByteWidth =
|
||||
(UINT8) AccessByteWidth;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -609,8 +621,10 @@ AcpiExPrepFieldValue (
|
|||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"RegionField: BitOff %X, Off %X, Gran %X, Region %p\n",
|
||||
ObjDesc->Field.StartFieldBitOffset, ObjDesc->Field.BaseByteOffset,
|
||||
ObjDesc->Field.AccessByteWidth, ObjDesc->Field.RegionObj));
|
||||
ObjDesc->Field.StartFieldBitOffset,
|
||||
ObjDesc->Field.BaseByteOffset,
|
||||
ObjDesc->Field.AccessByteWidth,
|
||||
ObjDesc->Field.RegionObj));
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
||||
|
@ -690,7 +704,8 @@ AcpiExPrepFieldValue (
|
|||
ObjDesc->IndexField.AccessByteWidth);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"IndexField: BitOff %X, Off %X, Value %X, Gran %X, Index %p, Data %p\n",
|
||||
"IndexField: BitOff %X, Off %X, Value %X, "
|
||||
"Gran %X, Index %p, Data %p\n",
|
||||
ObjDesc->IndexField.StartFieldBitOffset,
|
||||
ObjDesc->IndexField.BaseByteOffset,
|
||||
ObjDesc->IndexField.Value,
|
||||
|
@ -710,10 +725,11 @@ AcpiExPrepFieldValue (
|
|||
* Store the constructed descriptor (ObjDesc) into the parent Node,
|
||||
* preserving the current type of that NamedObj.
|
||||
*/
|
||||
Status = AcpiNsAttachObject (Info->FieldNode, ObjDesc,
|
||||
AcpiNsGetType (Info->FieldNode));
|
||||
Status = AcpiNsAttachObject (
|
||||
Info->FieldNode, ObjDesc, AcpiNsGetType (Info->FieldNode));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Set NamedObj %p [%4.4s], ObjDesc %p\n",
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Set NamedObj %p [%4.4s], ObjDesc %p\n",
|
||||
Info->FieldNode, AcpiUtGetNodeName (Info->FieldNode), ObjDesc));
|
||||
|
||||
/* Remove local reference to the object */
|
||||
|
|
|
@ -489,7 +489,8 @@ AcpiExPciConfigSpaceHandler (
|
|||
PciRegister = (UINT16) (UINT32) Address;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Pci-Config %u (%u) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
|
||||
"Pci-Config %u (%u) Seg(%04x) Bus(%04x) "
|
||||
"Dev(%04x) Func(%04x) Reg(%04x)\n",
|
||||
Function, BitWidth, PciId->Segment, PciId->Bus, PciId->Device,
|
||||
PciId->Function, PciRegister));
|
||||
|
||||
|
@ -498,14 +499,14 @@ AcpiExPciConfigSpaceHandler (
|
|||
case ACPI_READ:
|
||||
|
||||
*Value = 0;
|
||||
Status = AcpiOsReadPciConfiguration (PciId, PciRegister,
|
||||
Value, BitWidth);
|
||||
Status = AcpiOsReadPciConfiguration (
|
||||
PciId, PciRegister, Value, BitWidth);
|
||||
break;
|
||||
|
||||
case ACPI_WRITE:
|
||||
|
||||
Status = AcpiOsWritePciConfiguration (PciId, PciRegister,
|
||||
*Value, BitWidth);
|
||||
Status = AcpiOsWritePciConfiguration (
|
||||
PciId, PciRegister, *Value, BitWidth);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -190,7 +190,7 @@ AcpiExResolveNodeToValue (
|
|||
|
||||
/*
|
||||
* Several object types require no further processing:
|
||||
* 1) Device/Thermal objects don't have a "real" subobject, return the Node
|
||||
* 1) Device/Thermal objects don't have a "real" subobject, return Node
|
||||
* 2) Method locals and arguments have a pseudo-Node
|
||||
* 3) 10/2007: Added method type to assist with Package construction.
|
||||
*/
|
||||
|
|
|
@ -307,7 +307,8 @@ AcpiExResolveObjectToValue (
|
|||
* the package, can't dereference it
|
||||
*/
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Attempt to dereference an Index to NULL package element Idx=%p",
|
||||
"Attempt to dereference an Index to "
|
||||
"NULL package element Idx=%p",
|
||||
StackDesc));
|
||||
Status = AE_AML_UNINITIALIZED_ELEMENT;
|
||||
}
|
||||
|
@ -358,7 +359,8 @@ AcpiExResolveObjectToValue (
|
|||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Unknown Reference type 0x%X in %p", RefType, StackDesc));
|
||||
"Unknown Reference type 0x%X in %p",
|
||||
RefType, StackDesc));
|
||||
Status = AE_AML_INTERNAL;
|
||||
break;
|
||||
}
|
||||
|
@ -379,7 +381,8 @@ AcpiExResolveObjectToValue (
|
|||
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
||||
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "FieldRead SourceDesc=%p Type=%X\n",
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"FieldRead SourceDesc=%p Type=%X\n",
|
||||
StackDesc, StackDesc->Common.Type));
|
||||
|
||||
Status = AcpiExReadDataFromField (WalkState, StackDesc, &ObjDesc);
|
||||
|
@ -450,7 +453,8 @@ AcpiExResolveMultiple (
|
|||
if (Type == ACPI_TYPE_LOCAL_ALIAS)
|
||||
{
|
||||
Type = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;
|
||||
ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc);
|
||||
ObjDesc = AcpiNsGetAttachedObject (
|
||||
(ACPI_NAMESPACE_NODE *) ObjDesc);
|
||||
}
|
||||
|
||||
if (!ObjDesc)
|
||||
|
@ -599,7 +603,8 @@ AcpiExResolveMultiple (
|
|||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Unknown Reference Class 0x%2.2X", ObjDesc->Reference.Class));
|
||||
"Unknown Reference Class 0x%2.2X",
|
||||
ObjDesc->Reference.Class));
|
||||
return_ACPI_STATUS (AE_AML_INTERNAL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -171,7 +171,8 @@ AcpiExCheckObjectType (
|
|||
* specification, a store to a constant is a noop.)
|
||||
*/
|
||||
if ((ThisType == ACPI_TYPE_INTEGER) &&
|
||||
(((ACPI_OPERAND_OBJECT *) Object)->Common.Flags & AOPOBJ_AML_CONSTANT))
|
||||
(((ACPI_OPERAND_OBJECT *) Object)->Common.Flags &
|
||||
AOPOBJ_AML_CONSTANT))
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
@ -288,7 +289,8 @@ AcpiExResolveOperands (
|
|||
*/
|
||||
if (ObjectType == ACPI_TYPE_LOCAL_ALIAS)
|
||||
{
|
||||
ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc);
|
||||
ObjDesc = AcpiNsGetAttachedObject (
|
||||
(ACPI_NAMESPACE_NODE *) ObjDesc);
|
||||
*StackPtr = ObjDesc;
|
||||
ObjectType = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;
|
||||
}
|
||||
|
@ -369,7 +371,8 @@ AcpiExResolveOperands (
|
|||
{
|
||||
case ARGI_REF_OR_STRING: /* Can be a String or Reference */
|
||||
|
||||
if ((ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_OPERAND) &&
|
||||
if ((ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) ==
|
||||
ACPI_DESC_TYPE_OPERAND) &&
|
||||
(ObjDesc->Common.Type == ACPI_TYPE_STRING))
|
||||
{
|
||||
/*
|
||||
|
@ -403,8 +406,8 @@ AcpiExResolveOperands (
|
|||
goto NextOperand;
|
||||
}
|
||||
|
||||
Status = AcpiExCheckObjectType (ACPI_TYPE_LOCAL_REFERENCE,
|
||||
ObjectType, ObjDesc);
|
||||
Status = AcpiExCheckObjectType (
|
||||
ACPI_TYPE_LOCAL_REFERENCE, ObjectType, ObjDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -555,8 +558,8 @@ AcpiExResolveOperands (
|
|||
* But we can implicitly convert from a BUFFER or INTEGER
|
||||
* Aka - "Implicit Source Operand Conversion"
|
||||
*/
|
||||
Status = AcpiExConvertToString (ObjDesc, StackPtr,
|
||||
ACPI_IMPLICIT_CONVERT_HEX);
|
||||
Status = AcpiExConvertToString (
|
||||
ObjDesc, StackPtr, ACPI_IMPLICIT_CONVERT_HEX);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
if (Status == AE_TYPE)
|
||||
|
@ -689,8 +692,10 @@ AcpiExResolveOperands (
|
|||
|
||||
case ARGI_REGION_OR_BUFFER: /* Used by Load() only */
|
||||
|
||||
/* Need an operand of type REGION or a BUFFER (which could be a resolved region field) */
|
||||
|
||||
/*
|
||||
* Need an operand of type REGION or a BUFFER
|
||||
* (which could be a resolved region field)
|
||||
*/
|
||||
switch (ObjDesc->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
@ -734,9 +739,9 @@ AcpiExResolveOperands (
|
|||
if (AcpiGbl_EnableInterpreterSlack)
|
||||
{
|
||||
/*
|
||||
* Enable original behavior of Store(), allowing any and all
|
||||
* objects as the source operand. The ACPI spec does not
|
||||
* allow this, however.
|
||||
* Enable original behavior of Store(), allowing any
|
||||
* and all objects as the source operand. The ACPI
|
||||
* spec does not allow this, however.
|
||||
*/
|
||||
break;
|
||||
}
|
||||
|
@ -749,7 +754,8 @@ AcpiExResolveOperands (
|
|||
}
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Needed Integer/Buffer/String/Package/Ref/Ddb], found [%s] %p",
|
||||
"Needed Integer/Buffer/String/Package/Ref/Ddb]"
|
||||
", found [%s] %p",
|
||||
AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
|
||||
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
|
||||
|
@ -771,8 +777,8 @@ AcpiExResolveOperands (
|
|||
* Make sure that the original object was resolved to the
|
||||
* required object type (Simple cases only).
|
||||
*/
|
||||
Status = AcpiExCheckObjectType (TypeNeeded,
|
||||
(*StackPtr)->Common.Type, *StackPtr);
|
||||
Status = AcpiExCheckObjectType (
|
||||
TypeNeeded, (*StackPtr)->Common.Type, *StackPtr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
|
|
@ -346,7 +346,8 @@ AcpiExStoreObjectToIndex (
|
|||
{
|
||||
/* Normal object, copy it */
|
||||
|
||||
Status = AcpiUtCopyIobjectToIobject (SourceDesc, &NewDesc, WalkState);
|
||||
Status = AcpiUtCopyIobjectToIobject (
|
||||
SourceDesc, &NewDesc, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -559,7 +560,8 @@ AcpiExStoreObjectToNode (
|
|||
case ACPI_TYPE_THERMAL:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Target must be [Buffer/Integer/String/Reference], found [%s] (%4.4s)",
|
||||
"Target must be [Buffer/Integer/String/Reference]"
|
||||
", found [%s] (%4.4s)",
|
||||
AcpiUtGetTypeName (Node->Type), Node->Name.Ascii));
|
||||
|
||||
return_ACPI_STATUS (AE_AML_TARGET_TYPE);
|
||||
|
@ -599,8 +601,7 @@ AcpiExStoreObjectToNode (
|
|||
* an implicit conversion, as per the ACPI specification.
|
||||
* A direct store is performed instead.
|
||||
*/
|
||||
Status = AcpiExStoreDirectToNode (SourceDesc, Node,
|
||||
WalkState);
|
||||
Status = AcpiExStoreDirectToNode (SourceDesc, Node, WalkState);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -624,8 +625,8 @@ AcpiExStoreObjectToNode (
|
|||
* store has been performed such that the node/object type
|
||||
* has been changed.
|
||||
*/
|
||||
Status = AcpiNsAttachObject (Node, NewDesc,
|
||||
NewDesc->Common.Type);
|
||||
Status = AcpiNsAttachObject (
|
||||
Node, NewDesc, NewDesc->Common.Type);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Store type [%s] into [%s] via Convert/Attach\n",
|
||||
|
@ -657,8 +658,7 @@ AcpiExStoreObjectToNode (
|
|||
* operator. (Note, for this default case, all normal
|
||||
* Store/Target operations exited above with an error).
|
||||
*/
|
||||
Status = AcpiExStoreDirectToNode (SourceDesc, Node,
|
||||
WalkState);
|
||||
Status = AcpiExStoreDirectToNode (SourceDesc, Node, WalkState);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Module Name: exstorob - AML Interpreter object store support, store to object
|
||||
* Module Name: exstorob - AML object store support, store to object
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
@ -293,8 +293,9 @@ AcpiExStoreStringToString (
|
|||
ACPI_FREE (TargetDesc->String.Pointer);
|
||||
}
|
||||
|
||||
TargetDesc->String.Pointer = ACPI_ALLOCATE_ZEROED (
|
||||
(ACPI_SIZE) Length + 1);
|
||||
TargetDesc->String.Pointer =
|
||||
ACPI_ALLOCATE_ZEROED ((ACPI_SIZE) Length + 1);
|
||||
|
||||
if (!TargetDesc->String.Pointer)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
|
|
|
@ -158,7 +158,6 @@ AcpiExSystemWaitSemaphore (
|
|||
/* We must wait, so unlock the interpreter */
|
||||
|
||||
AcpiExExitInterpreter ();
|
||||
|
||||
Status = AcpiOsWaitSemaphore (Semaphore, 1, Timeout);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
|
@ -211,7 +210,6 @@ AcpiExSystemWaitMutex (
|
|||
/* We must wait, so unlock the interpreter */
|
||||
|
||||
AcpiExExitInterpreter ();
|
||||
|
||||
Status = AcpiOsAcquireMutex (Mutex, Timeout);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
|
@ -262,8 +260,8 @@ AcpiExSystemDoStall (
|
|||
* (ACPI specifies 100 usec as max, but this gives some slack in
|
||||
* order to support existing BIOSs)
|
||||
*/
|
||||
ACPI_ERROR ((AE_INFO, "Time parameter is too large (%u)",
|
||||
HowLong));
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Time parameter is too large (%u)", HowLong));
|
||||
Status = AE_AML_OPERAND_VALUE;
|
||||
}
|
||||
else
|
||||
|
|
499
reactos/drivers/bus/acpi/acpica/executer/extrace.c
Normal file
499
reactos/drivers/bus/acpi/acpica/executer/extrace.c
Normal file
|
@ -0,0 +1,499 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Module Name: extrace - Support for interpreter execution tracing
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2015, 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.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acinterp.h"
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_EXECUTER
|
||||
ACPI_MODULE_NAME ("extrace")
|
||||
|
||||
|
||||
static ACPI_OPERAND_OBJECT *AcpiGbl_TraceMethodObject = NULL;
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
#ifdef ACPI_DEBUG_OUTPUT
|
||||
static const char *
|
||||
AcpiExGetTraceEventName (
|
||||
ACPI_TRACE_EVENT_TYPE Type);
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExInterpreterTraceEnabled
|
||||
*
|
||||
* PARAMETERS: Name - Whether method name should be matched,
|
||||
* this should be checked before starting
|
||||
* the tracer
|
||||
*
|
||||
* RETURN: TRUE if interpreter trace is enabled.
|
||||
*
|
||||
* DESCRIPTION: Check whether interpreter trace is enabled
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static BOOLEAN
|
||||
AcpiExInterpreterTraceEnabled (
|
||||
char *Name)
|
||||
{
|
||||
|
||||
/* Check if tracing is enabled */
|
||||
|
||||
if (!(AcpiGbl_TraceFlags & ACPI_TRACE_ENABLED))
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if tracing is filtered:
|
||||
*
|
||||
* 1. If the tracer is started, AcpiGbl_TraceMethodObject should have
|
||||
* been filled by the trace starter
|
||||
* 2. If the tracer is not started, AcpiGbl_TraceMethodName should be
|
||||
* matched if it is specified
|
||||
* 3. If the tracer is oneshot style, AcpiGbl_TraceMethodName should
|
||||
* not be cleared by the trace stopper during the first match
|
||||
*/
|
||||
if (AcpiGbl_TraceMethodObject)
|
||||
{
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
if (Name &&
|
||||
(AcpiGbl_TraceMethodName &&
|
||||
strcmp (AcpiGbl_TraceMethodName, Name)))
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
if ((AcpiGbl_TraceFlags & ACPI_TRACE_ONESHOT) &&
|
||||
!AcpiGbl_TraceMethodName)
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExGetTraceEventName
|
||||
*
|
||||
* PARAMETERS: Type - Trace event type
|
||||
*
|
||||
* RETURN: Trace event name.
|
||||
*
|
||||
* DESCRIPTION: Used to obtain the full trace event name.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef ACPI_DEBUG_OUTPUT
|
||||
|
||||
static const char *
|
||||
AcpiExGetTraceEventName (
|
||||
ACPI_TRACE_EVENT_TYPE Type)
|
||||
{
|
||||
|
||||
switch (Type)
|
||||
{
|
||||
case ACPI_TRACE_AML_METHOD:
|
||||
|
||||
return "Method";
|
||||
|
||||
case ACPI_TRACE_AML_OPCODE:
|
||||
|
||||
return "Opcode";
|
||||
|
||||
case ACPI_TRACE_AML_REGION:
|
||||
|
||||
return "Region";
|
||||
|
||||
default:
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExTracePoint
|
||||
*
|
||||
* PARAMETERS: Type - Trace event type
|
||||
* Begin - TRUE if before execution
|
||||
* Aml - Executed AML address
|
||||
* Pathname - Object path
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Internal interpreter execution trace.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExTracePoint (
|
||||
ACPI_TRACE_EVENT_TYPE Type,
|
||||
BOOLEAN Begin,
|
||||
UINT8 *Aml,
|
||||
char *Pathname)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_NAME (ExTracePoint);
|
||||
|
||||
|
||||
if (Pathname)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_TRACE_POINT,
|
||||
"%s %s [0x%p:%s] execution.\n",
|
||||
AcpiExGetTraceEventName (Type), Begin ? "Begin" : "End",
|
||||
Aml, Pathname));
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_TRACE_POINT,
|
||||
"%s %s [0x%p] execution.\n",
|
||||
AcpiExGetTraceEventName (Type), Begin ? "Begin" : "End",
|
||||
Aml));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExStartTraceMethod
|
||||
*
|
||||
* PARAMETERS: MethodNode - Node of the method
|
||||
* ObjDesc - The method object
|
||||
* WalkState - current state, NULL if not yet executing
|
||||
* a method.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Start control method execution trace
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExStartTraceMethod (
|
||||
ACPI_NAMESPACE_NODE *MethodNode,
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
char *Pathname = NULL;
|
||||
BOOLEAN Enabled = FALSE;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (ExStartTraceMethod);
|
||||
|
||||
|
||||
if (MethodNode)
|
||||
{
|
||||
Pathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
|
||||
}
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
Enabled = AcpiExInterpreterTraceEnabled (Pathname);
|
||||
if (Enabled && !AcpiGbl_TraceMethodObject)
|
||||
{
|
||||
AcpiGbl_TraceMethodObject = ObjDesc;
|
||||
AcpiGbl_OriginalDbgLevel = AcpiDbgLevel;
|
||||
AcpiGbl_OriginalDbgLayer = AcpiDbgLayer;
|
||||
AcpiDbgLevel = ACPI_TRACE_LEVEL_ALL;
|
||||
AcpiDbgLayer = ACPI_TRACE_LAYER_ALL;
|
||||
|
||||
if (AcpiGbl_TraceDbgLevel)
|
||||
{
|
||||
AcpiDbgLevel = AcpiGbl_TraceDbgLevel;
|
||||
}
|
||||
|
||||
if (AcpiGbl_TraceDbgLayer)
|
||||
{
|
||||
AcpiDbgLayer = AcpiGbl_TraceDbgLayer;
|
||||
}
|
||||
}
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
|
||||
Exit:
|
||||
if (Enabled)
|
||||
{
|
||||
ACPI_TRACE_POINT (ACPI_TRACE_AML_METHOD, TRUE,
|
||||
ObjDesc ? ObjDesc->Method.AmlStart : NULL, Pathname);
|
||||
}
|
||||
|
||||
if (Pathname)
|
||||
{
|
||||
ACPI_FREE (Pathname);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExStopTraceMethod
|
||||
*
|
||||
* PARAMETERS: MethodNode - Node of the method
|
||||
* ObjDesc - The method object
|
||||
* WalkState - current state, NULL if not yet executing
|
||||
* a method.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Stop control method execution trace
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExStopTraceMethod (
|
||||
ACPI_NAMESPACE_NODE *MethodNode,
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
char *Pathname = NULL;
|
||||
BOOLEAN Enabled;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (ExStopTraceMethod);
|
||||
|
||||
|
||||
if (MethodNode)
|
||||
{
|
||||
Pathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
|
||||
}
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto ExitPath;
|
||||
}
|
||||
|
||||
Enabled = AcpiExInterpreterTraceEnabled (NULL);
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
|
||||
if (Enabled)
|
||||
{
|
||||
ACPI_TRACE_POINT (ACPI_TRACE_AML_METHOD, FALSE,
|
||||
ObjDesc ? ObjDesc->Method.AmlStart : NULL, Pathname);
|
||||
}
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto ExitPath;
|
||||
}
|
||||
|
||||
/* Check whether the tracer should be stopped */
|
||||
|
||||
if (AcpiGbl_TraceMethodObject == ObjDesc)
|
||||
{
|
||||
/* Disable further tracing if type is one-shot */
|
||||
|
||||
if (AcpiGbl_TraceFlags & ACPI_TRACE_ONESHOT)
|
||||
{
|
||||
AcpiGbl_TraceMethodName = NULL;
|
||||
}
|
||||
|
||||
AcpiDbgLevel = AcpiGbl_OriginalDbgLevel;
|
||||
AcpiDbgLayer = AcpiGbl_OriginalDbgLayer;
|
||||
AcpiGbl_TraceMethodObject = NULL;
|
||||
}
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
|
||||
ExitPath:
|
||||
if (Pathname)
|
||||
{
|
||||
ACPI_FREE (Pathname);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExStartTraceOpcode
|
||||
*
|
||||
* PARAMETERS: Op - The parser opcode object
|
||||
* WalkState - current state, NULL if not yet executing
|
||||
* a method.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Start opcode execution trace
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExStartTraceOpcode (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_NAME (ExStartTraceOpcode);
|
||||
|
||||
|
||||
if (AcpiExInterpreterTraceEnabled (NULL) &&
|
||||
(AcpiGbl_TraceFlags & ACPI_TRACE_OPCODE))
|
||||
{
|
||||
ACPI_TRACE_POINT (ACPI_TRACE_AML_OPCODE, TRUE,
|
||||
Op->Common.Aml, Op->Common.AmlOpName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExStopTraceOpcode
|
||||
*
|
||||
* PARAMETERS: Op - The parser opcode object
|
||||
* WalkState - current state, NULL if not yet executing
|
||||
* a method.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Stop opcode execution trace
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExStopTraceOpcode (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_NAME (ExStopTraceOpcode);
|
||||
|
||||
|
||||
if (AcpiExInterpreterTraceEnabled (NULL) &&
|
||||
(AcpiGbl_TraceFlags & ACPI_TRACE_OPCODE))
|
||||
{
|
||||
ACPI_TRACE_POINT (ACPI_TRACE_AML_OPCODE, FALSE,
|
||||
Op->Common.Aml, Op->Common.AmlOpName);
|
||||
}
|
||||
}
|
|
@ -259,8 +259,8 @@ AcpiExTruncateFor32bitTable (
|
|||
(ObjDesc->Integer.Value > (UINT64) ACPI_UINT32_MAX))
|
||||
{
|
||||
/*
|
||||
* We are executing in a 32-bit ACPI table.
|
||||
* Truncate the value to 32 bits by zeroing out the upper 32-bit field
|
||||
* We are executing in a 32-bit ACPI table. Truncate
|
||||
* the value to 32 bits by zeroing out the upper 32-bit field
|
||||
*/
|
||||
ObjDesc->Integer.Value &= (UINT64) ACPI_UINT32_MAX;
|
||||
return (TRUE);
|
||||
|
@ -441,7 +441,8 @@ AcpiExEisaIdToString (
|
|||
if (CompressedId > ACPI_UINT32_MAX)
|
||||
{
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Expected EISAID is larger than 32 bits: 0x%8.8X%8.8X, truncating",
|
||||
"Expected EISAID is larger than 32 bits: "
|
||||
"0x%8.8X%8.8X, truncating",
|
||||
ACPI_FORMAT_UINT64 (CompressedId)));
|
||||
}
|
||||
|
||||
|
@ -568,5 +569,4 @@ AcpiIsValidSpaceId (
|
|||
return (TRUE);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -221,8 +221,8 @@ AcpiHwSetMode (
|
|||
{
|
||||
if (AcpiHwGetMode () == Mode)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Mode %X successfully enabled\n",
|
||||
Mode));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Mode %X successfully enabled\n", Mode));
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
AcpiOsStall (ACPI_USEC_PER_MSEC);
|
||||
|
|
|
@ -202,7 +202,8 @@ AcpiHwExtendedSleep (
|
|||
|
||||
/* Clear wake status (WAK_STS) */
|
||||
|
||||
Status = AcpiWrite ((UINT64) ACPI_X_WAKE_STATUS, &AcpiGbl_FADT.SleepStatus);
|
||||
Status = AcpiWrite ((UINT64) ACPI_X_WAKE_STATUS,
|
||||
&AcpiGbl_FADT.SleepStatus);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
|
|
@ -280,9 +280,7 @@ AcpiHwClearGpe (
|
|||
*/
|
||||
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
|
||||
|
||||
Status = AcpiHwWrite (RegisterBit,
|
||||
&GpeRegisterInfo->StatusAddress);
|
||||
|
||||
Status = AcpiHwWrite (RegisterBit, &GpeRegisterInfo->StatusAddress);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
@ -405,8 +403,8 @@ AcpiHwGpeEnableWrite (
|
|||
|
||||
|
||||
GpeRegisterInfo->EnableMask = EnableMask;
|
||||
Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
|
||||
|
||||
Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
|
|
@ -140,6 +140,7 @@ AcpiHwWriteMultiple (
|
|||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwValidateRegister
|
||||
|
|
|
@ -155,7 +155,8 @@ AcpiHwLegacySleep (
|
|||
|
||||
/* Clear wake status */
|
||||
|
||||
Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
|
||||
Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS,
|
||||
ACPI_CLEAR_STATUS);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -406,7 +407,8 @@ AcpiHwLegacyWake (
|
|||
* and use it to determine whether the system is rebooting or
|
||||
* resuming. Clear WAK_STS for compatibility.
|
||||
*/
|
||||
(void) AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
|
||||
(void) AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS,
|
||||
ACPI_CLEAR_STATUS);
|
||||
AcpiGbl_SystemAwakeAndRunning = TRUE;
|
||||
|
||||
/* Enable power button */
|
||||
|
|
|
@ -637,12 +637,20 @@ AcpiGetSleepTypeData (
|
|||
* Evaluate the \_Sx namespace object containing the register values
|
||||
* for this state
|
||||
*/
|
||||
Info->RelativePathname = ACPI_CAST_PTR (
|
||||
char, AcpiGbl_SleepStateNames[SleepState]);
|
||||
Info->RelativePathname = ACPI_CAST_PTR (char,
|
||||
AcpiGbl_SleepStateNames[SleepState]);
|
||||
|
||||
Status = AcpiNsEvaluate (Info);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
if (Status == AE_NOT_FOUND)
|
||||
{
|
||||
/* The _Sx states are optional, ignore NOT_FOUND */
|
||||
|
||||
goto FinalCleanup;
|
||||
}
|
||||
|
||||
goto WarningCleanup;
|
||||
}
|
||||
|
||||
/* Must have a return object */
|
||||
|
@ -652,7 +660,7 @@ AcpiGetSleepTypeData (
|
|||
ACPI_ERROR ((AE_INFO, "No Sleep State object returned from [%s]",
|
||||
Info->RelativePathname));
|
||||
Status = AE_AML_NO_RETURN_VALUE;
|
||||
goto Cleanup;
|
||||
goto WarningCleanup;
|
||||
}
|
||||
|
||||
/* Return object must be of type Package */
|
||||
|
@ -661,7 +669,7 @@ AcpiGetSleepTypeData (
|
|||
{
|
||||
ACPI_ERROR ((AE_INFO, "Sleep State return object is not a Package"));
|
||||
Status = AE_AML_OPERAND_TYPE;
|
||||
goto Cleanup1;
|
||||
goto ReturnValueCleanup;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -708,16 +716,18 @@ AcpiGetSleepTypeData (
|
|||
break;
|
||||
}
|
||||
|
||||
Cleanup1:
|
||||
ReturnValueCleanup:
|
||||
AcpiUtRemoveReference (Info->ReturnObject);
|
||||
|
||||
Cleanup:
|
||||
WarningCleanup:
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"While evaluating Sleep State [%s]", Info->RelativePathname));
|
||||
"While evaluating Sleep State [%s]",
|
||||
Info->RelativePathname));
|
||||
}
|
||||
|
||||
FinalCleanup:
|
||||
ACPI_FREE (Info);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
|
|
@ -320,6 +320,7 @@ AcpiEnterSleepStateS4bios (
|
|||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
} while (!InValue);
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
|
|
|
@ -116,6 +116,7 @@
|
|||
#ifndef _ACAPPS
|
||||
#define _ACAPPS
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef _MSC_VER /* disable some level-4 warnings */
|
||||
#pragma warning(disable:4100) /* warning C4100: unreferenced formal parameter */
|
||||
|
@ -162,13 +163,51 @@
|
|||
AcpiOsPrintf (Description);
|
||||
|
||||
#define ACPI_OPTION(Name, Description) \
|
||||
AcpiOsPrintf (" %-18s%s\n", Name, Description);
|
||||
AcpiOsPrintf (" %-20s%s\n", Name, Description);
|
||||
|
||||
|
||||
/* Check for unexpected exceptions */
|
||||
|
||||
#define ACPI_CHECK_STATUS(Name, Status, Expected) \
|
||||
if (Status != Expected) \
|
||||
{ \
|
||||
AcpiOsPrintf ("Unexpected %s from %s (%s-%d)\n", \
|
||||
AcpiFormatException (Status), #Name, _AcpiModuleName, __LINE__); \
|
||||
}
|
||||
|
||||
/* Check for unexpected non-AE_OK errors */
|
||||
|
||||
|
||||
#define ACPI_CHECK_OK(Name, Status) ACPI_CHECK_STATUS (Name, Status, AE_OK);
|
||||
|
||||
#define FILE_SUFFIX_DISASSEMBLY "dsl"
|
||||
#define FILE_SUFFIX_BINARY_TABLE ".dat" /* Needs the dot */
|
||||
|
||||
|
||||
/* acfileio */
|
||||
|
||||
ACPI_STATUS
|
||||
AcGetAllTablesFromFile (
|
||||
char *Filename,
|
||||
UINT8 GetOnlyAmlTables,
|
||||
ACPI_NEW_TABLE_DESC **ReturnListHead);
|
||||
|
||||
BOOLEAN
|
||||
AcIsFileBinary (
|
||||
FILE *File);
|
||||
|
||||
ACPI_STATUS
|
||||
AcValidateTableHeader (
|
||||
FILE *File,
|
||||
long TableOffset);
|
||||
|
||||
|
||||
/* Values for GetOnlyAmlTables */
|
||||
|
||||
#define ACPI_GET_ONLY_AML_TABLES TRUE
|
||||
#define ACPI_GET_ALL_TABLES FALSE
|
||||
|
||||
|
||||
/*
|
||||
* getopt
|
||||
*/
|
||||
|
@ -197,51 +236,6 @@ CmGetFileSize (
|
|||
ACPI_FILE File);
|
||||
|
||||
|
||||
#ifndef ACPI_DUMP_APP
|
||||
/*
|
||||
* adisasm
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AdAmlDisassemble (
|
||||
BOOLEAN OutToFile,
|
||||
char *Filename,
|
||||
char *Prefix,
|
||||
char **OutFilename);
|
||||
|
||||
void
|
||||
AdPrintStatistics (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AdFindDsdt(
|
||||
UINT8 **DsdtPtr,
|
||||
UINT32 *DsdtLength);
|
||||
|
||||
void
|
||||
AdDumpTables (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AdGetLocalTables (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AdParseTable (
|
||||
ACPI_TABLE_HEADER *Table,
|
||||
ACPI_OWNER_ID *OwnerId,
|
||||
BOOLEAN LoadTable,
|
||||
BOOLEAN External);
|
||||
|
||||
ACPI_STATUS
|
||||
AdDisplayTables (
|
||||
char *Filename,
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
ACPI_STATUS
|
||||
AdDisplayStatistics (
|
||||
void);
|
||||
|
||||
|
||||
/*
|
||||
* adwalk
|
||||
*/
|
||||
|
@ -300,6 +294,5 @@ AdWriteTable (
|
|||
UINT32 Length,
|
||||
char *TableName,
|
||||
char *OemTableId);
|
||||
#endif
|
||||
|
||||
#endif /* _ACAPPS */
|
||||
|
|
|
@ -163,11 +163,17 @@ typedef struct acpi_db_execute_walk
|
|||
/*
|
||||
* dbxface - external debugger interfaces
|
||||
*/
|
||||
ACPI_DBR_DEPENDENT_RETURN_OK (
|
||||
ACPI_STATUS
|
||||
AcpiDbSingleStep (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 OpType);
|
||||
UINT32 OpType))
|
||||
|
||||
ACPI_DBR_DEPENDENT_RETURN_VOID (
|
||||
void
|
||||
AcpiDbSignalBreakPoint (
|
||||
ACPI_WALK_STATE *WalkState))
|
||||
|
||||
|
||||
/*
|
||||
|
@ -362,10 +368,11 @@ AcpiDbDecodeAndDisplayObject (
|
|||
char *Target,
|
||||
char *OutputType);
|
||||
|
||||
ACPI_DBR_DEPENDENT_RETURN_VOID (
|
||||
void
|
||||
AcpiDbDisplayResultObject (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
ACPI_WALK_STATE *WalkState))
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDbDisplayAllMethods (
|
||||
|
@ -391,10 +398,11 @@ void
|
|||
AcpiDbDisplayObjectType (
|
||||
char *ObjectArg);
|
||||
|
||||
ACPI_DBR_DEPENDENT_RETURN_VOID (
|
||||
void
|
||||
AcpiDbDisplayArgumentObject (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
ACPI_WALK_STATE *WalkState))
|
||||
|
||||
|
||||
/*
|
||||
|
@ -446,10 +454,8 @@ AcpiDbLoadAcpiTable (
|
|||
char *Filename);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDbGetTableFromFile (
|
||||
char *Filename,
|
||||
ACPI_TABLE_HEADER **Table,
|
||||
BOOLEAN MustBeAmlTable);
|
||||
AcpiDbLoadTables (
|
||||
ACPI_NEW_TABLE_DESC *ListHead);
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -1119,7 +1119,7 @@ AcpiDmCloseOperator (
|
|||
|
||||
|
||||
/*
|
||||
* acdisasm
|
||||
* dmtables
|
||||
*/
|
||||
void
|
||||
AdDisassemblerHeader (
|
||||
|
@ -1129,4 +1129,35 @@ AdDisassemblerHeader (
|
|||
#define ACPI_IS_AML_TABLE 0
|
||||
#define ACPI_IS_DATA_TABLE 1
|
||||
|
||||
|
||||
/*
|
||||
* adisasm
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AdAmlDisassemble (
|
||||
BOOLEAN OutToFile,
|
||||
char *Filename,
|
||||
char *Prefix,
|
||||
char **OutFilename);
|
||||
|
||||
ACPI_STATUS
|
||||
AdGetLocalTables (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AdParseTable (
|
||||
ACPI_TABLE_HEADER *Table,
|
||||
ACPI_OWNER_ID *OwnerId,
|
||||
BOOLEAN LoadTable,
|
||||
BOOLEAN External);
|
||||
|
||||
ACPI_STATUS
|
||||
AdDisplayTables (
|
||||
char *Filename,
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
ACPI_STATUS
|
||||
AdDisplayStatistics (
|
||||
void);
|
||||
|
||||
#endif /* __ACDISASM_H__ */
|
||||
|
|
|
@ -294,6 +294,11 @@ AcpiEvDeleteGpeHandlers (
|
|||
/*
|
||||
* evhandler - Address space handling
|
||||
*/
|
||||
ACPI_OPERAND_OBJECT *
|
||||
AcpiEvFindRegionHandler (
|
||||
ACPI_ADR_SPACE_TYPE SpaceId,
|
||||
ACPI_OPERAND_OBJECT *HandlerObj);
|
||||
|
||||
BOOLEAN
|
||||
AcpiEvHasDefaultHandler (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
|
@ -339,10 +344,15 @@ AcpiEvDetachRegion (
|
|||
ACPI_OPERAND_OBJECT *RegionObj,
|
||||
BOOLEAN AcpiNsIsLocked);
|
||||
|
||||
ACPI_STATUS
|
||||
void
|
||||
AcpiEvAssociateRegMethod (
|
||||
ACPI_OPERAND_OBJECT *RegionObj);
|
||||
|
||||
void
|
||||
AcpiEvExecuteRegMethods (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_ADR_SPACE_TYPE SpaceId);
|
||||
ACPI_ADR_SPACE_TYPE SpaceId,
|
||||
UINT32 Function);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvExecuteRegMethod (
|
||||
|
|
|
@ -200,8 +200,9 @@ typedef struct acpi_exception_info
|
|||
#define AE_OWNER_ID_LIMIT EXCEP_ENV (0x001B)
|
||||
#define AE_NOT_CONFIGURED EXCEP_ENV (0x001C)
|
||||
#define AE_ACCESS EXCEP_ENV (0x001D)
|
||||
#define AE_IO_ERROR EXCEP_ENV (0x001E)
|
||||
|
||||
#define AE_CODE_ENV_MAX 0x001D
|
||||
#define AE_CODE_ENV_MAX 0x001E
|
||||
|
||||
|
||||
/*
|
||||
|
@ -334,7 +335,8 @@ static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Env[] =
|
|||
EXCEP_TXT ("AE_NO_HANDLER", "A handler for the operation is not installed"),
|
||||
EXCEP_TXT ("AE_OWNER_ID_LIMIT", "There are no more Owner IDs available for ACPI tables or control methods"),
|
||||
EXCEP_TXT ("AE_NOT_CONFIGURED", "The interface is not part of the current subsystem configuration"),
|
||||
EXCEP_TXT ("AE_ACCESS", "Permission denied for the requested operation")
|
||||
EXCEP_TXT ("AE_ACCESS", "Permission denied for the requested operation"),
|
||||
EXCEP_TXT ("AE_IO_ERROR", "An I/O error occurred")
|
||||
};
|
||||
|
||||
static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Pgm[] =
|
||||
|
|
|
@ -134,6 +134,7 @@ ACPI_GLOBAL (ACPI_TABLE_HEADER, AcpiGbl_OriginalDsdtHeader);
|
|||
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_DsdtIndex, ACPI_INVALID_TABLE_INDEX);
|
||||
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_FacsIndex, ACPI_INVALID_TABLE_INDEX);
|
||||
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_XFacsIndex, ACPI_INVALID_TABLE_INDEX);
|
||||
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_FadtIndex, ACPI_INVALID_TABLE_INDEX);
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE)
|
||||
ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_FACS);
|
||||
|
@ -157,6 +158,8 @@ ACPI_GLOBAL (UINT8, AcpiGbl_IntegerBitWidth);
|
|||
ACPI_GLOBAL (UINT8, AcpiGbl_IntegerByteWidth);
|
||||
ACPI_GLOBAL (UINT8, AcpiGbl_IntegerNybbleWidth);
|
||||
|
||||
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_GroupModuleLevelCode, FALSE);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
|
@ -219,6 +222,7 @@ ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_OperandCache);
|
|||
|
||||
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_StartupFlags, 0);
|
||||
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_Shutdown, TRUE);
|
||||
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_EarlyInitialization, TRUE);
|
||||
|
||||
/* Global handlers */
|
||||
|
||||
|
@ -238,7 +242,7 @@ ACPI_GLOBAL (UINT8, AcpiGbl_NextOwnerIdOffset);
|
|||
|
||||
/* Initialization sequencing */
|
||||
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_RegMethodsExecuted);
|
||||
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_RegMethodsEnabled, FALSE);
|
||||
|
||||
/* Misc */
|
||||
|
||||
|
@ -400,9 +404,9 @@ ACPI_GLOBAL (ACPI_EXTERNAL_FILE *, AcpiGbl_ExternalFileList);
|
|||
|
||||
#ifdef ACPI_DEBUGGER
|
||||
|
||||
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DbTerminateThreads, FALSE);
|
||||
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_AbortMethod, FALSE);
|
||||
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_MethodExecuting, FALSE);
|
||||
ACPI_INIT_GLOBAL (ACPI_THREAD_ID, AcpiGbl_DbThreadId, ACPI_INVALID_THREAD_ID);
|
||||
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoIniMethods);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoRegionSupport);
|
||||
|
@ -412,6 +416,8 @@ ACPI_GLOBAL (char *, AcpiGbl_DbFilename);
|
|||
ACPI_GLOBAL (UINT32, AcpiGbl_DbDebugLevel);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_DbConsoleDebugLevel);
|
||||
ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_DbScopeNode);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbTerminateLoop);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbThreadsTerminated);
|
||||
|
||||
ACPI_GLOBAL (char *, AcpiGbl_DbArgs[ACPI_DEBUGGER_MAX_ARGS]);
|
||||
ACPI_GLOBAL (ACPI_OBJECT_TYPE, AcpiGbl_DbArgTypes[ACPI_DEBUGGER_MAX_ARGS]);
|
||||
|
|
|
@ -190,6 +190,14 @@ typedef struct acpi_rw_lock
|
|||
|
||||
#define ACPI_MUTEX_NOT_ACQUIRED (ACPI_THREAD_ID) -1
|
||||
|
||||
/* This Thread ID means an invalid thread ID */
|
||||
|
||||
#ifdef ACPI_OS_INVALID_THREAD_ID
|
||||
#define ACPI_INVALID_THREAD_ID ACPI_OS_INVALID_THREAD_ID
|
||||
#else
|
||||
#define ACPI_INVALID_THREAD_ID ((ACPI_THREAD_ID) 0xFFFFFFFF)
|
||||
#endif
|
||||
|
||||
/* Table for the global mutexes */
|
||||
|
||||
typedef struct acpi_mutex_info
|
||||
|
@ -308,6 +316,16 @@ typedef struct acpi_table_list
|
|||
#define ACPI_ROOT_ALLOW_RESIZE (2)
|
||||
|
||||
|
||||
/* List to manage incoming ACPI tables */
|
||||
|
||||
typedef struct acpi_new_table_desc
|
||||
{
|
||||
ACPI_TABLE_HEADER *Table;
|
||||
struct acpi_new_table_desc *Next;
|
||||
|
||||
} ACPI_NEW_TABLE_DESC;
|
||||
|
||||
|
||||
/* Predefined table indexes */
|
||||
|
||||
#define ACPI_INVALID_TABLE_INDEX (0xFFFFFFFF)
|
||||
|
@ -507,6 +525,7 @@ typedef union acpi_predefined_info
|
|||
/* Return object auto-repair info */
|
||||
|
||||
typedef ACPI_STATUS (*ACPI_OBJECT_CONVERTER) (
|
||||
struct acpi_namespace_node *Scope,
|
||||
union acpi_operand_object *OriginalObject,
|
||||
union acpi_operand_object **ConvertedObject);
|
||||
|
||||
|
@ -542,6 +561,7 @@ typedef struct acpi_simple_repair_info
|
|||
typedef struct acpi_reg_walk_info
|
||||
{
|
||||
ACPI_ADR_SPACE_TYPE SpaceId;
|
||||
UINT32 Function;
|
||||
UINT32 RegRunCount;
|
||||
|
||||
} ACPI_REG_WALK_INFO;
|
||||
|
@ -1094,6 +1114,7 @@ typedef struct acpi_parse_state
|
|||
#define ACPI_PARSEOP_CLOSING_PAREN 0x10
|
||||
#define ACPI_PARSEOP_COMPOUND 0x20
|
||||
#define ACPI_PARSEOP_ASSIGNMENT 0x40
|
||||
#define ACPI_PARSEOP_ELSEIF 0x80
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
|
@ -477,18 +477,6 @@
|
|||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Some code only gets executed when the debugger is built in.
|
||||
* Note that this is entirely independent of whether the
|
||||
* DEBUG_PRINT stuff (set by ACPI_DEBUG_OUTPUT) is on, or not.
|
||||
*/
|
||||
#ifdef ACPI_DEBUGGER
|
||||
#define ACPI_DEBUGGER_EXEC(a) a
|
||||
#else
|
||||
#define ACPI_DEBUGGER_EXEC(a)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Macros used for ACPICA utilities only
|
||||
*/
|
||||
|
|
|
@ -150,6 +150,7 @@
|
|||
/* Object is not a package element */
|
||||
|
||||
#define ACPI_NOT_PACKAGE_ELEMENT ACPI_UINT32_MAX
|
||||
#define ACPI_ALL_PACKAGE_ELEMENTS (ACPI_UINT32_MAX-1)
|
||||
|
||||
/* Always emit warning message, not dependent on node flags */
|
||||
|
||||
|
@ -296,11 +297,19 @@ AcpiNsConvertToBuffer (
|
|||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToUnicode (
|
||||
ACPI_NAMESPACE_NODE *Scope,
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToResource (
|
||||
ACPI_NAMESPACE_NODE *Scope,
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToReference (
|
||||
ACPI_NAMESPACE_NODE *Scope,
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
|
||||
|
|
|
@ -166,9 +166,10 @@
|
|||
#define AOPOBJ_AML_CONSTANT 0x01 /* Integer is an AML constant */
|
||||
#define AOPOBJ_STATIC_POINTER 0x02 /* Data is part of an ACPI table, don't delete */
|
||||
#define AOPOBJ_DATA_VALID 0x04 /* Object is initialized and data is valid */
|
||||
#define AOPOBJ_OBJECT_INITIALIZED 0x08 /* Region is initialized, _REG was run */
|
||||
#define AOPOBJ_SETUP_COMPLETE 0x10 /* Region setup is complete */
|
||||
#define AOPOBJ_INVALID 0x20 /* Host OS won't allow a Region address */
|
||||
#define AOPOBJ_OBJECT_INITIALIZED 0x08 /* Region is initialized */
|
||||
#define AOPOBJ_REG_CONNECTED 0x10 /* _REG was run */
|
||||
#define AOPOBJ_SETUP_COMPLETE 0x20 /* Region setup is complete */
|
||||
#define AOPOBJ_INVALID 0x40 /* Host OS won't allow a Region address */
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
|
|
|
@ -165,7 +165,7 @@
|
|||
#define ARGP_BYTELIST_OP ARGP_LIST1 (ARGP_NAMESTRING)
|
||||
#define ARGP_CONCAT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
|
||||
#define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
|
||||
#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SUPERNAME)
|
||||
#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_NAME_OR_REF,ARGP_TARGET)
|
||||
#define ARGP_CONNECTFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
|
||||
#define ARGP_CONTINUE_OP ARG_NONE
|
||||
#define ARGP_COPY_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SIMPLENAME)
|
||||
|
@ -225,13 +225,14 @@
|
|||
#define ARGP_NAMEPATH_OP ARGP_LIST1 (ARGP_NAMESTRING)
|
||||
#define ARGP_NOOP_OP ARG_NONE
|
||||
#define ARGP_NOTIFY_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_TERMARG)
|
||||
#define ARGP_OBJECT_TYPE_OP ARGP_LIST1 (ARGP_NAME_OR_REF)
|
||||
#define ARGP_ONE_OP ARG_NONE
|
||||
#define ARGP_ONES_OP ARG_NONE
|
||||
#define ARGP_PACKAGE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_BYTEDATA, ARGP_DATAOBJLIST)
|
||||
#define ARGP_POWER_RES_OP ARGP_LIST5 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_WORDDATA, ARGP_OBJLIST)
|
||||
#define ARGP_PROCESSOR_OP ARGP_LIST6 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_BYTEDATA, ARGP_OBJLIST)
|
||||
#define ARGP_QWORD_OP ARGP_LIST1 (ARGP_QWORDDATA)
|
||||
#define ARGP_REF_OF_OP ARGP_LIST1 (ARGP_SUPERNAME)
|
||||
#define ARGP_REF_OF_OP ARGP_LIST1 (ARGP_NAME_OR_REF)
|
||||
#define ARGP_REGION_OP ARGP_LIST4 (ARGP_NAME, ARGP_BYTEDATA, ARGP_TERMARG, ARGP_TERMARG)
|
||||
#define ARGP_RELEASE_OP ARGP_LIST1 (ARGP_SUPERNAME)
|
||||
#define ARGP_RESERVEDFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
|
||||
|
@ -258,7 +259,6 @@
|
|||
#define ARGP_TO_HEX_STR_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
|
||||
#define ARGP_TO_INTEGER_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
|
||||
#define ARGP_TO_STRING_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
|
||||
#define ARGP_TYPE_OP ARGP_LIST1 (ARGP_SUPERNAME)
|
||||
#define ARGP_UNLOAD_OP ARGP_LIST1 (ARGP_SUPERNAME)
|
||||
#define ARGP_VAR_PACKAGE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_DATAOBJLIST)
|
||||
#define ARGP_WAIT_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_TERMARG)
|
||||
|
@ -297,7 +297,7 @@
|
|||
#define ARGI_BUFFER_OP ARGI_LIST1 (ARGI_INTEGER)
|
||||
#define ARGI_BYTE_OP ARGI_INVALID_OPCODE
|
||||
#define ARGI_BYTELIST_OP ARGI_INVALID_OPCODE
|
||||
#define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA, ARGI_TARGETREF)
|
||||
#define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_ANYTYPE, ARGI_ANYTYPE, ARGI_TARGETREF)
|
||||
#define ARGI_CONCAT_RES_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_BUFFER, ARGI_TARGETREF)
|
||||
#define ARGI_COND_REF_OF_OP ARGI_LIST2 (ARGI_OBJECT_REF, ARGI_TARGETREF)
|
||||
#define ARGI_CONNECTFIELD_OP ARGI_INVALID_OPCODE
|
||||
|
@ -359,6 +359,7 @@
|
|||
#define ARGI_NAMEPATH_OP ARGI_INVALID_OPCODE
|
||||
#define ARGI_NOOP_OP ARG_NONE
|
||||
#define ARGI_NOTIFY_OP ARGI_LIST2 (ARGI_DEVICE_REF, ARGI_INTEGER)
|
||||
#define ARGI_OBJECT_TYPE_OP ARGI_LIST1 (ARGI_ANYTYPE)
|
||||
#define ARGI_ONE_OP ARG_NONE
|
||||
#define ARGI_ONES_OP ARG_NONE
|
||||
#define ARGI_PACKAGE_OP ARGI_LIST1 (ARGI_INTEGER)
|
||||
|
@ -392,7 +393,6 @@
|
|||
#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_TYPE_OP ARGI_LIST1 (ARGI_ANYTYPE)
|
||||
#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)
|
||||
|
|
|
@ -178,7 +178,12 @@ AcpiPsGetNextNamepath (
|
|||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_STATE *ParserState,
|
||||
ACPI_PARSE_OBJECT *Arg,
|
||||
BOOLEAN MethodCall);
|
||||
BOOLEAN PossibleMethodCall);
|
||||
|
||||
/* Values for BOOLEAN above */
|
||||
|
||||
#define ACPI_NOT_METHOD_CALL FALSE
|
||||
#define ACPI_POSSIBLE_METHOD_CALL TRUE
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiPsGetNextArg (
|
||||
|
|
|
@ -129,7 +129,8 @@ typedef enum
|
|||
OSL_GLOBAL_LOCK_HANDLER,
|
||||
OSL_NOTIFY_HANDLER,
|
||||
OSL_GPE_HANDLER,
|
||||
OSL_DEBUGGER_THREAD,
|
||||
OSL_DEBUGGER_MAIN_THREAD,
|
||||
OSL_DEBUGGER_EXEC_THREAD,
|
||||
OSL_EC_POLL_HANDLER,
|
||||
OSL_EC_BURST_HANDLER
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@
|
|||
|
||||
/* Current ACPICA subsystem version in YYYYMMDD format */
|
||||
|
||||
#define ACPI_CA_VERSION 0x20150930
|
||||
#define ACPI_CA_VERSION 0x20151218
|
||||
|
||||
#include "acconfig.h"
|
||||
#include "actypes.h"
|
||||
|
@ -263,6 +263,11 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CopyDsdtLocally, FALSE);
|
|||
*/
|
||||
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE);
|
||||
|
||||
/*
|
||||
* Optionally allow default region handlers to be overridden.
|
||||
*/
|
||||
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_OverrideDefaultRegionHandlers, FALSE);
|
||||
|
||||
/*
|
||||
* Optionally use 32-bit FADT addresses if and when there is a conflict
|
||||
* (address mismatch) between the 32-bit and 64-bit versions of the
|
||||
|
@ -341,6 +346,10 @@ ACPI_INIT_GLOBAL (UINT32, AcpiDbgLevel, ACPI_NORMAL_DEFAULT);
|
|||
#endif
|
||||
ACPI_INIT_GLOBAL (UINT32, AcpiDbgLayer, ACPI_COMPONENT_DEFAULT);
|
||||
|
||||
/* Optionally enable timer output with Debug Object output */
|
||||
|
||||
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisplayDebugTimer, FALSE);
|
||||
|
||||
/*
|
||||
* Other miscellaneous globals
|
||||
*/
|
||||
|
@ -449,6 +458,30 @@ ACPI_GLOBAL (BOOLEAN, AcpiGbl_SystemAwakeAndRunning);
|
|||
#endif /* ACPI_APPLICATION */
|
||||
|
||||
|
||||
/*
|
||||
* Debugger prototypes
|
||||
*
|
||||
* All interfaces used by debugger will be configured
|
||||
* out of the ACPICA build unless the ACPI_DEBUGGER
|
||||
* flag is defined.
|
||||
*/
|
||||
#ifdef ACPI_DEBUGGER
|
||||
#define ACPI_DBR_DEPENDENT_RETURN_OK(Prototype) \
|
||||
ACPI_EXTERNAL_RETURN_OK(Prototype)
|
||||
|
||||
#define ACPI_DBR_DEPENDENT_RETURN_VOID(Prototype) \
|
||||
ACPI_EXTERNAL_RETURN_VOID(Prototype)
|
||||
|
||||
#else
|
||||
#define ACPI_DBR_DEPENDENT_RETURN_OK(Prototype) \
|
||||
static ACPI_INLINE Prototype {return(AE_OK);}
|
||||
|
||||
#define ACPI_DBR_DEPENDENT_RETURN_VOID(Prototype) \
|
||||
static ACPI_INLINE Prototype {return;}
|
||||
|
||||
#endif /* ACPI_DEBUGGER */
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* ACPICA public interface prototypes
|
||||
|
@ -1288,4 +1321,8 @@ void
|
|||
AcpiTerminateDebugger (
|
||||
void);
|
||||
|
||||
void
|
||||
AcpiSetDebuggerThreadId (
|
||||
ACPI_THREAD_ID ThreadId);
|
||||
|
||||
#endif /* __ACXFACE_H__ */
|
||||
|
|
|
@ -187,7 +187,7 @@ AcpiTbSetTableLoadedFlag (
|
|||
*/
|
||||
void
|
||||
AcpiTbParseFadt (
|
||||
UINT32 TableIndex);
|
||||
void);
|
||||
|
||||
void
|
||||
AcpiTbCreateLocalFadt (
|
||||
|
@ -279,10 +279,6 @@ ACPI_STATUS
|
|||
AcpiTbInitializeFacs (
|
||||
void);
|
||||
|
||||
BOOLEAN
|
||||
AcpiTbTablesLoaded (
|
||||
void);
|
||||
|
||||
void
|
||||
AcpiTbPrintTableHeader(
|
||||
ACPI_PHYSICAL_ADDRESS Address,
|
||||
|
|
|
@ -1304,7 +1304,7 @@ UINT32 (*ACPI_INTERFACE_HANDLER) (
|
|||
#define ACPI_PCICLS_STRING_SIZE 7 /* Includes null terminator */
|
||||
|
||||
|
||||
/* Structures used for device/processor HID, UID, CID, and SUB */
|
||||
/* Structures used for device/processor HID, UID, CID */
|
||||
|
||||
typedef struct acpi_pnp_device_id
|
||||
{
|
||||
|
@ -1339,7 +1339,6 @@ typedef struct acpi_device_info
|
|||
UINT64 Address; /* _ADR value */
|
||||
ACPI_PNP_DEVICE_ID HardwareId; /* _HID value */
|
||||
ACPI_PNP_DEVICE_ID UniqueId; /* _UID value */
|
||||
ACPI_PNP_DEVICE_ID SubsystemId; /* _SUB value */
|
||||
ACPI_PNP_DEVICE_ID ClassCode; /* _CLS value */
|
||||
ACPI_PNP_DEVICE_ID_LIST CompatibleIdList; /* _CID list <must be last> */
|
||||
|
||||
|
@ -1355,13 +1354,12 @@ typedef struct acpi_device_info
|
|||
#define ACPI_VALID_ADR 0x0002
|
||||
#define ACPI_VALID_HID 0x0004
|
||||
#define ACPI_VALID_UID 0x0008
|
||||
#define ACPI_VALID_SUB 0x0010
|
||||
#define ACPI_VALID_CID 0x0020
|
||||
#define ACPI_VALID_CLS 0x0040
|
||||
#define ACPI_VALID_SXDS 0x0100
|
||||
#define ACPI_VALID_SXWS 0x0200
|
||||
|
||||
/* Flags for _STA return value (CurrentStatus above) */
|
||||
/* Flags for _STA method */
|
||||
|
||||
#define ACPI_STA_DEVICE_PRESENT 0x01
|
||||
#define ACPI_STA_DEVICE_ENABLED 0x02
|
||||
|
|
|
@ -278,7 +278,7 @@ AcpiUtInitGlobals (
|
|||
|
||||
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
|
||||
|
||||
char *
|
||||
const char *
|
||||
AcpiUtGetMutexName (
|
||||
UINT32 MutexId);
|
||||
|
||||
|
@ -288,15 +288,15 @@ AcpiUtGetNotifyName (
|
|||
ACPI_OBJECT_TYPE Type);
|
||||
#endif
|
||||
|
||||
char *
|
||||
const char *
|
||||
AcpiUtGetTypeName (
|
||||
ACPI_OBJECT_TYPE Type);
|
||||
|
||||
char *
|
||||
const char *
|
||||
AcpiUtGetNodeName (
|
||||
void *Object);
|
||||
|
||||
char *
|
||||
const char *
|
||||
AcpiUtGetDescriptorName (
|
||||
void *Object);
|
||||
|
||||
|
@ -304,15 +304,15 @@ const char *
|
|||
AcpiUtGetReferenceName (
|
||||
ACPI_OPERAND_OBJECT *Object);
|
||||
|
||||
char *
|
||||
const char *
|
||||
AcpiUtGetObjectTypeName (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc);
|
||||
|
||||
char *
|
||||
const char *
|
||||
AcpiUtGetRegionName (
|
||||
UINT8 SpaceId);
|
||||
|
||||
char *
|
||||
const char *
|
||||
AcpiUtGetEventName (
|
||||
UINT32 EventId);
|
||||
|
||||
|
@ -555,17 +555,6 @@ AcpiUtExecutePowerMethods (
|
|||
UINT8 *OutValues);
|
||||
|
||||
|
||||
/*
|
||||
* utfileio - file operations
|
||||
*/
|
||||
#ifdef ACPI_APPLICATION
|
||||
ACPI_STATUS
|
||||
AcpiUtReadTableFromFile (
|
||||
char *Filename,
|
||||
ACPI_TABLE_HEADER **Table);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* utids - device ID support
|
||||
*/
|
||||
|
@ -579,11 +568,6 @@ AcpiUtExecute_UID (
|
|||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_PNP_DEVICE_ID **ReturnId);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_SUB (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_PNP_DEVICE_ID **ReturnId);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_CID (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
|
|
|
@ -192,7 +192,7 @@
|
|||
#define AML_CREATE_WORD_FIELD_OP (UINT16) 0x8b
|
||||
#define AML_CREATE_BYTE_FIELD_OP (UINT16) 0x8c
|
||||
#define AML_CREATE_BIT_FIELD_OP (UINT16) 0x8d
|
||||
#define AML_TYPE_OP (UINT16) 0x8e
|
||||
#define AML_OBJECT_TYPE_OP (UINT16) 0x8e
|
||||
#define AML_CREATE_QWORD_FIELD_OP (UINT16) 0x8f /* ACPI 2.0 */
|
||||
#define AML_LAND_OP (UINT16) 0x90
|
||||
#define AML_LOR_OP (UINT16) 0x91
|
||||
|
@ -313,7 +313,8 @@
|
|||
#define ARGP_TERMLIST 0x0F
|
||||
#define ARGP_WORDDATA 0x10
|
||||
#define ARGP_QWORDDATA 0x11
|
||||
#define ARGP_SIMPLENAME 0x12
|
||||
#define ARGP_SIMPLENAME 0x12 /* NameString | LocalTerm | ArgTerm */
|
||||
#define ARGP_NAME_OR_REF 0x13 /* For ObjectType only */
|
||||
|
||||
/*
|
||||
* Resolved argument types for the AML Interpreter
|
||||
|
|
|
@ -136,12 +136,16 @@
|
|||
|
||||
#define ACPI_USE_SYSTEM_INTTYPES
|
||||
|
||||
/* Compile for reduced hardware mode only with this kernel config */
|
||||
/* Kernel specific ACPICA configuration */
|
||||
|
||||
#ifdef CONFIG_ACPI_REDUCED_HARDWARE_ONLY
|
||||
#define ACPI_REDUCED_HARDWARE 1
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ACPI_DEBUGGER
|
||||
#define ACPI_DEBUGGER
|
||||
#endif
|
||||
|
||||
#include <linux/string.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/ctype.h>
|
||||
|
@ -224,7 +228,6 @@
|
|||
* OSL interfaces used by utilities
|
||||
*/
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRedirectOutput
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetLine
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByName
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByIndex
|
||||
#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByAddress
|
||||
|
|
|
@ -208,6 +208,15 @@ AcpiOsGetThreadId (
|
|||
Lock ? AE_OK : AE_NO_MEMORY; \
|
||||
})
|
||||
|
||||
static inline BOOLEAN
|
||||
AcpiOsReadable (
|
||||
void *Pointer,
|
||||
ACPI_SIZE Length)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* OSL interfaces added by Linux
|
||||
*/
|
||||
|
|
|
@ -349,7 +349,8 @@ AcpiNsInstallNode (
|
|||
* modified the namespace. This is used for cleanup when the
|
||||
* method exits.
|
||||
*/
|
||||
WalkState->MethodDesc->Method.InfoFlags |= ACPI_METHOD_MODIFIED_NAMESPACE;
|
||||
WalkState->MethodDesc->Method.InfoFlags |=
|
||||
ACPI_METHOD_MODIFIED_NAMESPACE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -209,7 +209,8 @@ AcpiNsCheckAcpiCompliance (
|
|||
|
||||
/* Get the ACPI-required arg count from the predefined info table */
|
||||
|
||||
RequiredParamCount = METHOD_GET_ARG_COUNT (Predefined->Info.ArgumentList);
|
||||
RequiredParamCount =
|
||||
METHOD_GET_ARG_COUNT (Predefined->Info.ArgumentList);
|
||||
|
||||
/*
|
||||
* If this object is not a control method, we can check if the ACPI
|
||||
|
@ -355,7 +356,8 @@ AcpiNsCheckArgumentCount (
|
|||
* Some methods are allowed to have a "minimum" number of args (_SCP)
|
||||
* because their definition in ACPI has changed over time.
|
||||
*/
|
||||
RequiredParamCount = METHOD_GET_ARG_COUNT (Predefined->Info.ArgumentList);
|
||||
RequiredParamCount =
|
||||
METHOD_GET_ARG_COUNT (Predefined->Info.ArgumentList);
|
||||
|
||||
if (UserParamCount < RequiredParamCount)
|
||||
{
|
||||
|
|
|
@ -176,7 +176,8 @@ AcpiNsConvertToInteger (
|
|||
|
||||
for (i = 0; i < OriginalObject->Buffer.Length; i++)
|
||||
{
|
||||
Value |= ((UINT64) OriginalObject->Buffer.Pointer[i] << (i * 8));
|
||||
Value |= ((UINT64)
|
||||
OriginalObject->Buffer.Pointer[i] << (i * 8));
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -239,8 +240,8 @@ AcpiNsConvertToString (
|
|||
}
|
||||
else
|
||||
{
|
||||
Status = AcpiExConvertToString (OriginalObject, &NewObject,
|
||||
ACPI_IMPLICIT_CONVERT_HEX);
|
||||
Status = AcpiExConvertToString (OriginalObject,
|
||||
&NewObject, ACPI_IMPLICIT_CONVERT_HEX);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
|
@ -335,7 +336,8 @@ AcpiNsConvertToBuffer (
|
|||
|
||||
/* String-to-Buffer conversion. Simple data copy */
|
||||
|
||||
NewObject = AcpiUtCreateBufferObject (OriginalObject->String.Length);
|
||||
NewObject = AcpiUtCreateBufferObject
|
||||
(OriginalObject->String.Length);
|
||||
if (!NewObject)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
|
@ -402,7 +404,8 @@ AcpiNsConvertToBuffer (
|
|||
*
|
||||
* FUNCTION: AcpiNsConvertToUnicode
|
||||
*
|
||||
* PARAMETERS: OriginalObject - ASCII String Object to be converted
|
||||
* PARAMETERS: Scope - Namespace node for the method/object
|
||||
* OriginalObject - ASCII String Object to be converted
|
||||
* ReturnObject - Where the new converted object is returned
|
||||
*
|
||||
* RETURN: Status. AE_OK if conversion was successful.
|
||||
|
@ -413,6 +416,7 @@ AcpiNsConvertToBuffer (
|
|||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToUnicode (
|
||||
ACPI_NAMESPACE_NODE *Scope,
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject)
|
||||
{
|
||||
|
@ -474,7 +478,8 @@ AcpiNsConvertToUnicode (
|
|||
*
|
||||
* FUNCTION: AcpiNsConvertToResource
|
||||
*
|
||||
* PARAMETERS: OriginalObject - Object to be converted
|
||||
* PARAMETERS: Scope - Namespace node for the method/object
|
||||
* OriginalObject - Object to be converted
|
||||
* ReturnObject - Where the new converted object is returned
|
||||
*
|
||||
* RETURN: Status. AE_OK if conversion was successful
|
||||
|
@ -486,6 +491,7 @@ AcpiNsConvertToUnicode (
|
|||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToResource (
|
||||
ACPI_NAMESPACE_NODE *Scope,
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject)
|
||||
{
|
||||
|
@ -552,3 +558,81 @@ AcpiNsConvertToResource (
|
|||
*ReturnObject = NewObject;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsConvertToReference
|
||||
*
|
||||
* PARAMETERS: Scope - Namespace node for the method/object
|
||||
* OriginalObject - Object to be converted
|
||||
* ReturnObject - Where the new converted object is returned
|
||||
*
|
||||
* RETURN: Status. AE_OK if conversion was successful
|
||||
*
|
||||
* DESCRIPTION: Attempt to convert a Integer object to a ObjectReference.
|
||||
* Buffer.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToReference (
|
||||
ACPI_NAMESPACE_NODE *Scope,
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *NewObject = NULL;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_GENERIC_STATE ScopeInfo;
|
||||
char *Name;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (NsConvertToReference);
|
||||
|
||||
|
||||
/* Convert path into internal presentation */
|
||||
|
||||
Status = AcpiNsInternalizeName (OriginalObject->String.Pointer, &Name);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Find the namespace node */
|
||||
|
||||
ScopeInfo.Scope.Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Scope);
|
||||
Status = AcpiNsLookup (&ScopeInfo, Name,
|
||||
ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE,
|
||||
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
/* Check if we are resolving a named reference within a package */
|
||||
|
||||
ACPI_ERROR_NAMESPACE (OriginalObject->String.Pointer, Status);
|
||||
goto ErrorExit;
|
||||
}
|
||||
|
||||
/* Create and init a new internal ACPI object */
|
||||
|
||||
NewObject = AcpiUtCreateInternalObject (ACPI_TYPE_LOCAL_REFERENCE);
|
||||
if (!NewObject)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto ErrorExit;
|
||||
}
|
||||
NewObject->Reference.Node = Node;
|
||||
NewObject->Reference.Object = Node->Object;
|
||||
NewObject->Reference.Class = ACPI_REFCLASS_NAME;
|
||||
|
||||
/*
|
||||
* Increase reference of the object if needed (the object is likely a
|
||||
* null for device nodes).
|
||||
*/
|
||||
AcpiUtAddReference (Node->Object);
|
||||
|
||||
ErrorExit:
|
||||
ACPI_FREE (Name);
|
||||
*ReturnObject = NewObject;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
|
|
@ -331,7 +331,8 @@ AcpiNsDumpOneObject (
|
|||
|
||||
if (Type > ACPI_TYPE_LOCAL_MAX)
|
||||
{
|
||||
ACPI_WARNING ((AE_INFO, "Invalid ACPI Object Type 0x%08X", Type));
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Invalid ACPI Object Type 0x%08X", Type));
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%4.4s", AcpiUtGetNodeName (ThisNode));
|
||||
|
@ -637,14 +638,18 @@ AcpiNsDumpOneObject (
|
|||
|
||||
if (ObjType > ACPI_TYPE_LOCAL_MAX)
|
||||
{
|
||||
AcpiOsPrintf ("(Pointer to ACPI Object type %.2X [UNKNOWN])\n",
|
||||
AcpiOsPrintf (
|
||||
"(Pointer to ACPI Object type %.2X [UNKNOWN])\n",
|
||||
ObjType);
|
||||
|
||||
BytesToDump = 32;
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf ("(Pointer to ACPI Object type %.2X [%s])\n",
|
||||
AcpiOsPrintf (
|
||||
"(Pointer to ACPI Object type %.2X [%s])\n",
|
||||
ObjType, AcpiUtGetTypeName (ObjType));
|
||||
|
||||
BytesToDump = sizeof (ACPI_OPERAND_OBJECT);
|
||||
}
|
||||
|
||||
|
@ -674,7 +679,8 @@ AcpiNsDumpOneObject (
|
|||
*/
|
||||
BytesToDump = ObjDesc->String.Length;
|
||||
ObjDesc = (void *) ObjDesc->String.Pointer;
|
||||
AcpiOsPrintf ( "(Buffer/String pointer %p length %X)\n",
|
||||
|
||||
AcpiOsPrintf ("(Buffer/String pointer %p length %X)\n",
|
||||
ObjDesc, BytesToDump);
|
||||
ACPI_DUMP_BUFFER (ObjDesc, BytesToDump);
|
||||
goto Cleanup;
|
||||
|
@ -826,7 +832,7 @@ AcpiNsDumpOneObjectPath (
|
|||
return (AE_OK);
|
||||
}
|
||||
|
||||
Pathname = AcpiNsGetExternalPathname (Node);
|
||||
Pathname = AcpiNsGetNormalizedPathname (Node, TRUE);
|
||||
|
||||
PathIndent = 1;
|
||||
if (Level <= MaxLevel)
|
||||
|
@ -990,7 +996,8 @@ AcpiNsDumpTables (
|
|||
* If the name space has not been initialized,
|
||||
* there is nothing to dump.
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_TABLES, "namespace not initialized!\n"));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_TABLES,
|
||||
"namespace not initialized!\n"));
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@ AcpiNsEvaluate (
|
|||
|
||||
/* Get the full pathname to the object, for use in warning messages */
|
||||
|
||||
Info->FullPathname = AcpiNsGetExternalPathname (Info->Node);
|
||||
Info->FullPathname = AcpiNsGetNormalizedPathname (Info->Node, TRUE);
|
||||
if (!Info->FullPathname)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
|
@ -491,7 +491,7 @@ AcpiNsExecModuleCodeList (
|
|||
*
|
||||
* DESCRIPTION: Execute a control method containing a block of module-level
|
||||
* executable AML code. The control method is temporarily
|
||||
* installed to the root node, then evaluated.
|
||||
* installed to a local copy of the root node, then evaluated.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -500,10 +500,9 @@ AcpiNsExecModuleCode (
|
|||
ACPI_OPERAND_OBJECT *MethodObj,
|
||||
ACPI_EVALUATE_INFO *Info)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ParentObj;
|
||||
ACPI_NAMESPACE_NODE *ParentNode;
|
||||
ACPI_OBJECT_TYPE Type;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_NAMESPACE_NODE *TempNode;
|
||||
ACPI_NAMESPACE_NODE *ParentNode;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (NsExecModuleCode);
|
||||
|
@ -515,21 +514,18 @@ AcpiNsExecModuleCode (
|
|||
*/
|
||||
ParentNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
|
||||
MethodObj->Method.NextObject);
|
||||
Type = AcpiNsGetType (ParentNode);
|
||||
|
||||
/*
|
||||
* Get the region handler and save it in the method object. We may need
|
||||
* this if an operation region declaration causes a _REG method to be run.
|
||||
*
|
||||
* We can't do this in AcpiPsLinkModuleCode because
|
||||
* AcpiGbl_RootNode->Object is NULL at PASS1.
|
||||
*/
|
||||
if ((Type == ACPI_TYPE_DEVICE) && ParentNode->Object)
|
||||
/* Take a copy of the parent node to act as parent of this method */
|
||||
|
||||
TempNode = ACPI_ALLOCATE (sizeof (ACPI_NAMESPACE_NODE));
|
||||
if (!TempNode)
|
||||
{
|
||||
MethodObj->Method.Dispatch.Handler =
|
||||
ParentNode->Object->Device.Handler;
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
memcpy (TempNode, ParentNode, sizeof (ACPI_NAMESPACE_NODE));
|
||||
TempNode->Object = NULL; /* Clear the subobject */
|
||||
|
||||
/* Must clear NextObject (AcpiNsAttachObject needs the field) */
|
||||
|
||||
MethodObj->Method.NextObject = NULL;
|
||||
|
@ -537,26 +533,14 @@ AcpiNsExecModuleCode (
|
|||
/* Initialize the evaluation information block */
|
||||
|
||||
memset (Info, 0, sizeof (ACPI_EVALUATE_INFO));
|
||||
Info->PrefixNode = ParentNode;
|
||||
|
||||
/*
|
||||
* Get the currently attached parent object. Add a reference, because the
|
||||
* ref count will be decreased when the method object is installed to
|
||||
* the parent node.
|
||||
*/
|
||||
ParentObj = AcpiNsGetAttachedObject (ParentNode);
|
||||
if (ParentObj)
|
||||
{
|
||||
AcpiUtAddReference (ParentObj);
|
||||
}
|
||||
Info->PrefixNode = TempNode;
|
||||
|
||||
/* Install the method (module-level code) in the parent node */
|
||||
|
||||
Status = AcpiNsAttachObject (ParentNode, MethodObj,
|
||||
ACPI_TYPE_METHOD);
|
||||
Status = AcpiNsAttachObject (TempNode, MethodObj, ACPI_TYPE_METHOD);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Exit;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Execute the parent node as a control method */
|
||||
|
@ -574,25 +558,7 @@ AcpiNsExecModuleCode (
|
|||
AcpiUtRemoveReference (Info->ReturnObject);
|
||||
}
|
||||
|
||||
/* Detach the temporary method object */
|
||||
|
||||
AcpiNsDetachObject (ParentNode);
|
||||
|
||||
/* Restore the original parent object */
|
||||
|
||||
if (ParentObj)
|
||||
{
|
||||
Status = AcpiNsAttachObject (ParentNode, ParentObj, Type);
|
||||
}
|
||||
else
|
||||
{
|
||||
ParentNode->Type = (UINT8) Type;
|
||||
}
|
||||
|
||||
Exit:
|
||||
if (ParentObj)
|
||||
{
|
||||
AcpiUtRemoveReference (ParentObj);
|
||||
}
|
||||
Cleanup:
|
||||
ACPI_FREE (TempNode);
|
||||
return_VOID;
|
||||
}
|
||||
|
|
|
@ -703,7 +703,7 @@ AcpiNsInitOneDevice (
|
|||
{
|
||||
/* Ignore error and move on to next device */
|
||||
|
||||
char *ScopeName = AcpiNsGetExternalPathname (Info->Node);
|
||||
char *ScopeName = AcpiNsGetNormalizedPathname (DeviceNode, TRUE);
|
||||
|
||||
ACPI_EXCEPTION ((AE_INFO, Status, "during %s._INI execution",
|
||||
ScopeName));
|
||||
|
|
|
@ -239,6 +239,24 @@ Unlock:
|
|||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"**** 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 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.
|
||||
*/
|
||||
if (!AcpiGbl_GroupModuleLevelCode)
|
||||
{
|
||||
AcpiNsExecModuleCodeList ();
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
@ -432,7 +450,6 @@ AcpiNsUnloadNamespace (
|
|||
/* This function does the real work */
|
||||
|
||||
Status = AcpiNsDeleteSubtree (Handle);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -149,7 +149,6 @@ AcpiNsGetExternalPathname (
|
|||
|
||||
|
||||
NameBuffer = AcpiNsGetNormalizedPathname (Node, FALSE);
|
||||
|
||||
return_PTR (NameBuffer);
|
||||
}
|
||||
|
||||
|
@ -177,7 +176,6 @@ AcpiNsGetPathnameLength (
|
|||
|
||||
|
||||
Size = AcpiNsBuildNormalizedPath (Node, NULL, 0, FALSE);
|
||||
|
||||
return (Size);
|
||||
}
|
||||
|
||||
|
@ -318,6 +316,7 @@ AcpiNsBuildNormalizedPath (
|
|||
{
|
||||
ACPI_PATH_PUT8(FullPath, PathSize, AML_DUAL_NAME_PREFIX, Length);
|
||||
}
|
||||
|
||||
ACPI_MOVE_32_TO_32 (Name, &NextNode->Name);
|
||||
DoNoTrailing = NoTrailing;
|
||||
for (i = 0; i < 4; i++)
|
||||
|
@ -332,8 +331,10 @@ AcpiNsBuildNormalizedPath (
|
|||
ACPI_PATH_PUT8(FullPath, PathSize, c, Length);
|
||||
}
|
||||
}
|
||||
|
||||
NextNode = NextNode->Parent;
|
||||
}
|
||||
|
||||
ACPI_PATH_PUT8(FullPath, PathSize, AML_ROOT_PREFIX, Length);
|
||||
|
||||
/* Reverse the path string */
|
||||
|
@ -341,7 +342,8 @@ AcpiNsBuildNormalizedPath (
|
|||
if (Length <= PathSize)
|
||||
{
|
||||
Left = FullPath;
|
||||
Right = FullPath+Length-1;
|
||||
Right = FullPath+Length - 1;
|
||||
|
||||
while (Left < Right)
|
||||
{
|
||||
c = *Left;
|
||||
|
@ -353,7 +355,7 @@ AcpiNsBuildNormalizedPath (
|
|||
/* Append the trailing null */
|
||||
|
||||
BuildTrailingNull:
|
||||
ACPI_PATH_PUT8(FullPath, PathSize, '\0', Length);
|
||||
ACPI_PATH_PUT8 (FullPath, PathSize, '\0', Length);
|
||||
|
||||
#undef ACPI_PATH_PUT8
|
||||
|
||||
|
@ -403,7 +405,8 @@ AcpiNsGetNormalizedPathname (
|
|||
NameBuffer = ACPI_ALLOCATE_ZEROED (Size);
|
||||
if (!NameBuffer)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Could not allocate %u bytes", (UINT32) Size));
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Could not allocate %u bytes", (UINT32) Size));
|
||||
return_PTR (NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -215,7 +215,8 @@ AcpiNsOneCompleteParse (
|
|||
|
||||
if (StartNode && StartNode != AcpiGbl_RootNode)
|
||||
{
|
||||
Status = AcpiDsScopeStackPush (StartNode, ACPI_TYPE_METHOD, WalkState);
|
||||
Status = AcpiDsScopeStackPush (
|
||||
StartNode, ACPI_TYPE_METHOD, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiDsDeleteWalkState (WalkState);
|
||||
|
@ -225,7 +226,8 @@ AcpiNsOneCompleteParse (
|
|||
|
||||
/* Parse the AML */
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "*PARSE* pass %u parse\n", PassNumber));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
|
||||
"*PARSE* pass %u parse\n", PassNumber));
|
||||
Status = AcpiPsParseAml (WalkState);
|
||||
|
||||
Cleanup:
|
||||
|
@ -269,6 +271,7 @@ AcpiNsParseTable (
|
|||
* performs another complete parse of the AML.
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 1\n"));
|
||||
|
||||
Status = AcpiNsOneCompleteParse (ACPI_IMODE_LOAD_PASS1,
|
||||
TableIndex, StartNode);
|
||||
if (ACPI_FAILURE (Status))
|
||||
|
|
|
@ -312,8 +312,8 @@ AcpiNsCheckPackage (
|
|||
|
||||
/* First element is the (Integer) revision */
|
||||
|
||||
Status = AcpiNsCheckObjectType (Info, Elements,
|
||||
ACPI_RTYPE_INTEGER, 0);
|
||||
Status = AcpiNsCheckObjectType (
|
||||
Info, Elements, ACPI_RTYPE_INTEGER, 0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
|
@ -331,8 +331,8 @@ AcpiNsCheckPackage (
|
|||
|
||||
/* First element is the (Integer) count of subpackages to follow */
|
||||
|
||||
Status = AcpiNsCheckObjectType (Info, Elements,
|
||||
ACPI_RTYPE_INTEGER, 0);
|
||||
Status = AcpiNsCheckObjectType (
|
||||
Info, Elements, ACPI_RTYPE_INTEGER, 0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
|
@ -375,7 +375,8 @@ AcpiNsCheckPackage (
|
|||
{
|
||||
/* Create the new outer package and populate it */
|
||||
|
||||
Status = AcpiNsWrapWithPackage (Info, ReturnObject, ReturnObjectPtr);
|
||||
Status = AcpiNsWrapWithPackage (
|
||||
Info, ReturnObject, ReturnObjectPtr);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
|
|
|
@ -186,6 +186,11 @@ static const ACPI_SIMPLE_REPAIR_INFO AcpiObjectRepairInfo[] =
|
|||
ACPI_NOT_PACKAGE_ELEMENT,
|
||||
AcpiNsConvertToResource },
|
||||
|
||||
/* Object reference conversions */
|
||||
|
||||
{ "_DEP", ACPI_RTYPE_STRING, ACPI_ALL_PACKAGE_ELEMENTS,
|
||||
AcpiNsConvertToReference },
|
||||
|
||||
/* Unicode conversions */
|
||||
|
||||
{ "_MLS", ACPI_RTYPE_STRING, 1,
|
||||
|
@ -246,7 +251,8 @@ AcpiNsSimpleRepair (
|
|||
ACPI_WARN_ALWAYS, "Missing expected return value"));
|
||||
}
|
||||
|
||||
Status = Predefined->ObjectConverter (ReturnObject, &NewObject);
|
||||
Status = Predefined->ObjectConverter (Info->Node, ReturnObject,
|
||||
&NewObject);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
/* A fatal error occurred during a conversion */
|
||||
|
@ -445,13 +451,15 @@ AcpiNsMatchSimpleRepair (
|
|||
/* Check if we can actually repair this name/type combination */
|
||||
|
||||
if ((ReturnBtype & ThisName->UnexpectedBtypes) &&
|
||||
(PackageIndex == ThisName->PackageIndex))
|
||||
(ThisName->PackageIndex == ACPI_ALL_PACKAGE_ELEMENTS ||
|
||||
PackageIndex == ThisName->PackageIndex))
|
||||
{
|
||||
return (ThisName);
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
ThisName++;
|
||||
}
|
||||
|
||||
|
@ -536,11 +544,13 @@ AcpiNsRepairNullElement (
|
|||
|
||||
/* Set the reference count according to the parent Package object */
|
||||
|
||||
NewObject->Common.ReferenceCount = Info->ParentPackage->Common.ReferenceCount;
|
||||
NewObject->Common.ReferenceCount =
|
||||
Info->ParentPackage->Common.ReferenceCount;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR,
|
||||
"%s: Converted NULL package element to expected %s at index %u\n",
|
||||
Info->FullPathname, AcpiUtGetObjectTypeName (NewObject), PackageIndex));
|
||||
Info->FullPathname, AcpiUtGetObjectTypeName (NewObject),
|
||||
PackageIndex));
|
||||
|
||||
*ReturnObjectPtr = NewObject;
|
||||
Info->ReturnFlags |= ACPI_OBJECT_REPAIRED;
|
||||
|
@ -623,6 +633,7 @@ AcpiNsRemoveNullElements (
|
|||
*Dest = *Source;
|
||||
Dest++;
|
||||
}
|
||||
|
||||
Source++;
|
||||
}
|
||||
|
||||
|
@ -679,8 +690,8 @@ AcpiNsWrapWithPackage (
|
|||
|
||||
|
||||
/*
|
||||
* Create the new outer package and populate it. The new package will
|
||||
* have a single element, the lone sub-object.
|
||||
* Create the new outer package and populate it. The new
|
||||
* package will have a single element, the lone sub-object.
|
||||
*/
|
||||
PkgObjDesc = AcpiUtCreatePackageObject (1);
|
||||
if (!PkgObjDesc)
|
||||
|
|
|
@ -326,6 +326,7 @@ AcpiNsMatchComplexRepair (
|
|||
{
|
||||
return (ThisName);
|
||||
}
|
||||
|
||||
ThisName++;
|
||||
}
|
||||
|
||||
|
@ -411,7 +412,8 @@ AcpiNsRepair_FDE (
|
|||
|
||||
if (ReturnObject->Buffer.Length != ACPI_FDE_BYTE_BUFFER_SIZE)
|
||||
{
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO,
|
||||
Info->FullPathname, Info->NodeFlags,
|
||||
"Incorrect return buffer length %u, expected %u",
|
||||
ReturnObject->Buffer.Length, ACPI_FDE_DWORD_BUFFER_SIZE));
|
||||
|
||||
|
@ -420,7 +422,8 @@ AcpiNsRepair_FDE (
|
|||
|
||||
/* Create the new (larger) buffer object */
|
||||
|
||||
BufferObject = AcpiUtCreateBufferObject (ACPI_FDE_DWORD_BUFFER_SIZE);
|
||||
BufferObject = AcpiUtCreateBufferObject (
|
||||
ACPI_FDE_DWORD_BUFFER_SIZE);
|
||||
if (!BufferObject)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
|
@ -429,7 +432,8 @@ AcpiNsRepair_FDE (
|
|||
/* Expand each byte to a DWORD */
|
||||
|
||||
ByteBuffer = ReturnObject->Buffer.Pointer;
|
||||
DwordBuffer = ACPI_CAST_PTR (UINT32, BufferObject->Buffer.Pointer);
|
||||
DwordBuffer = ACPI_CAST_PTR (UINT32,
|
||||
BufferObject->Buffer.Pointer);
|
||||
|
||||
for (i = 0; i < ACPI_FDE_FIELD_COUNT; i++)
|
||||
{
|
||||
|
@ -582,7 +586,8 @@ AcpiNsRepair_CST (
|
|||
|
||||
if ((*OuterElements)->Package.Count == 0)
|
||||
{
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO,
|
||||
Info->FullPathname, Info->NodeFlags,
|
||||
"SubPackage[%u] - removing entry due to zero count", i));
|
||||
Removing = TRUE;
|
||||
goto RemoveElement;
|
||||
|
@ -591,7 +596,8 @@ AcpiNsRepair_CST (
|
|||
ObjDesc = (*OuterElements)->Package.Elements[1]; /* Index1 = Type */
|
||||
if ((UINT32) ObjDesc->Integer.Value == 0)
|
||||
{
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO,
|
||||
Info->FullPathname, Info->NodeFlags,
|
||||
"SubPackage[%u] - removing entry due to invalid Type(0)", i));
|
||||
Removing = TRUE;
|
||||
}
|
||||
|
@ -666,7 +672,8 @@ AcpiNsRepair_HID (
|
|||
|
||||
if (ReturnObject->String.Length == 0)
|
||||
{
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO,
|
||||
Info->FullPathname, Info->NodeFlags,
|
||||
"Invalid zero-length _HID or _CID string"));
|
||||
|
||||
/* Return AE_OK anyway, let driver handle it */
|
||||
|
@ -828,7 +835,7 @@ AcpiNsRepair_PSS (
|
|||
* incorrectly sorted, sort it. We sort by CpuFrequency, since this
|
||||
* should be proportional to the power.
|
||||
*/
|
||||
Status =AcpiNsCheckSortedList (Info, ReturnObject, 0, 6, 0,
|
||||
Status = AcpiNsCheckSortedList (Info, ReturnObject, 0, 6, 0,
|
||||
ACPI_SORT_DESCENDING, "CpuFrequency");
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
|
@ -850,7 +857,8 @@ AcpiNsRepair_PSS (
|
|||
|
||||
if ((UINT32) ObjDesc->Integer.Value > PreviousValue)
|
||||
{
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags,
|
||||
ACPI_WARN_PREDEFINED ((AE_INFO,
|
||||
Info->FullPathname, Info->NodeFlags,
|
||||
"SubPackage[%u,%u] - suspicious power dissipation values",
|
||||
i-1, i));
|
||||
}
|
||||
|
@ -1136,6 +1144,7 @@ AcpiNsRemoveElement (
|
|||
*Dest = *Source;
|
||||
Dest++;
|
||||
}
|
||||
|
||||
Source++;
|
||||
}
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ AcpiNsSearchOneScope (
|
|||
{
|
||||
char *ScopeName;
|
||||
|
||||
ScopeName = AcpiNsGetExternalPathname (ParentNode);
|
||||
ScopeName = AcpiNsGetNormalizedPathname (ParentNode, TRUE);
|
||||
if (ScopeName)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
|
||||
|
|
|
@ -268,9 +268,10 @@ AcpiNsGetInternalNameLength (
|
|||
Info->FullyQualified = FALSE;
|
||||
|
||||
/*
|
||||
* For the internal name, the required length is 4 bytes per segment, plus
|
||||
* 1 each for RootPrefix, MultiNamePrefixOp, segment count, trailing null
|
||||
* (which is not really needed, but no there's harm in putting it there)
|
||||
* For the internal name, the required length is 4 bytes per segment,
|
||||
* plus 1 each for RootPrefix, MultiNamePrefixOp, segment count,
|
||||
* trailing null (which is not really needed, but no there's harm in
|
||||
* putting it there)
|
||||
*
|
||||
* strlen() + 1 covers the first NameSeg, which has no path separator
|
||||
*/
|
||||
|
@ -684,7 +685,8 @@ AcpiNsExternalizeName (
|
|||
|
||||
/* Copy and validate the 4-char name segment */
|
||||
|
||||
ACPI_MOVE_NAME (&(*ConvertedName)[j], &InternalName[NamesIndex]);
|
||||
ACPI_MOVE_NAME (&(*ConvertedName)[j],
|
||||
&InternalName[NamesIndex]);
|
||||
AcpiUtRepairName (&(*ConvertedName)[j]);
|
||||
|
||||
j += ACPI_NAME_SIZE;
|
||||
|
@ -885,6 +887,7 @@ AcpiNsGetNode (
|
|||
{
|
||||
*ReturnNode = AcpiGbl_RootNode;
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
|
|
@ -526,8 +526,8 @@ AcpiEvaluateObject (
|
|||
{
|
||||
/* We have enough space for the object, build it */
|
||||
|
||||
Status = AcpiUtCopyIobjectToEobject (Info->ReturnObject,
|
||||
ReturnBuffer);
|
||||
Status = AcpiUtCopyIobjectToEobject (
|
||||
Info->ReturnObject, ReturnBuffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -892,8 +892,8 @@ AcpiNsGetDeviceCallback (
|
|||
|
||||
/* We have a valid device, invoke the user function */
|
||||
|
||||
Status = Info->UserFunction (ObjHandle, NestingLevel, Info->Context,
|
||||
ReturnValue);
|
||||
Status = Info->UserFunction (ObjHandle, NestingLevel,
|
||||
Info->Context, ReturnValue);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
|
|
@ -249,7 +249,7 @@ AcpiGetName (
|
|||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
char *NodeName;
|
||||
const char *NodeName;
|
||||
|
||||
|
||||
/* Parameter validation */
|
||||
|
@ -337,7 +337,6 @@ AcpiNsCopyDeviceId (
|
|||
ACPI_PNP_DEVICE_ID *Source,
|
||||
char *StringArea)
|
||||
{
|
||||
|
||||
/* Create the destination PNP_DEVICE_ID */
|
||||
|
||||
Dest->String = StringArea;
|
||||
|
@ -363,11 +362,18 @@ 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, _SUB,
|
||||
* _CLS, _STA, _ADR, _SxW, and _SxD methods.
|
||||
* For Device and Processor objects, run the Device _HID, _UID, _CID, _STA,
|
||||
* _CLS, _ADR, _SxW, and _SxD methods.
|
||||
*
|
||||
* Note: Allocates the return buffer, must be freed by the caller.
|
||||
*
|
||||
* Note: This interface is intended to be used during the initial device
|
||||
* 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).
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
|
@ -380,7 +386,6 @@ AcpiGetObjectInfo (
|
|||
ACPI_PNP_DEVICE_ID_LIST *CidList = NULL;
|
||||
ACPI_PNP_DEVICE_ID *Hid = NULL;
|
||||
ACPI_PNP_DEVICE_ID *Uid = NULL;
|
||||
ACPI_PNP_DEVICE_ID *Sub = NULL;
|
||||
ACPI_PNP_DEVICE_ID *Cls = NULL;
|
||||
char *NextIdString;
|
||||
ACPI_OBJECT_TYPE Type;
|
||||
|
@ -434,7 +439,7 @@ AcpiGetObjectInfo (
|
|||
{
|
||||
/*
|
||||
* Get extra info for ACPI Device/Processor objects only:
|
||||
* Run the Device _HID, _UID, _SUB, _CID, and _CLS methods.
|
||||
* Run the Device _HID, _UID, _CLS, and _CID methods.
|
||||
*
|
||||
* Note: none of these methods are required, so they may or may
|
||||
* not be present for this device. The Info->Valid bitfield is used
|
||||
|
@ -459,15 +464,6 @@ AcpiGetObjectInfo (
|
|||
Valid |= ACPI_VALID_UID;
|
||||
}
|
||||
|
||||
/* Execute the Device._SUB method */
|
||||
|
||||
Status = AcpiUtExecute_SUB (Node, &Sub);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
InfoSize += Sub->Length;
|
||||
Valid |= ACPI_VALID_SUB;
|
||||
}
|
||||
|
||||
/* Execute the Device._CID method */
|
||||
|
||||
Status = AcpiUtExecute_CID (Node, &CidList);
|
||||
|
@ -570,9 +566,8 @@ AcpiGetObjectInfo (
|
|||
}
|
||||
|
||||
/*
|
||||
* Copy the HID, UID, SUB, and CIDs to the return buffer.
|
||||
* The variable-length strings are copied to the reserved area
|
||||
* at the end of the buffer.
|
||||
* Copy the HID, UID, and CIDs to the return buffer. The variable-length
|
||||
* strings are copied to the reserved area at the end of the buffer.
|
||||
*
|
||||
* For HID and CID, check if the ID is a PCI Root Bridge.
|
||||
*/
|
||||
|
@ -593,12 +588,6 @@ AcpiGetObjectInfo (
|
|||
Uid, NextIdString);
|
||||
}
|
||||
|
||||
if (Sub)
|
||||
{
|
||||
NextIdString = AcpiNsCopyDeviceId (&Info->SubsystemId,
|
||||
Sub, NextIdString);
|
||||
}
|
||||
|
||||
if (CidList)
|
||||
{
|
||||
Info->CompatibleIdList.Count = CidList->Count;
|
||||
|
@ -645,10 +634,6 @@ Cleanup:
|
|||
{
|
||||
ACPI_FREE (Uid);
|
||||
}
|
||||
if (Sub)
|
||||
{
|
||||
ACPI_FREE (Sub);
|
||||
}
|
||||
if (CidList)
|
||||
{
|
||||
ACPI_FREE (CidList);
|
||||
|
@ -724,6 +709,7 @@ AcpiInstallMethod (
|
|||
ParserState.Aml += AcpiPsGetOpcodeSize (Opcode);
|
||||
ParserState.PkgEnd = AcpiPsGetNextPackageEnd (&ParserState);
|
||||
Path = AcpiPsGetNextNamestring (&ParserState);
|
||||
|
||||
MethodFlags = *ParserState.Aml++;
|
||||
AmlStart = ParserState.Aml;
|
||||
AmlLength = ACPI_PTR_DIFF (ParserState.PkgEnd, AmlStart);
|
||||
|
|
|
@ -153,10 +153,8 @@ AcpiGetType (
|
|||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/*
|
||||
* Special case for the predefined Root Node
|
||||
* (return type ANY)
|
||||
*/
|
||||
/* Special case for the predefined Root Node (return type ANY) */
|
||||
|
||||
if (Handle == ACPI_ROOT_OBJECT)
|
||||
{
|
||||
*RetType = ACPI_TYPE_ANY;
|
||||
|
@ -180,7 +178,6 @@ AcpiGetType (
|
|||
|
||||
*RetType = Node->Type;
|
||||
|
||||
|
||||
Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
return (Status);
|
||||
}
|
||||
|
|
|
@ -370,7 +370,7 @@ AcpiPsGetNextNamepath (
|
|||
PossibleMethodCall &&
|
||||
(Node->Type == ACPI_TYPE_METHOD))
|
||||
{
|
||||
if (WalkState->Opcode == AML_UNLOAD_OP)
|
||||
if (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) == ARGP_SUPERNAME)
|
||||
{
|
||||
/*
|
||||
* AcpiPsGetNextNamestring has increased the AML pointer,
|
||||
|
@ -816,7 +816,7 @@ AcpiPsGetNextField (
|
|||
*
|
||||
* PARAMETERS: WalkState - Current state
|
||||
* ParserState - Current parser state object
|
||||
* ArgType - The argument type (AML_*_ARG)
|
||||
* ArgType - The parser argument type (ARGP_*)
|
||||
* ReturnArg - Where the next arg is returned
|
||||
*
|
||||
* RETURN: Status, and an op object containing the next argument.
|
||||
|
@ -859,6 +859,7 @@ AcpiPsGetNextArg (
|
|||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
AcpiPsGetNextSimpleArg (ParserState, ArgType, Arg);
|
||||
break;
|
||||
|
||||
|
@ -928,6 +929,7 @@ AcpiPsGetNextArg (
|
|||
case ARGP_TARGET:
|
||||
case ARGP_SUPERNAME:
|
||||
case ARGP_SIMPLENAME:
|
||||
case ARGP_NAME_OR_REF:
|
||||
|
||||
Subop = AcpiPsPeekOpcode (ParserState);
|
||||
if (Subop == 0 ||
|
||||
|
@ -943,15 +945,16 @@ AcpiPsGetNextArg (
|
|||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* To support SuperName arg of Unload */
|
||||
/* SuperName allows argument to be a method call */
|
||||
|
||||
if (WalkState->Opcode == AML_UNLOAD_OP)
|
||||
if (ArgType == ARGP_SUPERNAME)
|
||||
{
|
||||
Status = AcpiPsGetNextNamepath (WalkState, ParserState, Arg, 1);
|
||||
Status = AcpiPsGetNextNamepath (WalkState, ParserState,
|
||||
Arg, ACPI_POSSIBLE_METHOD_CALL);
|
||||
|
||||
/*
|
||||
* If the SuperName arg of Unload is a method call,
|
||||
* we have restored the AML pointer, just free this Arg
|
||||
* If the SuperName argument is a method call, we have
|
||||
* already restored the AML pointer, just free this Arg
|
||||
*/
|
||||
if (Arg->Common.AmlOpcode == AML_INT_METHODCALL_OP)
|
||||
{
|
||||
|
@ -961,7 +964,8 @@ AcpiPsGetNextArg (
|
|||
}
|
||||
else
|
||||
{
|
||||
Status = AcpiPsGetNextNamepath (WalkState, ParserState, Arg, 0);
|
||||
Status = AcpiPsGetNextNamepath (WalkState, ParserState,
|
||||
Arg, ACPI_NOT_METHOD_CALL);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -192,7 +192,8 @@ AcpiPsGetArguments (
|
|||
|
||||
case AML_INT_NAMEPATH_OP: /* AML_NAMESTRING_ARG */
|
||||
|
||||
Status = AcpiPsGetNextNamepath (WalkState, &(WalkState->ParserState), Op, 1);
|
||||
Status = AcpiPsGetNextNamepath (WalkState,
|
||||
&(WalkState->ParserState), Op, ACPI_POSSIBLE_METHOD_CALL);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -205,7 +206,8 @@ AcpiPsGetArguments (
|
|||
/*
|
||||
* Op is not a constant or string, append each argument to the Op
|
||||
*/
|
||||
while (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) && !WalkState->ArgCount)
|
||||
while (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) &&
|
||||
!WalkState->ArgCount)
|
||||
{
|
||||
WalkState->Aml = WalkState->ParserState.Aml;
|
||||
|
||||
|
|
|
@ -223,7 +223,8 @@ AcpiPsGetAmlOpcode (
|
|||
|
||||
/* Found opcode info, this is a normal opcode */
|
||||
|
||||
WalkState->ParserState.Aml += AcpiPsGetOpcodeSize (WalkState->Opcode);
|
||||
WalkState->ParserState.Aml +=
|
||||
AcpiPsGetOpcodeSize (WalkState->Opcode);
|
||||
WalkState->ArgTypes = WalkState->OpInfo->ParseArgs;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -317,7 +317,7 @@ const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES] =
|
|||
/* 34 */ ACPI_OP ("CreateWordField", ARGP_CREATE_WORD_FIELD_OP, ARGI_CREATE_WORD_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
|
||||
/* 35 */ ACPI_OP ("CreateByteField", ARGP_CREATE_BYTE_FIELD_OP, ARGI_CREATE_BYTE_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
|
||||
/* 36 */ ACPI_OP ("CreateBitField", ARGP_CREATE_BIT_FIELD_OP, ARGI_CREATE_BIT_FIELD_OP, ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD, AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE | AML_DEFER | AML_CREATE),
|
||||
/* 37 */ ACPI_OP ("ObjectType", ARGP_TYPE_OP, ARGI_TYPE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_NO_OPERAND_RESOLVE),
|
||||
/* 37 */ ACPI_OP ("ObjectType", ARGP_OBJECT_TYPE_OP, ARGI_OBJECT_TYPE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_NO_OPERAND_RESOLVE),
|
||||
/* 38 */ ACPI_OP ("LAnd", ARGP_LAND_OP, ARGI_LAND_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL_NUMERIC | AML_CONSTANT),
|
||||
/* 39 */ ACPI_OP ("LOr", ARGP_LOR_OP, ARGI_LOR_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL_NUMERIC | AML_CONSTANT),
|
||||
/* 3A */ ACPI_OP ("LNot", ARGP_LNOT_OP, ARGI_LNOT_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R | AML_CONSTANT),
|
||||
|
|
|
@ -272,8 +272,8 @@ AcpiPsCompleteThisOp (
|
|||
* These opcodes contain TermArg operands. The current
|
||||
* op must be replaced by a placeholder return op
|
||||
*/
|
||||
ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP,
|
||||
Op->Common.Aml);
|
||||
ReplacementOp = AcpiPsAllocOp (
|
||||
AML_INT_RETURN_VALUE_OP, Op->Common.Aml);
|
||||
if (!ReplacementOp)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
|
@ -292,8 +292,8 @@ AcpiPsCompleteThisOp (
|
|||
(Op->Common.Parent->Common.AmlOpcode == AML_BANK_FIELD_OP) ||
|
||||
(Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
|
||||
{
|
||||
ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP,
|
||||
Op->Common.Aml);
|
||||
ReplacementOp = AcpiPsAllocOp (
|
||||
AML_INT_RETURN_VALUE_OP, Op->Common.Aml);
|
||||
if (!ReplacementOp)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
|
@ -323,8 +323,8 @@ AcpiPsCompleteThisOp (
|
|||
|
||||
default:
|
||||
|
||||
ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP,
|
||||
Op->Common.Aml);
|
||||
ReplacementOp = AcpiPsAllocOp (
|
||||
AML_INT_RETURN_VALUE_OP, Op->Common.Aml);
|
||||
if (!ReplacementOp)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
|
@ -566,7 +566,8 @@ AcpiPsParseAml (
|
|||
*/
|
||||
if (WalkState->MethodDesc)
|
||||
{
|
||||
WalkState->Thread->CurrentSyncLevel = WalkState->MethodDesc->Method.SyncLevel;
|
||||
WalkState->Thread->CurrentSyncLevel =
|
||||
WalkState->MethodDesc->Method.SyncLevel;
|
||||
}
|
||||
|
||||
AcpiDsPushWalkState (WalkState, Thread);
|
||||
|
@ -612,8 +613,8 @@ AcpiPsParseAml (
|
|||
}
|
||||
|
||||
/*
|
||||
* If the transfer to the new method method call worked, a new walk
|
||||
* state was created -- get it
|
||||
* If the transfer to the new method method call worked
|
||||
*, a new walk state was created -- get it
|
||||
*/
|
||||
WalkState = AcpiDsGetCurrentWalkState (Thread);
|
||||
continue;
|
||||
|
@ -632,7 +633,8 @@ AcpiPsParseAml (
|
|||
/* Check for possible multi-thread reentrancy problem */
|
||||
|
||||
if ((Status == AE_ALREADY_EXISTS) &&
|
||||
(!(WalkState->MethodDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED)))
|
||||
(!(WalkState->MethodDesc->Method.InfoFlags &
|
||||
ACPI_METHOD_SERIALIZED)))
|
||||
{
|
||||
/*
|
||||
* Method is not serialized and tried to create an object
|
||||
|
@ -658,7 +660,8 @@ AcpiPsParseAml (
|
|||
* encountered an error during the method parse phase, there's lots of
|
||||
* cleanup to do
|
||||
*/
|
||||
if (((WalkState->ParseFlags & ACPI_PARSE_MODE_MASK) == ACPI_PARSE_EXECUTE) ||
|
||||
if (((WalkState->ParseFlags & ACPI_PARSE_MODE_MASK) ==
|
||||
ACPI_PARSE_EXECUTE) ||
|
||||
(ACPI_FAILURE (Status)))
|
||||
{
|
||||
AcpiDsTerminateControlMethod (WalkState->MethodDesc, WalkState);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue