Re: The IO problem on multiple PCI busses

Jeff Garzik
2001-03-03T11:02:02Z

Benjamin Herrenschmidt wrote:
>
> >No, don't do this, it is evil. Use mappings, specify the device
> >related info somehow when creating the mapping (in the userspace
> >variant you do this by openning a specific device to mmap, in the
> >kernel variant you can encode the bus/dev/etc. info in the device's
> >resource and decode this at ioremap() time, see?).
>
> Well, except that drivers doing IOs don't ioremap...
>
> Maybe we could define an ioremap-like function for IOs, but the more

I/O is not supposed to be fast, that's what MMIO is for. :) Just do

void outb (u8 val, u16 addr)
{
void *addr = ioremap (ISA_IO_BASE + addr);
if (addr) {
writeb (val, addr);
iounmap (addr);
}
}

You can map and unmap for each call :) Ugly and slow, but hey, it's
I/O...

--
Jeff Garzik | "You see, in this world there's two kinds of
Building 1024 | people, my friend: Those with loaded guns
MandrakeSoft | and those who dig. You dig." --Blondie