Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: pbonzini@redhat.com (Paolo Bonzini)
Subject: [ltt-dev] [PATCH 07/12] use uatomic_generic.h for common fallback implementations
Date: Fri, 19 Feb 2010 20:22:49 +0100	[thread overview]
Message-ID: <1266607374-1107-8-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1266607374-1107-1-git-send-email-pbonzini@redhat.com>

And now, really remove the code for S390/SPARC, using the fallback
implementation of uatomic_generic.h

Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
---
 urcu/uatomic_arch_s390.h    |   42 ----------------------
 urcu/uatomic_arch_sparc64.h |   83 -------------------------------------------
 2 files changed, 0 insertions(+), 125 deletions(-)

diff --git a/urcu/uatomic_arch_s390.h b/urcu/uatomic_arch_s390.h
index 2378ebd..5942ffe 100644
--- a/urcu/uatomic_arch_s390.h
+++ b/urcu/uatomic_arch_s390.h
@@ -163,48 +163,6 @@ unsigned long _uatomic_cmpxchg(void *addr, unsigned long old,
 					       (unsigned long)(_new),	\
 					       sizeof(*(addr)))
 
-/* uatomic_add_return */
-
-static inline __attribute__((always_inline))
-unsigned long _uatomic_add_return(void *addr, unsigned long val, int len)
-{
-	switch (len) {
-	case 4:
-	{
-		unsigned int old, oldt;
-
-		oldt = uatomic_read((unsigned int *)addr);
-		do {
-			old = oldt;
-			oldt = _uatomic_cmpxchg(addr, old, old + val, 4);
-		} while (oldt != old);
-
-		return old + val;
-	}
-#if (BITS_PER_LONG == 64)
-	case 8:
-	{
-		unsigned long old, oldt;
-
-		oldt = uatomic_read((unsigned long *)addr);
-		do {
-			old = oldt;
-			oldt = _uatomic_cmpxchg(addr, old, old + val, 8);
-		} while (oldt != old);
-
-		return old + val;
-	}
-#endif
-	}
-	__builtin_trap();
-	return 0;
-}
-
-#define uatomic_add_return(addr, v)					\
-	((__typeof__(*(addr))) _uatomic_add_return((addr),		\
-						  (unsigned long)(v),	\
-						  sizeof(*(addr))))
-
 #ifdef __cplusplus 
 }
 #endif
diff --git a/urcu/uatomic_arch_sparc64.h b/urcu/uatomic_arch_sparc64.h
index ec9d8e8..81f95cb 100644
--- a/urcu/uatomic_arch_sparc64.h
+++ b/urcu/uatomic_arch_sparc64.h
@@ -83,89 +83,6 @@ unsigned long _uatomic_cmpxchg(void *addr, unsigned long old,
 						(unsigned long)(_new), 	    \
 						sizeof(*(addr))))
 
-/* xchg */
-
-static inline __attribute__((always_inline))
-unsigned long _uatomic_exchange(void *addr, unsigned long val, int len)
-{
-	switch (len) {
-	case 4:
-	{
-		unsigned int old, oldt;
-
-		oldt = uatomic_read((unsigned int *)addr);
-		do {
-			old = oldt;
-			oldt = _uatomic_cmpxchg(addr, old, val, 4);
-		} while (oldt != old);
-
-		return old;
-	}
-#if (BITS_PER_LONG == 64)
-	case 8:
-	{
-		unsigned long old, oldt;
-
-		oldt = uatomic_read((unsigned long *)addr);
-		do {
-			old = oldt;
-			oldt = _uatomic_cmpxchg(addr, old, val, 8);
-		} while (oldt != old);
-
-		return old;
-	}
-#endif
-	}
-	__builtin_trap();
-	return 0;
-}
-
-#define uatomic_xchg(addr, v)						    \
-	((__typeof__(*(addr))) _uatomic_exchange((addr), (unsigned long)(v), \
-						sizeof(*(addr))))
-
-/* uatomic_add_return */
-
-static inline __attribute__((always_inline))
-unsigned long _uatomic_add_return(void *addr, unsigned long val, int len)
-{
-	switch (len) {
-	case 4:
-	{
-		unsigned int old, oldt;
-
-		oldt = uatomic_read((unsigned int *)addr);
-		do {
-			old = oldt;
-			oldt = _uatomic_cmpxchg(addr, old, old + val, 4);
-		} while (oldt != old);
-
-		return old + val;
-	}
-#if (BITS_PER_LONG == 64)
-	case 8:
-	{
-		unsigned long old, oldt;
-
-		oldt = uatomic_read((unsigned long *)addr);
-		do {
-			old = oldt;
-			oldt = _uatomic_cmpxchg(addr, old, old + val, 8);
-		} while (oldt != old);
-
-		return old + val;
-	}
-#endif
-	}
-	__builtin_trap();
-	return 0;
-}
-
-#define uatomic_add_return(addr, v)					\
-	((__typeof__(*(addr))) _uatomic_add_return((addr),		\
-						  (unsigned long)(v),	\
-						  sizeof(*(addr))))
-
 #ifdef __cplusplus 
 }
 #endif
-- 
1.6.6






  parent reply	other threads:[~2010-02-19 19:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-19 19:22 [ltt-dev] [PATCH 00/12] provide generic version of uatomic and other per-arch defs Paolo Bonzini
2010-02-19 19:22 ` [ltt-dev] [PATCH 01/12] use kernel style makefile output Paolo Bonzini
2010-02-19 19:22 ` [ltt-dev] [PATCH 02/12] use autoconf symbolic linking Paolo Bonzini
2010-02-19 19:22 ` [ltt-dev] [PATCH 03/12] add urcu/arch_generic.h Paolo Bonzini
2010-02-19 19:22 ` [ltt-dev] [PATCH 04/12] define sync_core for x86 PIC Paolo Bonzini
2010-02-19 19:22 ` [ltt-dev] [PATCH 05/12] remove compat_uatomic_cmpxchg #define from non-x86 Paolo Bonzini
2010-02-19 19:22 ` [ltt-dev] [PATCH 06/12] add uatomic_generic.h, use it for common definitions Paolo Bonzini
2010-02-19 19:22 ` Paolo Bonzini [this message]
2010-02-19 19:22 ` [ltt-dev] [PATCH 08/12] move whether atomic byte/short exists to uatomic_arch_*.h Paolo Bonzini
2010-02-19 19:22 ` [ltt-dev] [PATCH 09/12] add Alpha support Paolo Bonzini
2010-02-19 19:22 ` [ltt-dev] [PATCH 10/12] support compiling on unknown architectures Paolo Bonzini
2010-02-19 19:22 ` [ltt-dev] [PATCH 11/12] avoid multiple evaluation of STORE_SHARED argument Paolo Bonzini
2010-02-19 19:22 ` [ltt-dev] [PATCH 12/12] centralize definition of BITS_PER_LONG Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1266607374-1107-8-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox