Commit fe2efd06 authored by Sebastian Wilhelmi's avatar Sebastian Wilhelmi Committed by Sebastian Wilhelmi

Moved the assembler functions from gatomic.h to gatomic.c, which makes for


2004-02-29  Sebastian Wilhelmi  <seppi@seppi.de>

	* 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.
parent 760d96ed
2004-02-29 Sebastian Wilhelmi <seppi@seppi.de>
* 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 <hans@breuer.org>
* glib/glib.def : updated externals, including those
......
2004-02-29 Sebastian Wilhelmi <seppi@seppi.de>
* 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 <hans@breuer.org>
* glib/glib.def : updated externals, including those
......
2004-02-29 Sebastian Wilhelmi <seppi@seppi.de>
* 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 <hans@breuer.org>
* glib/glib.def : updated externals, including those
......
2004-02-29 Sebastian Wilhelmi <seppi@seppi.de>
* 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 <hans@breuer.org>
* glib/glib.def : updated externals, including those
......
2004-02-29 Sebastian Wilhelmi <seppi@seppi.de>
* 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 <hans@breuer.org>
* glib/glib.def : updated externals, including those
......
2004-02-29 Sebastian Wilhelmi <seppi@seppi.de>
* 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 <hans@breuer.org>
* glib/glib.def : updated externals, including those
......
......@@ -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"
......
2004-02-29 Sebastian Wilhelmi <seppi@seppi.de>
* 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 <herzi@gnome-de.org>
* glib/tmpl/limits.sgml: exchange non-existing G_MAX_DOUBLE for
......
......@@ -290,58 +290,16 @@ gchar c
# g_atomic
<FUNCTION>
<NAME>g_atomic_int_get</NAME>
<RETURNS>gint32</RETURNS>
gint32 *atomic
</FUNCTION>
<FUNCTION>
<NAME>g_atomic_int_exchange_and_add</NAME>
<RETURNS>gint32</RETURNS>
gint32 *atomic
gint32 val
</FUNCTION>
<FUNCTION>
<NAME>g_atomic_int_add</NAME>
<RETURNS>void</RETURNS>
gint32 *atomic
gint32 val
</FUNCTION>
<FUNCTION>
<NAME>g_atomic_int_compare_and_exchange</NAME>
<RETURNS>gboolean</RETURNS>
gint32 *atomic
gint32 oldval
gint32 newval
</FUNCTION>
<FUNCTION>
<NAME>g_atomic_pointer_get</NAME>
<RETURNS>gpointer</RETURNS>
gpointer *atomic
</FUNCTION>
<FUNCTION>
<NAME>g_atomic_pointer_compare_and_exchange</NAME>
<RETURNS>gboolean</RETURNS>
gpointer *atomic
gpointer oldval
gpointer newval
</FUNCTION>
<FUNCTION>
<NAME>g_atomic_int_inc</NAME>
<RETURNS>void</RETURNS>
gint32 *atomic
gint *atomic
</FUNCTION>
<FUNCTION>
<NAME>g_atomic_int_dec_and_test</NAME>
<RETURNS>gboolean</RETURNS>
gint32 *atomic
gint *atomic
</FUNCTION>
<STRUCT>
......
......@@ -665,12 +665,6 @@ g_atomic_int_inc
g_atomic_int_dec_and_test
</SECTION>
<SUBSECTION Private>
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
<SECTION>
<TITLE>IO Channels</TITLE>
<FILE>iochannels</FILE>
......
......@@ -66,7 +66,7 @@ Reads the value of the integer pointed to by @atomic. Also acts as
a memory barrier.
</para>
@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.
</para>
@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.
</para>
@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.
</para>
@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.
</para>
@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.
</para>
@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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment