From owner-svn-src-head@FreeBSD.ORG Fri Aug 9 03:24:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A19EA1C4; Fri, 9 Aug 2013 03:24:12 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9026F28B8; Fri, 9 Aug 2013 03:24:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r793OCbh005686; Fri, 9 Aug 2013 03:24:12 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r793OC4C005685; Fri, 9 Aug 2013 03:24:12 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201308090324.r793OC4C005685@svn.freebsd.org> From: Jeff Roberson Date: Fri, 9 Aug 2013 03:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254120 - head/sys/ofed/include/linux 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.14 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: Fri, 09 Aug 2013 03:24:12 -0000 Author: jeff Date: Fri Aug 9 03:24:12 2013 New Revision: 254120 URL: http://svnweb.freebsd.org/changeset/base/254120 Log: - Use the correct type in the linux bitops emulation. Submitted by: Maxim Ignatenko Modified: head/sys/ofed/include/linux/bitops.h Modified: head/sys/ofed/include/linux/bitops.h ============================================================================== --- head/sys/ofed/include/linux/bitops.h Fri Aug 9 01:27:05 2013 (r254119) +++ head/sys/ofed/include/linux/bitops.h Fri Aug 9 03:24:12 2013 (r254120) @@ -272,22 +272,25 @@ bitmap_empty(unsigned long *addr, int si return (1); } -#define NBINT (NBBY * sizeof(int)) +#define NBLONG (NBBY * sizeof(long)) #define set_bit(i, a) \ - atomic_set_int(&((volatile int *)(a))[(i)/NBINT], 1 << (i) % NBINT) + atomic_set_long(&((volatile long *)(a))[(i)/NBLONG], 1 << (i) % NBLONG) #define clear_bit(i, a) \ - atomic_clear_int(&((volatile int *)(a))[(i)/NBINT], 1 << (i) % NBINT) + atomic_clear_long(&((volatile long *)(a))[(i)/NBLONG], 1 << (i) % NBLONG) #define test_bit(i, a) \ - !!(atomic_load_acq_int(&((volatile int *)(a))[(i)/NBINT]) & 1 << ((i) % NBINT)) + !!(atomic_load_acq_long(&((volatile long *)(a))[(i)/NBLONG]) & \ + 1 << ((i) % NBLONG)) static inline long test_and_clear_bit(long bit, long *var) { long val; + var += bit / (sizeof(long) * NBBY); + bit %= sizeof(long) * NBBY; bit = 1 << bit; do { val = *(volatile long *)var; @@ -301,6 +304,8 @@ test_and_set_bit(long bit, long *var) { long val; + var += bit / (sizeof(long) * NBBY); + bit %= sizeof(long) * NBBY; bit = 1 << bit; do { val = *(volatile long *)var;