Subject: Re: Proposed extension to bus.h interface
To: Matthias Drochner <>
From: Chris G Demetriou <>
List: tech-kern
Date: 08/16/1996 12:36:05
> Excerpts from netbsd: 15-Aug-96 Re: Proposed extension to b.. Jason
> Thorpe@nas.nasa.go (893)
> >  > Wouldn't bus_io_{alloc,free}() be better as bus_mem_{alloc,free}() with
> >  > a different chipset tag?  All you're doing is allocating from a different
> >  > address space.
> > 
> > No, because the chipset tag identifies the bus, in the particular case 
> > I'm thinking about, "ISA", or a particular implementation of "ISA".  
> > Otherwise, by your suggestion, we'd only have bus_mem_*(), and the 
> > bus_io_*() functions would be gone completely.
> Think of VME bus, there are lots of address spaces (at least the 3
> address widths must be separated, BLT must be handled).
> How to avoid to write
>  bus_mem_A{16,24,32}_{SGL,BLT,BLT64}_{alloc,free}() ?

Well, all implementations of VME code i've seen so far use seperate
attributes to attach devices to the 16/24/32 spaces, and that
indicates to me that they're perfect candidates for being their own
chipsets, and having their own chipset tags.

I have no idea what BLT is...  (Well, i do, but i wouldn't want 64 of
them, especially if they included the tomatoes...  8-)

> In an ideal world, I would drop the bus_io_*() at all, and
> introduce a space patameter to the bus_mem_{map,alloc}* functions.
> The only reason for this split seems to be the ability to use
> macros for the io on the i386. Somebody investigated the
> performance loss caused by replacing the macros by
> (indirect) function calls?

My original implementation of these ideas was such that it would have
required indirect function calls on the i386.  Charles told me flat
out, no way was he going to allow that overhead.  I thought at the
time that it was stupid to say that without measurement, and still do,
but pretty much everybody here knows that putting the effort into
arguing the point would have been a waste.  8-)

It's worth noting that if you want to use chipsets at all on the i386,
you need to change the bus_* macro definitions.  Right now, they're
written so that they can only handle the 'standard' stuff.  (Were you
to do this, i'd suggest changing them to something like:

	(tag == NULL ? current action : indirect chipset function call)