Merge branch 'fix-gbitlock-asm' into 'master'

gbitlock.c: replace remaining 'asm' with '__asm__'

Closes #2344

See merge request GNOME/glib!1979
This commit is contained in:
Sebastian Dröge 2021-03-09 12:44:29 +00:00
commit e401825d77

View File

@ -322,10 +322,10 @@ g_bit_unlock (volatile gint *address,
gint lock_bit) gint lock_bit)
{ {
#ifdef USE_ASM_GOTO #ifdef USE_ASM_GOTO
asm volatile ("lock btr %1, (%0)" __asm__ volatile ("lock btr %1, (%0)"
: /* no output */ : /* no output */
: "r" (address), "r" (lock_bit) : "r" (address), "r" (lock_bit)
: "cc", "memory"); : "cc", "memory");
#else #else
guint mask = 1u << lock_bit; guint mask = 1u << lock_bit;
@ -405,12 +405,12 @@ void
{ {
#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" ((gsize) lock_bit) : "r" (address), "r" ((gsize) lock_bit)
: "cc", "memory" : "cc", "memory"
: contended); : contended);
return; return;
contended: contended:
@ -477,12 +477,12 @@ gboolean
#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" ((gsize) lock_bit) : "r" (address), "r" ((gsize) lock_bit)
: "cc", "memory"); : "cc", "memory");
return result; return result;
#else #else
@ -520,10 +520,10 @@ void
{ {
#ifdef USE_ASM_GOTO #ifdef USE_ASM_GOTO
asm volatile ("lock btr %1, (%0)" __asm__ volatile ("lock btr %1, (%0)"
: /* no output */ : /* no output */
: "r" (address), "r" ((gsize) lock_bit) : "r" (address), "r" ((gsize) lock_bit)
: "cc", "memory"); : "cc", "memory");
#else #else
volatile gsize *pointer_address = address; volatile gsize *pointer_address = address;
gsize mask = 1u << lock_bit; gsize mask = 1u << lock_bit;