Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Sep 1999 14:09:47 -0600
From:      Warner Losh <imp@village.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Takahashi Yoshihiro <nyan@FreeBSD.org>, winter@jurai.net, kato@FreeBSD.org, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, FreeBSD98-hackers@jp.freebsd.org
Subject:   Re: cvs commit: src/sys/conf files src/sys/i386/conf files.i386 
Message-ID:  <199909282009.OAA05966@harmony.village.org>
In-Reply-To: Your message of "Wed, 29 Sep 1999 05:48:29 %2B1000." <Pine.BSF.4.10.9909290511240.7835-100000@alphplex.bde.org> 
References:  <Pine.BSF.4.10.9909290511240.7835-100000@alphplex.bde.org>  

next in thread | previous in thread | raw e-mail | index | archive | help
In message <Pine.BSF.4.10.9909290511240.7835-100000@alphplex.bde.org> Bruce Evans writes:
: In more detail:

I see what you are saying...  I'm not sure I necessarily agree with
its implied conclusions, however...  Must think about this some more.
It sounds like you are suggesting that it wouldn't make sense to
convert, say, the sio driver to use bus_space even though there appear
to be some wins for doing this from a flexibility point of view.  The
costs for slow machines are too high, if I understand what you are
getting at here.

: > : > bus_space_handle_t is the union instead of u_int.
: > : > 
: > : > 	union bus_space_handle {
: > : > 		bus_addr_t bsh_base;
: > : > 		bus_addr_t *bsh_iat;
: > : > 	};
: > : > 	typedef union bus_space_handle bus_space_handle_t;
: > : 
: > : Doesn't this require changing all drivers that currently use the
: > : bus space functions to be changed to initialise their sc->sc_bsh.base
: > : instead of their sc->sc_bsh?  This is uglier than casting.
: > 
: > No.  There are remarkably few drivers that do math or other naughty
: > things with their bus handle.  There are likely only 3-5 in the tree.
: > Doesn't sound like an undue burdon to me.  I had an experimental bus
: 
: It's incompatible with NetBSD, etc.  Only the first member of a union
: can be initialised statically in Standard C.

A bus_space_handle_t is an opaue data type.  All the drivers in NetBSD
that use bus_space that I've looked at are careful to only take the
bsh from the config data and never do math on it directly.  FreeBSD's
tree is a little sloppier here because bus_space was imported
incompletely into FreeBSD and isn't as religiously used as in NetBSD.
bus_space_handles are never initialized directly by the drivers, in
theory.  That's why it would be nice to have some extension to rman to
take an array of addresses from somewhere (where I'm not sure),
package that up into one struct resource * and then have the driver
get the bus_space_tag_t/handle_t from there.  Where that is, what
syntax config things need to use, etc is left up to the pc98's isa bus
extentions to cope with this...  I think this would make a good topic
for FreeBSDCon.

Warner


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199909282009.OAA05966>