Subject: Re: Making the zs driver trully MI
To: Bill Studenmund <wrstuden@zembu.com>
From: Steve Woodford <scw@netbsd.org>
List: tech-kern
Date: 09/19/2000 09:00:00
On Mon, 18 Sep 2000, Bill Studenmund wrote:

> On Sat, 16 Sep 2000, Steve Woodford wrote:
> 
> > My plan is to put a __BROKEN_ZS_DRIVER_ATTACHMENT define in the
> > <machine/types.h> file of each port which currently has a
> > <machine/z8530var.h>, and modify the zs driver to conditionally present
> > the original not-quite-MI attachment interface or a new proper-MI
> > interface depending on this #define. (Note: alpha and sgimips have a
> > <machine/z8530var.h> header file, but don't seem to use the driver!)
> 
> Please don't do it this way. :-) Just move everyone to a better MI
> interface. :-)

In an ideal world, that's what I'd do. :-)

Unfortunately most ports use the code for their console and I have no way
to test it on anything but mvme68k. I phear the brickage which would ensue
should I screw it up. ;-}

> I'd recomend doing something a little different. Add a pointer to a table
> of functions to either the zsc or channlestate structures (which ever
> makes more sense). Then have the zsc attachment just fill this in. As all
> of the zsc attachment is done in MD (or bus dependent) code, you won't
> need to do anything in the MI code.

This is one avenue I considered, and it is the most portable way. I'm just
not sure our older platforms could stand the performance hit of 
indirecting through a function pointer for every register read/write...
(Which is actually a double indirection, since the table pointer needs to
be fetched first. I guess the compiler's optimiser would help here :)

Cheers, Steve