diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2011-07-25 16:00:43 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2011-07-25 16:00:43 +0400 |
commit | 5b775416fa6b373c417fd7cd2958a79e8e685a66 (patch) | |
tree | de464fa97cb0534b7e5ef5151325390e35422002 | |
parent | 3e9dd13e2d274be6654f0539ab9da65e8ece4112 (diff) | |
download | libatomic_ops-5b775416fa6b373c417fd7cd2958a79e8e685a66.tar.gz |
libatomic_ops-1.2 tarball importlibatomic_ops-1_2
-rw-r--r-- | ChangeLog | 44 | ||||
-rwxr-xr-x | compile | 10 | ||||
-rwxr-xr-x | configure | 20 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/atomic_ops/sysdeps/gcc/ia64.h | 2 | ||||
-rw-r--r-- | src/atomic_ops/sysdeps/gcc/powerpc.h | 50 | ||||
-rw-r--r-- | src/atomic_ops/sysdeps/gcc/x86.h | 2 | ||||
-rw-r--r-- | src/atomic_ops/sysdeps/gcc/x86_64.h | 4 | ||||
-rw-r--r-- | src/atomic_ops/sysdeps/hpc/ia64.h | 4 | ||||
-rw-r--r-- | tests/.deps/test_atomic.Po | 1 | ||||
-rw-r--r-- | tests/.deps/test_atomic_pthreads-test_atomic.Po | 1 | ||||
-rw-r--r-- | tests/.deps/test_malloc.Po | 1 | ||||
-rw-r--r-- | tests/.deps/test_stack.Po | 1 |
13 files changed, 97 insertions, 45 deletions
@@ -1,28 +1,34 @@ +[1.2 release] + +2006-07-11 Hans Boehm <Hans.Boehm@hp.com> + * src/atomic_ops/sysdeps/hpc/ia64.h: Fix typos. + 2006-03-28 Earl Chew (Agilent) - * src/atomic_ops/sysdeps/gcc/powerpc.h: Remove unused variable cr. - * src/atomic_ops/sysdeps/msftc/x86.h: - Use new intrinsics available in MSVC 2003 and MSVC 2005. - Use inline assembler to generate mfence and byte sized xchg - Use correct prototype for InterlockedCompareExchange. - * src/atomic_ops.h: Add test for __PPC__ . - * tests/run_parallel.inc: Add simple VxWorks support. - * tests/test_atomic.c, tests/test_atomic_include.h: Add prototypes to silence compiler warnings. + * src/atomic_ops/sysdeps/gcc/powerpc.h: Remove unused variable cr. + * src/atomic_ops/sysdeps/msftc/x86.h: + Use new intrinsics available in MSVC 2003 and MSVC 2005. + Use inline assembler to generate mfence and byte sized xchg + Use correct prototype for InterlockedCompareExchange. + * src/atomic_ops.h: Add test for __PPC__ . + * tests/run_parallel.inc: Add simple VxWorks support. + * tests/test_atomic.c, tests/test_atomic_include.h: Add prototypes + to silence compiler warnings. 2006-1-13 Hans Boehm <Hans.Boehm@hp.com> - *src/atomic_ops/sysdeps/gcc/powerpc.h: Beginnings of 64 bit support. - *src/atomic_ops/sysdeps/gcc/x86.h: Use "=q" for AO_test_and_set_full. + *src/atomic_ops/sysdeps/gcc/powerpc.h: Beginnings of 64 bit support. + *src/atomic_ops/sysdeps/gcc/x86.h: Use "=q" for AO_test_and_set_full. 2005-11-4 Hans Boehm <Hans.Boehm@hp.com> - *src/atomic_ops/sysdeps/gcc/ia64.h: Include - all_acquire_release_volatile.h, instead of just the pointer-sized - version. - *src/atomic_ops/sysdeps/gcc/ia64.h: Include - all_acquire_release_volatile.h and all_atomic_load_store.h, - instead of just the pointer-sized versions. + *src/atomic_ops/sysdeps/gcc/ia64.h: Include + all_acquire_release_volatile.h, instead of just the pointer-sized + version. + *src/atomic_ops/sysdeps/gcc/ia64.h: Include + all_acquire_release_volatile.h and all_atomic_load_store.h, + instead of just the pointer-sized versions. [1.1 release] -2003-09-27 Hans Boehm <Hans.Boehm@hp.com> +2005-09-27 Hans Boehm <Hans.Boehm@hp.com> *src/atomic_ops.h: Define AO_CAN_EMUL_CAS for arm. *src/atomic_ops/sysdeps/read_ordered.h: New file, extracted from ordered_except_wr.h. @@ -30,12 +36,12 @@ instead of duplicating it. *src/atomic_ops/sysdeps/gcc/arm.h: Include read_ordered.h. -2003-09-16 Hans Boehm <Hans.Boehm@hp.com> +2005-09-16 Hans Boehm <Hans.Boehm@hp.com> *src/atomic_ops/sysdeps/gcc/arm.h: Replace the AO_test_and_set definition with one that might actually work. (Thanks to Kazu Hirata and Paul Brook.) -2003-08-01 Hans Boehm <Hans.Boehm@hp.com> +2005-08-01 Hans Boehm <Hans.Boehm@hp.com> *src/atomic_ops/Makefile.am: Change function naming from "byte" to "char" (again). @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand `-c -o'. -scriptversion=2004-10-12.08 +scriptversion=2005-05-14.22 -# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # Written by Tom Tromey <tromey@cygnus.com>. # # This program is free software; you can redistribute it and/or modify @@ -18,7 +18,7 @@ scriptversion=2004-10-12.08 # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -47,11 +47,11 @@ right script to run: please start by reading the file `INSTALL'. Report bugs to <bug-automake@gnu.org>. EOF - exit 0 + exit $? ;; -v | --v*) echo "compile $scriptversion" - exit 0 + exit $? ;; esac @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for libatomic_ops 1.1. +# Generated by GNU Autoconf 2.59 for libatomic_ops 1.2. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation @@ -267,8 +267,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='libatomic_ops' PACKAGE_TARNAME='libatomic_ops' -PACKAGE_VERSION='1.1' -PACKAGE_STRING='libatomic_ops 1.1' +PACKAGE_VERSION='1.2' +PACKAGE_STRING='libatomic_ops 1.2' PACKAGE_BUGREPORT='' ac_unique_file="src/atomic_ops.c" @@ -786,7 +786,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libatomic_ops 1.1 to adapt to many kinds of systems. +\`configure' configures libatomic_ops 1.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -853,7 +853,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libatomic_ops 1.1:";; + short | recursive ) echo "Configuration of libatomic_ops 1.2:";; esac cat <<\_ACEOF @@ -972,7 +972,7 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -libatomic_ops configure 1.1 +libatomic_ops configure 1.2 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. @@ -986,7 +986,7 @@ cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libatomic_ops $as_me 1.1, which was +It was created by libatomic_ops $as_me 1.2, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ @@ -1712,7 +1712,7 @@ fi # Define the identity of the package. PACKAGE='libatomic_ops' - VERSION='1.1' + VERSION='1.2' cat >>confdefs.h <<_ACEOF @@ -4559,7 +4559,7 @@ _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by libatomic_ops $as_me 1.1, which was +This file was extended by libatomic_ops $as_me 1.2, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4622,7 +4622,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -libatomic_ops config.status 1.1 +libatomic_ops config.status 1.2 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index 5d9d245..3d0efe7 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ # Process this file with autoconf to produce a configure script. -AC_INIT([libatomic_ops],[1.1]) +AC_INIT([libatomic_ops],[1.2]) AC_CANONICAL_TARGET([]) AC_CONFIG_SRCDIR(src/atomic_ops.c) AM_INIT_AUTOMAKE diff --git a/src/atomic_ops/sysdeps/gcc/ia64.h b/src/atomic_ops/sysdeps/gcc/ia64.h index 522eaee..119b9ed 100644 --- a/src/atomic_ops/sysdeps/gcc/ia64.h +++ b/src/atomic_ops/sysdeps/gcc/ia64.h @@ -22,7 +22,7 @@ #include "../all_atomic_load_store.h" -#include "../acquire_release_volatile.h" +#include "../all_acquire_release_volatile.h" #include "../test_and_set_t_is_char.h" diff --git a/src/atomic_ops/sysdeps/gcc/powerpc.h b/src/atomic_ops/sysdeps/gcc/powerpc.h index cd5a534..3ca39fe 100644 --- a/src/atomic_ops/sysdeps/gcc/powerpc.h +++ b/src/atomic_ops/sysdeps/gcc/powerpc.h @@ -97,6 +97,29 @@ AO_store_release(volatile AO_t *addr, AO_t value) /* This is similar to the code in the garbage collector. Deleting */ /* this and having it synthesized from compare_and_swap would probably */ /* only cost us a load immediate instruction. */ +#if defined(__powerpc64__) || defined(__ppc64__) || defined(__64BIT__) +/* Completely untested. And we should be using smaller objects anyway. */ +AO_INLINE AO_TS_VAL_t +AO_test_and_set(volatile AO_TS_t *addr) { + unsigned long oldval; + unsigned long temp = 1; /* locked value */ + + __asm__ __volatile__( + "1:ldarx %0,0,%1\n" /* load and reserve */ + "cmpdi %0, 0\n" /* if load is */ + "bne 2f\n" /* non-zero, return already set */ + "stdcx. %2,0,%1\n" /* else store conditional */ + "bne- 1b\n" /* retry if lost reservation */ + "2:\n" /* oldval is zero if we set */ + : "=&r"(oldval) + : "r"(addr), "r"(temp) + : "memory", "cc"); + + return oldval; +} + +#else + AO_INLINE AO_TS_VAL_t AO_test_and_set(volatile AO_TS_t *addr) { int oldval; @@ -116,6 +139,8 @@ AO_test_and_set(volatile AO_TS_t *addr) { return oldval; } +#endif + #define AO_have_test_and_set AO_INLINE AO_TS_VAL_t @@ -146,6 +171,30 @@ AO_test_and_set_full(volatile AO_TS_t *addr) { #define AO_HAVE_test_and_set_full +#if defined(__powerpc64__) || defined(__ppc64__) || defined(__64BIT__) +/* FIXME: Completely untested. */ +AO_INLINE int +AO_compare_and_swap(volatile AO_t *addr, AO_t old, AO_t new_val) { + AO_t oldval; + int result = 0; + + __asm__ __volatile__( + "1:ldarx %0,0,%2\n" /* load and reserve */ + "cmpd %0, %4\n" /* if load is not equal to */ + "bne 2f\n" /* old, fail */ + "stdcx. %3,0,%2\n" /* else store conditional */ + "bne- 1b\n" /* retry if lost reservation */ + "li %1,1\n" /* result = 1; */ + "2:\n" + : "=&r"(oldval), "=&r"(result) + : "r"(addr), "r"(new_val), "r"(old), "1"(result) + : "memory", "cc"); + + return result; +} + +#else + AO_INLINE int AO_compare_and_swap(volatile AO_t *addr, AO_t old, AO_t new_val) { AO_t oldval; @@ -165,6 +214,7 @@ AO_compare_and_swap(volatile AO_t *addr, AO_t old, AO_t new_val) { return result; } +#endif #define AO_HAVE_compare_and_swap diff --git a/src/atomic_ops/sysdeps/gcc/x86.h b/src/atomic_ops/sysdeps/gcc/x86.h index 1f720a2..27e047e 100644 --- a/src/atomic_ops/sysdeps/gcc/x86.h +++ b/src/atomic_ops/sysdeps/gcc/x86.h @@ -76,7 +76,7 @@ AO_char_fetch_and_add_full (volatile unsigned char *p, unsigned char incr) unsigned char result; __asm__ __volatile__ ("lock; xaddb %0, %1" : - "=r" (result), "=m" (*p) : "0" (incr), "m" (*p) + "=q" (result), "=m" (*p) : "0" (incr), "m" (*p) : "memory"); return result; } diff --git a/src/atomic_ops/sysdeps/gcc/x86_64.h b/src/atomic_ops/sysdeps/gcc/x86_64.h index 356476f..75c2448 100644 --- a/src/atomic_ops/sysdeps/gcc/x86_64.h +++ b/src/atomic_ops/sysdeps/gcc/x86_64.h @@ -74,7 +74,7 @@ AO_char_fetch_and_add_full (volatile unsigned char *p, unsigned char incr) unsigned char result; __asm__ __volatile__ ("lock; xaddb %0, %1" : - "=r" (result), "=m" (*p) : "0" (incr), "m" (*p) + "=q" (result), "=m" (*p) : "0" (incr), "m" (*p) : "memory"); return result; } @@ -123,7 +123,7 @@ AO_test_and_set_full(volatile AO_TS_t *addr) unsigned char oldval; /* Note: the "xchg" instruction does not need a "lock" prefix */ __asm__ __volatile__("xchgb %0, %1" - : "=r"(oldval), "=m"(*addr) + : "=q"(oldval), "=m"(*addr) : "0"(0xff), "m"(*addr) : "memory"); return (AO_TS_VAL_t)oldval; } diff --git a/src/atomic_ops/sysdeps/hpc/ia64.h b/src/atomic_ops/sysdeps/hpc/ia64.h index b194e03..99fdbb2 100644 --- a/src/atomic_ops/sysdeps/hpc/ia64.h +++ b/src/atomic_ops/sysdeps/hpc/ia64.h @@ -26,9 +26,9 @@ * gcc file. */ -#include "../atomic_load_store.h" +#include "../all_atomic_load_store.h" -#include "../acquire_release_volatile.h" +#include "../all_acquire_release_volatile.h" #include "../test_and_set_t_is_char.h" diff --git a/tests/.deps/test_atomic.Po b/tests/.deps/test_atomic.Po deleted file mode 100644 index 9ce06a8..0000000 --- a/tests/.deps/test_atomic.Po +++ /dev/null @@ -1 +0,0 @@ -# dummy diff --git a/tests/.deps/test_atomic_pthreads-test_atomic.Po b/tests/.deps/test_atomic_pthreads-test_atomic.Po deleted file mode 100644 index 9ce06a8..0000000 --- a/tests/.deps/test_atomic_pthreads-test_atomic.Po +++ /dev/null @@ -1 +0,0 @@ -# dummy diff --git a/tests/.deps/test_malloc.Po b/tests/.deps/test_malloc.Po deleted file mode 100644 index 9ce06a8..0000000 --- a/tests/.deps/test_malloc.Po +++ /dev/null @@ -1 +0,0 @@ -# dummy diff --git a/tests/.deps/test_stack.Po b/tests/.deps/test_stack.Po deleted file mode 100644 index 9ce06a8..0000000 --- a/tests/.deps/test_stack.Po +++ /dev/null @@ -1 +0,0 @@ -# dummy |