Cleanup and update of debug output levels

date	2002.03.22.21.47.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 17:43:16 +00:00
parent 2ea25c4e6b
commit c1cb71dcd8

View File

@ -2,7 +2,7 @@
/****************************************************************************** /******************************************************************************
* *
* Module Name: exprep - ACPI AML (p-code) execution - field prep utilities * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities
* $Revision: 1.114 $ * $Revision: 1.115 $
* *
*****************************************************************************/ *****************************************************************************/
@ -303,16 +303,18 @@ AcpiExPrepCommonFieldObject (
* two pieces of information - the width of each field access and the * two pieces of information - the width of each field access and the
* necessary ByteAlignment (address granularity) of the access. * necessary ByteAlignment (address granularity) of the access.
* *
* For AnyAcc, the AccessBitWidth is the largest width that is both necessary * For AnyAcc, the AccessBitWidth is the largest width that is both
* and possible in an attempt to access the whole field in one * necessary and possible in an attempt to access the whole field in one
* I/O operation. However, for AnyAcc, the ByteAlignment is always one byte. * I/O operation. However, for AnyAcc, the ByteAlignment is always one
* byte.
* *
* For all Buffer Fields, the ByteAlignment is always one byte. * For all Buffer Fields, the ByteAlignment is always one byte.
* *
* For all other access types (Byte, Word, Dword, Qword), the Bitwidth is the * For all other access types (Byte, Word, Dword, Qword), the Bitwidth is
* same (equivalent) as the ByteAlignment. * the same (equivalent) as the ByteAlignment.
*/ */
AccessBitWidth = AcpiExDecodeFieldAccess (ObjDesc, FieldFlags, &ByteAlignment); AccessBitWidth = AcpiExDecodeFieldAccess (ObjDesc, FieldFlags,
&ByteAlignment);
if (!AccessBitWidth) if (!AccessBitWidth)
{ {
return_ACPI_STATUS (AE_AML_OPERAND_VALUE); return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
@ -320,45 +322,59 @@ AcpiExPrepCommonFieldObject (
/* Setup width (access granularity) fields */ /* Setup width (access granularity) fields */
ObjDesc->CommonField.AccessByteWidth = (UINT8) ACPI_DIV_8 (AccessBitWidth); /* 1, 2, 4, 8 */ ObjDesc->CommonField.AccessByteWidth = (UINT8)
ACPI_DIV_8 (AccessBitWidth); /* 1, 2, 4, 8 */
/* /*
* BaseByteOffset is the address of the start of the field within the region. It is * BaseByteOffset is the address of the start of the field within the
* the byte address of the first *datum* (field-width data unit) of the field. * region. It is the byte address of the first *datum* (field-width data
* (i.e., the first datum that contains at least the first *bit* of the field.) * unit) of the field. (i.e., the first datum that contains at least the
* Note: ByteAlignment is always either equal to the AccessBitWidth or 8 (Byte access), * first *bit* of the field.)
* and it defines the addressing granularity of the parent region or buffer. *
* Note: ByteAlignment is always either equal to the AccessBitWidth or 8
* (Byte access), and it defines the addressing granularity of the parent
* region or buffer.
*/ */
NearestByteAddress = ACPI_ROUND_BITS_DOWN_TO_BYTES (FieldBitPosition); NearestByteAddress =
ObjDesc->CommonField.BaseByteOffset = ACPI_ROUND_DOWN (NearestByteAddress, ByteAlignment); ACPI_ROUND_BITS_DOWN_TO_BYTES (FieldBitPosition);
ObjDesc->CommonField.BaseByteOffset =
ACPI_ROUND_DOWN (NearestByteAddress, ByteAlignment);
/* /*
* StartFieldBitOffset is the offset of the first bit of the field within a field datum. * StartFieldBitOffset is the offset of the first bit of the field within
* a field datum.
*/ */
ObjDesc->CommonField.StartFieldBitOffset = (UINT8) (FieldBitPosition - ObjDesc->CommonField.StartFieldBitOffset = (UINT8)
ACPI_MUL_8 (ObjDesc->CommonField.BaseByteOffset)); (FieldBitPosition - ACPI_MUL_8 (ObjDesc->CommonField.BaseByteOffset));
/* /*
* Valid bits -- the number of bits that compose a partial datum, * Valid bits -- the number of bits that compose a partial datum,
* 1) At the end of the field within the region (arbitrary starting bit offset) * 1) At the end of the field within the region (arbitrary starting bit
* 2) At the end of a buffer used to contain the field (starting offset always zero) * offset)
* 2) At the end of a buffer used to contain the field (starting offset
* always zero)
*/ */
ObjDesc->CommonField.EndFieldValidBits = (UINT8) ((ObjDesc->CommonField.StartFieldBitOffset + FieldBitLength) % ObjDesc->CommonField.EndFieldValidBits = (UINT8)
((ObjDesc->CommonField.StartFieldBitOffset + FieldBitLength) %
AccessBitWidth); AccessBitWidth);
ObjDesc->CommonField.EndBufferValidBits = (UINT8) (FieldBitLength % AccessBitWidth); /* StartBufferBitOffset always = 0 */ /* StartBufferBitOffset always = 0 */
ObjDesc->CommonField.EndBufferValidBits = (UINT8)
(FieldBitLength % AccessBitWidth);
/* /*
* DatumValidBits is the number of valid field bits in the first field datum. * DatumValidBits is the number of valid field bits in the first
* field datum.
*/ */
ObjDesc->CommonField.DatumValidBits = (UINT8) (AccessBitWidth - ObjDesc->CommonField.DatumValidBits = (UINT8)
ObjDesc->CommonField.StartFieldBitOffset); (AccessBitWidth - ObjDesc->CommonField.StartFieldBitOffset);
/* /*
* Does the entire field fit within a single field access element? (datum) * Does the entire field fit within a single field access element? (datum)
* (i.e., without crossing a datum boundary) * (i.e., without crossing a datum boundary)
*/ */
if ((ObjDesc->CommonField.StartFieldBitOffset + FieldBitLength) <= if ((ObjDesc->CommonField.StartFieldBitOffset + FieldBitLength) <=
(UINT16) AccessBitWidth) (UINT16) AccessBitWidth)
{ {
ObjDesc->Common.Flags |= AOPOBJ_SINGLE_DATUM; ObjDesc->Common.Flags |= AOPOBJ_SINGLE_DATUM;
} }
@ -448,7 +464,7 @@ AcpiExPrepFieldValue (
AcpiUtAddReference (ObjDesc->Field.RegionObj); AcpiUtAddReference (ObjDesc->Field.RegionObj);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"RegionField: Bitoff=%X Off=%X Gran=%X Region %p\n", "RegionField: Bitoff=%X Off=%X Gran=%X Region %p\n",
ObjDesc->Field.StartFieldBitOffset, ObjDesc->Field.BaseByteOffset, ObjDesc->Field.StartFieldBitOffset, ObjDesc->Field.BaseByteOffset,
ObjDesc->Field.AccessByteWidth, ObjDesc->Field.RegionObj)); ObjDesc->Field.AccessByteWidth, ObjDesc->Field.RegionObj));
@ -466,9 +482,12 @@ AcpiExPrepFieldValue (
AcpiUtAddReference (ObjDesc->BankField.RegionObj); AcpiUtAddReference (ObjDesc->BankField.RegionObj);
AcpiUtAddReference (ObjDesc->BankField.BankObj); AcpiUtAddReference (ObjDesc->BankField.BankObj);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Bank Field: BitOff=%X Off=%X Gran=%X Region %p BankReg %p\n", ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
ObjDesc->BankField.StartFieldBitOffset, ObjDesc->BankField.BaseByteOffset, "Bank Field: BitOff=%X Off=%X Gran=%X Region %p BankReg %p\n",
ObjDesc->Field.AccessByteWidth, ObjDesc->BankField.RegionObj, ObjDesc->BankField.StartFieldBitOffset,
ObjDesc->BankField.BaseByteOffset,
ObjDesc->Field.AccessByteWidth,
ObjDesc->BankField.RegionObj,
ObjDesc->BankField.BankObj)); ObjDesc->BankField.BankObj));
break; break;
@ -477,8 +496,8 @@ AcpiExPrepFieldValue (
ObjDesc->IndexField.IndexObj = AcpiNsGetAttachedObject (Info->RegisterNode); ObjDesc->IndexField.IndexObj = AcpiNsGetAttachedObject (Info->RegisterNode);
ObjDesc->IndexField.DataObj = AcpiNsGetAttachedObject (Info->DataRegisterNode); ObjDesc->IndexField.DataObj = AcpiNsGetAttachedObject (Info->DataRegisterNode);
ObjDesc->IndexField.Value = (UINT32) (Info->FieldBitPosition / ObjDesc->IndexField.Value = (UINT32)
ACPI_MUL_8 (ObjDesc->Field.AccessByteWidth)); (Info->FieldBitPosition / ACPI_MUL_8 (ObjDesc->Field.AccessByteWidth));
if (!ObjDesc->IndexField.DataObj || !ObjDesc->IndexField.IndexObj) if (!ObjDesc->IndexField.DataObj || !ObjDesc->IndexField.IndexObj)
{ {
@ -491,9 +510,12 @@ AcpiExPrepFieldValue (
AcpiUtAddReference (ObjDesc->IndexField.DataObj); AcpiUtAddReference (ObjDesc->IndexField.DataObj);
AcpiUtAddReference (ObjDesc->IndexField.IndexObj); AcpiUtAddReference (ObjDesc->IndexField.IndexObj);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "IndexField: bitoff=%X off=%X gran=%X Index %p Data %p\n", ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
ObjDesc->IndexField.StartFieldBitOffset, ObjDesc->IndexField.BaseByteOffset, "IndexField: bitoff=%X off=%X gran=%X Index %p Data %p\n",
ObjDesc->Field.AccessByteWidth, ObjDesc->IndexField.IndexObj, ObjDesc->IndexField.StartFieldBitOffset,
ObjDesc->IndexField.BaseByteOffset,
ObjDesc->Field.AccessByteWidth,
ObjDesc->IndexField.IndexObj,
ObjDesc->IndexField.DataObj)); ObjDesc->IndexField.DataObj));
break; break;
} }
@ -505,7 +527,7 @@ AcpiExPrepFieldValue (
Status = AcpiNsAttachObject (Info->FieldNode, ObjDesc, Status = AcpiNsAttachObject (Info->FieldNode, ObjDesc,
AcpiNsGetType (Info->FieldNode)); AcpiNsGetType (Info->FieldNode));
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "set NamedObj %p (%4.4s) val = %p\n", ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "set NamedObj %p (%4.4s) val = %p\n",
Info->FieldNode, (char *) &(Info->FieldNode->Name), ObjDesc)); Info->FieldNode, (char *) &(Info->FieldNode->Name), ObjDesc));
/* Remove local reference to the object */ /* Remove local reference to the object */