summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/exregion.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/exregion.c')
-rw-r--r--sys/contrib/dev/acpica/exregion.c42
1 files changed, 25 insertions, 17 deletions
diff --git a/sys/contrib/dev/acpica/exregion.c b/sys/contrib/dev/acpica/exregion.c
index 58c6aa3..52546cc 100644
--- a/sys/contrib/dev/acpica/exregion.c
+++ b/sys/contrib/dev/acpica/exregion.c
@@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exregion - ACPI default OpRegion (address space) handlers
- * $Revision: 87 $
+ * $Revision: 1.91 $
*
*****************************************************************************/
@@ -10,7 +10,7 @@
*
* 1. Copyright Notice
*
- * Some or all of this work - Copyright (c) 1999 - 2004, Intel Corp.
+ * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
* All rights reserved.
*
* 2. License
@@ -158,7 +158,7 @@ AcpiExSystemMemorySpaceHandler (
ACPI_MEM_SPACE_CONTEXT *MemInfo = RegionContext;
UINT32 Length;
ACPI_SIZE WindowSize;
-#ifndef ACPI_MISALIGNED_TRANSFERS
+#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
UINT32 Remainder;
#endif
@@ -191,8 +191,7 @@ AcpiExSystemMemorySpaceHandler (
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
}
-
-#ifndef ACPI_MISALIGNED_TRANSFERS
+#ifdef ACPI_MISALIGNMENT_NOT_SUPPORTED
/*
* Hardware does not support non-aligned data transfers, we must verify
* the request.
@@ -211,7 +210,8 @@ AcpiExSystemMemorySpaceHandler (
*/
if ((Address < MemInfo->MappedPhysicalAddress) ||
(((ACPI_INTEGER) Address + Length) >
- ((ACPI_INTEGER) MemInfo->MappedPhysicalAddress + MemInfo->MappedLength)))
+ ((ACPI_INTEGER)
+ MemInfo->MappedPhysicalAddress + MemInfo->MappedLength)))
{
/*
* The request cannot be resolved by the current memory mapping;
@@ -229,7 +229,9 @@ AcpiExSystemMemorySpaceHandler (
* 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);
+ WindowSize = (ACPI_SIZE)
+ ((MemInfo->Address + MemInfo->Length) - Address);
+
if (WindowSize > ACPI_SYSMEM_REGION_WINDOW_SIZE)
{
WindowSize = ACPI_SYSMEM_REGION_WINDOW_SIZE;
@@ -241,8 +243,9 @@ AcpiExSystemMemorySpaceHandler (
(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_FORMAT_UINT64 (Address), (UINT32) WindowSize));
+ ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+ "Could not map memory at %8.8X%8.8X, size %X\n",
+ ACPI_FORMAT_UINT64 (Address), (UINT32) WindowSize));
MemInfo->MappedLength = 0;
return_ACPI_STATUS (Status);
}
@@ -258,10 +261,12 @@ AcpiExSystemMemorySpaceHandler (
* access
*/
LogicalAddrPtr = MemInfo->MappedLogicalAddress +
- ((ACPI_INTEGER) Address - (ACPI_INTEGER) MemInfo->MappedPhysicalAddress);
+ ((ACPI_INTEGER) Address -
+ (ACPI_INTEGER) MemInfo->MappedPhysicalAddress);
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
- "SystemMemory %d (%d width) Address=%8.8X%8.8X\n", Function, BitWidth,
+ "SystemMemory %d (%d width) Address=%8.8X%8.8X\n",
+ Function, BitWidth,
ACPI_FORMAT_UINT64 (Address)));
/*
@@ -383,13 +388,15 @@ AcpiExSystemIoSpaceHandler (
{
case ACPI_READ:
- Status = AcpiOsReadPort ((ACPI_IO_ADDRESS) Address, &Value32, BitWidth);
+ Status = AcpiOsReadPort ((ACPI_IO_ADDRESS) Address,
+ &Value32, BitWidth);
*Value = Value32;
break;
case ACPI_WRITE:
- Status = AcpiOsWritePort ((ACPI_IO_ADDRESS) Address, (UINT32) *Value, BitWidth);
+ Status = AcpiOsWritePort ((ACPI_IO_ADDRESS) Address,
+ (UINT32) *Value, BitWidth);
break;
default:
@@ -461,12 +468,14 @@ AcpiExPciConfigSpaceHandler (
case ACPI_READ:
*Value = 0;
- Status = AcpiOsReadPciConfiguration (PciId, PciRegister, Value, BitWidth);
+ Status = AcpiOsReadPciConfiguration (PciId, PciRegister,
+ Value, BitWidth);
break;
case ACPI_WRITE:
- Status = AcpiOsWritePciConfiguration (PciId, PciRegister, *Value, BitWidth);
+ Status = AcpiOsWritePciConfiguration (PciId, PciRegister,
+ *Value, BitWidth);
break;
default:
@@ -591,8 +600,7 @@ AcpiExDataTableSpaceHandler (
LogicalAddrPtr = ACPI_PHYSADDR_TO_PTR (Address);
-
- /* Perform the memory read or write */
+ /* Perform the memory read or write */
switch (Function)
{
OpenPOWER on IntegriCloud