mirror of
https://github.com/acpica/acpica/
synced 2025-02-23 00:44:17 +03:00
Converted to use new Object Stack handling functions
date 99.08.10.21.43.00; author rmoore1; state Exp;
This commit is contained in:
parent
459ce36a19
commit
9653170b71
@ -532,7 +532,7 @@ AmlGetRvalue (
|
||||
* Convert it to an object.
|
||||
*/
|
||||
|
||||
if (AE_OK != (Status = AmlObjPushIfExec (MODE_Exec))) /* ObjStack */
|
||||
if (AE_OK != (Status = AmlObjStackPushIfExec (MODE_Exec))) /* ObjStack */
|
||||
{
|
||||
FUNCTION_STATUS_EXIT (Status);
|
||||
return Status;
|
||||
@ -542,18 +542,18 @@ AmlGetRvalue (
|
||||
AE_OK == (Status = AmlDoPkg (TYPE_Package, MODE_Exec)) &&
|
||||
AE_OK == (Status = AmlPkgPopExec ())) /* PkgStack */
|
||||
{
|
||||
NsSetValue ((ACPI_HANDLE)* StackPtr, ObjStack[ObjStackTop],
|
||||
NsSetValue ((ACPI_HANDLE) *StackPtr, AmlObjStackGetValue (0),
|
||||
(UINT8) TYPE_Package);
|
||||
|
||||
/* Refresh local value pointer to reflect newly set value */
|
||||
|
||||
ValDesc = (ACPI_OBJECT_INTERNAL *) NsGetValue ((ACPI_HANDLE)* StackPtr);
|
||||
ObjStackTop--;
|
||||
AmlObjStackPop (1);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
ObjStackTop--;
|
||||
AmlObjStackPop (1);
|
||||
FUNCTION_STATUS_EXIT (Status);
|
||||
return Status;
|
||||
}
|
||||
@ -619,7 +619,7 @@ AmlGetRvalue (
|
||||
* points to a buffer definition in the AML stream.
|
||||
* Convert it to an object.
|
||||
*/
|
||||
if (AE_OK != (Status = AmlObjPushIfExec (MODE_Exec))) /* ObjStack */
|
||||
if (AE_OK != (Status = AmlObjStackPushIfExec (MODE_Exec))) /* ObjStack */
|
||||
{
|
||||
FUNCTION_STATUS_EXIT (Status);
|
||||
return Status;
|
||||
@ -629,18 +629,18 @@ AmlGetRvalue (
|
||||
AE_OK == (Status = AmlDoPkg (TYPE_Buffer, MODE_Exec)) &&
|
||||
AE_OK == (Status = AmlPkgPopExec ())) /* PkgStack */
|
||||
{
|
||||
NsSetValue ((ACPI_HANDLE) *StackPtr, ObjStack[ObjStackTop],
|
||||
NsSetValue ((ACPI_HANDLE) *StackPtr, AmlObjStackGetValue (0),
|
||||
(UINT8) TYPE_Buffer);
|
||||
|
||||
/* Refresh local value pointer to reflect newly set value */
|
||||
|
||||
ValDesc = (ACPI_OBJECT_INTERNAL *) NsGetValue ((ACPI_HANDLE)* StackPtr);
|
||||
ObjStackTop--;
|
||||
AmlObjStackPop (1);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
ObjStackTop--;
|
||||
AmlObjStackPop (1);
|
||||
FUNCTION_STATUS_EXIT (Status);
|
||||
return Status;
|
||||
}
|
||||
@ -784,7 +784,6 @@ AmlGetRvalue (
|
||||
|
||||
case TYPE_DefField:
|
||||
|
||||
|
||||
/*
|
||||
* XXX - Implementation limitation: Fields are implemented as type
|
||||
* XXX - Number, but they really are supposed to be type Buffer.
|
||||
|
@ -224,8 +224,8 @@ AmlExecuteMethod (
|
||||
if (AE_RETURN_VALUE == Status)
|
||||
{
|
||||
DEBUG_PRINT (ACPI_INFO, ("Method returned: \n"));
|
||||
DUMP_STACK_ENTRY ((ACPI_OBJECT_INTERNAL *) ObjStack[ObjStackTop]);
|
||||
DEBUG_PRINT (ACPI_INFO, (" at stack level %d\n", ObjStackTop));
|
||||
DUMP_STACK_ENTRY (AmlObjStackGetValue (STACK_TOP));
|
||||
DEBUG_PRINT (ACPI_INFO, (" at stack level %d\n", AmlObjStackLevel()));
|
||||
}
|
||||
|
||||
AmlPkgPopExec (); /* package stack -- inverse of AmlPrepExec() */
|
||||
@ -235,10 +235,10 @@ AmlExecuteMethod (
|
||||
|
||||
}
|
||||
|
||||
if (ObjStackTop)
|
||||
if (AmlObjStackLevel())
|
||||
{
|
||||
DEBUG_PRINT (ACPI_INFO, ("AmlExecuteMethod: Obj stack at exit %p, idx=%d\n",
|
||||
ObjStack, ObjStackTop));
|
||||
DEBUG_PRINT (ACPI_INFO, ("AmlExecuteMethod: Obj TOS at exit=%d\n",
|
||||
AmlObjStackLevel()));
|
||||
}
|
||||
|
||||
FUNCTION_STATUS_EXIT (Status);
|
||||
@ -313,11 +313,11 @@ AmlExecStore (
|
||||
DestDesc->Lvalue.Object = TempHandle;
|
||||
|
||||
/*
|
||||
* Push the descriptor on TOS temporarily
|
||||
* Push the descriptor on the object stack temporarily
|
||||
* to protect it from garbage collection
|
||||
*/
|
||||
|
||||
Status = AmlObjPushIfExec (MODE_Exec);
|
||||
Status = AmlObjStackPushIfExec (MODE_Exec);
|
||||
if (AE_OK != Status)
|
||||
{
|
||||
CmFree (DestDesc);
|
||||
@ -325,7 +325,7 @@ AmlExecStore (
|
||||
}
|
||||
else
|
||||
{
|
||||
ObjStack[ObjStackTop] = DestDesc;
|
||||
AmlObjStackSetValue (STACK_TOP, DestDesc);
|
||||
Stacked = TRUE;
|
||||
}
|
||||
}
|
||||
@ -425,7 +425,7 @@ AmlExecStore (
|
||||
{
|
||||
/* Must clear the top of the stack or it will get deleted twice */
|
||||
|
||||
ObjStack[ObjStackTop] = NULL;
|
||||
AmlObjStackClearTop ();
|
||||
}
|
||||
|
||||
DestDesc = NsGetValue (TempHandle);
|
||||
@ -512,7 +512,7 @@ AmlExecStore (
|
||||
{
|
||||
/* Must clear the top of the stack or it will get deleted twice */
|
||||
|
||||
ObjStack[ObjStackTop] = NULL;
|
||||
AmlObjStackClearTop ();
|
||||
}
|
||||
|
||||
DestDesc = NsGetValue (TempHandle);
|
||||
@ -582,7 +582,7 @@ AmlExecStore (
|
||||
{
|
||||
/* Must clear the top of the stack or it will get deleted twice */
|
||||
|
||||
ObjStack[ObjStackTop] = NULL;
|
||||
AmlObjStackClearTop ();
|
||||
}
|
||||
|
||||
DestDesc = NsGetValue (TempHandle);
|
||||
@ -666,7 +666,7 @@ AmlExecStore (
|
||||
{
|
||||
/* Must clear the top of the stack or it will get deleted twice */
|
||||
|
||||
ObjStack[ObjStackTop] = NULL;
|
||||
AmlObjStackClearTop ();
|
||||
}
|
||||
|
||||
DestDesc = NsGetValue (TempHandle);
|
||||
@ -679,7 +679,7 @@ AmlExecStore (
|
||||
else
|
||||
{
|
||||
DEBUG_PRINT (ACPI_INFO,
|
||||
("AmlExecStore: FieldUnit: name's value DestDesc=%p, DestDesc->Type=%02Xh\n",
|
||||
("AmlExecStore: FieldUnit: Name's value DestDesc=%p, DestDesc->Type=%02Xh\n",
|
||||
DestDesc, DestDesc->Type));
|
||||
}
|
||||
}
|
||||
@ -688,7 +688,7 @@ AmlExecStore (
|
||||
(DestDesc->Type != (UINT8) NsGetType (TempHandle)))
|
||||
{
|
||||
DEBUG_PRINT (ACPI_ERROR, (
|
||||
"AmlExecStore/FieldUnit:internal error: Name %4.4s type %d does not match value-type %d at %p\n",
|
||||
"AmlExecStore/FieldUnit: Internal error - Name %4.4s type %d does not match value-type %d at %p\n",
|
||||
TempHandle, NsGetType(TempHandle), DestDesc->Type, DestDesc));
|
||||
|
||||
Status = AE_AML_ERROR;
|
||||
@ -700,9 +700,20 @@ AmlExecStore (
|
||||
DestDesc->FieldUnit.Sequence
|
||||
!= DestDesc->FieldUnit.Container->Buffer.Sequence))
|
||||
{
|
||||
NsDumpPathname (TempHandle, "AmlExecStore/FieldUnit: bad container in: ",
|
||||
NsDumpPathname (TempHandle, "AmlExecStore/FieldUnit: Bad container in ",
|
||||
ACPI_ERROR, _COMPONENT);
|
||||
DUMP_ENTRY (TempHandle);
|
||||
|
||||
DEBUG_PRINT (ACPI_ERROR, ("Container: %p", DestDesc->FieldUnit.Container));
|
||||
if (DestDesc->FieldUnit.Container)
|
||||
{
|
||||
DEBUG_PRINT_RAW (ACPI_ERROR, (" Type %d, FuSeq %x BufSeq %x",
|
||||
DestDesc->FieldUnit.Container->Type,
|
||||
DestDesc->FieldUnit.Sequence,
|
||||
DestDesc->FieldUnit.Container->Buffer.Sequence));
|
||||
}
|
||||
DEBUG_PRINT_RAW (ACPI_ERROR, ("\n"));
|
||||
|
||||
Status = AE_AML_ERROR;
|
||||
}
|
||||
|
||||
@ -859,7 +870,7 @@ AmlExecStore (
|
||||
if (DeleteDestDesc)
|
||||
{
|
||||
CmFree (DeleteDestDesc);
|
||||
if (ObjStack[ObjStackTop] == DeleteDestDesc)
|
||||
if (AmlObjStackGetValue (STACK_TOP) == DeleteDestDesc)
|
||||
{
|
||||
/*
|
||||
* Clear the object from the stack entry so that it won't be used
|
||||
@ -867,15 +878,15 @@ AmlExecStore (
|
||||
*/
|
||||
|
||||
DEBUG_PRINT (ACPI_ERROR, ("AmlExecStore - Deleted desc was at stack top %p (idx %d)\n",
|
||||
&ObjStack[ObjStackTop], ObjStackTop));
|
||||
ObjStack[ObjStackTop] = NULL;
|
||||
AmlObjStackGetTopPtr (), AmlObjStackLevel ()));
|
||||
|
||||
AmlObjStackClearTop ();
|
||||
}
|
||||
}
|
||||
|
||||
if (Stacked)
|
||||
{
|
||||
ObjStack[ObjStackTop] = NULL;
|
||||
ObjStackTop--;
|
||||
AmlObjStackPop (1);
|
||||
}
|
||||
|
||||
FUNCTION_STATUS_EXIT (Status);
|
||||
|
Loading…
x
Reference in New Issue
Block a user