Subject: Re: diff betw. bus_space_{read,write} and
To: None <Guenther.Grau@bk.bosch.de>
From: Ken Nakata <kenn@synap.ne.jp>
List: tech-kern
Date: 08/25/1998 19:35:36
On Tue, 25 Aug 1998 12:00:21 +0200, Guenther Grau wrote:
> 
> First of all, IMHO, the Atari solution is the "correct" one,

I agree.

> as that is the way the bus_dma stuff was designed to work (that is,
> if I understood it properly :-).

Well, mac68k has yet to have bus_dma impelemented.

> But in real life we might not always be able to or want (due to
> various reasons) to implement the correct solution. In this case you
> claim that we shouldn't do so, because we have to expect a
> performance hit.

I did not say we (who's "we", anyway?) should not implement it in
atari way.  I just think it's too much only for the IDE bus.  Nothing
else on mac68k requires byte-swapping by bus_space methods.

> IMHO, you should implement the Atari solution on the mac68k, which
> shouldn't be all that different, and do some measurements with this
> version compared to a modified wdc for the mac68k.

In principle, I agree with you, but in reality, I wouldn't expect such
a measurement done on mac68k to be all that reliable, due to the
infamous clock interrupt priority botch in the Macintosh hardware.  We
lose a few minutes every hour on mac68k if we do anything at all.
There's a kernel compile going on for two hours or so, and I already
lost about 20 minutes.  It's that bad on mac68k.

> Sometimes you cannot tell from just looking at the code if something
> is a performance hit, or not.  Thus real numbers are a base to make
> decisions from :-)

In general, of course.  Though I think it's pretty obvious in this
particular case.

But I like Jason's idea.  Scott, Allen and I were talking about how we
could use the MI wdc driver the other day, and Scott mentioned sparse
bus_space which is implemented in atari.  He said he had considered
implementing it but had not because of a performance hit which would
have been added to every bus_space method, not just the accesses on
sparse spaces.  With Jason's idea, I think it's possible to implement
sparse space methods as well as byte-swapping methods without adding
much overhead to non-sparse, non-byte-swapping methods.

Later,

Ken