diff options
author | msmith <msmith@FreeBSD.org> | 2001-02-02 08:31:50 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 2001-02-02 08:31:50 +0000 |
commit | 4ae46f175424455223efc4900a37984cb683378d (patch) | |
tree | d8361d92b30388955e720d4194e43347a6ad7cdd /sys/contrib | |
parent | e6bd7f7c6d1d8a84684b1b83f687d53ddd55c478 (diff) | |
download | FreeBSD-src-4ae46f175424455223efc4900a37984cb683378d.zip FreeBSD-src-4ae46f175424455223efc4900a37984cb683378d.tar.gz |
Patch the reintroduced (~0 << 32) == 1 bug with a cryptic but functional
version. This should fix the read-before-write problem again.
Obtained from: "Adam J. Richter" <adam@yggdrasil.com>
Diffstat (limited to 'sys/contrib')
-rw-r--r-- | sys/contrib/dev/acpica/Subsystem/Interpreter/amfldio.c | 3 | ||||
-rw-r--r-- | sys/contrib/dev/acpica/exfldio.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/contrib/dev/acpica/Subsystem/Interpreter/amfldio.c b/sys/contrib/dev/acpica/Subsystem/Interpreter/amfldio.c index ad40aec..b8583d8 100644 --- a/sys/contrib/dev/acpica/Subsystem/Interpreter/amfldio.c +++ b/sys/contrib/dev/acpica/Subsystem/Interpreter/amfldio.c @@ -572,7 +572,8 @@ AcpiAmlWriteFieldDataWithUpdateRule ( /* Check if update rule needs to be applied (not if mask is all ones) */ - if (((1 << BitGranularity) -1) & ~Mask) + /* The left shift drops the bits we want to ignore. */ + if ((~Mask << (sizeof(Mask) * 8 - BitGranularity)) != 0) { /* * Read the current contents of the byte/word/dword containing diff --git a/sys/contrib/dev/acpica/exfldio.c b/sys/contrib/dev/acpica/exfldio.c index ad40aec..b8583d8 100644 --- a/sys/contrib/dev/acpica/exfldio.c +++ b/sys/contrib/dev/acpica/exfldio.c @@ -572,7 +572,8 @@ AcpiAmlWriteFieldDataWithUpdateRule ( /* Check if update rule needs to be applied (not if mask is all ones) */ - if (((1 << BitGranularity) -1) & ~Mask) + /* The left shift drops the bits we want to ignore. */ + if ((~Mask << (sizeof(Mask) * 8 - BitGranularity)) != 0) { /* * Read the current contents of the byte/word/dword containing |