Headers: move arch_*.h to urcu/arch/*.h
[urcu.git] / urcu / uatomic_arch_s390.h
index 2378ebd202ba256310f5edfcffcd7d278f5fef7f..2a4fa03e66cedb8d32488ae9e659ef886e76d88f 100644 (file)
@@ -8,7 +8,7 @@
  *
  * Copyright (c) 2009 Novell, Inc.
  * Author: Jan Blunck <jblunck@suse.de>
- * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
+ * Copyright (c) 2009 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to
 extern "C" {
 #endif 
 
-#ifndef __SIZEOF_LONG__
-#ifdef __s390x__
-#define __SIZEOF_LONG__ 8
-#else
-#define __SIZEOF_LONG__ 4
-#endif
-#endif
-
-#ifndef BITS_PER_LONG
-#define BITS_PER_LONG  (__SIZEOF_LONG__ * 8)
-#endif
-
 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
 #define COMPILER_HAVE_SHORT_MEM_OPERAND
 #endif
@@ -96,7 +84,7 @@ unsigned long _uatomic_exchange(volatile void *addr, unsigned long val, int len)
                        : "memory", "cc");
                return old_val;
        }
-#if (BITS_PER_LONG == 64)
+#if (CAA_BITS_PER_LONG == 64)
        case 8:
        {
                unsigned long old_val;
@@ -139,7 +127,7 @@ unsigned long _uatomic_cmpxchg(void *addr, unsigned long old,
                        : "memory", "cc");
                return old_val;
        }
-#if (BITS_PER_LONG == 64)
+#if (CAA_BITS_PER_LONG == 64)
        case 8:
        {
                __asm__ __volatile__(
@@ -163,48 +151,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
This page took 0.023999 seconds and 4 git commands to generate.