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

Commit 2330f7e65ee22e42016d28c26f554fcfe9518ed5 changed 'asm' to '__asm__' in
g_bit_lock and g_bit_trylock.

Replace 'asm' with '__asm__' in the remaining functions.

Fixes https://gitlab.gnome.org/GNOME/glib/-/issues/2344
This commit is contained in:
Aleksandr Mezin 2021-03-04 04:39:27 +06:00
parent 14c9fc79ac
commit d18bdef42d

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;