From owner-svn-src-head@freebsd.org Wed Jul 15 21:44:17 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A217C9A33C5; Wed, 15 Jul 2015 21:44:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9093C1F97; Wed, 15 Jul 2015 21:44:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svnmir.geo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6FLiHeh000546; Wed, 15 Jul 2015 21:44:17 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svnmir.geo.freebsd.org (8.14.9/8.14.9/Submit) id t6FLiHVS000545; Wed, 15 Jul 2015 21:44:17 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201507152144.t6FLiHVS000545@svnmir.geo.freebsd.org> X-Authentication-Warning: svnmir.geo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 15 Jul 2015 21:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285616 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jul 2015 21:44:17 -0000 Author: kib Date: Wed Jul 15 21:44:16 2015 New Revision: 285616 URL: https://svnweb.freebsd.org/changeset/base/285616 Log: 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 Modified: head/sys/kern/kern_intr.c Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Wed Jul 15 21:35:09 2015 (r285615) +++ head/sys/kern/kern_intr.c Wed Jul 15 21:44:16 2015 (r285616) @@ -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