From owner-svn-src-head@FreeBSD.ORG Thu Aug 29 19:47:53 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 3D824A44; Thu, 29 Aug 2013 19:47:53 +0000 (UTC) (envelope-from jkim@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 2AAAB244C; Thu, 29 Aug 2013 19:47:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7TJlr85051304; Thu, 29 Aug 2013 19:47:53 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7TJlrqI051303; Thu, 29 Aug 2013 19:47:53 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201308291947.r7TJlrqI051303@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 29 Aug 2013 19:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255039 - head/sys/dev/drm2 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: Thu, 29 Aug 2013 19:47:53 -0000 Author: jkim Date: Thu Aug 29 19:47:52 2013 New Revision: 255039 URL: http://svnweb.freebsd.org/changeset/base/255039 Log: - Remove test_and_set_bit() macro. It is unused since r255037. - Relax atomic_read() and atomic_set() macros. Linux does not require any memory barrier. Also, these macros may be even reordered or optimized away according to the API documentation: https://www.kernel.org/doc/Documentation/atomic_ops.txt Modified: head/sys/dev/drm2/drm_atomic.h Modified: head/sys/dev/drm2/drm_atomic.h ============================================================================== --- head/sys/dev/drm2/drm_atomic.h Thu Aug 29 19:35:14 2013 (r255038) +++ head/sys/dev/drm2/drm_atomic.h Thu Aug 29 19:47:52 2013 (r255039) @@ -37,8 +37,8 @@ typedef uint64_t atomic64_t; #define BITS_TO_LONGS(x) howmany(x, sizeof(long) * NBBY) -#define atomic_set(p, v) atomic_store_rel_int(p, v) -#define atomic_read(p) atomic_load_acq_int(p) +#define atomic_read(p) (*(volatile u_int *)(p)) +#define atomic_set(p, v) do { *(u_int *)(p) = (v); } while (0) #define atomic_add(v, p) atomic_add_int(p, v) #define atomic_sub(v, p) atomic_subtract_int(p, v) @@ -63,9 +63,7 @@ typedef uint64_t atomic64_t; #define set_bit(b, p) \ atomic_set_int((volatile u_int *)(p) + (b) / 32, 1 << (b) % 32) #define test_bit(b, p) \ - (atomic_load_acq_int((volatile u_int *)(p) + (b) / 32) & (1 << (b) % 32)) -#define test_and_set_bit(b, p) \ - atomic_testandset_int((volatile u_int *)(p) + (b) / 32, b) + ((atomic_read((volatile u_int *)(p) + (b) / 32) & (1 << (b) % 32)) != 0) static __inline int find_first_zero_bit(volatile void *p, int max)