use uatomic_generic.h for common fallback implementations
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 1 Mar 2010 18:58:45 +0000 (13:58 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Mon, 1 Mar 2010 18:58:45 +0000 (13:58 -0500)
And now, really remove the code for S390/SPARC, using the fallback
implementation of uatomic_generic.h

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
urcu/uatomic_arch_s390.h
urcu/uatomic_arch_sparc64.h

index 2378ebd202ba256310f5edfcffcd7d278f5fef7f..5942ffe46bf81220383ab36757dc1628274915e0 100644 (file)
@@ -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
index ec9d8e8d6323784a85efe1e3cc0d0b36de4bc2da..81f95cbe91ac641aacdce2e5e2f450a9cf1ec41f 100644 (file)
@@ -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
This page took 0.029386 seconds and 4 git commands to generate.