atomic_ops/generalize-arithm.template \
atomic_ops/generalize-small.template \
atomic_ops/sysdeps/loadstore/acquire_release_volatile.template \
- atomic_ops/sysdeps/loadstore/aligned_atomic_load_store.template \
atomic_ops/sysdeps/loadstore/atomic_load_store.template \
atomic_ops/sysdeps/sunc/sparc.S
BUILT_SOURCES = atomic_ops/generalize-arithm.h \
atomic_ops/generalize-small.h \
atomic_ops/sysdeps/loadstore/acquire_release_volatile.h \
- atomic_ops/sysdeps/loadstore/aligned_atomic_load_store.h \
atomic_ops/sysdeps/loadstore/atomic_load_store.h \
atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h \
atomic_ops/sysdeps/loadstore/char_atomic_load_store.h \
atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h \
- atomic_ops/sysdeps/loadstore/int_aligned_atomic_load_store.h \
atomic_ops/sysdeps/loadstore/int_atomic_load_store.h \
atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h \
- atomic_ops/sysdeps/loadstore/short_aligned_atomic_load_store.h \
atomic_ops/sysdeps/loadstore/short_atomic_load_store.h
#Private Headers
atomic_ops/sysdeps/test_and_set_t_is_char.h \
\
atomic_ops/sysdeps/loadstore/acquire_release_volatile.h \
- atomic_ops/sysdeps/loadstore/aligned_atomic_load_store.h \
atomic_ops/sysdeps/loadstore/atomic_load_store.h \
atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h \
atomic_ops/sysdeps/loadstore/char_atomic_load_store.h \
atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h \
- atomic_ops/sysdeps/loadstore/int_aligned_atomic_load_store.h \
atomic_ops/sysdeps/loadstore/int_atomic_load_store.h \
atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h \
- atomic_ops/sysdeps/loadstore/short_aligned_atomic_load_store.h \
atomic_ops/sysdeps/loadstore/short_atomic_load_store.h \
\
atomic_ops/sysdeps/armcc/arm_v6.h \
atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
sed -e s:XSIZE_:short_:g -e s:XCTYPE:unsigned/**/short:g $? > $@
-atomic_ops/sysdeps/loadstore/aligned_atomic_load_store.h: \
- atomic_ops/sysdeps/loadstore/aligned_atomic_load_store.template
- sed -e s:XSIZE_::g -e s:XCTYPE:AO_t:g $? > $@
-
-atomic_ops/sysdeps/loadstore/int_aligned_atomic_load_store.h: \
- atomic_ops/sysdeps/loadstore/aligned_atomic_load_store.template
- sed -e s:XSIZE_:int_:g -e s:XCTYPE:unsigned:g $? > $@
-
-atomic_ops/sysdeps/loadstore/short_aligned_atomic_load_store.h: \
- atomic_ops/sysdeps/loadstore/aligned_atomic_load_store.template
- sed -e s:XSIZE_:short_:g -e s:XCTYPE:unsigned/**/short:g $? > $@
-
atomic_ops/sysdeps/loadstore/atomic_load_store.h: \
atomic_ops/sysdeps/loadstore/atomic_load_store.template
sed -e s:XSIZE_::g -e s:XCTYPE:AO_t:g $? > $@
*/
/* Describes architectures on which AO_t, unsigned char, unsigned */
-/* short, and unsigned int loads and stores are atomic for all normally */
-/* legal alignments. */
+/* short, and unsigned int loads and stores are atomic but only if data */
+/* is suitably aligned. */
-#include "loadstore/aligned_atomic_load_store.h"
+#define AO_ACCESS_CHECK_ALIGNED
+#include "loadstore/atomic_load_store.h"
#include "loadstore/char_atomic_load_store.h"
-#include "loadstore/short_aligned_atomic_load_store.h"
-#include "loadstore/int_aligned_atomic_load_store.h"
+#define AO_ACCESS_short_CHECK_ALIGNED
+#include "loadstore/short_atomic_load_store.h"
+#define AO_ACCESS_int_CHECK_ALIGNED
+#include "loadstore/int_atomic_load_store.h"
+++ /dev/null
-/*
- * Copyright (c) 2004 Hewlett-Packard Development Company, L.P.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-/* Definitions for architectures on which loads and stores of given */
-/* type are atomic for all legal alignments. */
-
-AO_INLINE AO_t
-AO_load(const volatile AO_t *addr)
-{
- assert(((size_t)addr & (sizeof(*addr) - 1)) == 0);
- /* Cast away the volatile for architectures like IA64 where */
- /* volatile adds barrier (fence) semantics. */
- return *(const AO_t *)addr;
-}
-#define AO_HAVE_load
-
-AO_INLINE void
-AO_store(volatile AO_t *addr, AO_t new_val)
-{
- assert(((size_t)addr & (sizeof(*addr) - 1)) == 0);
- *(AO_t *)addr = new_val;
-}
-#define AO_HAVE_store
+++ /dev/null
-/*
- * Copyright (c) 2004 Hewlett-Packard Development Company, L.P.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-/* Definitions for architectures on which loads and stores of given */
-/* type are atomic for all legal alignments. */
-
-AO_INLINE XCTYPE
-AO_XSIZE_load(const volatile XCTYPE *addr)
-{
- assert(((size_t)addr & (sizeof(*addr) - 1)) == 0);
- /* Cast away the volatile for architectures like IA64 where */
- /* volatile adds barrier (fence) semantics. */
- return *(const XCTYPE *)addr;
-}
-#define AO_HAVE_XSIZE_load
-
-AO_INLINE void
-AO_XSIZE_store(volatile XCTYPE *addr, XCTYPE new_val)
-{
- assert(((size_t)addr & (sizeof(*addr) - 1)) == 0);
- *(XCTYPE *)addr = new_val;
-}
-#define AO_HAVE_XSIZE_store
/*
- * Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
+ * Copyright (c) 2004 Hewlett-Packard Development Company, L.P.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
*/
/* Definitions for architectures on which loads and stores of given */
-/* type are atomic for all legal alignments. */
+/* type are atomic (either for suitably aligned data only or for any */
+/* legal alignment). */
AO_INLINE AO_t
AO_load(const volatile AO_t *addr)
{
+# ifdef AO_ACCESS_CHECK_ALIGNED
+ assert(((size_t)addr & (sizeof(*addr) - 1)) == 0);
+# endif
/* Cast away the volatile for architectures like IA64 where */
- /* volatile adds barrier semantics. */
+ /* volatile adds barrier (fence) semantics. */
return *(const AO_t *)addr;
}
#define AO_HAVE_load
AO_INLINE void
AO_store(volatile AO_t *addr, AO_t new_val)
{
+# ifdef AO_ACCESS_CHECK_ALIGNED
+ assert(((size_t)addr & (sizeof(*addr) - 1)) == 0);
+# endif
*(AO_t *)addr = new_val;
}
#define AO_HAVE_store
/*
- * Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
+ * Copyright (c) 2004 Hewlett-Packard Development Company, L.P.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
*/
/* Definitions for architectures on which loads and stores of given */
-/* type are atomic for all legal alignments. */
+/* type are atomic (either for suitably aligned data only or for any */
+/* legal alignment). */
AO_INLINE XCTYPE
AO_XSIZE_load(const volatile XCTYPE *addr)
{
+# ifdef AO_ACCESS_XSIZE_CHECK_ALIGNED
+ assert(((size_t)addr & (sizeof(*addr) - 1)) == 0);
+# endif
/* Cast away the volatile for architectures like IA64 where */
- /* volatile adds barrier semantics. */
+ /* volatile adds barrier (fence) semantics. */
return *(const XCTYPE *)addr;
}
#define AO_HAVE_XSIZE_load
AO_INLINE void
AO_XSIZE_store(volatile XCTYPE *addr, XCTYPE new_val)
{
+# ifdef AO_ACCESS_XSIZE_CHECK_ALIGNED
+ assert(((size_t)addr & (sizeof(*addr) - 1)) == 0);
+# endif
*(XCTYPE *)addr = new_val;
}
#define AO_HAVE_XSIZE_store
/*
- * Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
+ * Copyright (c) 2004 Hewlett-Packard Development Company, L.P.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
*/
/* Definitions for architectures on which loads and stores of given */
-/* type are atomic for all legal alignments. */
+/* type are atomic (either for suitably aligned data only or for any */
+/* legal alignment). */
AO_INLINE unsigned/**/char
AO_char_load(const volatile unsigned/**/char *addr)
{
+# ifdef AO_ACCESS_char_CHECK_ALIGNED
+ assert(((size_t)addr & (sizeof(*addr) - 1)) == 0);
+# endif
/* Cast away the volatile for architectures like IA64 where */
- /* volatile adds barrier semantics. */
+ /* volatile adds barrier (fence) semantics. */
return *(const unsigned/**/char *)addr;
}
#define AO_HAVE_char_load
AO_INLINE void
AO_char_store(volatile unsigned/**/char *addr, unsigned/**/char new_val)
{
+# ifdef AO_ACCESS_char_CHECK_ALIGNED
+ assert(((size_t)addr & (sizeof(*addr) - 1)) == 0);
+# endif
*(unsigned/**/char *)addr = new_val;
}
#define AO_HAVE_char_store
+++ /dev/null
-/*
- * Copyright (c) 2004 Hewlett-Packard Development Company, L.P.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-/* Definitions for architectures on which loads and stores of given */
-/* type are atomic for all legal alignments. */
-
-AO_INLINE unsigned
-AO_int_load(const volatile unsigned *addr)
-{
- assert(((size_t)addr & (sizeof(*addr) - 1)) == 0);
- /* Cast away the volatile for architectures like IA64 where */
- /* volatile adds barrier (fence) semantics. */
- return *(const unsigned *)addr;
-}
-#define AO_HAVE_int_load
-
-AO_INLINE void
-AO_int_store(volatile unsigned *addr, unsigned new_val)
-{
- assert(((size_t)addr & (sizeof(*addr) - 1)) == 0);
- *(unsigned *)addr = new_val;
-}
-#define AO_HAVE_int_store
/*
- * Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
+ * Copyright (c) 2004 Hewlett-Packard Development Company, L.P.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
*/
/* Definitions for architectures on which loads and stores of given */
-/* type are atomic for all legal alignments. */
+/* type are atomic (either for suitably aligned data only or for any */
+/* legal alignment). */
AO_INLINE unsigned
AO_int_load(const volatile unsigned *addr)
{
+# ifdef AO_ACCESS_int_CHECK_ALIGNED
+ assert(((size_t)addr & (sizeof(*addr) - 1)) == 0);
+# endif
/* Cast away the volatile for architectures like IA64 where */
- /* volatile adds barrier semantics. */
+ /* volatile adds barrier (fence) semantics. */
return *(const unsigned *)addr;
}
#define AO_HAVE_int_load
AO_INLINE void
AO_int_store(volatile unsigned *addr, unsigned new_val)
{
+# ifdef AO_ACCESS_int_CHECK_ALIGNED
+ assert(((size_t)addr & (sizeof(*addr) - 1)) == 0);
+# endif
*(unsigned *)addr = new_val;
}
#define AO_HAVE_int_store
+++ /dev/null
-/*
- * Copyright (c) 2004 Hewlett-Packard Development Company, L.P.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-/* Definitions for architectures on which loads and stores of given */
-/* type are atomic for all legal alignments. */
-
-AO_INLINE unsigned/**/short
-AO_short_load(const volatile unsigned/**/short *addr)
-{
- assert(((size_t)addr & (sizeof(*addr) - 1)) == 0);
- /* Cast away the volatile for architectures like IA64 where */
- /* volatile adds barrier (fence) semantics. */
- return *(const unsigned/**/short *)addr;
-}
-#define AO_HAVE_short_load
-
-AO_INLINE void
-AO_short_store(volatile unsigned/**/short *addr, unsigned/**/short new_val)
-{
- assert(((size_t)addr & (sizeof(*addr) - 1)) == 0);
- *(unsigned/**/short *)addr = new_val;
-}
-#define AO_HAVE_short_store
/*
- * Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
+ * Copyright (c) 2004 Hewlett-Packard Development Company, L.P.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
*/
/* Definitions for architectures on which loads and stores of given */
-/* type are atomic for all legal alignments. */
+/* type are atomic (either for suitably aligned data only or for any */
+/* legal alignment). */
AO_INLINE unsigned/**/short
AO_short_load(const volatile unsigned/**/short *addr)
{
+# ifdef AO_ACCESS_short_CHECK_ALIGNED
+ assert(((size_t)addr & (sizeof(*addr) - 1)) == 0);
+# endif
/* Cast away the volatile for architectures like IA64 where */
- /* volatile adds barrier semantics. */
+ /* volatile adds barrier (fence) semantics. */
return *(const unsigned/**/short *)addr;
}
#define AO_HAVE_short_load
AO_INLINE void
AO_short_store(volatile unsigned/**/short *addr, unsigned/**/short new_val)
{
+# ifdef AO_ACCESS_short_CHECK_ALIGNED
+ assert(((size_t)addr & (sizeof(*addr) - 1)) == 0);
+# endif
*(unsigned/**/short *)addr = new_val;
}
#define AO_HAVE_short_store