Re: readb vs isa_readb

Alan Cox (alan@lxorguk.ukuu.org.uk)
Fri, 10 Dec 1999 18:09:19 +0000 (GMT)


> Could you elaborate on the differences here? I noticed that you changed
> the ibmtr-driver to use the latter form, and from my understanding, ibmtr
> is used by the mca-version of the adapter as well, so isa_readb can't
> really be an isa-only function?!
>
> Oh, and is there corresponding versions for inb, outb too?! If so, what
> version should mca.c use? I'm still experiencing a strange panic on boot

Ok I've cc'd the reply back to include linux-kernel as this is probably
generally useful

In historical days the ISA memory space was mapped at the same physical address
as virtual address. Programs poked around with 0xD0000 etc and the right things
happened. PCI required that we map high memory areas and also required we
do remapping as we can't physically map all of PCI space, and 3 gigs of
application space.

2.3 finally breaks the ability to go using ISA space addresses directly as you
could before. There are two ways to deal with this. You can either use
ioremap() (which also works fine on 2.2 for this) or you can use the isa_
macros which are meant to make porting more easy.

You will get log messages if you just use readb/writeb without an ioremap or
the isa_...

MCA uses the same memory area as ISA so the macros work for MCA bus too and
if you wanted you could define an mca_readb() etc. On the other hand that
misleads people into writing code like

if(mca) x=mca_readb(foo); else x=isa_readb(foo)

If you need to support both ISA and PCI then you need to use ioremap and readb.

Finally it doesn't affect I/O port space because that isnt part of the memory
mapping process.

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/