On Thu, 12 Oct 2000, Benjamin Herrenschmidt wrote:
> Note to linux-kenrel readers: This discussion is the Nth attempt to find
> a solution to handle both legacy IOs and PCI IOs on machines with several
> IO busses memory mapped at different locations in the CPU space.

> Linus: Would you accept this change now ?
> 
> #define ISA_PORT(n)     (n)
> 
> And change to _all_ drivers doing legacy IOs to use that in their in/out
> macros ?

    [...]

> My "pet" solution would be to have all legacy drivers request an IO base
> this way
> 
>   base = isa_get_IO_base(legacy_addr);
> 
> The isa_get_IO_base function could then be "tweaked" to recognize known
> legacy addresses and return different bases. (There might still be
> problems with VGA vs. parallell, I don't know x86 world well enough to be
> sure).

Or, more general, treat [PCI] I/O space similar to [PCI] memory space. Just
like we must use ioremap() for memory space:

    cookie = ioremap(memory_space_address, size);
    x = readb(cookie+offset);

we could have ioportremap() for I/O space:

    cookie = ioportremap(io_space_address, size);
    x = inb(cookie+offset);

On PC, ioportremap(x) would evaluate to (x). On other platforms, we can do
whatever we want.

Gr{oetje,eeting}s,

                                                Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [EMAIL PROTECTED]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                                            -- Linus Torvalds

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/

Reply via email to