Re: can somebody explain barrier() macro ?

From: Alan Cox (
Date: Tue Feb 20 2001 - 16:02:09 EST

> barrier() is defined in kernel.h as follows :
> #define barrier() __asm__ __volatile__("": : :"memory")
> what does this mean ? is this like "nop" ?

Its adds an empty piece of assembler (ie no code) and declares that this
non code causes effects on memory. That forces gcc to writeback before the
barrier and reload cached values afterwards
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Fri Feb 23 2001 - 21:00:23 EST