Print this page
update to acpica-unix2-20140114
acpica-unix2-20130823
PANKOVs restructure
*** 1,15 ****
-
/*******************************************************************************
*
* Module Name: hwregs - Read/write access functions for the various ACPI
* control and status registers.
*
******************************************************************************/
/*
! * Copyright (C) 2000 - 2011, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
--- 1,14 ----
/*******************************************************************************
*
* Module Name: hwregs - Read/write access functions for the various ACPI
* control and status registers.
*
******************************************************************************/
/*
! * Copyright (C) 2000 - 2014, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*** 51,60 ****
--- 50,61 ----
#define _COMPONENT ACPI_HARDWARE
ACPI_MODULE_NAME ("hwregs")
+ #if (!ACPI_REDUCED_HARDWARE)
+
/* Local Prototypes */
static ACPI_STATUS
AcpiHwReadMultiple (
UINT32 *Value,
*** 65,74 ****
--- 66,76 ----
AcpiHwWriteMultiple (
UINT32 Value,
ACPI_GENERIC_ADDRESS *RegisterA,
ACPI_GENERIC_ADDRESS *RegisterB);
+ #endif /* !ACPI_REDUCED_HARDWARE */
/******************************************************************************
*
* FUNCTION: AcpiHwValidateRegister
*
*** 168,177 ****
--- 170,180 ----
AcpiHwRead (
UINT32 *Value,
ACPI_GENERIC_ADDRESS *Reg)
{
UINT64 Address;
+ UINT64 Value64;
ACPI_STATUS Status;
ACPI_FUNCTION_NAME (HwRead);
*** 193,203 ****
* not supported here because the GAS structure is insufficient
*/
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
! Address, Value, Reg->BitWidth);
}
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
{
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
Address, Value, Reg->BitWidth);
--- 196,208 ----
* not supported here because the GAS structure is insufficient
*/
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
! Address, &Value64, Reg->BitWidth);
!
! *Value = (UINT32) Value64;
}
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
{
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
Address, Value, Reg->BitWidth);
*** 252,262 ****
* not supported here because the GAS structure is insufficient
*/
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
! Address, Value, Reg->BitWidth);
}
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
{
Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
Address, Value, Reg->BitWidth);
--- 257,267 ----
* not supported here because the GAS structure is insufficient
*/
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
{
Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
! Address, (UINT64) Value, Reg->BitWidth);
}
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
{
Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
Address, Value, Reg->BitWidth);
*** 269,278 ****
--- 274,284 ----
return (Status);
}
+ #if (!ACPI_REDUCED_HARDWARE)
/*******************************************************************************
*
* FUNCTION: AcpiHwClearAcpiStatus
*
* PARAMETERS: None
*** 319,329 ****
}
/*******************************************************************************
*
! * FUNCTION: AcpiHwGetRegisterBitMask
*
* PARAMETERS: RegisterId - Index of ACPI Register to access
*
* RETURN: The bitmask to be used when accessing the register
*
--- 325,335 ----
}
/*******************************************************************************
*
! * FUNCTION: AcpiHwGetBitRegisterInfo
*
* PARAMETERS: RegisterId - Index of ACPI Register to access
*
* RETURN: The bitmask to be used when accessing the register
*
*** 422,440 ****
Status = AcpiHwReadMultiple (&Value,
&AcpiGbl_XPm1aStatus,
&AcpiGbl_XPm1bStatus);
break;
-
case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access each */
Status = AcpiHwReadMultiple (&Value,
&AcpiGbl_XPm1aEnable,
&AcpiGbl_XPm1bEnable);
break;
-
case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */
Status = AcpiHwReadMultiple (&Value,
&AcpiGbl_FADT.XPm1aControlBlock,
&AcpiGbl_FADT.XPm1bControlBlock);
--- 428,444 ----
*** 445,474 ****
* software masks out all write-only bits."
*/
Value &= ~ACPI_PM1_CONTROL_WRITEONLY_BITS;
break;
-
case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
Status = AcpiHwRead (&Value, &AcpiGbl_FADT.XPm2ControlBlock);
break;
-
case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
Status = AcpiHwRead (&Value, &AcpiGbl_FADT.XPmTimerBlock);
break;
-
case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
Status = AcpiHwReadPort (AcpiGbl_FADT.SmiCommand, &Value, 8);
break;
-
default:
ACPI_ERROR ((AE_INFO, "Unknown Register ID: 0x%X",
RegisterId));
Status = AE_BAD_PARAMETER;
break;
}
--- 449,475 ----
* software masks out all write-only bits."
*/
Value &= ~ACPI_PM1_CONTROL_WRITEONLY_BITS;
break;
case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
Status = AcpiHwRead (&Value, &AcpiGbl_FADT.XPm2ControlBlock);
break;
case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
Status = AcpiHwRead (&Value, &AcpiGbl_FADT.XPmTimerBlock);
break;
case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
Status = AcpiHwReadPort (AcpiGbl_FADT.SmiCommand, &Value, 8);
break;
default:
+
ACPI_ERROR ((AE_INFO, "Unknown Register ID: 0x%X",
RegisterId));
Status = AE_BAD_PARAMETER;
break;
}
*** 538,558 ****
Status = AcpiHwWriteMultiple (Value,
&AcpiGbl_XPm1aStatus,
&AcpiGbl_XPm1bStatus);
break;
-
case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access each */
Status = AcpiHwWriteMultiple (Value,
&AcpiGbl_XPm1aEnable,
&AcpiGbl_XPm1bEnable);
break;
-
case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */
-
/*
* Perform a read first to preserve certain bits (per ACPI spec)
* Note: This includes SCI_EN, we never want to change this bit
*/
Status = AcpiHwReadMultiple (&ReadValue,
--- 539,556 ----
*** 572,584 ****
Status = AcpiHwWriteMultiple (Value,
&AcpiGbl_FADT.XPm1aControlBlock,
&AcpiGbl_FADT.XPm1bControlBlock);
break;
-
case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
-
/*
* For control registers, all reserved bits must be preserved,
* as per the ACPI spec.
*/
Status = AcpiHwRead (&ReadValue, &AcpiGbl_FADT.XPm2ControlBlock);
--- 570,580 ----
*** 592,617 ****
ACPI_INSERT_BITS (Value, ACPI_PM2_CONTROL_PRESERVED_BITS, ReadValue);
Status = AcpiHwWrite (Value, &AcpiGbl_FADT.XPm2ControlBlock);
break;
-
case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
Status = AcpiHwWrite (Value, &AcpiGbl_FADT.XPmTimerBlock);
break;
-
case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
/* SMI_CMD is currently always in IO space */
Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand, Value, 8);
break;
-
default:
ACPI_ERROR ((AE_INFO, "Unknown Register ID: 0x%X",
RegisterId));
Status = AE_BAD_PARAMETER;
break;
}
--- 588,611 ----
ACPI_INSERT_BITS (Value, ACPI_PM2_CONTROL_PRESERVED_BITS, ReadValue);
Status = AcpiHwWrite (Value, &AcpiGbl_FADT.XPm2ControlBlock);
break;
case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
Status = AcpiHwWrite (Value, &AcpiGbl_FADT.XPmTimerBlock);
break;
case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
/* SMI_CMD is currently always in IO space */
Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand, Value, 8);
break;
default:
+
ACPI_ERROR ((AE_INFO, "Unknown Register ID: 0x%X",
RegisterId));
Status = AE_BAD_PARAMETER;
break;
}
*** 729,733 ****
--- 723,728 ----
}
return (Status);
}
+ #endif /* !ACPI_REDUCED_HARDWARE */