This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/9][v2][BZ 16892] Add linux-generic lowlevellock.h
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: Bernard Ogden <bernie dot ogden at linaro dot org>
- Cc: Richard Henderson <rth at twiddle dot net>, libc-alpha at sourceware dot org
- Date: Sat, 14 Jun 2014 22:23:33 +0200
- Subject: Re: [PATCH 1/9][v2][BZ 16892] Add linux-generic lowlevellock.h
- Authentication-results: sourceware.org; auth=none
- References: <E10DC0AF-A48B-4EC7-8EA4-0A3D3EF6BDD7 at linaro dot org> <5398A441 dot 9080603 at twiddle dot net> <43ED977F-8000-48AD-9E57-DD78E0ACB36A at linaro dot org>
Bernard Ogden <bernie.ogden@linaro.org> writes:
> +static inline int __attribute__ ((always_inline))
> +__lll_trylock (int *futex)
> +{
> + return atomic_compare_and_exchange_bool_acq (futex, 1, 0);
> +}
You cannot use inlines here, it breaks coldfire:
In file included from ../sysdeps/unix/sysv/linux/m68k/coldfire/sysdep.h:21:0,
from x.c:1:
../sysdeps/unix/sysv/linux/lowlevellock.h: In function â__lll_trylockâ:
../sysdeps/unix/sysdep.h:34:31: error: âSYS_atomic_cmpxchg_32â undeclared (first use in this function)
#define SYS_ify(syscall_name) SYS_##syscall_name
^
../sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits/atomic.h:74:29: note: in expansion of macro âSYS_ifyâ
= (__typeof (oldval)) SYS_ify (atomic_cmpxchg_32); \
^
../include/atomic.h:138:6: note: in expansion of macro âatomic_compare_and_exchange_val_acqâ
atomic_compare_and_exchange_val_acq (mem, newval, __atg3_old) \
^
../sysdeps/unix/sysv/linux/lowlevellock.h:186:10: note: in expansion of macro âatomic_compare_and_exchange_bool_acqâ
return atomic_compare_and_exchange_bool_acq (futex, 1, 0);
^
../sysdeps/unix/sysdep.h:34:31: note: each undeclared identifier is reported only once for each function it appears in
#define SYS_ify(syscall_name) SYS_##syscall_name
^
../sysdeps/unix/sysv/linux/m68k/coldfire/nptl/bits/atomic.h:74:29: note: in expansion of macro âSYS_ifyâ
= (__typeof (oldval)) SYS_ify (atomic_cmpxchg_32); \
^
../include/atomic.h:138:6: note: in expansion of macro âatomic_compare_and_exchange_val_acqâ
atomic_compare_and_exchange_val_acq (mem, newval, __atg3_old) \
^
../sysdeps/unix/sysv/linux/lowlevellock.h:186:10: note: in expansion of macro âatomic_compare_and_exchange_bool_acqâ
return atomic_compare_and_exchange_bool_acq (futex, 1, 0);
^
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."