diff options
author | iwasaki <iwasaki@FreeBSD.org> | 2002-08-29 01:51:24 +0000 |
---|---|---|
committer | iwasaki <iwasaki@FreeBSD.org> | 2002-08-29 01:51:24 +0000 |
commit | 1824f192010fc0c0826e9889892e534075b58793 (patch) | |
tree | bbc04a2733724f3f0ab5cecb259948ac9a9723d7 /sys/contrib/dev/acpica/hwregs.c | |
parent | 3f86517f16a9cf970e93e483e90066da6eb323dd (diff) | |
download | FreeBSD-src-1824f192010fc0c0826e9889892e534075b58793.zip FreeBSD-src-1824f192010fc0c0826e9889892e534075b58793.tar.gz |
Vendor import of the Intel ACPI CA 20020815 drop.
Diffstat (limited to 'sys/contrib/dev/acpica/hwregs.c')
-rw-r--r-- | sys/contrib/dev/acpica/hwregs.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/sys/contrib/dev/acpica/hwregs.c b/sys/contrib/dev/acpica/hwregs.c index fb2b8e4..164a44f 100644 --- a/sys/contrib/dev/acpica/hwregs.c +++ b/sys/contrib/dev/acpica/hwregs.c @@ -3,7 +3,7 @@ * * Module Name: hwregs - Read/write access functions for the various ACPI * control and status registers. - * $Revision: 133 $ + * $Revision: 134 $ * ******************************************************************************/ @@ -305,7 +305,7 @@ AcpiGetSleepTypeData ( * FUNCTION: AcpiHwGetRegisterBitMask * * PARAMETERS: RegisterId - Index of ACPI Register to access - * + * * RETURN: The bit mask to be used when accessing the register * * DESCRIPTION: Map RegisterId into a register bit mask. @@ -374,7 +374,7 @@ AcpiGetRegister ( } } - Status = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, + Status = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, BitRegInfo->ParentRegister, &RegisterValue); if (Flags & ACPI_MTX_LOCK) @@ -386,7 +386,7 @@ AcpiGetRegister ( { /* Normalize the value that was read */ - RegisterValue = ((RegisterValue & BitRegInfo->AccessBitMask) + RegisterValue = ((RegisterValue & BitRegInfo->AccessBitMask) >> BitRegInfo->BitPosition); *ReturnValue = RegisterValue; @@ -447,7 +447,7 @@ AcpiSetRegister ( /* Always do a register read first so we can insert the new bits */ - Status = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, + Status = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, BitRegInfo->ParentRegister, &RegisterValue); if (ACPI_FAILURE (Status)) { @@ -471,11 +471,11 @@ AcpiSetRegister ( * information is the single bit we're interested in, all others should * be written as 0 so they will be left unchanged */ - Value = ACPI_REGISTER_PREPARE_BITS (Value, + Value = ACPI_REGISTER_PREPARE_BITS (Value, BitRegInfo->BitPosition, BitRegInfo->AccessBitMask); if (Value) { - Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, + Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_STATUS, (UINT16) Value); RegisterValue = 0; } @@ -484,10 +484,10 @@ AcpiSetRegister ( case ACPI_REGISTER_PM1_ENABLE: - ACPI_REGISTER_INSERT_VALUE (RegisterValue, BitRegInfo->BitPosition, + ACPI_REGISTER_INSERT_VALUE (RegisterValue, BitRegInfo->BitPosition, BitRegInfo->AccessBitMask, Value); - Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, + Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM1_ENABLE, (UINT16) RegisterValue); break; @@ -501,7 +501,7 @@ AcpiSetRegister ( */ ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM1 control: Read %X\n", RegisterValue)); - ACPI_REGISTER_INSERT_VALUE (RegisterValue, BitRegInfo->BitPosition, + ACPI_REGISTER_INSERT_VALUE (RegisterValue, BitRegInfo->BitPosition, BitRegInfo->AccessBitMask, Value); Status = AcpiHwRegisterWrite (ACPI_MTX_DO_NOT_LOCK, RegisterId, @@ -511,7 +511,7 @@ AcpiSetRegister ( case ACPI_REGISTER_PM2_CONTROL: - Status = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, + Status = AcpiHwRegisterRead (ACPI_MTX_DO_NOT_LOCK, ACPI_REGISTER_PM2_CONTROL, &RegisterValue); if (ACPI_FAILURE (Status)) { @@ -519,11 +519,11 @@ AcpiSetRegister ( } ACPI_DEBUG_PRINT ((ACPI_DB_IO, "PM2 control: Read %X from %8.8X%8.8X\n", - RegisterValue, + RegisterValue, ACPI_HIDWORD (ACPI_GET_ADDRESS (AcpiGbl_FADT->XPm2CntBlk.Address)), ACPI_LODWORD (ACPI_GET_ADDRESS (AcpiGbl_FADT->XPm2CntBlk.Address)))); - ACPI_REGISTER_INSERT_VALUE (RegisterValue, BitRegInfo->BitPosition, + ACPI_REGISTER_INSERT_VALUE (RegisterValue, BitRegInfo->BitPosition, BitRegInfo->AccessBitMask, Value); ACPI_DEBUG_PRINT ((ACPI_DB_IO, "About to write %4.4X to %8.8X%8.8X\n", @@ -847,7 +847,7 @@ AcpiHwLowLevelRead ( { case ACPI_ADR_SPACE_SYSTEM_MEMORY: - MemAddress = (ACPI_GET_ADDRESS (Reg->Address) + MemAddress = (ACPI_GET_ADDRESS (Reg->Address) + (ACPI_PHYSICAL_ADDRESS) Offset); Status = AcpiOsReadMemory (MemAddress, Value, Width); @@ -856,7 +856,7 @@ AcpiHwLowLevelRead ( case ACPI_ADR_SPACE_SYSTEM_IO: - IoAddress = (ACPI_IO_ADDRESS) (ACPI_GET_ADDRESS (Reg->Address) + IoAddress = (ACPI_IO_ADDRESS) (ACPI_GET_ADDRESS (Reg->Address) + (ACPI_PHYSICAL_ADDRESS) Offset); Status = AcpiOsReadPort (IoAddress, Value, Width); @@ -937,7 +937,7 @@ AcpiHwLowLevelWrite ( { case ACPI_ADR_SPACE_SYSTEM_MEMORY: - MemAddress = (ACPI_GET_ADDRESS (Reg->Address) + MemAddress = (ACPI_GET_ADDRESS (Reg->Address) + (ACPI_PHYSICAL_ADDRESS) Offset); Status = AcpiOsWriteMemory (MemAddress, (ACPI_INTEGER) Value, Width); @@ -946,7 +946,7 @@ AcpiHwLowLevelWrite ( case ACPI_ADR_SPACE_SYSTEM_IO: - IoAddress = (ACPI_IO_ADDRESS) (ACPI_GET_ADDRESS (Reg->Address) + IoAddress = (ACPI_IO_ADDRESS) (ACPI_GET_ADDRESS (Reg->Address) + (ACPI_PHYSICAL_ADDRESS) Offset); Status = AcpiOsWritePort (IoAddress, (ACPI_INTEGER) Value, Width); @@ -959,7 +959,7 @@ AcpiHwLowLevelWrite ( PciId.Bus = 0; PciId.Device = ACPI_PCI_DEVICE (ACPI_GET_ADDRESS (Reg->Address)); PciId.Function = ACPI_PCI_FUNCTION (ACPI_GET_ADDRESS (Reg->Address)); - PciRegister = (UINT16) (ACPI_PCI_REGISTER (ACPI_GET_ADDRESS (Reg->Address)) + PciRegister = (UINT16) (ACPI_PCI_REGISTER (ACPI_GET_ADDRESS (Reg->Address)) + Offset); Status = AcpiOsWritePciConfiguration (&PciId, PciRegister, (ACPI_INTEGER) Value, Width); |