Automated cleanup

date	2002.07.30.22.15.00;	author rmoore1;	state Exp;
This commit is contained in:
aystarik 2005-06-29 17:37:18 +00:00
parent c5c163bcd7
commit 0e4a191594
6 changed files with 120 additions and 76 deletions

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exoparg1 - AML execution - opcodes with 1 argument
* $Revision: 1.141 $
* $Revision: 1.142 $
*
*****************************************************************************/
@ -306,7 +306,6 @@ AcpiExOpcode_1A_1T_1R (
ACPI_FUNCTION_TRACE_STR ("ExOpcode_1A_1T_1R", AcpiPsGetOpcodeName (WalkState->Opcode));
/* Examine the AML opcode */
switch (WalkState->Opcode)
@ -894,8 +893,8 @@ AcpiExOpcode_1A_0T_1R (
* 2) Dereference the node to an actual object. Could be a Field, so we nee
* to resolve the node to a value.
*/
Status = AcpiNsGetNodeByPath (Operand[0]->String.Pointer,
WalkState->ScopeInfo->Scope.Node, ACPI_NS_SEARCH_PARENT,
Status = AcpiNsGetNodeByPath (Operand[0]->String.Pointer,
WalkState->ScopeInfo->Scope.Node, ACPI_NS_SEARCH_PARENT,
ACPI_CAST_INDIRECT_PTR (ACPI_NAMESPACE_NODE, &ReturnDesc));
if (ACPI_FAILURE (Status))
{
@ -946,7 +945,7 @@ AcpiExOpcode_1A_0T_1R (
TempDesc = Operand[0]->Reference.Object;
/*
* Create a new object that contains one element of the
* Create a new object that contains one element of the
* buffer -- the element pointed to by the index.
*
* NOTE: index into a buffer is NOT a pointer to a
@ -973,7 +972,7 @@ AcpiExOpcode_1A_0T_1R (
case ACPI_TYPE_PACKAGE:
/*
* Return the referenced element of the package. We must add
* Return the referenced element of the package. We must add
* another reference to the referenced object, however.
*/
ReturnDesc = *(Operand[0]->Reference.Where);

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: exoparg2 - AML execution - opcodes with 2 arguments
* $Revision: 1.108 $
* $Revision: 1.110 $
*
*****************************************************************************/
@ -175,7 +175,7 @@ AcpiExOpcode_2A_0T_0R (
ACPI_STATUS Status = AE_OK;
ACPI_FUNCTION_TRACE_STR ("ExOpcode_2A_0T_0R",
ACPI_FUNCTION_TRACE_STR ("ExOpcode_2A_0T_0R",
AcpiPsGetOpcodeName (WalkState->Opcode));
@ -214,7 +214,7 @@ AcpiExOpcode_2A_0T_0R (
default:
ACPI_REPORT_ERROR (("AcpiExOpcode_2A_0T_0R: Unknown opcode %X\n",
ACPI_REPORT_ERROR (("AcpiExOpcode_2A_0T_0R: Unknown opcode %X\n",
WalkState->Opcode));
Status = AE_AML_BAD_OPCODE;
}
@ -470,7 +470,8 @@ AcpiExOpcode_2A_1T_1R (
if (Index >= Operand[0]->Package.Count)
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value beyond package end\n"));
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value (%X) beyond package end (%X)\n",
Index, Operand[0]->Package.Count));
Status = AE_AML_PACKAGE_LIMIT;
goto Cleanup;
}
@ -516,7 +517,8 @@ AcpiExOpcode_2A_1T_1R (
if (Index >= Operand[0]->Buffer.Length)
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value beyond end of buffer\n"));
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Index value (%X) beyond end of buffer (%X)\n",
Index, Operand[0]->Buffer.Length));
Status = AE_AML_BUFFER_LIMIT;
goto Cleanup;
}
@ -645,7 +647,8 @@ AcpiExOpcode_2A_0T_1R (
default:
ACPI_REPORT_ERROR (("AcpiExOpcode_2A_0T_1R: Unknown opcode %X\n", WalkState->Opcode));
ACPI_REPORT_ERROR (("AcpiExOpcode_2A_0T_1R: Unknown opcode %X\n",
WalkState->Opcode));
Status = AE_AML_BAD_OPCODE;
goto Cleanup;
}

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exprep - ACPI AML (p-code) execution - field prep utilities
* $Revision: 1.118 $
* $Revision: 1.119 $
*
*****************************************************************************/
@ -303,17 +303,17 @@ 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
* 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
* 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
* For all other access types (Byte, Word, Dword, Qword), the Bitwidth is
* the same (equivalent) as the ByteAlignment.
*/
AccessBitWidth = AcpiExDecodeFieldAccess (ObjDesc, FieldFlags,
AccessBitWidth = AcpiExDecodeFieldAccess (ObjDesc, FieldFlags,
&ByteAlignment);
if (!AccessBitWidth)
{
@ -322,26 +322,26 @@ AcpiExPrepCommonFieldObject (
/* Setup width (access granularity) fields */
ObjDesc->CommonField.AccessByteWidth = (UINT8)
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
* 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
* 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 =
NearestByteAddress =
ACPI_ROUND_BITS_DOWN_TO_BYTES (FieldBitPosition);
ObjDesc->CommonField.BaseByteOffset =
ObjDesc->CommonField.BaseByteOffset =
ACPI_ROUND_DOWN (NearestByteAddress, ByteAlignment);
/*
* StartFieldBitOffset is the offset of the first bit of the field within
* StartFieldBitOffset is the offset of the first bit of the field within
* a field datum.
*/
ObjDesc->CommonField.StartFieldBitOffset = (UINT8)
@ -349,24 +349,24 @@ AcpiExPrepCommonFieldObject (
/*
* Valid bits -- the number of bits that compose a partial datum,
* 1) At the end of the field within the region (arbitrary starting bit
* 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
* 2) At the end of a buffer used to contain the field (starting offset
* always zero)
*/
ObjDesc->CommonField.EndFieldValidBits = (UINT8)
ObjDesc->CommonField.EndFieldValidBits = (UINT8)
((ObjDesc->CommonField.StartFieldBitOffset + FieldBitLength) %
AccessBitWidth);
/* StartBufferBitOffset always = 0 */
ObjDesc->CommonField.EndBufferValidBits = (UINT8)
ObjDesc->CommonField.EndBufferValidBits = (UINT8)
(FieldBitLength % AccessBitWidth);
/*
* DatumValidBits is the number of valid field bits in the first
* DatumValidBits is the number of valid field bits in the first
* field datum.
*/
ObjDesc->CommonField.DatumValidBits = (UINT8)
ObjDesc->CommonField.DatumValidBits = (UINT8)
(AccessBitWidth - ObjDesc->CommonField.StartFieldBitOffset);
/*
@ -482,11 +482,11 @@ AcpiExPrepFieldValue (
AcpiUtAddReference (ObjDesc->BankField.RegionObj);
AcpiUtAddReference (ObjDesc->BankField.BankObj);
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"Bank Field: BitOff=%X Off=%X Gran=%X Region %p BankReg %p\n",
ObjDesc->BankField.StartFieldBitOffset,
ObjDesc->BankField.StartFieldBitOffset,
ObjDesc->BankField.BaseByteOffset,
ObjDesc->Field.AccessByteWidth,
ObjDesc->Field.AccessByteWidth,
ObjDesc->BankField.RegionObj,
ObjDesc->BankField.BankObj));
break;
@ -496,7 +496,7 @@ AcpiExPrepFieldValue (
ObjDesc->IndexField.IndexObj = AcpiNsGetAttachedObject (Info->RegisterNode);
ObjDesc->IndexField.DataObj = AcpiNsGetAttachedObject (Info->DataRegisterNode);
ObjDesc->IndexField.Value = (UINT32)
ObjDesc->IndexField.Value = (UINT32)
(Info->FieldBitPosition / ACPI_MUL_8 (ObjDesc->Field.AccessByteWidth));
if (!ObjDesc->IndexField.DataObj || !ObjDesc->IndexField.IndexObj)
@ -510,11 +510,11 @@ AcpiExPrepFieldValue (
AcpiUtAddReference (ObjDesc->IndexField.DataObj);
AcpiUtAddReference (ObjDesc->IndexField.IndexObj);
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
"IndexField: bitoff=%X off=%X gran=%X Index %p Data %p\n",
ObjDesc->IndexField.StartFieldBitOffset,
ObjDesc->IndexField.StartFieldBitOffset,
ObjDesc->IndexField.BaseByteOffset,
ObjDesc->Field.AccessByteWidth,
ObjDesc->Field.AccessByteWidth,
ObjDesc->IndexField.IndexObj,
ObjDesc->IndexField.DataObj));
break;

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exregion - ACPI default OpRegion (address space) handlers
* $Revision: 1.67 $
* $Revision: 1.80 $
*
*****************************************************************************/
@ -10,7 +10,7 @@
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp.
* Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.
* All rights reserved.
*
* 2. License
@ -120,14 +120,10 @@
#include "acpi.h"
#include "acinterp.h"
#include "amlcode.h"
#include "acnamesp.h"
#include "achware.h"
#include "acevents.h"
#define _COMPONENT ACPI_EXECUTER
MODULE_NAME ("exregion")
ACPI_MODULE_NAME ("exregion")
/*******************************************************************************
@ -161,9 +157,12 @@ AcpiExSystemMemorySpaceHandler (
void *LogicalAddrPtr = NULL;
ACPI_MEM_SPACE_CONTEXT *MemInfo = RegionContext;
UINT32 Length;
ACPI_SIZE WindowSize;
#ifndef _HW_ALIGNMENT_SUPPORT
UINT32 Remainder;
#endif
FUNCTION_TRACE ("ExSystemMemorySpaceHandler");
ACPI_FUNCTION_TRACE ("ExSystemMemorySpaceHandler");
/* Validate and translate the bit width */
@ -193,6 +192,18 @@ AcpiExSystemMemorySpaceHandler (
}
#ifndef _HW_ALIGNMENT_SUPPORT
/*
* Hardware does not support non-aligned data transfers, we must verify
* the request.
*/
(void) AcpiUtShortDivide ((ACPI_INTEGER *) &Address, Length, NULL, &Remainder);
if (Remainder != 0)
{
return_ACPI_STATUS (AE_AML_ALIGNMENT);
}
#endif
/*
* Does the request fit into the cached memory mapping?
* Is 1) Address below the current mapping? OR
@ -214,24 +225,34 @@ AcpiExSystemMemorySpaceHandler (
MemInfo->MappedLength);
}
MemInfo->MappedLength = 0; /* In case of failure below */
/*
* Don't attempt to map memory beyond the end of the region, and
* constrain the maximum mapping size to something reasonable.
*/
WindowSize = (ACPI_SIZE) ((MemInfo->Address + MemInfo->Length) - Address);
if (WindowSize > SYSMEM_REGION_WINDOW_SIZE)
{
WindowSize = SYSMEM_REGION_WINDOW_SIZE;
}
/* Create a new mapping starting at the address given */
Status = AcpiOsMapMemory (Address, SYSMEM_REGION_WINDOW_SIZE,
Status = AcpiOsMapMemory (Address, WindowSize,
(void **) &MemInfo->MappedLogicalAddress);
if (ACPI_FAILURE (Status))
{
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Could not map memory at %8.8X%8.8X, size %X\n",
ACPI_HIDWORD (Address), ACPI_LODWORD (Address), (UINT32) WindowSize));
MemInfo->MappedLength = 0;
return_ACPI_STATUS (Status);
}
/* Save the physical address and mapping size */
MemInfo->MappedPhysicalAddress = Address;
MemInfo->MappedLength = SYSMEM_REGION_WINDOW_SIZE;
MemInfo->MappedLength = WindowSize;
}
/*
* Generate a logical pointer corresponding to the address we want to
* access
@ -241,30 +262,42 @@ AcpiExSystemMemorySpaceHandler (
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"SystemMemory %d (%d width) Address=%8.8X%8.8X\n", Function, BitWidth,
HIDWORD (Address), LODWORD (Address)));
/* Perform the memory read or write */
ACPI_HIDWORD (Address), ACPI_LODWORD (Address)));
/*
* Perform the memory read or write
*
* Note: For machines that do not support non-aligned transfers, the target
* address was checked for alignment above. We do not attempt to break the
* transfer up into smaller (byte-size) chunks because the AML specifically
* asked for a transfer width that the hardware may require.
*/
switch (Function)
{
case ACPI_READ:
*Value = 0;
switch (BitWidth)
{
case 8:
*Value = (UINT32)* (UINT8 *) LogicalAddrPtr;
*Value = (ACPI_INTEGER) *((UINT8 *) LogicalAddrPtr);
break;
case 16:
MOVE_UNALIGNED16_TO_32 (Value, LogicalAddrPtr);
*Value = (ACPI_INTEGER) *((UINT16 *) LogicalAddrPtr);
break;
case 32:
MOVE_UNALIGNED32_TO_32 (Value, LogicalAddrPtr);
*Value = (ACPI_INTEGER) *((UINT32 *) LogicalAddrPtr);
break;
#if ACPI_MACHINE_WIDTH != 16
case 64:
MOVE_UNALIGNED64_TO_64 (Value, LogicalAddrPtr);
*Value = (ACPI_INTEGER) *((UINT64 *) LogicalAddrPtr);
break;
#endif
default:
/* BitWidth was already validated */
break;
}
break;
@ -278,15 +311,21 @@ AcpiExSystemMemorySpaceHandler (
break;
case 16:
MOVE_UNALIGNED16_TO_16 (LogicalAddrPtr, Value);
*(UINT16 *) LogicalAddrPtr = (UINT16) *Value;
break;
case 32:
MOVE_UNALIGNED32_TO_32 (LogicalAddrPtr, Value);
*(UINT32 *) LogicalAddrPtr = (UINT32) *Value;
break;
#if ACPI_MACHINE_WIDTH != 16
case 64:
MOVE_UNALIGNED64_TO_64 (LogicalAddrPtr, Value);
*(UINT64 *) LogicalAddrPtr = (UINT64) *Value;
break;
#endif
default:
/* BitWidth was already validated */
break;
}
break;
@ -330,12 +369,12 @@ AcpiExSystemIoSpaceHandler (
ACPI_STATUS Status = AE_OK;
FUNCTION_TRACE ("ExSystemIoSpaceHandler");
ACPI_FUNCTION_TRACE ("ExSystemIoSpaceHandler");
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"SystemIO %d (%d width) Address=%8.8X%8.8X\n", Function, BitWidth,
HIDWORD (Address), LODWORD (Address)));
ACPI_HIDWORD (Address), ACPI_LODWORD (Address)));
/* Decode the function parameter */
@ -393,7 +432,7 @@ AcpiExPciConfigSpaceHandler (
UINT16 PciRegister;
FUNCTION_TRACE ("ExPciConfigSpaceHandler");
ACPI_FUNCTION_TRACE ("ExPciConfigSpaceHandler");
/*
@ -409,7 +448,7 @@ AcpiExPciConfigSpaceHandler (
*
*/
PciId = (ACPI_PCI_ID *) RegionContext;
PciRegister = (UINT16) (ACPI_SIZE) Address;
PciRegister = (UINT16) (UINT32) Address;
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
"PciConfig %d (%d) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
@ -469,7 +508,7 @@ AcpiExCmosSpaceHandler (
ACPI_STATUS Status = AE_OK;
FUNCTION_TRACE ("ExCmosSpaceHandler");
ACPI_FUNCTION_TRACE ("ExCmosSpaceHandler");
return_ACPI_STATUS (Status);
@ -506,7 +545,7 @@ AcpiExPciBarSpaceHandler (
ACPI_STATUS Status = AE_OK;
FUNCTION_TRACE ("ExPciBarSpaceHandler");
ACPI_FUNCTION_TRACE ("ExPciBarSpaceHandler");
return_ACPI_STATUS (Status);
@ -541,15 +580,15 @@ AcpiExDataTableSpaceHandler (
void *RegionContext)
{
ACPI_STATUS Status = AE_OK;
UINT32 ByteWidth = DIV_8 (BitWidth);
UINT32 ByteWidth = ACPI_DIV_8 (BitWidth);
UINT32 i;
char *LogicalAddrPtr;
FUNCTION_TRACE ("ExDataTableSpaceHandler");
ACPI_FUNCTION_TRACE ("ExDataTableSpaceHandler");
LogicalAddrPtr = (char *) (ACPI_SIZE) Address;
LogicalAddrPtr = ACPI_PHYSADDR_TO_PTR (Address);
/* Perform the memory read or write */
@ -565,6 +604,7 @@ AcpiExDataTableSpaceHandler (
break;
case ACPI_WRITE:
default:
return_ACPI_STATUS (AE_SUPPORT);
}

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exresop - AML Interpreter operand/object resolution
* $Revision: 1.53 $
* $Revision: 1.55 $
*
*****************************************************************************/
@ -201,8 +201,8 @@ AcpiExCheckObjectType (
* target operator.
*
* Each 5-bit group in ArgTypes represents one required
* operand and indicates the required Type. The corresponding operand
* will be converted to the required type if possible, otherwise we
* operand and indicates the required Type. The corresponding operand
* will be converted to the required type if possible, otherwise we
* abort with an exception.
*
******************************************************************************/
@ -309,6 +309,7 @@ AcpiExResolveOperands (
case AML_DEBUG_OP:
case AML_NAME_OP:
case AML_INDEX_OP:
case AML_REF_OF_OP:
case AML_ARG_OP:
case AML_LOCAL_OP:

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exstore - AML Interpreter object store support
* $Revision: 1.167 $
* $Revision: 1.169 $
*
*****************************************************************************/
@ -186,7 +186,7 @@ AcpiExStore (
/* Destination object must be a Reference or a Constant object */
switch (ACPI_GET_OBJECT_TYPE (DestDesc))
{
{
case INTERNAL_TYPE_REFERENCE:
break;
@ -227,6 +227,7 @@ AcpiExStore (
switch (RefDesc->Reference.Opcode)
{
case AML_NAME_OP:
case AML_REF_OF_OP:
/* Storing an object into a Name "container" */