I am trying to compile the arm inline assembly code for ARMV7 to compare and swap atomically, basically i have copied the code from ARM linux kernel but somehow it doesnt compile. it gives the below error
Erro: thumb conditional instruction should be in IT block -- strexeq r5,r1,[r3]
. below is the code
static inline int
dfp_atomic32_cmpset(volatile uint32_t *dst, uint32_t exp, uint32_t src)
{
unsigned long oldval, res;
smp_mb();
do {
__asm__ __volatile__("@ dfp_atomic32_cmpset\n"
"ldrex %1, [%3]\n"
"mov %0, #0\n"
"teq %1, %4\n"
"strexeq %0, %5, [%3]\n"
: "=&r" (res), "=&r" (oldval), "+Qo" (*dst)
: "r" (dst), "Ir" (exp), "r" (src)
: "cc");
} while (res);
smp_mb();
return oldval;
}
Any idea what that error means?