[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

atomic_add ?



Hi,

Can anybody explain what is going on this function?

static __inline__ void atomic_add(int i, atomic_t *v)
{
     __asm__ __volatile__(
               LOCK "addl %1,%0"
               :"=m" (v->counter)
               :"ir" (i), "m" (v->counter));
}

I understand that the LOCK (0xf0) makes the instruction atomic on systems
with multiple cpus. But besides that what is .. "=m", :"ir" etc?

-Learner


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/