From fe2efd06a08c1a035339b1a6e46446a9a02958b1 Mon Sep 17 00:00:00 2001 From: Sebastian Wilhelmi Date: Sun, 29 Feb 2004 16:47:48 +0000 Subject: [PATCH] Moved the assembler functions from gatomic.h to gatomic.c, which makes for 2004-02-29 Sebastian Wilhelmi * configure.in, glib/gatomic.c, glib/gatomic.h: Moved the assembler functions from gatomic.h to gatomic.c, which makes for better maintainability. Also use gint instead of gint32 to be able to use reference counting for ABI-fixed structures with gint/guint. * glib/gthread.h: Adapted accordingly. * tests/atomic-test.c: Updated to test for G_MAXINT and G_MININT. * glib/glib-overrides.txt, glib/glib-sections.txt, glib/tmpl/atomic_operations.sgml: Updated according to code changes. --- ChangeLog | 12 +++++ ChangeLog.pre-2-10 | 12 +++++ ChangeLog.pre-2-12 | 12 +++++ ChangeLog.pre-2-4 | 12 +++++ ChangeLog.pre-2-6 | 12 +++++ ChangeLog.pre-2-8 | 12 +++++ configure.in | 41 +++++++++++------ docs/reference/ChangeLog | 5 ++ docs/reference/glib/glib-overrides.txt | 46 +------------------ docs/reference/glib/glib-sections.txt | 6 --- .../glib/tmpl/atomic_operations.sgml | 12 ++--- 11 files changed, 112 insertions(+), 70 deletions(-) diff --git a/ChangeLog b/ChangeLog index b8be66679..4fcb4fe5d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2004-02-29 Sebastian Wilhelmi + + * configure.in, glib/gatomic.c, glib/gatomic.h: Moved the + assembler functions from gatomic.h to gatomic.c, which makes for + better maintainability. Also use gint instead of gint32 to be able + to use reference counting for ABI-fixed structures with + gint/guint. + + * glib/gthread.h: Adapted accordingly. + + * tests/atomic-test.c: Updated to test for G_MAXINT and G_MININT. + 2003-02-28 Hans Breuer * glib/glib.def : updated externals, including those diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index b8be66679..4fcb4fe5d 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,15 @@ +2004-02-29 Sebastian Wilhelmi + + * configure.in, glib/gatomic.c, glib/gatomic.h: Moved the + assembler functions from gatomic.h to gatomic.c, which makes for + better maintainability. Also use gint instead of gint32 to be able + to use reference counting for ABI-fixed structures with + gint/guint. + + * glib/gthread.h: Adapted accordingly. + + * tests/atomic-test.c: Updated to test for G_MAXINT and G_MININT. + 2003-02-28 Hans Breuer * glib/glib.def : updated externals, including those diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index b8be66679..4fcb4fe5d 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,15 @@ +2004-02-29 Sebastian Wilhelmi + + * configure.in, glib/gatomic.c, glib/gatomic.h: Moved the + assembler functions from gatomic.h to gatomic.c, which makes for + better maintainability. Also use gint instead of gint32 to be able + to use reference counting for ABI-fixed structures with + gint/guint. + + * glib/gthread.h: Adapted accordingly. + + * tests/atomic-test.c: Updated to test for G_MAXINT and G_MININT. + 2003-02-28 Hans Breuer * glib/glib.def : updated externals, including those diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index b8be66679..4fcb4fe5d 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,15 @@ +2004-02-29 Sebastian Wilhelmi + + * configure.in, glib/gatomic.c, glib/gatomic.h: Moved the + assembler functions from gatomic.h to gatomic.c, which makes for + better maintainability. Also use gint instead of gint32 to be able + to use reference counting for ABI-fixed structures with + gint/guint. + + * glib/gthread.h: Adapted accordingly. + + * tests/atomic-test.c: Updated to test for G_MAXINT and G_MININT. + 2003-02-28 Hans Breuer * glib/glib.def : updated externals, including those diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index b8be66679..4fcb4fe5d 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,15 @@ +2004-02-29 Sebastian Wilhelmi + + * configure.in, glib/gatomic.c, glib/gatomic.h: Moved the + assembler functions from gatomic.h to gatomic.c, which makes for + better maintainability. Also use gint instead of gint32 to be able + to use reference counting for ABI-fixed structures with + gint/guint. + + * glib/gthread.h: Adapted accordingly. + + * tests/atomic-test.c: Updated to test for G_MAXINT and G_MININT. + 2003-02-28 Hans Breuer * glib/glib.def : updated externals, including those diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index b8be66679..4fcb4fe5d 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,15 @@ +2004-02-29 Sebastian Wilhelmi + + * configure.in, glib/gatomic.c, glib/gatomic.h: Moved the + assembler functions from gatomic.h to gatomic.c, which makes for + better maintainability. Also use gint instead of gint32 to be able + to use reference counting for ABI-fixed structures with + gint/guint. + + * glib/gthread.h: Adapted accordingly. + + * tests/atomic-test.c: Updated to test for G_MAXINT and G_MININT. + 2003-02-28 Hans Breuer * glib/glib.def : updated externals, including those diff --git a/configure.in b/configure.in index 1c2232d9a..625711f90 100644 --- a/configure.in +++ b/configure.in @@ -1818,16 +1818,19 @@ dnl ******************************** dnl *** g_atomic_* tests for gcc *** dnl ******************************** -AC_MSG_CHECKING([whether to use inline assembler code for atomic operations]) +AC_MSG_CHECKING([whether to use assembler code for atomic operations]) if test x"$GCC" = xyes; then case $host_cpu in i386) - AC_MSG_RESULT([no]) + AC_MSG_RESULT([none]) + glib_memory_barrier_needed=no ;; i?86) AC_MSG_RESULT([i486]) - glib_atomic_inlined_implementation=I486 + AC_DEFINE_UNQUOTED(G_ATOMIC_I486, 1, + [i486 atomic implementation]) + glib_memory_barrier_needed=no ;; sparc*) SPARCV9_WARNING="Try to rerun configure with CFLAGS='-mcpu=v9', @@ -1844,29 +1847,39 @@ if test x"$GCC" = xyes; then : "=&r" (tmp1), "=&r" (tmp2) : "r" (&tmp3)); }]], AC_MSG_RESULT([sparcv9]) - glib_atomic_inlined_implementation=SPARCV9, + AC_DEFINE_UNQUOTED(G_ATOMIC_SPARCV9, 1, + [sparcv9 atomic implementation]), AC_MSG_RESULT([no]) AC_MSG_WARN([[$SPARCV9_WARNING]])) + glib_memory_barrier_needed=yes ;; - alpha) + alpha*) AC_MSG_RESULT([alpha]) - glib_atomic_inlined_implementation=ALPHA + AC_DEFINE_UNQUOTED(G_ATOMIC_ALPHA, 1, + [alpha atomic implementation]) + glib_memory_barrier_needed=yes ;; x86_64) AC_MSG_RESULT([x86_64]) - glib_atomic_inlined_implementation=X86_64 - ;; + AC_DEFINE_UNQUOTED(G_ATOMIC_X86_64, 1, + [x86_64 atomic implementation]) + glib_memory_barrier_needed=no + ;; powerpc*) AC_MSG_RESULT([powerpc]) - glib_atomic_inlined_implementation=POWERPC + AC_DEFINE_UNQUOTED(G_ATOMIC_POWERPC, 1, + [powerpc atomic implementation]) + glib_memory_barrier_needed=yes ;; ia64) AC_MSG_RESULT([ia64]) - glib_atomic_inlined_implementation=IA64 + AC_DEFINE_UNQUOTED(G_ATOMIC_IA64, 1, + [ia64 atomic implementation]) + glib_memory_barrier_needed=yes ;; *) AC_MSG_RESULT([none]) - glib_atomic_inlined_implementation=NONE + glib_memory_barrier_needed=yes ;; esac fi @@ -2226,9 +2239,9 @@ union _GSystemThread long dummy_long; }; _______EOF - if test x"$g_atomic_inlined_implementation" != x; then + if test x"$g_memory_barrier_needed" != xno; then echo >>$outfile - echo "#define G_ATOMIC_INLINED_IMPLEMENTATION_$g_atomic_inlined_implementation" >>$outfile + echo "#define G_ATOMIC_OP_MEMORY_BARRIER_NEEDED 1" >>$outfile fi echo >>$outfile @@ -2532,7 +2545,7 @@ g_mutex_sizeof="$glib_cv_sizeof_gmutex" g_system_thread_sizeof="$glib_cv_sizeof_system_thread" g_mutex_contents="$glib_cv_byte_contents_gmutex" -g_atomic_inlined_implementation="$glib_atomic_inlined_implementation" +g_memory_barrier_needed="$glib_memory_barrier_needed" g_module_suffix="$glib_gmodule_suffix" diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index 3b5e8067b..384c77ecb 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,8 @@ +2004-02-29 Sebastian Wilhelmi + + * glib/glib-overrides.txt, glib/glib-sections.txt, + glib/tmpl/atomic_operations.sgml: Updated according to code changes. + Sun Feb 29 02:35:00 2004 Sven Herzberg * glib/tmpl/limits.sgml: exchange non-existing G_MAX_DOUBLE for diff --git a/docs/reference/glib/glib-overrides.txt b/docs/reference/glib/glib-overrides.txt index f4898652e..d645afc24 100644 --- a/docs/reference/glib/glib-overrides.txt +++ b/docs/reference/glib/glib-overrides.txt @@ -290,58 +290,16 @@ gchar c # g_atomic - -g_atomic_int_get -gint32 -gint32 *atomic - - - -g_atomic_int_exchange_and_add -gint32 -gint32 *atomic -gint32 val - - - -g_atomic_int_add -void -gint32 *atomic -gint32 val - - - -g_atomic_int_compare_and_exchange -gboolean -gint32 *atomic -gint32 oldval -gint32 newval - - - -g_atomic_pointer_get -gpointer -gpointer *atomic - - - -g_atomic_pointer_compare_and_exchange -gboolean -gpointer *atomic -gpointer oldval -gpointer newval - - g_atomic_int_inc void -gint32 *atomic +gint *atomic g_atomic_int_dec_and_test gboolean -gint32 *atomic +gint *atomic diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt index 16ed31c53..249bf04ec 100644 --- a/docs/reference/glib/glib-sections.txt +++ b/docs/reference/glib/glib-sections.txt @@ -665,12 +665,6 @@ g_atomic_int_inc g_atomic_int_dec_and_test - -g_atomic_int_add_fallback -g_atomic_int_exchange_and_add_fallback -g_atomic_int_compare_and_exchange_fallback -g_atomic_pointer_compare_and_exchange_fallback -
IO Channels iochannels diff --git a/docs/reference/glib/tmpl/atomic_operations.sgml b/docs/reference/glib/tmpl/atomic_operations.sgml index 8b76b06f7..bccb0fe36 100644 --- a/docs/reference/glib/tmpl/atomic_operations.sgml +++ b/docs/reference/glib/tmpl/atomic_operations.sgml @@ -66,7 +66,7 @@ Reads the value of the integer pointed to by @atomic. Also acts as a memory barrier. -@atomic: a pointer to a 32-bit integer. +@atomic: a pointer to an integer. @Returns: the value of *@atomic. @Since: 2.4 @@ -77,7 +77,7 @@ Atomically adds @val to the integer pointed to by @atomic. Also acts as a memory barrier. -@atomic: a pointer to a 32-bit integer. +@atomic: a pointer to an integer. @val: the value to add to *@atomic. @Since: 2.4 @@ -89,7 +89,7 @@ the value of *@atomic just before the addition took place. Also acts as a memory barrier. -@atomic: a pointer to a 32-bit integer. +@atomic: a pointer to an integer. @val: the value to add to *@atomic. @Returns: the value of *@atomic before the addition. @Since: 2.4 @@ -102,7 +102,7 @@ if they are equal, atomically exchanges *@atomic with @newval. Also acts as a memory barrier. -@atomic: a pointer to a 32-bit integer. +@atomic: a pointer to an integer. @oldval: the assumed old value of *@atomic. @newval: the new value of *@atomic. @Returns: %TRUE, if *@atomic was equal @oldval. %FALSE otherwise. @@ -139,7 +139,7 @@ Also acts as a memory barrier. Atomically increments the integer pointed to by @atomic by 1. -@atomic: a pointer to a 32-bit integer. +@atomic: a pointer to an integer. @Since: 2.4 @@ -148,7 +148,7 @@ Atomically increments the integer pointed to by @atomic by 1. Atomically decrements the integer pointed to by @atomic by 1. -@atomic: a pointer to a 32-bit integer. +@atomic: a pointer to an integer. @Returns: %TRUE, if the integer pointed to by @atomic is 0 after decrementing it. @Since: 2.4