summaryrefslogtreecommitdiff
path: root/include/atomic/nolock.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/atomic/nolock.h')
-rw-r--r--include/atomic/nolock.h132
1 files changed, 2 insertions, 130 deletions
diff --git a/include/atomic/nolock.h b/include/atomic/nolock.h
index cf21a94c7de..458cb3e4f66 100644
--- a/include/atomic/nolock.h
+++ b/include/atomic/nolock.h
@@ -27,137 +27,9 @@
#endif
#endif
-#ifdef make_atomic_add_body8
+#ifdef make_atomic_add_body
-#ifdef HAVE_INLINE
-
-#define make_atomic_add(S) \
-static inline uint ## S _my_atomic_add ## S( \
- my_atomic_ ## S ## _t *a, uint ## S v) \
-{ \
- make_atomic_add_body ## S; \
- return v; \
-}
-
-#define make_atomic_swap(S) \
-static inline uint ## S _my_atomic_swap ## S( \
- my_atomic_ ## S ## _t *a, uint ## S v) \
-{ \
- make_atomic_swap_body ## S; \
- return v; \
-}
-
-#define make_atomic_cas(S) \
-static inline uint _my_atomic_cas ## S(my_atomic_ ## S ## _t *a,\
- uint ## S *cmp, uint ## S set) \
-{ \
- uint8 ret; \
- make_atomic_cas_body ## S; \
- return ret; \
-}
-
-#define make_atomic_load(S) \
-static inline uint ## S _my_atomic_load ## S( \
- my_atomic_ ## S ## _t *a) \
-{ \
- uint ## S ret; \
- make_atomic_load_body ## S; \
- return ret; \
-}
-
-#define make_atomic_store(S) \
-static inline void _my_atomic_store ## S( \
- my_atomic_ ## S ## _t *a, uint ## S v) \
-{ \
- make_atomic_store_body ## S; \
-}
-
-#else /* no inline functions */
-
-#define make_atomic_add(S) \
-extern uint ## S _my_atomic_add ## S( \
- my_atomic_ ## S ## _t *a, uint ## S v);
-
-#define make_atomic_swap(S) \
-extern uint ## S _my_atomic_swap ## S( \
- my_atomic_ ## S ## _t *a, uint ## S v);
-
-#define make_atomic_cas(S) \
-extern uint _my_atomic_cas ## S(my_atomic_ ## S ## _t *a, \
- uint ## S *cmp, uint ## S set);
-
-#define make_atomic_load(S) \
-extern uint ## S _my_atomic_load ## S( \
- my_atomic_ ## S ## _t *a);
-
-#define make_atomic_store(S) \
-extern void _my_atomic_store ## S( \
- my_atomic_ ## S ## _t *a, uint ## S v);
-
-#endif
-
-make_atomic_add( 8)
-make_atomic_add(16)
-make_atomic_add(32)
-
-make_atomic_cas( 8)
-make_atomic_cas(16)
-make_atomic_cas(32)
-
-make_atomic_load( 8)
-make_atomic_load(16)
-make_atomic_load(32)
-
-make_atomic_store( 8)
-make_atomic_store(16)
-make_atomic_store(32)
-
-make_atomic_swap( 8)
-make_atomic_swap(16)
-make_atomic_swap(32)
-
-#undef make_atomic_add_body8
-#undef make_atomic_cas_body8
-#undef make_atomic_load_body8
-#undef make_atomic_store_body8
-#undef make_atomic_swap_body8
-#undef make_atomic_add_body16
-#undef make_atomic_cas_body16
-#undef make_atomic_load_body16
-#undef make_atomic_store_body16
-#undef make_atomic_swap_body16
-#undef make_atomic_add_body32
-#undef make_atomic_cas_body32
-#undef make_atomic_load_body32
-#undef make_atomic_store_body32
-#undef make_atomic_swap_body32
-#undef make_atomic_add
-#undef make_atomic_cas
-#undef make_atomic_load
-#undef make_atomic_store
-#undef make_atomic_swap
-
-#define my_atomic_add8(a,v,L) _my_atomic_add8(a,v)
-#define my_atomic_add16(a,v,L) _my_atomic_add16(a,v)
-#define my_atomic_add32(a,v,L) _my_atomic_add32(a,v)
-
-#define my_atomic_cas8(a,c,v,L) _my_atomic_cas8(a,c,v)
-#define my_atomic_cas16(a,c,v,L) _my_atomic_cas16(a,c,v)
-#define my_atomic_cas32(a,c,v,L) _my_atomic_cas32(a,c,v)
-
-#define my_atomic_load8(a,L) _my_atomic_load8(a)
-#define my_atomic_load16(a,L) _my_atomic_load16(a)
-#define my_atomic_load32(a,L) _my_atomic_load32(a)
-
-#define my_atomic_store8(a,v,L) _my_atomic_store8(a,v)
-#define my_atomic_store16(a,v,L) _my_atomic_store16(a,v)
-#define my_atomic_store32(a,v,L) _my_atomic_store32(a,v)
-
-#define my_atomic_swap8(a,v,L) _my_atomic_swap8(a,v)
-#define my_atomic_swap16(a,v,L) _my_atomic_swap16(a,v)
-#define my_atomic_swap32(a,v,L) _my_atomic_swap32(a,v)
-
-#define my_atomic_rwlock_t typedef int
+typedef struct { } my_atomic_rwlock_t;
#define my_atomic_rwlock_destroy(name)
#define my_atomic_rwlock_init(name)
#define my_atomic_rwlock_rdlock(name)