Subject: Re: Correct use of bus_space functions
To: Martin Husemann <martin@duskware.de>
From: Nathan J. Williams <nathanw@wasabisystems.com>
List: tech-kern
Date: 01/07/2003 19:42:30
Martin Husemann <martin@duskware.de> writes:

> On Tue, Jan 07, 2003 at 11:56:02PM +0000, Martin J. Laubach wrote:
> 
> >   A part from that gcc-ismic thing of misusing a macro as a function, 
> > is the bus_space_barrier() correct or not?
> 
> This depends on the context. Doing it the way OpenBSD did is the big
> hammer to make it safe everywhere, at the cost of performance.
> 
> Sprinkling some bus_space_barriers explicitly in the driver at the
> right (few) points is a better way to handle this.

Most (all?) of our bus_space implementations on systems that permit
memory reordering already have barriers built in to the bus_space
operations. This is an unfortunate accomodation to the fact that most
of our drivers don't have any barriers, much less properly placed
ones, and are developed on platforms (like i386) with in-order memory
operations. It might be nice to change this some day.

The OpenBSD form would be redundant in our current state of affairs,
and the bare bus_space is sufficent.

        - Nathan