From: Hollis Blanchard Subject: [PATCH] atomic_read Date: Fri, 11 Mar 2005 09:57:06 -0500 Message-ID: Mime-Version: 1.0 (Apple Message framework v619.2) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Sender: xen-devel-admin@lists.sourceforge.net Errors-To: xen-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: xen-devel@lists.sourceforge.net List-Id: xen-devel@lists.xenproject.org Hi, I noticed that include/xen/sched.h uses _atomic_*() in a couple places, while all other Xen code uses atomic_*(). In general I think functions prefixed with an underscore are not part of the public interface... This patch should be safe since atomic_*() just use volatile and _atomic_*() do not. Side note: the Xen copy of atomic.h appears to be a little out of date with respect to the Linux 2.6.11 version, in which _atomic_*() is no longer present (only atomic_*() are). --- xen/include/xen/sched.h.old Thu Mar 10 16:01:14 2005 +++ xen/include/xen/sched.h Thu Mar 10 16:01:17 2005 @@ -194,12 +194,12 @@ static always_inline int get_domain(stru do { old = seen; - if ( unlikely(_atomic_read(old) & DOMAIN_DESTRUCTED) ) + if ( unlikely(atomic_read(old) & DOMAIN_DESTRUCTED) ) return 0; - _atomic_set(new, _atomic_read(old) + 1); + atomic_set(new, atomic_read(old) + 1); seen = atomic_compareandswap(old, new, &d->refcnt); } - while ( unlikely(_atomic_read(seen) != _atomic_read(old)) ); + while ( unlikely(atomic_read(seen) != atomic_read(old)) ); return 1; } Signed-off-by: Hollis Blanchard -- Hollis Blanchard IBM Linux Technology Center ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click