mirror of
https://github.com/acpica/acpica/
synced 2025-03-15 10:42:55 +03:00
Improved error messages
date 2002.11.25.20.40.00; author rmoore1; state Exp;
This commit is contained in:
parent
01c02a8c54
commit
38aa8c7b6d
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Module Name: hwregs - Read/write access functions for the various ACPI
|
||||
* control and status registers.
|
||||
* $Revision: 1.133 $
|
||||
* $Revision: 1.135 $
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@ -243,6 +243,9 @@ AcpiGetSleepTypeData (
|
||||
NULL, &ObjDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_REPORT_ERROR (("%s while evaluating SleepState method [%s]\n",
|
||||
AcpiFormatException (Status), AcpiGbl_DbSleepStates[SleepState]));
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@ -291,8 +294,8 @@ AcpiGetSleepTypeData (
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Bad Sleep object %p type %s\n",
|
||||
ObjDesc, AcpiUtGetObjectTypeName (ObjDesc)));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "While evaluating SleepState method [%s], bad Sleep object %p type %s\n",
|
||||
AcpiGbl_DbSleepStates[SleepState], ObjDesc, AcpiUtGetObjectTypeName (ObjDesc)));
|
||||
}
|
||||
|
||||
AcpiUtRemoveReference (ObjDesc);
|
||||
@ -305,7 +308,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 +377,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 +389,7 @@ AcpiGetRegister (
|
||||
{
|
||||
/* Normalize the value that was read */
|
||||
|
||||
RegisterValue = ((RegisterValue & BitRegInfo->AccessBitMask)
|
||||
RegisterValue = ((RegisterValue & BitRegInfo->AccessBitMask)
|
||||
>> BitRegInfo->BitPosition);
|
||||
|
||||
*ReturnValue = RegisterValue;
|
||||
@ -447,7 +450,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 +474,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 +487,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 +504,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 +514,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 +522,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 +850,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 +859,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 +940,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 +949,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 +962,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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user