#ifndef _INCLUDE_API_H
-static __attribute__((always_inline))
+static inline __attribute__((always_inline))
unsigned int atomic_exchange_32(volatile unsigned int *addr, unsigned int val)
{
unsigned int result;
#if (BITS_PER_LONG == 64)
-static __attribute__((always_inline))
+static inline __attribute__((always_inline))
unsigned long atomic_exchange_64(volatile unsigned long *addr,
unsigned long val)
{
#endif
-static __attribute__((always_inline))
+static inline __attribute__((always_inline))
unsigned long _atomic_exchange(volatile void *addr, unsigned long val, int len)
{
switch (len) {
return 0;
}
-#define xchg(addr, v) (__typeof__(*(addr))) _atomic_exchange((addr), (v), \
- sizeof(*(addr)))
+#define xchg(addr, v) \
+ (__typeof__(*(addr))) _atomic_exchange((addr), (unsigned long)(v), \
+ sizeof(*(addr)))
#endif /* #ifndef _INCLUDE_API_H */