Re: mb()!!

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

 



Ketan Mukadam wrote:
> Hi all,
> 
> I was going through the code of __wait_event in sched.c [ kernel 2.2.19] and i
> came across a MACRO mb(), and it was defined in asm-i386/system.h as following
> 
> #define mb()    __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
> 
> I don't know what this MACRO does?? [ I actually don't know assembly ]
> 
> Can anyone help me?? 

mb() stands for 'memory barrior'... it is a command to prevent the 
compiler from re-ordering memory accesses across that point.

Eli
--------------------. "If it ain't broke now,
Eli Carter           \                  it will be soon." -- crypto-gram
eli.carter(a)inet.com `-------------------------------------------------

--
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