This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]