diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2015-11-25 21:04:42 +0000 | 
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2015-11-25 21:04:42 +0000 | 
| commit | b9098066cd6284319bca922f13e59517f774a103 (patch) | |
| tree | f01fd6c9053cb01ed84c00cb42ee789adafceaf5 /source/components/hardware/hwxface.c | |
| parent | 1e24cf365bc9c8df179b145c90d52852724e54ee (diff) | |
Notes
Diffstat (limited to 'source/components/hardware/hwxface.c')
| -rw-r--r-- | source/components/hardware/hwxface.c | 48 | 
1 files changed, 29 insertions, 19 deletions
| diff --git a/source/components/hardware/hwxface.c b/source/components/hardware/hwxface.c index 7a8b5a2a91cd..ab6a3277860b 100644 --- a/source/components/hardware/hwxface.c +++ b/source/components/hardware/hwxface.c @@ -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,20 @@ AcpiGetSleepTypeData (       * Evaluate the \_Sx namespace object containing the register values       * for this state       */ -    Info->RelativePathname = ACPI_CAST_PTR ( -        char, AcpiGbl_SleepStateNames[SleepState]); +    Info->RelativePathname = ACPI_CAST_PTR (char, +        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 +588,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 +597,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 +644,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);  } | 
