mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 15:06:14 +01:00
Rename __asm to __asm__ and __volatile to __volatile__ to make the file
2004-07-02 Sebastian Wilhelmi <seppi@seppi.de> * glib/gatomic.c: Rename __asm to __asm__ and __volatile to __volatile__ to make the file consistent. Spotted by Benoit Carpentier <gtkool_2kx@yahoo.fr>.
This commit is contained in:
parent
14892c1dc8
commit
906a83b7f6
@ -1,3 +1,9 @@
|
|||||||
|
2004-07-02 Sebastian Wilhelmi <seppi@seppi.de>
|
||||||
|
|
||||||
|
* glib/gatomic.c: Rename __asm to __asm__ and __volatile to
|
||||||
|
__volatile__ to make the file consistent. Spotted by Benoit
|
||||||
|
Carpentier <gtkool_2kx@yahoo.fr>.
|
||||||
|
|
||||||
2004-07-01 John Ehresman <jpe@wingide.com>
|
2004-07-01 John Ehresman <jpe@wingide.com>
|
||||||
|
|
||||||
* glib/giowin32.c (g_io_channel_win32_init, g_io_win32_free)
|
* glib/giowin32.c (g_io_channel_win32_init, g_io_win32_free)
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2004-07-02 Sebastian Wilhelmi <seppi@seppi.de>
|
||||||
|
|
||||||
|
* glib/gatomic.c: Rename __asm to __asm__ and __volatile to
|
||||||
|
__volatile__ to make the file consistent. Spotted by Benoit
|
||||||
|
Carpentier <gtkool_2kx@yahoo.fr>.
|
||||||
|
|
||||||
2004-07-01 John Ehresman <jpe@wingide.com>
|
2004-07-01 John Ehresman <jpe@wingide.com>
|
||||||
|
|
||||||
* glib/giowin32.c (g_io_channel_win32_init, g_io_win32_free)
|
* glib/giowin32.c (g_io_channel_win32_init, g_io_win32_free)
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2004-07-02 Sebastian Wilhelmi <seppi@seppi.de>
|
||||||
|
|
||||||
|
* glib/gatomic.c: Rename __asm to __asm__ and __volatile to
|
||||||
|
__volatile__ to make the file consistent. Spotted by Benoit
|
||||||
|
Carpentier <gtkool_2kx@yahoo.fr>.
|
||||||
|
|
||||||
2004-07-01 John Ehresman <jpe@wingide.com>
|
2004-07-01 John Ehresman <jpe@wingide.com>
|
||||||
|
|
||||||
* glib/giowin32.c (g_io_channel_win32_init, g_io_win32_free)
|
* glib/giowin32.c (g_io_channel_win32_init, g_io_win32_free)
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2004-07-02 Sebastian Wilhelmi <seppi@seppi.de>
|
||||||
|
|
||||||
|
* glib/gatomic.c: Rename __asm to __asm__ and __volatile to
|
||||||
|
__volatile__ to make the file consistent. Spotted by Benoit
|
||||||
|
Carpentier <gtkool_2kx@yahoo.fr>.
|
||||||
|
|
||||||
2004-07-01 John Ehresman <jpe@wingide.com>
|
2004-07-01 John Ehresman <jpe@wingide.com>
|
||||||
|
|
||||||
* glib/giowin32.c (g_io_channel_win32_init, g_io_win32_free)
|
* glib/giowin32.c (g_io_channel_win32_init, g_io_win32_free)
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2004-07-02 Sebastian Wilhelmi <seppi@seppi.de>
|
||||||
|
|
||||||
|
* glib/gatomic.c: Rename __asm to __asm__ and __volatile to
|
||||||
|
__volatile__ to make the file consistent. Spotted by Benoit
|
||||||
|
Carpentier <gtkool_2kx@yahoo.fr>.
|
||||||
|
|
||||||
2004-07-01 John Ehresman <jpe@wingide.com>
|
2004-07-01 John Ehresman <jpe@wingide.com>
|
||||||
|
|
||||||
* glib/giowin32.c (g_io_channel_win32_init, g_io_win32_free)
|
* glib/giowin32.c (g_io_channel_win32_init, g_io_win32_free)
|
||||||
|
166
glib/gatomic.c
166
glib/gatomic.c
@ -56,9 +56,9 @@ g_atomic_int_compare_and_exchange (gint *atomic,
|
|||||||
{
|
{
|
||||||
gint result;
|
gint result;
|
||||||
|
|
||||||
__asm __volatile ("lock; cmpxchgl %2, %1"
|
__asm__ __volatile__ ("lock; cmpxchgl %2, %1"
|
||||||
: "=a" (result), "=m" (*atomic)
|
: "=a" (result), "=m" (*atomic)
|
||||||
: "r" (newval), "m" (*atomic), "0" (oldval));
|
: "r" (newval), "m" (*atomic), "0" (oldval));
|
||||||
|
|
||||||
return result == oldval;
|
return result == oldval;
|
||||||
}
|
}
|
||||||
@ -74,9 +74,9 @@ g_atomic_pointer_compare_and_exchange (gpointer *atomic,
|
|||||||
{
|
{
|
||||||
gpointer result;
|
gpointer result;
|
||||||
|
|
||||||
__asm __volatile ("lock; cmpxchgl %2, %1"
|
__asm__ __volatile__ ("lock; cmpxchgl %2, %1"
|
||||||
: "=a" (result), "=m" (*atomic)
|
: "=a" (result), "=m" (*atomic)
|
||||||
: "r" (newval), "m" (*atomic), "0" (oldval));
|
: "r" (newval), "m" (*atomic), "0" (oldval));
|
||||||
|
|
||||||
return result == oldval;
|
return result == oldval;
|
||||||
}
|
}
|
||||||
@ -87,10 +87,10 @@ g_atomic_pointer_compare_and_exchange (gpointer *atomic,
|
|||||||
# define ATOMIC_INT_CMP_XCHG(atomic, oldval, newval) \
|
# define ATOMIC_INT_CMP_XCHG(atomic, oldval, newval) \
|
||||||
({ \
|
({ \
|
||||||
gint __result; \
|
gint __result; \
|
||||||
__asm __volatile ("cas [%4], %2, %0" \
|
__asm__ __volatile__ ("cas [%4], %2, %0" \
|
||||||
: "=r" (__result), "=m" (*(atomic)) \
|
: "=r" (__result), "=m" (*(atomic)) \
|
||||||
: "r" (oldval), "m" (*(atomic)), "r" (atomic), \
|
: "r" (oldval), "m" (*(atomic)), "r" (atomic),\
|
||||||
"0" (newval)); \
|
"0" (newval)); \
|
||||||
__result == oldval; \
|
__result == oldval; \
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -101,10 +101,10 @@ g_atomic_pointer_compare_and_exchange (gpointer *atomic,
|
|||||||
gpointer newval)
|
gpointer newval)
|
||||||
{
|
{
|
||||||
gpointer result;
|
gpointer result;
|
||||||
__asm __volatile ("cas [%4], %2, %0"
|
__asm__ __volatile__ ("cas [%4], %2, %0"
|
||||||
: "=r" (result), "=m" (*atomic)
|
: "=r" (result), "=m" (*atomic)
|
||||||
: "r" (oldval), "m" (*atomic), "r" (atomic),
|
: "r" (oldval), "m" (*atomic), "r" (atomic),
|
||||||
"0" (newval));
|
"0" (newval));
|
||||||
return result == oldval;
|
return result == oldval;
|
||||||
}
|
}
|
||||||
# elif GLIB_SIZEOF_VOID_P == 8 /* 64-bit system */
|
# elif GLIB_SIZEOF_VOID_P == 8 /* 64-bit system */
|
||||||
@ -115,18 +115,18 @@ g_atomic_pointer_compare_and_exchange (gpointer *atomic,
|
|||||||
{
|
{
|
||||||
gpointer result;
|
gpointer result;
|
||||||
gpointer *a = atomic;
|
gpointer *a = atomic;
|
||||||
__asm __volatile ("casx [%4], %2, %0"
|
__asm__ __volatile__ ("casx [%4], %2, %0"
|
||||||
: "=r" (result), "=m" (*a)
|
: "=r" (result), "=m" (*a)
|
||||||
: "r" (oldval), "m" (*a), "r" (a),
|
: "r" (oldval), "m" (*a), "r" (a),
|
||||||
"0" (newval));
|
"0" (newval));
|
||||||
return result != 0;
|
return result != 0;
|
||||||
}
|
}
|
||||||
# else /* What's that */
|
# else /* What's that */
|
||||||
# error "Your system has an unsupported pointer size"
|
# error "Your system has an unsupported pointer size"
|
||||||
# endif /* GLIB_SIZEOF_VOID_P */
|
# endif /* GLIB_SIZEOF_VOID_P */
|
||||||
# define G_ATOMIC_MEMORY_BARRIER \
|
# define G_ATOMIC_MEMORY_BARRIER \
|
||||||
__asm __volatile ("membar #LoadLoad | #LoadStore" \
|
__asm__ __volatile__ ("membar #LoadLoad | #LoadStore" \
|
||||||
" | #StoreLoad | #StoreStore" : : : "memory")
|
" | #StoreLoad | #StoreStore" : : : "memory")
|
||||||
|
|
||||||
# elif defined (G_ATOMIC_ALPHA)
|
# elif defined (G_ATOMIC_ALPHA)
|
||||||
/* Adapted from CVS version 1.3 of glibc's sysdeps/alpha/bits/atomic.h
|
/* Adapted from CVS version 1.3 of glibc's sysdeps/alpha/bits/atomic.h
|
||||||
@ -208,7 +208,7 @@ g_atomic_pointer_compare_and_exchange (gpointer *atomic,
|
|||||||
# else /* What's that */
|
# else /* What's that */
|
||||||
# error "Your system has an unsupported pointer size"
|
# error "Your system has an unsupported pointer size"
|
||||||
# endif /* GLIB_SIZEOF_VOID_P */
|
# endif /* GLIB_SIZEOF_VOID_P */
|
||||||
# define G_ATOMIC_MEMORY_BARRIER __asm ("mb" : : : "memory")
|
# define G_ATOMIC_MEMORY_BARRIER __asm__ ("mb" : : : "memory")
|
||||||
# elif defined (G_ATOMIC_X86_64)
|
# elif defined (G_ATOMIC_X86_64)
|
||||||
/* Adapted from CVS version 1.9 of glibc's sysdeps/x86_64/bits/atomic.h
|
/* Adapted from CVS version 1.9 of glibc's sysdeps/x86_64/bits/atomic.h
|
||||||
*/
|
*/
|
||||||
@ -240,9 +240,9 @@ g_atomic_int_compare_and_exchange (gint *atomic,
|
|||||||
{
|
{
|
||||||
gint result;
|
gint result;
|
||||||
|
|
||||||
__asm __volatile ("lock; cmpxchgl %2, %1"
|
__asm__ __volatile__ ("lock; cmpxchgl %2, %1"
|
||||||
: "=a" (result), "=m" (*atomic)
|
: "=a" (result), "=m" (*atomic)
|
||||||
: "r" (newval), "m" (*atomic), "0" (oldval));
|
: "r" (newval), "m" (*atomic), "0" (oldval));
|
||||||
|
|
||||||
return result == oldval;
|
return result == oldval;
|
||||||
}
|
}
|
||||||
@ -254,9 +254,9 @@ g_atomic_pointer_compare_and_exchange (gpointer *atomic,
|
|||||||
{
|
{
|
||||||
gpointer result;
|
gpointer result;
|
||||||
|
|
||||||
__asm __volatile ("lock; cmpxchgq %q2, %1"
|
__asm__ __volatile__ ("lock; cmpxchgq %q2, %1"
|
||||||
: "=a" (result), "=m" (*atomic)
|
: "=a" (result), "=m" (*atomic)
|
||||||
: "r" (newval), "m" (*atomic), "0" (oldval));
|
: "r" (newval), "m" (*atomic), "0" (oldval));
|
||||||
|
|
||||||
return result == oldval;
|
return result == oldval;
|
||||||
}
|
}
|
||||||
@ -274,13 +274,13 @@ g_atomic_int_exchange_and_add (gint *atomic,
|
|||||||
gint val)
|
gint val)
|
||||||
{
|
{
|
||||||
gint result, temp;
|
gint result, temp;
|
||||||
__asm __volatile ("1: lwarx %0,0,%3\n"
|
__asm__ __volatile__ ("1: lwarx %0,0,%3\n"
|
||||||
" add %1,%0,%4\n"
|
" add %1,%0,%4\n"
|
||||||
" stwcx. %1,0,%3\n"
|
" stwcx. %1,0,%3\n"
|
||||||
" bne- 1b"
|
" bne- 1b"
|
||||||
: "=&b" (result), "=&r" (temp), "=m" (*atomic)
|
: "=&b" (result), "=&r" (temp), "=m" (*atomic)
|
||||||
: "b" (atomic), "r" (val), "2" (*atomic)
|
: "b" (atomic), "r" (val), "2" (*atomic)
|
||||||
: "cr0", "memory");
|
: "cr0", "memory");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,13 +290,13 @@ g_atomic_int_add (gint *atomic,
|
|||||||
gint val)
|
gint val)
|
||||||
{
|
{
|
||||||
gint result, temp;
|
gint result, temp;
|
||||||
__asm __volatile ("1: lwarx %0,0,%3\n"
|
__asm__ __volatile__ ("1: lwarx %0,0,%3\n"
|
||||||
" add %1,%0,%4\n"
|
" add %1,%0,%4\n"
|
||||||
" stwcx. %1,0,%3\n"
|
" stwcx. %1,0,%3\n"
|
||||||
" bne- 1b"
|
" bne- 1b"
|
||||||
: "=&b" (result), "=&r" (temp), "=m" (*atomic)
|
: "=&b" (result), "=&r" (temp), "=m" (*atomic)
|
||||||
: "b" (atomic), "r" (val), "2" (*atomic)
|
: "b" (atomic), "r" (val), "2" (*atomic)
|
||||||
: "cr0", "memory");
|
: "cr0", "memory");
|
||||||
}
|
}
|
||||||
# else /* !__OPTIMIZE__ */
|
# else /* !__OPTIMIZE__ */
|
||||||
gint
|
gint
|
||||||
@ -329,16 +329,16 @@ g_atomic_int_compare_and_exchange (gint *atomic,
|
|||||||
gint newval)
|
gint newval)
|
||||||
{
|
{
|
||||||
gint result;
|
gint result;
|
||||||
__asm __volatile ("sync\n"
|
__asm__ __volatile__ ("sync\n"
|
||||||
"1: lwarx %0,0,%1\n"
|
"1: lwarx %0,0,%1\n"
|
||||||
" subf. %0,%2,%0\n"
|
" subf. %0,%2,%0\n"
|
||||||
" bne 2f\n"
|
" bne 2f\n"
|
||||||
" stwcx. %3,0,%1\n"
|
" stwcx. %3,0,%1\n"
|
||||||
" bne- 1b\n"
|
" bne- 1b\n"
|
||||||
"2: isync"
|
"2: isync"
|
||||||
: "=&r" (result)
|
: "=&r" (result)
|
||||||
: "b" (atomic), "r" (oldval), "r" (newval)
|
: "b" (atomic), "r" (oldval), "r" (newval)
|
||||||
: "cr0", "memory");
|
: "cr0", "memory");
|
||||||
return result == 0;
|
return result == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,16 +348,16 @@ g_atomic_pointer_compare_and_exchange (gpointer *atomic,
|
|||||||
gpointer newval)
|
gpointer newval)
|
||||||
{
|
{
|
||||||
gpointer result;
|
gpointer result;
|
||||||
__asm __volatile ("sync\n"
|
__asm__ __volatile__ ("sync\n"
|
||||||
"1: lwarx %0,0,%1\n"
|
"1: lwarx %0,0,%1\n"
|
||||||
" subf. %0,%2,%0\n"
|
" subf. %0,%2,%0\n"
|
||||||
" bne 2f\n"
|
" bne 2f\n"
|
||||||
" stwcx. %3,0,%1\n"
|
" stwcx. %3,0,%1\n"
|
||||||
" bne- 1b\n"
|
" bne- 1b\n"
|
||||||
"2: isync"
|
"2: isync"
|
||||||
: "=&r" (result)
|
: "=&r" (result)
|
||||||
: "b" (atomic), "r" (oldval), "r" (newval)
|
: "b" (atomic), "r" (oldval), "r" (newval)
|
||||||
: "cr0", "memory");
|
: "cr0", "memory");
|
||||||
return result == 0;
|
return result == 0;
|
||||||
}
|
}
|
||||||
# elif GLIB_SIZEOF_VOID_P == 8 /* 64-bit system */
|
# elif GLIB_SIZEOF_VOID_P == 8 /* 64-bit system */
|
||||||
@ -367,17 +367,17 @@ g_atomic_int_compare_and_exchange (gint *atomic,
|
|||||||
gint newval)
|
gint newval)
|
||||||
{
|
{
|
||||||
gpointer result;
|
gpointer result;
|
||||||
__asm __volatile ("sync\n"
|
__asm__ __volatile__ ("sync\n"
|
||||||
"1: lwarx %0,0,%1\n"
|
"1: lwarx %0,0,%1\n"
|
||||||
" extsw %0,%0\n"
|
" extsw %0,%0\n"
|
||||||
" subf. %0,%2,%0\n"
|
" subf. %0,%2,%0\n"
|
||||||
" bne 2f\n"
|
" bne 2f\n"
|
||||||
" stwcx. %3,0,%1\n"
|
" stwcx. %3,0,%1\n"
|
||||||
" bne- 1b\n"
|
" bne- 1b\n"
|
||||||
"2: isync"
|
"2: isync"
|
||||||
: "=&r" (result)
|
: "=&r" (result)
|
||||||
: "b" (atomic), "r" (oldval), "r" (newval)
|
: "b" (atomic), "r" (oldval), "r" (newval)
|
||||||
: "cr0", "memory");
|
: "cr0", "memory");
|
||||||
return result == 0;
|
return result == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -387,23 +387,23 @@ g_atomic_pointer_compare_and_exchange (gpointer *atomic,
|
|||||||
gpointer newval)
|
gpointer newval)
|
||||||
{
|
{
|
||||||
gpointer result;
|
gpointer result;
|
||||||
__asm __volatile ("sync\n"
|
__asm__ __volatile__ ("sync\n"
|
||||||
"1: ldarx %0,0,%1\n"
|
"1: ldarx %0,0,%1\n"
|
||||||
" subf. %0,%2,%0\n"
|
" subf. %0,%2,%0\n"
|
||||||
" bne 2f\n"
|
" bne 2f\n"
|
||||||
" stdcx. %3,0,%1\n"
|
" stdcx. %3,0,%1\n"
|
||||||
" bne- 1b\n"
|
" bne- 1b\n"
|
||||||
"2: isync"
|
"2: isync"
|
||||||
: "=&r" (result)
|
: "=&r" (result)
|
||||||
: "b" (atomic), "r" (oldval), "r" (newval)
|
: "b" (atomic), "r" (oldval), "r" (newval)
|
||||||
: "cr0", "memory");
|
: "cr0", "memory");
|
||||||
return result == 0;
|
return result == 0;
|
||||||
}
|
}
|
||||||
# else /* What's that */
|
# else /* What's that */
|
||||||
# error "Your system has an unsupported pointer size"
|
# error "Your system has an unsupported pointer size"
|
||||||
# endif /* GLIB_SIZEOF_VOID_P */
|
# endif /* GLIB_SIZEOF_VOID_P */
|
||||||
|
|
||||||
# define G_ATOMIC_MEMORY_BARRIER __asm ("sync" : : : "memory")
|
# define G_ATOMIC_MEMORY_BARRIER __asm__ ("sync" : : : "memory")
|
||||||
|
|
||||||
# elif defined (G_ATOMIC_IA64)
|
# elif defined (G_ATOMIC_IA64)
|
||||||
/* Adapted from CVS version 1.8 of glibc's sysdeps/ia64/bits/atomic.h
|
/* Adapted from CVS version 1.8 of glibc's sysdeps/ia64/bits/atomic.h
|
||||||
|
Loading…
Reference in New Issue
Block a user