diff options
author | kib <kib@FreeBSD.org> | 2015-07-15 21:44:16 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-07-15 21:44:16 +0000 |
commit | abe89cf2273a58b07b609d6c6fdb415955f7c03b (patch) | |
tree | c2d1b84edcc5792d7be6901cd6f1f151cc33f430 | |
parent | 9a743646f33d8059de49943ec004b2ec8b47b2d9 (diff) | |
download | FreeBSD-src-abe89cf2273a58b07b609d6c6fdb415955f7c03b.zip FreeBSD-src-abe89cf2273a58b07b609d6c6fdb415955f7c03b.tar.gz |
Do not use atomic_swap_int(9), it is not available on all
architectures. Atomic_cmpset_int(9) is a direct replacement, due to
loop. The change fixes arm, arm64, mips an sparc64, which lack
atomic_swap().
Suggested and reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
-rw-r--r-- | sys/kern/kern_intr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index da86b0e..bfe78bb 100644 --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -1327,7 +1327,7 @@ ithread_loop(void *arg) * we are running, it will set it_need to note that we * should make another pass. */ - while (atomic_swap_int(&ithd->it_need, 0) != 0) { + while (atomic_cmpset_int(&ithd->it_need, 1, 0) != 0) { /* * This needs a release barrier to make sure * that this write posts before any of the @@ -1506,7 +1506,7 @@ ithread_loop(void *arg) * we are running, it will set it_need to note that we * should make another pass. */ - while (atomic_swap_int(&ithd->it_need, 0) != 0) { + while (atomic_cmpset_int(&ithd->it_need, 1, 0) != 0) { /* * This needs a release barrier to make sure * that this write posts before any of the |