Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 20 Feb 2001 15:18:41 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 20 Feb 2001 15:18:31 -0500 Received: from chaos.analogic.com ([204.178.40.224]:7296 "EHLO chaos.analogic.com") by vger.kernel.org with ESMTP id ; Tue, 20 Feb 2001 15:18:15 -0500 Date: Tue, 20 Feb 2001 15:17:39 -0500 (EST) From: "Richard B. Johnson" Reply-To: root@chaos.analogic.com To: hiren_mehta@agilent.com cc: linux-kernel@vger.kernel.org Subject: Re: can somebody explain barrier() macro ? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 20 Feb 2001 hiren_mehta@agilent.com wrote: > Hi, > > barrier() is defined in kernel.h as follows : > > #define barrier() __asm__ __volatile__("": : :"memory") > > > what does this mean ? is this like "nop" ? > It tells the compiler that memory was, or is about to be, modified. Therefore, the complier must put back into memory anything it was caching, and after the barrier, it must re-read anything it uses from memory. It, itself, generates no code, but the compiler will usually spew out some 'extra' instructions as a result of this, so it isn't a "nop". Cheers, Dick Johnson Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips). "Memory is like gasoline. You use it up when you are running. Of course you get it all back when you reboot..."; Actual explanation obtained from the Micro$oft help desk. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/