Re: readl/writel and memory barriers

From: Jesse Barnes (jbarnes@sgi.com)
Date: Tue Feb 19 2002 - 17:17:04 EST


On Wed, Feb 20, 2002 at 09:05:37AM +1100, Keith Owens wrote:
> On Tue, 19 Feb 2002 10:35:06 -0800,
> Jesse Barnes <jbarnes@sgi.com> wrote:
> >Making a variable volatile doesn't guarantee that the compiler won't
> >reorder references to it, AFAIK.
>
> Ignoring the issue of hardware that reorders I/O, volatile accesses
> must not be reordered by the compiler. From a C9X draft (1999, anybody
> have the current C standard online?) :-

Of course volatile references must be ordered wrt each other, but a
reference to a volatile doesn't preclude the compiler from moving it
above or below accesses to other variables. That is, it doesn't act
as an optimization barrier. Sound right? I guess I'm getting a
little off-topic here...

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



This archive was generated by hypermail 2b29 : Sat Feb 23 2002 - 21:00:22 EST