Index: Interpreter/amfldio.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/Subsystem/Interpreter/amfldio.c,v retrieving revision 1.1.1.4 diff -u -r1.1.1.4 amfldio.c --- Interpreter/amfldio.c 2000/12/21 06:56:40 1.1.1.4 +++ Interpreter/amfldio.c 2001/01/03 02:59:40 @@ -541,14 +541,23 @@ ACPI_STATUS Status = AE_OK; UINT32 MergedValue; UINT32 CurrentValue; + UINT32 BitMask; /* Start with the new bits */ MergedValue = FieldValue; - /* Check if update rule needs to be applied (not if mask is all ones) */ + /* Check which bits are valid in the target address */ + switch (BitGranularity) { + case 32: + BitMask = 0xffffffff; + break; + default: + BitMask = (1UL << BitGranularity) - 1; + break; + } /* Decode the update rule */ @@ -559,11 +568,15 @@ /* * Read the current contents of the byte/word/dword containing - * the field, and merge with the new field value. + * the field, and merge with the new field value. Only do this + * if we are adding significant bits that needs to be preserved + * and was not supplied by the caller. */ - Status = AcpiAmlReadFieldData (ObjDesc, ThisFieldByteOffset, - BitGranularity, &CurrentValue); - MergedValue |= (CurrentValue & ~Mask); + if (BitMask & ~Mask) { + Status = AcpiAmlReadFieldData (ObjDesc, ThisFieldByteOffset, + BitGranularity, &CurrentValue); + MergedValue |= (CurrentValue & ~Mask); + } break; Index: Interpreter/amregion.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/dev/acpica/Subsystem/Interpreter/amregion.c,v retrieving revision 1.1.1.4 diff -u -r1.1.1.4 amregion.c --- Interpreter/amregion.c 2000/12/21 06:56:41 1.1.1.4 +++ Interpreter/amregion.c 2001/01/03 02:57:37 @@ -250,7 +250,7 @@ case ADDRESS_SPACE_READ: DEBUG_PRINT ((TRACE_OPREGION | VERBOSE_INFO), - ("Read (%d width) Address=%p\n", BitWidth, Address)); + ("Read (%d width) Address=%p\n", BitWidth, (void *)Address)); switch (BitWidth) { @@ -274,7 +274,7 @@ DEBUG_PRINT ((TRACE_OPREGION | VERBOSE_INFO), ("Write (%d width) Address=%p Value %X\n", - BitWidth, Address, *Value)); + BitWidth, (void *)Address, *Value)); switch (BitWidth) { @@ -344,7 +344,7 @@ case ADDRESS_SPACE_READ: DEBUG_PRINT ((TRACE_OPREGION | VERBOSE_INFO), - ("Read(%d width) Address=%p\n", BitWidth, Address)); + ("Read(%d width) Address=%p\n", BitWidth, (void *)Address)); switch (BitWidth) { @@ -376,7 +376,7 @@ DEBUG_PRINT ((TRACE_OPREGION | VERBOSE_INFO), ("Write(%d width) Address=%p Value %X\n", - BitWidth, Address, *Value)); + BitWidth, (void *)Address, *Value)); switch (BitWidth) {