Subject: Re: change bus_space_barrier() semantic
To: Wolfgang Solfrank <ws@tools.de>
From: Garrett D'Amore <garrett_damore@tadpole.com>
List: tech-kern
Date: 01/11/2006 04:49:03
Wolfgang Solfrank wrote:

> Huh?
>
> Obviously, converting a compile time option into a run time option is 
> easy.


The point you make below is obvious (now :-).  I don't know why I didn't 
think of it right away.  I'll shut up now before I embarrass myself any 
further. :-)

    -- Garrett

> In your case, you could have something like
>
> typedef struct {
>     int    implicit_barrier;
>     ...
> } *bus_space_handle_t;
>
> int
> bus_space_map_barrier(bus_space_tag_t space, bus_addr_t address,
>     bus_space_size_t size, int flags, bus_space_handle_t *handlep,
>     int implicit_barrier)
> {
>     *handlep = ...
>     (*handlep)->implicit_barrier = implicit_barrier;
>     ...
> }
>
> #ifdef    USE_IMPLICIT
> #define    bus_space_map(s, a, sz, f, h)    \
>     bus_space_map_barrier((s), (a), (sz), (f), (h), 1)
> #else
> #define    bus_space_map(s, a, sz, f, h)    \
>     bus_space_map_barrier((s), (a), (sz), (f), (h), 0)
> #endif
>
> And testing the implicit_barrier flag in the bus_space_* access functions
> (as you would have to do with your approach anyway).
>
> Or are you thinking about something else?
>
> Ciao,
> Wolfgang