[PATCH 1/9][v2][BZ 16892] Add linux-generic lowlevellock.h

Andreas Schwab schwab@linux-m68k.org
Sat Jun 14 20:23:00 GMT 2014


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."



More information about the Libc-alpha mailing list