diff options
Diffstat (limited to 'libpthread')
30 files changed, 93 insertions, 93 deletions
diff --git a/libpthread/linuxthreads/condvar.c b/libpthread/linuxthreads/condvar.c index d049d9782..d7b2e9886 100644 --- a/libpthread/linuxthreads/condvar.c +++ b/libpthread/linuxthreads/condvar.c @@ -46,7 +46,7 @@ strong_alias (__pthread_cond_destroy, pthread_cond_destroy) static int cond_extricate_func(void *obj, pthread_descr th) { - volatile pthread_descr self = thread_self(); + __volatile__ pthread_descr self = thread_self(); pthread_cond_t *cond = obj; int did_remove = 0; @@ -59,7 +59,7 @@ static int cond_extricate_func(void *obj, pthread_descr th) int __pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) { - volatile pthread_descr self = thread_self(); + __volatile__ pthread_descr self = thread_self(); pthread_extricate_if extr; int already_canceled = 0; int spurious_wakeup_count; @@ -141,7 +141,7 @@ pthread_cond_timedwait_relative(pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec * abstime) { - volatile pthread_descr self = thread_self(); + __volatile__ pthread_descr self = thread_self(); int already_canceled = 0; pthread_extricate_if extr; int spurious_wakeup_count; diff --git a/libpthread/linuxthreads/internals.h b/libpthread/linuxthreads/internals.h index 28d86459d..a04995f41 100644 --- a/libpthread/linuxthreads/internals.h +++ b/libpthread/linuxthreads/internals.h @@ -161,13 +161,13 @@ extern int __pthread_exit_requested, __pthread_exit_code; /* Set to 1 by gdb if we're debugging */ -extern volatile int __pthread_threads_debug; +extern __volatile__ int __pthread_threads_debug; /* Globally enabled events. */ -extern volatile td_thr_events_t __pthread_threads_events; +extern __volatile__ td_thr_events_t __pthread_threads_events; /* Pointer to descriptor of thread with last event. */ -extern volatile pthread_descr __pthread_last_event; +extern __volatile__ pthread_descr __pthread_last_event; /* Flag which tells whether we are executing on SMP kernel. */ extern int __pthread_smp_kernel; @@ -229,7 +229,7 @@ static inline int nonexisting_handle(pthread_handle h, pthread_t id) distinguish between full, read and write barriers. */ #ifndef MEMORY_BARRIER -#define MEMORY_BARRIER() asm ("" : : : "memory") +#define MEMORY_BARRIER() __asm__ ("" : : : "memory") #endif #ifndef READ_MEMORY_BARRIER #define READ_MEMORY_BARRIER() MEMORY_BARRIER() diff --git a/libpthread/linuxthreads/join.c b/libpthread/linuxthreads/join.c index 148f22231..c9c030f6f 100644 --- a/libpthread/linuxthreads/join.c +++ b/libpthread/linuxthreads/join.c @@ -97,7 +97,7 @@ void __pthread_do_exit(void *retval, char *currentframe) static int join_extricate_func(void *obj, pthread_descr th) { - volatile pthread_descr self = thread_self(); + __volatile__ pthread_descr self = thread_self(); pthread_handle handle = obj; pthread_descr jo; int did_remove = 0; @@ -113,7 +113,7 @@ static int join_extricate_func(void *obj, pthread_descr th) int pthread_join(pthread_t thread_id, void ** thread_return) { - volatile pthread_descr self = thread_self(); + __volatile__ pthread_descr self = thread_self(); struct pthread_request request; pthread_handle handle = thread_handle(thread_id); pthread_descr th; diff --git a/libpthread/linuxthreads/manager.c b/libpthread/linuxthreads/manager.c index ef6ffeecf..4cd575b41 100644 --- a/libpthread/linuxthreads/manager.c +++ b/libpthread/linuxthreads/manager.c @@ -52,17 +52,17 @@ int __pthread_nonstandard_stacks; #endif /* Number of active entries in __pthread_handles (used by gdb) */ -volatile int __pthread_handles_num = 2; +__volatile__ int __pthread_handles_num = 2; /* Whether to use debugger additional actions for thread creation (set to 1 by gdb) */ -volatile int __pthread_threads_debug; +__volatile__ int __pthread_threads_debug; /* Globally enabled events. */ -volatile td_thr_events_t __pthread_threads_events; +__volatile__ td_thr_events_t __pthread_threads_events; /* Pointer to thread descriptor with last event. */ -volatile pthread_descr __pthread_last_event; +__volatile__ pthread_descr __pthread_last_event; static pthread_descr manager_thread; @@ -87,7 +87,7 @@ static inline pthread_descr thread_segment(int seg) /* Flag set in signal handler to record child termination */ -static volatile int terminated_children; +static __volatile__ int terminated_children; /* Flag set when the initial thread is blocked on pthread_exit waiting for all other threads to terminate */ diff --git a/libpthread/linuxthreads/semaphore.c b/libpthread/linuxthreads/semaphore.c index 2b13c1450..392c37bfa 100644 --- a/libpthread/linuxthreads/semaphore.c +++ b/libpthread/linuxthreads/semaphore.c @@ -44,7 +44,7 @@ int sem_init(sem_t *sem, int pshared, unsigned int value) static int new_sem_extricate_func(void *obj, pthread_descr th) { - volatile pthread_descr self = thread_self(); + __volatile__ pthread_descr self = thread_self(); sem_t *sem = obj; int did_remove = 0; @@ -57,7 +57,7 @@ static int new_sem_extricate_func(void *obj, pthread_descr th) int sem_wait(sem_t * sem) { - volatile pthread_descr self = thread_self(); + __volatile__ pthread_descr self = thread_self(); pthread_extricate_if extr; int already_canceled = 0; int spurious_wakeup_count; diff --git a/libpthread/linuxthreads/signals.c b/libpthread/linuxthreads/signals.c index b282d3ecc..62e83211a 100644 --- a/libpthread/linuxthreads/signals.c +++ b/libpthread/linuxthreads/signals.c @@ -141,7 +141,7 @@ strong_alias(__pthread_sigaction, sigaction) /* sigwait -- synchronously wait for a signal */ int __pthread_sigwait(const sigset_t * set, int * sig) { - volatile pthread_descr self = thread_self(); + __volatile__ pthread_descr self = thread_self(); sigset_t mask; int s; sigjmp_buf jmpbuf; diff --git a/libpthread/linuxthreads/spinlock.c b/libpthread/linuxthreads/spinlock.c index 08fff082e..6b6610688 100644 --- a/libpthread/linuxthreads/spinlock.c +++ b/libpthread/linuxthreads/spinlock.c @@ -30,7 +30,7 @@ static inline void __pthread_release(int * spinlock) { WRITE_MEMORY_BARRIER(); *spinlock = __LT_SPINLOCK_INIT; - __asm __volatile ("" : "=m" (*spinlock) : "m" (*spinlock)); + __asm__ __volatile__ ("" : "=m" (*spinlock) : "m" (*spinlock)); } @@ -106,7 +106,7 @@ void internal_function __pthread_lock(struct _pthread_fastlock * lock, #ifdef BUSY_WAIT_NOP BUSY_WAIT_NOP; #endif - __asm __volatile ("" : "=m" (lock->__status) : "m" (lock->__status)); + __asm__ __volatile__ ("" : "=m" (lock->__status) : "m" (lock->__status)); } lock->__spinlock += (spin_count - lock->__spinlock) / 8; diff --git a/libpthread/linuxthreads/sysdeps/alpha/pspinlock.c b/libpthread/linuxthreads/sysdeps/alpha/pspinlock.c index 79b783629..d54a2a98b 100644 --- a/libpthread/linuxthreads/sysdeps/alpha/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/alpha/pspinlock.c @@ -35,7 +35,7 @@ int __pthread_spin_lock (pthread_spinlock_t *lock) { unsigned int tmp; - asm volatile + __asm__ __volatile__ ("1: ldl_l %0,%1\n" " blbs %0,2f\n" " or %0,1,%0\n" @@ -60,7 +60,7 @@ __pthread_spin_trylock (pthread_spinlock_t *lock) unsigned long int oldval; unsigned long int temp; - asm volatile + __asm__ __volatile__ ("1: ldl_l %0,%1\n" " and %0,%3,%2\n" " bne %2,2f\n" @@ -83,7 +83,7 @@ weak_alias (__pthread_spin_trylock, pthread_spin_trylock) int __pthread_spin_unlock (pthread_spinlock_t *lock) { - asm volatile ("mb"); + __asm__ __volatile__ ("mb"); return *lock = 0; } weak_alias (__pthread_spin_unlock, pthread_spin_unlock) diff --git a/libpthread/linuxthreads/sysdeps/arm/pspinlock.c b/libpthread/linuxthreads/sysdeps/arm/pspinlock.c index 665e270b6..9deb0b1b1 100644 --- a/libpthread/linuxthreads/sysdeps/arm/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/arm/pspinlock.c @@ -28,7 +28,7 @@ __pthread_spin_lock (pthread_spinlock_t *lock) unsigned int val; do - asm volatile ("swp %0, %1, [%2]" + __asm__ __volatile__ ("swp %0, %1, [%2]" : "=r" (val) : "0" (1), "r" (lock) : "memory"); @@ -44,7 +44,7 @@ __pthread_spin_trylock (pthread_spinlock_t *lock) { unsigned int val; - asm volatile ("swp %0, %1, [%2]" + __asm__ __volatile__ ("swp %0, %1, [%2]" : "=r" (val) : "0" (1), "r" (lock) : "memory"); diff --git a/libpthread/linuxthreads/sysdeps/hppa/pspinlock.c b/libpthread/linuxthreads/sysdeps/hppa/pspinlock.c index 7f481fa4b..71a537fd6 100644 --- a/libpthread/linuxthreads/sysdeps/hppa/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/hppa/pspinlock.c @@ -27,7 +27,7 @@ __pthread_spin_lock (pthread_spinlock_t *lock) unsigned int val; do - asm volatile ("ldcw %1,%0" + __asm__ __volatile__ ("ldcw %1,%0" : "=r" (val), "=m" (*lock) : "m" (*lock)); while (!val); @@ -42,7 +42,7 @@ __pthread_spin_trylock (pthread_spinlock_t *lock) { unsigned int val; - asm volatile ("ldcw %1,%0" + __asm__ __volatile__ ("ldcw %1,%0" : "=r" (val), "=m" (*lock) : "m" (*lock)); diff --git a/libpthread/linuxthreads/sysdeps/i386/pspinlock.c b/libpthread/linuxthreads/sysdeps/i386/pspinlock.c index e4ec24a0b..c9c62724b 100644 --- a/libpthread/linuxthreads/sysdeps/i386/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/i386/pspinlock.c @@ -35,7 +35,7 @@ int __pthread_spin_lock (pthread_spinlock_t *lock) { - asm volatile + __asm__ __volatile__ ("\n" "1:\n\t" "lock; decl %0\n\t" @@ -58,7 +58,7 @@ __pthread_spin_trylock (pthread_spinlock_t *lock) { int oldval; - asm volatile + __asm__ __volatile__ ("xchgl %0,%1" : "=r" (oldval), "=m" (*lock) : "0" (0)); @@ -70,7 +70,7 @@ weak_alias (__pthread_spin_trylock, pthread_spin_trylock) int __pthread_spin_unlock (pthread_spinlock_t *lock) { - asm volatile + __asm__ __volatile__ ("movl $1,%0" : "=m" (*lock)); return 0; diff --git a/libpthread/linuxthreads/sysdeps/i386/tls.h b/libpthread/linuxthreads/sysdeps/i386/tls.h index f230a33ba..2abd3a093 100644 --- a/libpthread/linuxthreads/sysdeps/i386/tls.h +++ b/libpthread/linuxthreads/sysdeps/i386/tls.h @@ -136,7 +136,7 @@ TLS_DO_MODIFY_LDT_KERNEL_CHECK( \ { nr, (unsigned long int) (descr), 0xfffff /* 4GB in pages */, \ 1, 0, 0, 1, 0, 1, 0 }; \ int result; \ - asm volatile (TLS_LOAD_EBX \ + __asm__ __volatile__ (TLS_LOAD_EBX \ "int $0x80\n\t" \ TLS_LOAD_EBX \ : "=a" (result) \ @@ -147,7 +147,7 @@ TLS_DO_MODIFY_LDT_KERNEL_CHECK( \ "m" (ldt_entry), TLS_EBX_ARG (1), "c" (&ldt_entry), \ "d" (sizeof (ldt_entry))); \ __builtin_expect (result, 0) == 0 \ - ? ({ asm ("movw %w0, %%gs" : : "q" ((nr) * 8 + 7)); NULL; }) \ + ? ({ __asm__ ("movw %w0, %%gs" : : "q" ((nr) * 8 + 7)); NULL; }) \ : "cannot set up LDT for thread-local storage\n"; \ })) @@ -159,9 +159,9 @@ TLS_DO_MODIFY_LDT_KERNEL_CHECK( \ int result; \ if (secondcall) \ ldt_entry.entry_number = ({ int _gs; \ - asm ("movw %%gs, %w0" : "=q" (_gs)); \ + __asm__ ("movw %%gs, %w0" : "=q" (_gs)); \ (_gs & 0xffff) >> 3; }); \ - asm volatile (TLS_LOAD_EBX \ + __asm__ __volatile__ (TLS_LOAD_EBX \ "int $0x80\n\t" \ TLS_LOAD_EBX \ : "=a" (result), "=m" (ldt_entry.entry_number) \ @@ -171,7 +171,7 @@ TLS_DO_MODIFY_LDT_KERNEL_CHECK( \ here. */ \ TLS_EBX_ARG (&ldt_entry), "m" (ldt_entry)); \ if (__builtin_expect (result, 0) == 0) \ - asm ("movw %w0, %%gs" : : "q" (ldt_entry.entry_number * 8 + 3)); \ + __asm__ ("movw %w0, %%gs" : : "q" (ldt_entry.entry_number * 8 + 3)); \ result; \ }) diff --git a/libpthread/linuxthreads/sysdeps/i386/useldt.h b/libpthread/linuxthreads/sysdeps/i386/useldt.h index 4ac82f1ab..a2eb53fed 100644 --- a/libpthread/linuxthreads/sysdeps/i386/useldt.h +++ b/libpthread/linuxthreads/sysdeps/i386/useldt.h @@ -72,7 +72,7 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t); 1, 0, 0, 1, 0, 1, 0 }; \ if (__modify_ldt (1, &ldt_entry, sizeof (ldt_entry)) != 0) \ abort (); \ - asm ("movw %w0, %%gs" : : "q" (nr * 8 + 7)); \ + __asm__ ("movw %w0, %%gs" : : "q" (nr * 8 + 7)); \ }) #ifdef __PIC__ @@ -98,14 +98,14 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t); int __gs; \ if (DO_SET_THREAD_AREA_REUSE (nr)) \ { \ - asm ("movw %%gs, %w0" : "=q" (__gs)); \ + __asm__ ("movw %%gs, %w0" : "=q" (__gs)); \ struct modify_ldt_ldt_s ldt_entry = \ { (__gs & 0xffff) >> 3, \ (unsigned long int) (descr), 0xfffff /* 4GB in pages */, \ 1, 0, 0, 1, 0, 1, 0 }; \ \ int __result; \ - __asm (USETLS_LOAD_EBX \ + __asm__ (USETLS_LOAD_EBX \ "movl %2, %%eax\n\t" \ "int $0x80\n\t" \ USETLS_LOAD_EBX \ @@ -114,7 +114,7 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t); "m" (ldt_entry) \ : "memory"); \ if (__result == 0) \ - asm ("movw %w0, %%gs" :: "q" (__gs)); \ + __asm__ ("movw %w0, %%gs" :: "q" (__gs)); \ else \ __gs = -1; \ } \ @@ -125,7 +125,7 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t); (unsigned long int) (descr), 0xfffff /* 4GB in pages */, \ 1, 0, 0, 1, 0, 1, 0 }; \ int __result; \ - __asm (USETLS_LOAD_EBX \ + __asm__ (USETLS_LOAD_EBX \ "movl %2, %%eax\n\t" \ "int $0x80\n\t" \ USETLS_LOAD_EBX \ @@ -136,7 +136,7 @@ extern int __modify_ldt (int, struct modify_ldt_ldt_s *, size_t); if (__result == 0) \ { \ __gs = (ldt_entry.entry_number << 3) + 3; \ - asm ("movw %w0, %%gs" : : "q" (__gs)); \ + __asm__ ("movw %w0, %%gs" : : "q" (__gs)); \ } \ else \ __gs = -1; \ diff --git a/libpthread/linuxthreads/sysdeps/ia64/pspinlock.c b/libpthread/linuxthreads/sysdeps/ia64/pspinlock.c index d61aa3f43..8bbaf6f92 100644 --- a/libpthread/linuxthreads/sysdeps/ia64/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/ia64/pspinlock.c @@ -35,7 +35,7 @@ __pthread_spin_lock (pthread_spinlock_t *lock) { /* Spin without using the atomic instruction. */ do - __asm __volatile ("" : : : "memory"); + __asm__ __volatile__ ("" : : : "memory"); while (*p); } return 0; diff --git a/libpthread/linuxthreads/sysdeps/ia64/pt-machine.h b/libpthread/linuxthreads/sysdeps/ia64/pt-machine.h index 6c5dfe93b..be1d37986 100644 --- a/libpthread/linuxthreads/sysdeps/ia64/pt-machine.h +++ b/libpthread/linuxthreads/sysdeps/ia64/pt-machine.h @@ -33,7 +33,7 @@ extern int __compare_and_swap (long int *p, long int oldval, long int newval); /* Make sure gcc doesn't try to be clever and move things around on us. We need to use _exactly_ the address the user gave us, not some alias that contains the same information. */ -#define __atomic_fool_gcc(x) (*(volatile struct { int a[100]; } *)x) +#define __atomic_fool_gcc(x) (*(__volatile__ struct { int a[100]; } *)x) #ifndef ELF_MACHINE_NAME diff --git a/libpthread/linuxthreads/sysdeps/m68k/pspinlock.c b/libpthread/linuxthreads/sysdeps/m68k/pspinlock.c index 30b9b9e8b..35b851faf 100644 --- a/libpthread/linuxthreads/sysdeps/m68k/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/m68k/pspinlock.c @@ -28,7 +28,7 @@ __pthread_spin_lock (pthread_spinlock_t *lock) unsigned int val; do - asm volatile ("tas %1; sne %0" + __asm__ __volatile__ ("tas %1; sne %0" : "=dm" (val), "=m" (*lock) : "m" (*lock) : "cc"); @@ -44,7 +44,7 @@ __pthread_spin_trylock (pthread_spinlock_t *lock) { unsigned int val; - asm volatile ("tas %1; sne %0" + __asm__ __volatile__ ("tas %1; sne %0" : "=dm" (val), "=m" (*lock) : "m" (*lock) : "cc"); diff --git a/libpthread/linuxthreads/sysdeps/mips/pspinlock.c b/libpthread/linuxthreads/sysdeps/mips/pspinlock.c index 350aa7553..a106c0f77 100644 --- a/libpthread/linuxthreads/sysdeps/mips/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/mips/pspinlock.c @@ -31,7 +31,7 @@ __pthread_spin_lock (pthread_spinlock_t *lock) { unsigned int tmp1, tmp2; - asm volatile + __asm__ __volatile__ ("\t\t\t# spin_lock\n" "1:\n\t" ".set push\n\t" @@ -66,7 +66,7 @@ weak_alias (__pthread_spin_trylock, pthread_spin_trylock) int __pthread_spin_unlock (pthread_spinlock_t *lock) { - asm volatile + __asm__ __volatile__ ("\t\t\t# spin_unlock\n\t" "sw $0,%0" : "=m" (*lock) diff --git a/libpthread/linuxthreads/sysdeps/mips/tls.h b/libpthread/linuxthreads/sysdeps/mips/tls.h index be4478db4..15dda696d 100644 --- a/libpthread/linuxthreads/sysdeps/mips/tls.h +++ b/libpthread/linuxthreads/sysdeps/mips/tls.h @@ -39,7 +39,7 @@ typedef union dtv # define READ_THREAD_POINTER() \ ({ void *__result; \ - asm volatile (".set\tpush\n\t.set\tmips32r2\n\t" \ + __asm__ __volatile__ (".set\tpush\n\t.set\tmips32r2\n\t" \ "rdhwr\t%0, $29\n\t.set\tpop" : "=v" (__result)); \ __result; }) diff --git a/libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h b/libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h index d1daef07a..4ea6d8ac5 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h +++ b/libpthread/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h @@ -128,7 +128,7 @@ typedef struct #ifdef __USE_XOPEN2K /* POSIX spinlock data type. */ -typedef volatile int pthread_spinlock_t; +typedef __volatile__ int pthread_spinlock_t; /* POSIX barrier. */ typedef struct { diff --git a/libpthread/linuxthreads/sysdeps/pthread/pt-initfini.c b/libpthread/linuxthreads/sysdeps/pthread/pt-initfini.c index 1ccac2f6e..15aeb2166 100644 --- a/libpthread/linuxthreads/sysdeps/pthread/pt-initfini.c +++ b/libpthread/linuxthreads/sysdeps/pthread/pt-initfini.c @@ -40,16 +40,16 @@ /* We use embedded asm for .section unconditionally, as this makes it easier to insert the necessary directives into crtn.S. */ -#define SECTION(x) asm (".section " x ) +#define SECTION(x) __asm__ (".section " x ) /* Embed an #include to pull in the alignment and .end directives. */ -asm ("\n#include \"defs.h\""); +__asm__ ("\n#include \"defs.h\""); /* The initial common code ends here. */ -asm ("\n/*@HEADER_ENDS*/"); +__asm__ ("\n/*@HEADER_ENDS*/"); /* To determine whether we need .end and .align: */ -asm ("\n/*@TESTS_BEGIN*/"); +__asm__ ("\n/*@TESTS_BEGIN*/"); extern void dummy (void (*foo) (void)); void dummy (void (*foo) (void)) @@ -57,10 +57,10 @@ dummy (void (*foo) (void)) if (foo) (*foo) (); } -asm ("\n/*@TESTS_END*/"); +__asm__ ("\n/*@TESTS_END*/"); /* The beginning of _init: */ -asm ("\n/*@_init_PROLOG_BEGINS*/"); +__asm__ ("\n/*@_init_PROLOG_BEGINS*/"); static void call_initialize_minimal (void) @@ -78,18 +78,18 @@ _init (void) /* The very first thing we must do is to set up the registers. */ call_initialize_minimal (); - asm ("ALIGN"); - asm("END_INIT"); + __asm__ ("ALIGN"); + __asm__("END_INIT"); /* Now the epilog. */ - asm ("\n/*@_init_PROLOG_ENDS*/"); - asm ("\n/*@_init_EPILOG_BEGINS*/"); + __asm__ ("\n/*@_init_PROLOG_ENDS*/"); + __asm__ ("\n/*@_init_EPILOG_BEGINS*/"); SECTION(".init"); } -asm ("END_INIT"); +__asm__ ("END_INIT"); /* End of the _init epilog, beginning of the _fini prolog. */ -asm ("\n/*@_init_EPILOG_ENDS*/"); -asm ("\n/*@_fini_PROLOG_BEGINS*/"); +__asm__ ("\n/*@_init_EPILOG_ENDS*/"); +__asm__ ("\n/*@_fini_PROLOG_BEGINS*/"); SECTION (".fini"); extern void _fini (void); @@ -98,9 +98,9 @@ _fini (void) { /* End of the _fini prolog. */ - asm ("ALIGN"); - asm ("END_FINI"); - asm ("\n/*@_fini_PROLOG_ENDS*/"); + __asm__ ("ALIGN"); + __asm__ ("END_FINI"); + __asm__ ("\n/*@_fini_PROLOG_ENDS*/"); { /* Let GCC know that _fini is not a leaf function by having a dummy @@ -111,14 +111,14 @@ _fini (void) } /* Beginning of the _fini epilog. */ - asm ("\n/*@_fini_EPILOG_BEGINS*/"); + __asm__ ("\n/*@_fini_EPILOG_BEGINS*/"); SECTION (".fini"); } -asm ("END_FINI"); +__asm__ ("END_FINI"); /* End of the _fini epilog. Any further generated assembly (e.g. .ident) is shared between both crt files. */ -asm ("\n/*@_fini_EPILOG_ENDS*/"); -asm ("\n/*@TRAILER_BEGINS*/"); +__asm__ ("\n/*@_fini_EPILOG_ENDS*/"); +__asm__ ("\n/*@TRAILER_BEGINS*/"); /* End of file. */ diff --git a/libpthread/linuxthreads/sysdeps/s390/pspinlock.c b/libpthread/linuxthreads/sysdeps/s390/pspinlock.c index f963f3537..98be504e1 100644 --- a/libpthread/linuxthreads/sysdeps/s390/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/s390/pspinlock.c @@ -34,7 +34,7 @@ int __pthread_spin_lock (pthread_spinlock_t *lock) { - asm volatile(" basr 1,0\n" + __asm__ __volatile__(" basr 1,0\n" "0: slr 0,0\n" " cs 0,1,%1\n" " jl 0b\n" @@ -49,7 +49,7 @@ __pthread_spin_trylock (pthread_spinlock_t *lock) { int oldval; - asm volatile(" slr %1,%1\n" + __asm__ __volatile__(" slr %1,%1\n" " basr 1,0\n" "0: cs %1,1,%0" : "=m" (*lock), "=&d" (oldval) @@ -62,7 +62,7 @@ weak_alias (__pthread_spin_trylock, pthread_spin_trylock) int __pthread_spin_unlock (pthread_spinlock_t *lock) { - asm volatile(" xc 0(4,%0),0(%0)\n" + __asm__ __volatile__(" xc 0(4,%0),0(%0)\n" " bcr 15,0" : : "a" (lock) : "memory" ); return 0; diff --git a/libpthread/linuxthreads/sysdeps/sh/pspinlock.c b/libpthread/linuxthreads/sysdeps/sh/pspinlock.c index 2dec849d3..c4e333a74 100644 --- a/libpthread/linuxthreads/sysdeps/sh/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/sh/pspinlock.c @@ -27,7 +27,7 @@ __pthread_spin_lock (pthread_spinlock_t *lock) unsigned int val; do - asm volatile ("tas.b @%1; movt %0" + __asm__ __volatile__ ("tas.b @%1; movt %0" : "=r" (val) : "r" (lock) : "memory"); @@ -43,7 +43,7 @@ __pthread_spin_trylock (pthread_spinlock_t *lock) { unsigned int val; - asm volatile ("tas.b @%1; movt %0" + __asm__ __volatile__ ("tas.b @%1; movt %0" : "=r" (val) : "r" (lock) : "memory"); diff --git a/libpthread/linuxthreads/sysdeps/sh/tls.h b/libpthread/linuxthreads/sysdeps/sh/tls.h index 027be4bf4..350d129db 100644 --- a/libpthread/linuxthreads/sysdeps/sh/tls.h +++ b/libpthread/linuxthreads/sysdeps/sh/tls.h @@ -91,7 +91,7 @@ typedef struct /* Install new dtv for current thread. */ # define INSTALL_NEW_DTV(dtv) \ ({ tcbhead_t *__tcbp; \ - __asm __volatile ("stc gbr,%0" : "=r" (__tcbp)); \ + __asm__ __volatile__ ("stc gbr,%0" : "=r" (__tcbp)); \ __tcbp->dtv = (dtv);}) /* Return dtv of given thread descriptor. */ @@ -102,25 +102,25 @@ typedef struct special attention since 'errno' is not yet available and if the operation can cause a failure 'errno' must not be touched. */ # define TLS_INIT_TP(tcbp, secondcall) \ - ({ __asm __volatile ("ldc %0,gbr" : : "r" (tcbp)); 0; }) + ({ __asm__ __volatile__ ("ldc %0,gbr" : : "r" (tcbp)); 0; }) /* Return the address of the dtv for the current thread. */ # define THREAD_DTV() \ ({ tcbhead_t *__tcbp; \ - __asm __volatile ("stc gbr,%0" : "=r" (__tcbp)); \ + __asm__ __volatile__ ("stc gbr,%0" : "=r" (__tcbp)); \ __tcbp->dtv;}) /* Return the thread descriptor for the current thread. */ # undef THREAD_SELF # define THREAD_SELF \ ({ struct _pthread_descr_struct *__self; \ - __asm ("stc gbr,%0" : "=r" (__self)); \ + __asm__ ("stc gbr,%0" : "=r" (__self)); \ __self - 1;}) # undef INIT_THREAD_SELF # define INIT_THREAD_SELF(descr, nr) \ ({ struct _pthread_descr_struct *__self = (void *) descr; \ - __asm __volatile ("ldc %0,gbr" : : "r" (__self + 1)); \ + __asm__ __volatile__ ("ldc %0,gbr" : : "r" (__self + 1)); \ 0; }) # define TLS_MULTIPLE_THREADS_IN_TCB 1 @@ -149,7 +149,7 @@ typedef struct # define NONTLS_INIT_TP \ do { \ static const tcbhead_t nontls_init_tp = { .multiple_threads = 0 }; \ - __asm __volatile ("ldc %0,gbr" : : "r" (&nontls_init_tp)); \ + __asm__ __volatile__ ("ldc %0,gbr" : : "r" (&nontls_init_tp)); \ } while (0) # endif /* __ASSEMBLER__ */ diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c index a67dbf901..812c7ff2a 100644 --- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/sparc/sparc32/pspinlock.c @@ -25,7 +25,7 @@ int __pthread_spin_lock (pthread_spinlock_t *lock) { - asm volatile + __asm__ __volatile__ ("1: ldstub [%0], %%g2\n" " orcc %%g2, 0x0, %%g0\n" " bne,a 2f\n" @@ -48,7 +48,7 @@ int __pthread_spin_trylock (pthread_spinlock_t *lock) { int result; - asm volatile + __asm__ __volatile__ ("ldstub [%1], %0" : "=r" (result) : "r" (lock) diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c index 04f588bed..7e55df414 100644 --- a/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/sparc/sparc32/sparcv9/pspinlock.c @@ -26,7 +26,7 @@ int __pthread_spin_lock (pthread_spinlock_t *lock) { - asm volatile + __asm__ __volatile__ ("1: ldstub [%0], %%g2\n" " brnz,pn %%g2, 2f\n" " membar #StoreLoad | #StoreStore\n" @@ -48,7 +48,7 @@ int __pthread_spin_trylock (pthread_spinlock_t *lock) { int result; - asm volatile + __asm__ __volatile__ ("ldstub [%1], %0\n" "membar #StoreLoad | #StoreStore" : "=r" (result) @@ -62,7 +62,7 @@ weak_alias (__pthread_spin_trylock, pthread_spin_trylock) int __pthread_spin_unlock (pthread_spinlock_t *lock) { - asm volatile + __asm__ __volatile__ ("membar #StoreStore | #LoadStore\n" "stb %%g0, [%0]" : diff --git a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c b/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c index 92b84f510..e0c350e6b 100644 --- a/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/sparc/sparc64/pspinlock.c @@ -25,7 +25,7 @@ int __pthread_spin_lock (pthread_spinlock_t *lock) { - asm volatile + __asm__ __volatile__ ("1: ldstub [%0], %%g5\n" " brnz,pn %%g5, 2f\n" " membar #StoreLoad | #StoreStore\n" @@ -47,7 +47,7 @@ int __pthread_spin_trylock (pthread_spinlock_t *lock) { int result; - asm volatile + __asm__ __volatile__ ("ldstub [%1], %0\n" "membar #StoreLoad | #StoreStore" : "=r" (result) @@ -61,7 +61,7 @@ weak_alias (__pthread_spin_trylock, pthread_spin_trylock) int __pthread_spin_unlock (pthread_spinlock_t *lock) { - asm volatile + __asm__ __volatile__ ("membar #StoreStore | #LoadStore\n" "stb %%g0, [%0]" : diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mq_notify.c b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mq_notify.c index 2ec11bf68..eace94c86 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mq_notify.c +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/mq_notify.c @@ -87,7 +87,7 @@ notification_function (void *arg) { /* Copy the function and parameter so that the parent thread can go on with its life. */ - volatile union notify_data *data = (volatile union notify_data *) arg; + __volatile__ union notify_data *data = (__volatile__ union notify_data *) arg; void (*fct) (union sigval) = data->fct; union sigval param = data->param; diff --git a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/fork.h b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/fork.h index 793cb1d5f..b736526c1 100644 --- a/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/fork.h +++ b/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sparc/fork.h @@ -24,7 +24,7 @@ register long __o0 __asm__ ("o0"); \ register long __o1 __asm__ ("o1"); \ register long __g1 __asm__ ("g1") = __NR_fork; \ - __asm __volatile (__SYSCALL_STRING \ + __asm__ __volatile__ (__SYSCALL_STRING \ : "=r" (__g1), "=r" (__o0), "=r" (__o1) \ : "0" (__g1) \ : __SYSCALL_CLOBBERS); \ diff --git a/libpthread/linuxthreads/sysdeps/x86_64/pspinlock.c b/libpthread/linuxthreads/sysdeps/x86_64/pspinlock.c index e1b2a6684..b43d4ac8d 100644 --- a/libpthread/linuxthreads/sysdeps/x86_64/pspinlock.c +++ b/libpthread/linuxthreads/sysdeps/x86_64/pspinlock.c @@ -33,7 +33,7 @@ int __pthread_spin_lock (pthread_spinlock_t *lock) { - asm volatile + __asm__ __volatile__ ("\n" "1:\n\t" "lock; decl %0\n\t" @@ -56,7 +56,7 @@ __pthread_spin_trylock (pthread_spinlock_t *lock) { int oldval; - asm volatile + __asm__ __volatile__ ("xchgl %0,%1" : "=r" (oldval), "=m" (*lock) : "0" (0)); @@ -68,7 +68,7 @@ weak_alias (__pthread_spin_trylock, pthread_spin_trylock) int __pthread_spin_unlock (pthread_spinlock_t *lock) { - asm volatile + __asm__ __volatile__ ("movl $1,%0" : "=m" (*lock)); return 0; diff --git a/libpthread/linuxthreads/sysdeps/x86_64/tls.h b/libpthread/linuxthreads/sysdeps/x86_64/tls.h index d67275c10..5e7239d17 100644 --- a/libpthread/linuxthreads/sysdeps/x86_64/tls.h +++ b/libpthread/linuxthreads/sysdeps/x86_64/tls.h @@ -108,7 +108,7 @@ typedef struct /* For now the thread descriptor is at the same address. */ \ head->self = _descr; \ \ - asm volatile ("syscall" \ + __asm__ __volatile__ ("syscall" \ : "=a" (_result) \ : "0" ((unsigned long int) __NR_arch_prctl), \ "D" ((unsigned long int) ARCH_SET_FS), \ |