Print this page
update to acpica-unix2-20140114
acpica-unix2-20130823
PANKOVs restructure
*** 1,14 ****
-
/******************************************************************************
*
* Module Name: exoparg1 - AML execution - opcodes with 1 argument
*
*****************************************************************************/
/*
! * Copyright (C) 2000 - 2011, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
--- 1,13 ----
/******************************************************************************
*
* Module Name: exoparg1 - AML execution - opcodes with 1 argument
*
*****************************************************************************/
/*
! * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*** 179,219 ****
case AML_RELEASE_OP: /* Release (MutexObject) */
Status = AcpiExReleaseMutex (Operand[0], WalkState);
break;
-
case AML_RESET_OP: /* Reset (EventObject) */
Status = AcpiExSystemResetEvent (Operand[0]);
break;
-
case AML_SIGNAL_OP: /* Signal (EventObject) */
Status = AcpiExSystemSignalEvent (Operand[0]);
break;
-
case AML_SLEEP_OP: /* Sleep (MsecTime) */
Status = AcpiExSystemDoSleep (Operand[0]->Integer.Value);
break;
-
case AML_STALL_OP: /* Stall (UsecTime) */
Status = AcpiExSystemDoStall ((UINT32) Operand[0]->Integer.Value);
break;
-
case AML_UNLOAD_OP: /* Unload (Handle) */
Status = AcpiExUnloadTable (Operand[0]);
break;
-
default: /* Unknown opcode */
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
WalkState->Opcode));
Status = AE_AML_BAD_OPCODE;
--- 178,212 ----
*** 329,339 ****
case AML_BIT_NOT_OP: /* Not (Operand, Result) */
ReturnDesc->Integer.Value = ~Operand[0]->Integer.Value;
break;
-
case AML_FIND_SET_LEFT_BIT_OP: /* FindSetLeftBit (Operand, Result) */
ReturnDesc->Integer.Value = Operand[0]->Integer.Value;
/*
--- 322,331 ----
*** 347,357 ****
}
ReturnDesc->Integer.Value = Temp32;
break;
-
case AML_FIND_SET_RIGHT_BIT_OP: /* FindSetRightBit (Operand, Result) */
ReturnDesc->Integer.Value = Operand[0]->Integer.Value;
/*
--- 339,348 ----
*** 368,380 ****
ReturnDesc->Integer.Value =
Temp32 == 0 ? 0 : (ACPI_INTEGER_BIT_SIZE + 1) - Temp32;
break;
-
case AML_FROM_BCD_OP: /* FromBcd (BCDValue, Result) */
-
/*
* The 64-bit ACPI integer can hold 16 4-bit BCD characters
* (if table is 32-bit, integer can hold 8 BCD characters)
* Convert each 4-bit BCD value
*/
--- 359,369 ----
*** 415,425 ****
PowerOfTen *= 10;
}
break;
-
case AML_TO_BCD_OP: /* ToBcd (Operand, Result) */
ReturnDesc->Integer.Value = 0;
Digit = Operand[0]->Integer.Value;
--- 404,413 ----
*** 447,459 ****
Status = AE_AML_NUMERIC_OVERFLOW;
goto Cleanup;
}
break;
-
case AML_COND_REF_OF_OP: /* CondRefOf (SourceObject, Result) */
-
/*
* This op is a little strange because the internal return value is
* different than the return value stored in the result descriptor
* (There are really two return values)
*/
--- 435,445 ----
*** 484,501 ****
ReturnDesc->Integer.Value = ACPI_UINT64_MAX;
goto Cleanup;
default:
/* No other opcodes get here */
break;
}
break;
-
case AML_STORE_OP: /* Store (Source, Target) */
-
/*
* A store operand is typically a number, string, buffer or lvalue
* Be careful about deleting the source object,
* since the object itself may have been stored.
*/
--- 470,487 ----
ReturnDesc->Integer.Value = ACPI_UINT64_MAX;
goto Cleanup;
default:
+
/* No other opcodes get here */
+
break;
}
break;
case AML_STORE_OP: /* Store (Source, Target) */
/*
* A store operand is typically a number, string, buffer or lvalue
* Be careful about deleting the source object,
* since the object itself may have been stored.
*/
*** 518,538 ****
WalkState->ResultObj = Operand[0];
WalkState->Operands[0] = NULL; /* Prevent deletion */
}
return_ACPI_STATUS (Status);
-
/*
* ACPI 2.0 Opcodes
*/
case AML_COPY_OP: /* Copy (Source, Target) */
Status = AcpiUtCopyIobjectToIobject (Operand[0], &ReturnDesc,
WalkState);
break;
-
case AML_TO_DECSTRING_OP: /* ToDecimalString (Data, Result) */
Status = AcpiExConvertToString (Operand[0], &ReturnDesc,
ACPI_EXPLICIT_CONVERT_DECIMAL);
if (ReturnDesc == Operand[0])
--- 504,522 ----
*** 540,550 ****
/* 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);
if (ReturnDesc == Operand[0])
--- 524,533 ----
*** 552,562 ****
/* No conversion performed, add ref to handle return value */
AcpiUtAddReference (ReturnDesc);
}
break;
-
case AML_TO_BUFFER_OP: /* ToBuffer (Data, Result) */
Status = AcpiExConvertToBuffer (Operand[0], &ReturnDesc);
if (ReturnDesc == Operand[0])
{
--- 535,544 ----
*** 563,573 ****
/* 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);
if (ReturnDesc == Operand[0])
--- 545,554 ----
*** 575,585 ****
/* No conversion performed, add ref to handle return value */
AcpiUtAddReference (ReturnDesc);
}
break;
-
case AML_SHIFT_LEFT_BIT_OP: /* ShiftLeftBit (Source, BitNum) */
case AML_SHIFT_RIGHT_BIT_OP: /* ShiftRightBit (Source, BitNum) */
/* These are two obsolete opcodes */
--- 556,565 ----
*** 587,597 ****
"%s is obsolete and not implemented",
AcpiPsGetOpcodeName (WalkState->Opcode)));
Status = AE_SUPPORT;
goto Cleanup;
-
default: /* Unknown opcode */
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
WalkState->Opcode));
Status = AE_AML_BAD_OPCODE;
--- 567,576 ----
*** 675,688 ****
{
ReturnDesc->Integer.Value = ACPI_UINT64_MAX;
}
break;
-
case AML_DECREMENT_OP: /* Decrement (Operand) */
case AML_INCREMENT_OP: /* Increment (Operand) */
-
/*
* Create a new integer. Can't just get the base integer and
* increment it because it may be an Arg or Field.
*/
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
--- 654,665 ----
*** 743,755 ****
* Reference object
*/
Status = AcpiExStore (ReturnDesc, Operand[0], WalkState);
break;
-
case AML_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
* want to resolve a FieldUnit to its value, we want the actual
* FieldUnit object.
--- 720,730 ----
*** 771,783 ****
Status = AE_NO_MEMORY;
goto Cleanup;
}
break;
-
case AML_SIZE_OF_OP: /* SizeOf (SourceObject) */
-
/*
* Note: The operand is not resolved at this point because we want to
* get the associated object, not its value.
*/
--- 746,756 ----
*** 800,813 ****
--- 773,788 ----
* global (4 or 8 bytes).
*/
switch (Type)
{
case ACPI_TYPE_INTEGER:
+
Value = AcpiGbl_IntegerByteWidth;
break;
case ACPI_TYPE_STRING:
+
Value = TempDesc->String.Length;
break;
case ACPI_TYPE_BUFFER:
*** 824,833 ****
--- 799,809 ----
Status = AcpiDsGetPackageArguments (TempDesc);
Value = TempDesc->Package.Count;
break;
default:
+
ACPI_ERROR ((AE_INFO,
"Operand must be Buffer/Integer/String/Package - found type %s",
AcpiUtGetTypeName (Type)));
Status = AE_AML_OPERAND_TYPE;
goto Cleanup;
*** 931,943 ****
--- 907,921 ----
break;
}
break;
case ACPI_TYPE_STRING:
+
break;
default:
+
Status = AE_AML_OPERAND_TYPE;
goto Cleanup;
}
}
*** 992,1002 ****
* Index() or RefOf() operator
*/
switch (Operand[0]->Reference.Class)
{
case ACPI_REFCLASS_INDEX:
-
/*
* The target type for the Index operator must be
* either a Buffer or a Package
*/
switch (Operand[0]->Reference.TargetType)
--- 970,979 ----
*** 1024,1048 ****
Status = AE_NO_MEMORY;
goto Cleanup;
}
break;
-
case ACPI_TYPE_PACKAGE:
-
/*
* Return the referenced element of the package. We must
* add another reference to the referenced object, however.
*/
ReturnDesc = *(Operand[0]->Reference.Where);
! if (ReturnDesc)
{
! AcpiUtAddReference (ReturnDesc);
}
break;
-
default:
ACPI_ERROR ((AE_INFO,
"Unknown Index TargetType 0x%X in reference object %p",
Operand[0]->Reference.TargetType, Operand[0]));
--- 1001,1029 ----
Status = AE_NO_MEMORY;
goto Cleanup;
}
break;
case ACPI_TYPE_PACKAGE:
/*
* Return the referenced element of the package. We must
* add another reference to the referenced object, however.
*/
ReturnDesc = *(Operand[0]->Reference.Where);
! if (!ReturnDesc)
{
! /*
! * Element is NULL, do not allow the dereference.
! * This provides compatibility with other ACPI
! * implementations.
! */
! return_ACPI_STATUS (AE_AML_UNINITIALIZED_ELEMENT);
}
+
+ AcpiUtAddReference (ReturnDesc);
break;
default:
ACPI_ERROR ((AE_INFO,
"Unknown Index TargetType 0x%X in reference object %p",
Operand[0]->Reference.TargetType, Operand[0]));
*** 1049,1077 ****
Status = AE_AML_OPERAND_TYPE;
goto Cleanup;
}
break;
-
case ACPI_REFCLASS_REFOF:
ReturnDesc = Operand[0]->Reference.Object;
if (ACPI_GET_DESCRIPTOR_TYPE (ReturnDesc) ==
ACPI_DESC_TYPE_NAMED)
{
ReturnDesc = AcpiNsGetAttachedObject (
(ACPI_NAMESPACE_NODE *) ReturnDesc);
}
! /* Add another reference to the object! */
! AcpiUtAddReference (ReturnDesc);
break;
default:
ACPI_ERROR ((AE_INFO,
"Unknown class in reference(%p) - 0x%2.2X",
Operand[0], Operand[0]->Reference.Class));
Status = AE_TYPE;
--- 1030,1086 ----
Status = AE_AML_OPERAND_TYPE;
goto Cleanup;
}
break;
case ACPI_REFCLASS_REFOF:
ReturnDesc = Operand[0]->Reference.Object;
if (ACPI_GET_DESCRIPTOR_TYPE (ReturnDesc) ==
ACPI_DESC_TYPE_NAMED)
{
ReturnDesc = AcpiNsGetAttachedObject (
(ACPI_NAMESPACE_NODE *) ReturnDesc);
+ if (!ReturnDesc)
+ {
+ break;
}
! /*
! * June 2013:
! * BufferFields/FieldUnits require additional resolution
! */
! switch (ReturnDesc->Common.Type)
! {
! case ACPI_TYPE_BUFFER_FIELD:
! case ACPI_TYPE_LOCAL_REGION_FIELD:
! case ACPI_TYPE_LOCAL_BANK_FIELD:
! case ACPI_TYPE_LOCAL_INDEX_FIELD:
! Status = AcpiExReadDataFromField (WalkState,
! ReturnDesc, &TempDesc);
! if (ACPI_FAILURE (Status))
! {
! goto Cleanup;
! }
!
! ReturnDesc = TempDesc;
break;
+ default:
+ /* Add another reference to the object */
+
+ AcpiUtAddReference (ReturnDesc);
+ break;
+ }
+ }
+ break;
+
default:
+
ACPI_ERROR ((AE_INFO,
"Unknown class in reference(%p) - 0x%2.2X",
Operand[0], Operand[0]->Reference.Class));
Status = AE_TYPE;
*** 1078,1088 ****
goto Cleanup;
}
}
break;
-
default:
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
WalkState->Opcode));
Status = AE_AML_BAD_OPCODE;
--- 1087,1096 ----
*** 1106,1111 ****
WalkState->ResultObj = ReturnDesc;
}
return_ACPI_STATUS (Status);
}
-
--- 1114,1118 ----