aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRyan Libby <rlibby@FreeBSD.org>2021-01-03 02:09:37 +0000
committerRyan Libby <rlibby@FreeBSD.org>2021-01-03 02:09:37 +0000
commit486580c44ce29c1e3b1d9b858a08d9df9428b699 (patch)
tree1f16e91940bb984af6dfceb1a1ce5d0240bf7fae /sys
parentd189a74dfdcd4a89c92a48ecbf8fcb6f6903f9b6 (diff)
downloadsrc-486580c44ce29c1e3b1d9b858a08d9df9428b699.tar.gz
src-486580c44ce29c1e3b1d9b858a08d9df9428b699.zip
arm: fix atomic_testand{set,clear}_64 for ops on high bits
The fix in bd03acedb804add1e22178d50eb2bfb703974ddf worked for 32-bit ops, and for 64-bit ops for bit arguments of 0 - 95, but then was broken for operations on the high 32 bits after that. Reviewed by: markj, mmel Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D27897
Diffstat (limited to 'sys')
-rw-r--r--sys/arm/include/atomic-v6.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/arm/include/atomic-v6.h b/sys/arm/include/atomic-v6.h
index ede879cb9fa8..b81ad6447ef7 100644
--- a/sys/arm/include/atomic-v6.h
+++ b/sys/arm/include/atomic-v6.h
@@ -913,9 +913,8 @@ atomic_testandclear_64(volatile uint64_t *p, u_int v)
* Assume little-endian,
* atomic_testandclear_32() uses only last 5 bits of v
*/
- if (v >= 32) {
+ if ((v & 0x20) != 0)
p32++;
- }
return (atomic_testandclear_32(p32, v));
}
@@ -973,9 +972,8 @@ atomic_testandset_64(volatile uint64_t *p, u_int v)
* Assume little-endian,
* atomic_testandset_32() uses only last 5 bits of v
*/
- if (v >= 32) {
+ if ((v & 0x20) != 0)
p32++;
- }
return (atomic_testandset_32(p32, v));
}