atomic_add ?

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

 



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/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux