Go to the documentation of this file. 1 #ifndef _ASM_MICROBLAZE_CMPXCHG_H
2 #define _ASM_MICROBLAZE_CMPXCHG_H
8 static inline unsigned long __xchg(
unsigned long x,
volatile void *
ptr,
17 ret = *(
volatile unsigned char *)ptr;
18 *(
volatile unsigned char *)ptr = x;
24 ret = *(
volatile unsigned long *)ptr;
25 *(
volatile unsigned long *)ptr = x;
36 #define xchg(ptr, x) \
37 ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))