This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-devel] [PATCH] atomic_read

To: xen-devel@xxxxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] atomic_read
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Fri, 11 Mar 2005 09:57:06 -0500
Delivery-date: Fri, 11 Mar 2005 14:59:27 +0000
Envelope-to: xen+James.Bulpin@xxxxxxxxxxxx
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
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
         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 <hollisb@xxxxxxxxxx>

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.
Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>