Subject: Re: Nubus card debugging
To: Daniel R. Killoran,Ph.D. <drk@shore.net>
From: David A. Gatwood <dgatwood@gatwood.net>
List: port-mac68k
Date: 08/04/2002 21:13:47
On Sun, 4 Aug 2002, Daniel R. Killoran,Ph.D. wrote:

> David A. Gatwood wrote:
> >
> >And why does this code appear to read from the same hardware address
> >several times in a row?  Is that by design, or did I break something while
> >porting it?  (or both... :-)
> >
> 
> "Reading" a hardware address is not always done with the intention of 
> obtaining its contents. Often it is done to clear a flag. This will 
> often be the case when the address is that of a hardware register on 
> the board.
> Alternatively, it might be waiting for a flag to be raised.

It's the generic nubus slot probe support, though (nubus.c).  I could
certainly understand pounding something a couple of times to make sure,
for example, that there's no interrupt pending on some line, but...
reading a single byte eight times in a row and checking the value to make
sure it's reasonable... weird.

Okay, looking at the Linux nubus support, I understand.  It implements an
identical algorithm, except shifting the reads out one level, where it
isn't being repeatedly re-read.

The more I think about this, the more I wonder if the VM system is doing
something nasty with the mapping behind my back.  I think I'm going to end
up slogging through Mach VM again.  Ugh.  Maybe I can kick it just enough
to work for probing and fall back to the non-removable io_map mapping once
we know something is there....  :-}


Later,
David

---------------------------------------------------------------------
David A. Gatwood                                dgatwood@gatwood.net
Developer Docs Writer                             dgatwood@apple.com
Apple Computer                                  dgatwood@mklinux.org

                    Check out my weekly web comic:
                     http://www.techmagazine.org