mirror of
https://github.com/acpica/acpica/
synced 2025-02-23 08:54:16 +03:00
Cleanup and update of debug output levels
date 2002.03.22.21.47.00; author rmoore1; state Exp;
This commit is contained in:
parent
2ea25c4e6b
commit
c1cb71dcd8
@ -2,7 +2,7 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
* necessary ByteAlignment (address granularity) of the access.
|
||||
*
|
||||
* For AnyAcc, the AccessBitWidth is the largest width that is both 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.
|
||||
* For AnyAcc, the AccessBitWidth is the largest width that is both
|
||||
* 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.
|
||||
*
|
||||
* For all Buffer Fields, the ByteAlignment is always one byte.
|
||||
*
|
||||
* For all other access types (Byte, Word, Dword, Qword), the Bitwidth is the
|
||||
* same (equivalent) as the ByteAlignment.
|
||||
* 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);
|
||||
@ -320,45 +322,59 @@ AcpiExPrepCommonFieldObject (
|
||||
|
||||
/* 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
|
||||
* the byte address of the first *datum* (field-width data unit) of the field.
|
||||
* (i.e., the first datum that contains at least the first *bit* of the field.)
|
||||
* 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.
|
||||
* BaseByteOffset is the address of the start of the field within the
|
||||
* region. It is the byte address of the first *datum* (field-width data
|
||||
* unit) of the field. (i.e., the first datum that contains at least the
|
||||
* first *bit* of the field.)
|
||||
*
|
||||
* 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);
|
||||
ObjDesc->CommonField.BaseByteOffset = ACPI_ROUND_DOWN (NearestByteAddress, ByteAlignment);
|
||||
NearestByteAddress =
|
||||
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 -
|
||||
ACPI_MUL_8 (ObjDesc->CommonField.BaseByteOffset));
|
||||
ObjDesc->CommonField.StartFieldBitOffset = (UINT8)
|
||||
(FieldBitPosition - ACPI_MUL_8 (ObjDesc->CommonField.BaseByteOffset));
|
||||
|
||||
/*
|
||||
* 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)
|
||||
* 2) At the end of a buffer used to contain the field (starting offset always zero)
|
||||
* 1) At the end of the field within the region (arbitrary starting bit
|
||||
* 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);
|
||||
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.StartFieldBitOffset);
|
||||
ObjDesc->CommonField.DatumValidBits = (UINT8)
|
||||
(AccessBitWidth - ObjDesc->CommonField.StartFieldBitOffset);
|
||||
|
||||
/*
|
||||
* Does the entire field fit within a single field access element? (datum)
|
||||
* (i.e., without crossing a datum boundary)
|
||||
*/
|
||||
if ((ObjDesc->CommonField.StartFieldBitOffset + FieldBitLength) <=
|
||||
(UINT16) AccessBitWidth)
|
||||
(UINT16) AccessBitWidth)
|
||||
{
|
||||
ObjDesc->Common.Flags |= AOPOBJ_SINGLE_DATUM;
|
||||
}
|
||||
@ -448,7 +464,7 @@ AcpiExPrepFieldValue (
|
||||
|
||||
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",
|
||||
ObjDesc->Field.StartFieldBitOffset, ObjDesc->Field.BaseByteOffset,
|
||||
ObjDesc->Field.AccessByteWidth, ObjDesc->Field.RegionObj));
|
||||
@ -466,9 +482,12 @@ AcpiExPrepFieldValue (
|
||||
AcpiUtAddReference (ObjDesc->BankField.RegionObj);
|
||||
AcpiUtAddReference (ObjDesc->BankField.BankObj);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Bank Field: BitOff=%X Off=%X Gran=%X Region %p BankReg %p\n",
|
||||
ObjDesc->BankField.StartFieldBitOffset, ObjDesc->BankField.BaseByteOffset,
|
||||
ObjDesc->Field.AccessByteWidth, ObjDesc->BankField.RegionObj,
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Bank Field: BitOff=%X Off=%X Gran=%X Region %p BankReg %p\n",
|
||||
ObjDesc->BankField.StartFieldBitOffset,
|
||||
ObjDesc->BankField.BaseByteOffset,
|
||||
ObjDesc->Field.AccessByteWidth,
|
||||
ObjDesc->BankField.RegionObj,
|
||||
ObjDesc->BankField.BankObj));
|
||||
break;
|
||||
|
||||
@ -477,8 +496,8 @@ AcpiExPrepFieldValue (
|
||||
|
||||
ObjDesc->IndexField.IndexObj = AcpiNsGetAttachedObject (Info->RegisterNode);
|
||||
ObjDesc->IndexField.DataObj = AcpiNsGetAttachedObject (Info->DataRegisterNode);
|
||||
ObjDesc->IndexField.Value = (UINT32) (Info->FieldBitPosition /
|
||||
ACPI_MUL_8 (ObjDesc->Field.AccessByteWidth));
|
||||
ObjDesc->IndexField.Value = (UINT32)
|
||||
(Info->FieldBitPosition / ACPI_MUL_8 (ObjDesc->Field.AccessByteWidth));
|
||||
|
||||
if (!ObjDesc->IndexField.DataObj || !ObjDesc->IndexField.IndexObj)
|
||||
{
|
||||
@ -491,9 +510,12 @@ AcpiExPrepFieldValue (
|
||||
AcpiUtAddReference (ObjDesc->IndexField.DataObj);
|
||||
AcpiUtAddReference (ObjDesc->IndexField.IndexObj);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "IndexField: bitoff=%X off=%X gran=%X Index %p Data %p\n",
|
||||
ObjDesc->IndexField.StartFieldBitOffset, ObjDesc->IndexField.BaseByteOffset,
|
||||
ObjDesc->Field.AccessByteWidth, ObjDesc->IndexField.IndexObj,
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"IndexField: bitoff=%X off=%X gran=%X Index %p Data %p\n",
|
||||
ObjDesc->IndexField.StartFieldBitOffset,
|
||||
ObjDesc->IndexField.BaseByteOffset,
|
||||
ObjDesc->Field.AccessByteWidth,
|
||||
ObjDesc->IndexField.IndexObj,
|
||||
ObjDesc->IndexField.DataObj));
|
||||
break;
|
||||
}
|
||||
@ -505,7 +527,7 @@ AcpiExPrepFieldValue (
|
||||
Status = AcpiNsAttachObject (Info->FieldNode, ObjDesc,
|
||||
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));
|
||||
|
||||
/* Remove local reference to the object */
|
||||
|
Loading…
x
Reference in New Issue
Block a user