On Tue, 22 Mar 2005 16:48:14 +0000
David Howells <[EMAIL PROTECTED]> wrote:
> Matthew Wilcox <[EMAIL PROTECTED]> wrote:
>
> > - io_*mb() are equivalent, for io memory.
>
> I don't think these actually exist at the moment. My suggestion was that we
> rename {r,w,}mb() to io_{r,w,}mb().
This is the first time I've seen that ?mb() should order I/O
accesses. My sparc64 versions certainly don't handle that
correctly. :-) That being said, I think we're all being
educated to so me extent in this thread.
On sparc64, we have a "membar" instruction. It takes a bitmask,
and each bit says what ordering constraint is desired. So, for
example, there is a bit that says "complete all previous loads
before executing any future stores", it looks like:
membar #LoadStore
if you wanted to order previous stores with future stores as well,
you'd do something like:
membar #LoadStore | #StoreStore
Anyways, there is a special bit called "#Sync" which usually sits
by itself and it causes all previous memory operations (even deferred
ones) to complete before that membar finishes execution. This is
the only way to get deferred errors and traps (f.e. deferred store
causes memory bus error) to get signalled synchronously.
Finally, there is the #Lookaside bit which is the only way to order
cacheable vs. non-cacheable accesses. I would need to add this bit
to the ?mb() macros if I/O ordering is really required.