I user S32R274, it's a muti core MCUs and has hardware lock between cpus.
but , i think a mechanism like spin_lock/spin_lock_irqsave and atomic is needed in
so I test like
static __inline__ int atomic_add_return(int a, atomic_t *v)
"1: lwarx %0,0,%2 # atomic_add_return\n\
" stwcx. %0,0,%2 \n\
: "=&r" (t)
: "r" (a), "r" (&v->counter)
: "cc", "memory");
but it seems not a atomic operation in a concurrent scenario。
So,do anyone know how to do it and pls tell me .
thanks a lot