diff options
author | jkim <jkim@FreeBSD.org> | 2013-08-23 18:01:58 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2013-08-23 18:01:58 +0000 |
commit | b2a92415360aacb32d9b6107bdcf100d16d09167 (patch) | |
tree | 89234dd9f502de2faaf4a280ccd0d3785a7ae96f /source/components/hardware/hwxface.c | |
parent | 8e9a373708032aaf58694e237e3889d7d3fd796f (diff) | |
download | FreeBSD-src-b2a92415360aacb32d9b6107bdcf100d16d09167.zip FreeBSD-src-b2a92415360aacb32d9b6107bdcf100d16d09167.tar.gz |
Import ACPICA 20130823.
Diffstat (limited to 'source/components/hardware/hwxface.c')
-rw-r--r-- | source/components/hardware/hwxface.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/source/components/hardware/hwxface.c b/source/components/hardware/hwxface.c index 25ad60a..45d5654 100644 --- a/source/components/hardware/hwxface.c +++ b/source/components/hardware/hwxface.c @@ -131,7 +131,8 @@ AcpiRead ( UINT64 *ReturnValue, ACPI_GENERIC_ADDRESS *Reg) { - UINT32 Value; + UINT32 ValueLo; + UINT32 ValueHi; UINT32 Width; UINT64 Address; ACPI_STATUS Status; @@ -153,13 +154,8 @@ AcpiRead ( return (Status); } - /* Initialize entire 64-bit return value to zero */ - - *ReturnValue = 0; - Value = 0; - /* - * Two address spaces supported: Memory or IO. PCI_Config is + * Two address spaces supported: Memory or I/O. PCI_Config is * not supported here because the GAS structure is insufficient */ if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) @@ -173,6 +169,9 @@ AcpiRead ( } else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ { + ValueLo = 0; + ValueHi = 0; + Width = Reg->BitWidth; if (Width == 64) { @@ -180,25 +179,27 @@ AcpiRead ( } Status = AcpiHwReadPort ((ACPI_IO_ADDRESS) - Address, &Value, Width); + Address, &ValueLo, Width); if (ACPI_FAILURE (Status)) { return (Status); } - *ReturnValue = Value; if (Reg->BitWidth == 64) { /* Read the top 32 bits */ Status = AcpiHwReadPort ((ACPI_IO_ADDRESS) - (Address + 4), &Value, 32); + (Address + 4), &ValueHi, 32); if (ACPI_FAILURE (Status)) { return (Status); } - *ReturnValue |= ((UINT64) Value << 32); } + + /* Set the return value only if status is AE_OK */ + + *ReturnValue = (ValueLo | ((UINT64) ValueHi << 32)); } ACPI_DEBUG_PRINT ((ACPI_DB_IO, @@ -207,7 +208,7 @@ AcpiRead ( ACPI_FORMAT_UINT64 (Address), AcpiUtGetRegionName (Reg->SpaceId))); - return (Status); + return (AE_OK); } ACPI_EXPORT_SYMBOL (AcpiRead) |