Re: readl/writel and memory barriers

From: David Mosberger (davidm@hpl.hp.com)
Date: Tue Feb 19 2002 - 12:10:44 EST


>>>>> On Mon, 18 Feb 2002 20:45:29 -0500, "Dan Maas" <dmaas@dcine.com> said:

  Dan> In a quick survey of architectures that need explicit memory
  Dan> barriers to enforce ordering of PCI accesses, it seems that
  Dan> alpha and PPC include memory barriers inside readl() and
  Dan> writel(), whereas MIPS, sparc64, ia64, and s390 do not include
  Dan> them. (I'm not intimately familiar with these architectures so
  Dan> forgive me if I got some wrong...). What is the official story
  Dan> here?

On ia64, the fact that readl()/writel() are accessing uncached space
ensures the CPU doesn't reorder the accesses. Furthermore, the
accesses are performed through "volatile" pointers, which ensures that
the compiler doesn't reorder them (and, as a side-effect, such
pointers also generate ordered loads/stores, but this isn't strictly
needed, due to accessing uncached space).

        --david
-
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:20 EST