summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/components/hardware/hwxface.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2016-09-30 22:40:58 +0000
committerjkim <jkim@FreeBSD.org>2016-09-30 22:40:58 +0000
commitdba8c0a565199df70a86f6a036d00c92f0c7675f (patch)
treecf4924274c6e92898c01efb3c8ba31b34f0630f2 /sys/contrib/dev/acpica/components/hardware/hwxface.c
parent0f41551ef9dde560d9d191d7190af02904dbf611 (diff)
downloadFreeBSD-src-dba8c0a565199df70a86f6a036d00c92f0c7675f.zip
FreeBSD-src-dba8c0a565199df70a86f6a036d00c92f0c7675f.tar.gz
MFC: r284583, r285797, r285799, r287168, r298714, r298720, r298838,
r300879 Merge ACPICA up to 20160527. Requested by: mav
Diffstat (limited to 'sys/contrib/dev/acpica/components/hardware/hwxface.c')
-rw-r--r--sys/contrib/dev/acpica/components/hardware/hwxface.c49
1 files changed, 29 insertions, 20 deletions
diff --git a/sys/contrib/dev/acpica/components/hardware/hwxface.c b/sys/contrib/dev/acpica/components/hardware/hwxface.c
index fcd5c9e..734dfc2 100644
--- a/sys/contrib/dev/acpica/components/hardware/hwxface.c
+++ b/sys/contrib/dev/acpica/components/hardware/hwxface.c
@@ -5,7 +5,7 @@
*****************************************************************************/
/*
- * Copyright (C) 2000 - 2015, Intel Corp.
+ * Copyright (C) 2000 - 2016, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -169,7 +169,7 @@ AcpiRead (
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
- Address, ReturnValue, Reg->BitWidth);
+ Address, ReturnValue, Reg->BitWidth);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -187,7 +187,7 @@ AcpiRead (
}
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
- Address, &ValueLo, Width);
+ Address, &ValueLo, Width);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -198,7 +198,7 @@ AcpiRead (
/* Read the top 32 bits */
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
- (Address + 4), &ValueHi, 32);
+ (Address + 4), &ValueHi, 32);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -263,7 +263,7 @@ AcpiWrite (
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
- Address, Value, Reg->BitWidth);
+ Address, Value, Reg->BitWidth);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -278,7 +278,7 @@ AcpiWrite (
}
Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
- Address, ACPI_LODWORD (Value), Width);
+ Address, ACPI_LODWORD (Value), Width);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -287,7 +287,7 @@ AcpiWrite (
if (Reg->BitWidth == 64)
{
Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
- (Address + 4), ACPI_HIDWORD (Value), 32);
+ (Address + 4), ACPI_HIDWORD (Value), 32);
if (ACPI_FAILURE (Status))
{
return (Status);
@@ -358,7 +358,7 @@ AcpiReadBitRegister (
/* Read the entire parent register */
Status = AcpiHwRegisterRead (BitRegInfo->ParentRegister,
- &RegisterValue);
+ &RegisterValue);
if (ACPI_FAILURE (Status))
{
return_ACPI_STATUS (Status);
@@ -367,7 +367,7 @@ AcpiReadBitRegister (
/* Normalize the value that was read, mask off other bits */
Value = ((RegisterValue & BitRegInfo->AccessBitMask)
- >> BitRegInfo->BitPosition);
+ >> BitRegInfo->BitPosition);
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
"BitReg %X, ParentReg %X, Actual %8.8X, ReturnValue %8.8X\n",
@@ -439,7 +439,7 @@ AcpiWriteBitRegister (
* interested in
*/
Status = AcpiHwRegisterRead (BitRegInfo->ParentRegister,
- &RegisterValue);
+ &RegisterValue);
if (ACPI_FAILURE (Status))
{
goto UnlockAndExit;
@@ -453,7 +453,7 @@ AcpiWriteBitRegister (
BitRegInfo->AccessBitMask, Value);
Status = AcpiHwRegisterWrite (BitRegInfo->ParentRegister,
- RegisterValue);
+ RegisterValue);
}
else
{
@@ -473,7 +473,7 @@ AcpiWriteBitRegister (
if (RegisterValue)
{
Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_STATUS,
- RegisterValue);
+ RegisterValue);
}
}
@@ -565,12 +565,19 @@ AcpiGetSleepTypeData (
* Evaluate the \_Sx namespace object containing the register values
* for this state
*/
- Info->RelativePathname = ACPI_CAST_PTR (
- char, AcpiGbl_SleepStateNames[SleepState]);
+ Info->RelativePathname = AcpiGbl_SleepStateNames[SleepState];
+
Status = AcpiNsEvaluate (Info);
if (ACPI_FAILURE (Status))
{
- goto Cleanup;
+ if (Status == AE_NOT_FOUND)
+ {
+ /* The _Sx states are optional, ignore NOT_FOUND */
+
+ goto FinalCleanup;
+ }
+
+ goto WarningCleanup;
}
/* Must have a return object */
@@ -580,7 +587,7 @@ AcpiGetSleepTypeData (
ACPI_ERROR ((AE_INFO, "No Sleep State object returned from [%s]",
Info->RelativePathname));
Status = AE_AML_NO_RETURN_VALUE;
- goto Cleanup;
+ goto WarningCleanup;
}
/* Return object must be of type Package */
@@ -589,7 +596,7 @@ AcpiGetSleepTypeData (
{
ACPI_ERROR ((AE_INFO, "Sleep State return object is not a Package"));
Status = AE_AML_OPERAND_TYPE;
- goto Cleanup1;
+ goto ReturnValueCleanup;
}
/*
@@ -636,16 +643,18 @@ AcpiGetSleepTypeData (
break;
}
-Cleanup1:
+ReturnValueCleanup:
AcpiUtRemoveReference (Info->ReturnObject);
-Cleanup:
+WarningCleanup:
if (ACPI_FAILURE (Status))
{
ACPI_EXCEPTION ((AE_INFO, Status,
- "While evaluating Sleep State [%s]", Info->RelativePathname));
+ "While evaluating Sleep State [%s]",
+ Info->RelativePathname));
}
+FinalCleanup:
ACPI_FREE (Info);
return_ACPI_STATUS (Status);
}
OpenPOWER on IntegriCloud