summaryrefslogtreecommitdiff
path: root/src/atomic_ops/sysdeps/gcc/generic-arithm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/atomic_ops/sysdeps/gcc/generic-arithm.h')
-rw-r--r--src/atomic_ops/sysdeps/gcc/generic-arithm.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/atomic_ops/sysdeps/gcc/generic-arithm.h b/src/atomic_ops/sysdeps/gcc/generic-arithm.h
index f7f3878..2688328 100644
--- a/src/atomic_ops/sysdeps/gcc/generic-arithm.h
+++ b/src/atomic_ops/sysdeps/gcc/generic-arithm.h
@@ -15,6 +15,8 @@
*
*/
+#ifndef AO_NO_char_ARITHM
+
AO_INLINE unsigned/**/char
AO_char_fetch_and_add(volatile unsigned/**/char *addr, unsigned/**/char incr)
{
@@ -48,6 +50,8 @@ AO_char_fetch_and_add(volatile unsigned/**/char *addr, unsigned/**/char incr)
}
# define AO_HAVE_char_xor
#endif
+
+#endif /* !AO_NO_char_ARITHM */
/*
* Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
@@ -65,6 +69,8 @@ AO_char_fetch_and_add(volatile unsigned/**/char *addr, unsigned/**/char incr)
*
*/
+#ifndef AO_NO_short_ARITHM
+
AO_INLINE unsigned/**/short
AO_short_fetch_and_add(volatile unsigned/**/short *addr, unsigned/**/short incr)
{
@@ -98,6 +104,8 @@ AO_short_fetch_and_add(volatile unsigned/**/short *addr, unsigned/**/short incr)
}
# define AO_HAVE_short_xor
#endif
+
+#endif /* !AO_NO_short_ARITHM */
/*
* Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
@@ -115,6 +123,8 @@ AO_short_fetch_and_add(volatile unsigned/**/short *addr, unsigned/**/short incr)
*
*/
+#ifndef AO_NO_int_ARITHM
+
AO_INLINE unsigned
AO_int_fetch_and_add(volatile unsigned *addr, unsigned incr)
{
@@ -148,6 +158,8 @@ AO_int_fetch_and_add(volatile unsigned *addr, unsigned incr)
}
# define AO_HAVE_int_xor
#endif
+
+#endif /* !AO_NO_int_ARITHM */
/*
* Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
@@ -165,6 +177,8 @@ AO_int_fetch_and_add(volatile unsigned *addr, unsigned incr)
*
*/
+#ifndef AO_NO_ARITHM
+
AO_INLINE AO_t
AO_fetch_and_add(volatile AO_t *addr, AO_t incr)
{
@@ -198,6 +212,8 @@ AO_fetch_and_add(volatile AO_t *addr, AO_t incr)
}
# define AO_HAVE_xor
#endif
+
+#endif /* !AO_NO_ARITHM */
/*
* Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
@@ -215,6 +231,8 @@ AO_fetch_and_add(volatile AO_t *addr, AO_t incr)
*
*/
+#ifndef AO_NO_char_ARITHM
+
AO_INLINE unsigned/**/char
AO_char_fetch_and_add_acquire(volatile unsigned/**/char *addr, unsigned/**/char incr)
{
@@ -248,6 +266,8 @@ AO_char_fetch_and_add_acquire(volatile unsigned/**/char *addr, unsigned/**/char
}
# define AO_HAVE_char_xor_acquire
#endif
+
+#endif /* !AO_NO_char_ARITHM */
/*
* Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
@@ -265,6 +285,8 @@ AO_char_fetch_and_add_acquire(volatile unsigned/**/char *addr, unsigned/**/char
*
*/
+#ifndef AO_NO_short_ARITHM
+
AO_INLINE unsigned/**/short
AO_short_fetch_and_add_acquire(volatile unsigned/**/short *addr, unsigned/**/short incr)
{
@@ -298,6 +320,8 @@ AO_short_fetch_and_add_acquire(volatile unsigned/**/short *addr, unsigned/**/sho
}
# define AO_HAVE_short_xor_acquire
#endif
+
+#endif /* !AO_NO_short_ARITHM */
/*
* Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
@@ -315,6 +339,8 @@ AO_short_fetch_and_add_acquire(volatile unsigned/**/short *addr, unsigned/**/sho
*
*/
+#ifndef AO_NO_int_ARITHM
+
AO_INLINE unsigned
AO_int_fetch_and_add_acquire(volatile unsigned *addr, unsigned incr)
{
@@ -348,6 +374,8 @@ AO_int_fetch_and_add_acquire(volatile unsigned *addr, unsigned incr)
}
# define AO_HAVE_int_xor_acquire
#endif
+
+#endif /* !AO_NO_int_ARITHM */
/*
* Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
@@ -365,6 +393,8 @@ AO_int_fetch_and_add_acquire(volatile unsigned *addr, unsigned incr)
*
*/
+#ifndef AO_NO_ARITHM
+
AO_INLINE AO_t
AO_fetch_and_add_acquire(volatile AO_t *addr, AO_t incr)
{
@@ -398,6 +428,8 @@ AO_fetch_and_add_acquire(volatile AO_t *addr, AO_t incr)
}
# define AO_HAVE_xor_acquire
#endif
+
+#endif /* !AO_NO_ARITHM */
/*
* Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
@@ -415,6 +447,8 @@ AO_fetch_and_add_acquire(volatile AO_t *addr, AO_t incr)
*
*/
+#ifndef AO_NO_char_ARITHM
+
AO_INLINE unsigned/**/char
AO_char_fetch_and_add_release(volatile unsigned/**/char *addr, unsigned/**/char incr)
{
@@ -448,6 +482,8 @@ AO_char_fetch_and_add_release(volatile unsigned/**/char *addr, unsigned/**/char
}
# define AO_HAVE_char_xor_release
#endif
+
+#endif /* !AO_NO_char_ARITHM */
/*
* Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
@@ -465,6 +501,8 @@ AO_char_fetch_and_add_release(volatile unsigned/**/char *addr, unsigned/**/char
*
*/
+#ifndef AO_NO_short_ARITHM
+
AO_INLINE unsigned/**/short
AO_short_fetch_and_add_release(volatile unsigned/**/short *addr, unsigned/**/short incr)
{
@@ -498,6 +536,8 @@ AO_short_fetch_and_add_release(volatile unsigned/**/short *addr, unsigned/**/sho
}
# define AO_HAVE_short_xor_release
#endif
+
+#endif /* !AO_NO_short_ARITHM */
/*
* Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
@@ -515,6 +555,8 @@ AO_short_fetch_and_add_release(volatile unsigned/**/short *addr, unsigned/**/sho
*
*/
+#ifndef AO_NO_int_ARITHM
+
AO_INLINE unsigned
AO_int_fetch_and_add_release(volatile unsigned *addr, unsigned incr)
{
@@ -548,6 +590,8 @@ AO_int_fetch_and_add_release(volatile unsigned *addr, unsigned incr)
}
# define AO_HAVE_int_xor_release
#endif
+
+#endif /* !AO_NO_int_ARITHM */
/*
* Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
@@ -565,6 +609,8 @@ AO_int_fetch_and_add_release(volatile unsigned *addr, unsigned incr)
*
*/
+#ifndef AO_NO_ARITHM
+
AO_INLINE AO_t
AO_fetch_and_add_release(volatile AO_t *addr, AO_t incr)
{
@@ -598,6 +644,8 @@ AO_fetch_and_add_release(volatile AO_t *addr, AO_t incr)
}
# define AO_HAVE_xor_release
#endif
+
+#endif /* !AO_NO_ARITHM */
/*
* Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
@@ -615,6 +663,8 @@ AO_fetch_and_add_release(volatile AO_t *addr, AO_t incr)
*
*/
+#ifndef AO_NO_char_ARITHM
+
AO_INLINE unsigned/**/char
AO_char_fetch_and_add_full(volatile unsigned/**/char *addr, unsigned/**/char incr)
{
@@ -648,6 +698,8 @@ AO_char_fetch_and_add_full(volatile unsigned/**/char *addr, unsigned/**/char inc
}
# define AO_HAVE_char_xor_full
#endif
+
+#endif /* !AO_NO_char_ARITHM */
/*
* Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
@@ -665,6 +717,8 @@ AO_char_fetch_and_add_full(volatile unsigned/**/char *addr, unsigned/**/char inc
*
*/
+#ifndef AO_NO_short_ARITHM
+
AO_INLINE unsigned/**/short
AO_short_fetch_and_add_full(volatile unsigned/**/short *addr, unsigned/**/short incr)
{
@@ -698,6 +752,8 @@ AO_short_fetch_and_add_full(volatile unsigned/**/short *addr, unsigned/**/short
}
# define AO_HAVE_short_xor_full
#endif
+
+#endif /* !AO_NO_short_ARITHM */
/*
* Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
@@ -715,6 +771,8 @@ AO_short_fetch_and_add_full(volatile unsigned/**/short *addr, unsigned/**/short
*
*/
+#ifndef AO_NO_int_ARITHM
+
AO_INLINE unsigned
AO_int_fetch_and_add_full(volatile unsigned *addr, unsigned incr)
{
@@ -748,6 +806,8 @@ AO_int_fetch_and_add_full(volatile unsigned *addr, unsigned incr)
}
# define AO_HAVE_int_xor_full
#endif
+
+#endif /* !AO_NO_int_ARITHM */
/*
* Copyright (c) 1991-1994 by Xerox Corporation. All rights reserved.
* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
@@ -765,6 +825,8 @@ AO_int_fetch_and_add_full(volatile unsigned *addr, unsigned incr)
*
*/
+#ifndef AO_NO_ARITHM
+
AO_INLINE AO_t
AO_fetch_and_add_full(volatile AO_t *addr, AO_t incr)
{
@@ -798,3 +860,5 @@ AO_fetch_and_add_full(volatile AO_t *addr, AO_t incr)
}
# define AO_HAVE_xor_full
#endif
+
+#endif /* !AO_NO_ARITHM */