mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-16 04:28:05 +02:00
Use __asm__ instead of asm
This is a little more robust as various compiler flags make gcc forget about asm. https://bugzilla.gnome.org/show_bug.cgi?id=693299
This commit is contained in:
parent
ff9a61eed9
commit
2330f7e65e
@ -208,12 +208,12 @@ g_bit_lock (volatile gint *address,
|
|||||||
{
|
{
|
||||||
#ifdef USE_ASM_GOTO
|
#ifdef USE_ASM_GOTO
|
||||||
retry:
|
retry:
|
||||||
asm volatile goto ("lock bts %1, (%0)\n"
|
__asm__ volatile goto ("lock bts %1, (%0)\n"
|
||||||
"jc %l[contended]"
|
"jc %l[contended]"
|
||||||
: /* no output */
|
: /* no output */
|
||||||
: "r" (address), "r" (lock_bit)
|
: "r" (address), "r" (lock_bit)
|
||||||
: "cc", "memory"
|
: "cc", "memory"
|
||||||
: contended);
|
: contended);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
contended:
|
contended:
|
||||||
@ -281,12 +281,12 @@ g_bit_trylock (volatile gint *address,
|
|||||||
#ifdef USE_ASM_GOTO
|
#ifdef USE_ASM_GOTO
|
||||||
gboolean result;
|
gboolean result;
|
||||||
|
|
||||||
asm volatile ("lock bts %2, (%1)\n"
|
__asm__ volatile ("lock bts %2, (%1)\n"
|
||||||
"setnc %%al\n"
|
"setnc %%al\n"
|
||||||
"movzx %%al, %0"
|
"movzx %%al, %0"
|
||||||
: "=r" (result)
|
: "=r" (result)
|
||||||
: "r" (address), "r" (lock_bit)
|
: "r" (address), "r" (lock_bit)
|
||||||
: "cc", "memory");
|
: "cc", "memory");
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user