From 70a3efc14f8df981084ed309ceb6f469aeb44cd5 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Wed, 15 Jul 2015 21:44:16 +0000 Subject: [PATCH] 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 --- sys/kern/kern_intr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index da86b0e4c15..bfe78bbb77a 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