Re: [PATCH] add legacy I/O and memory access routines to

Benjamin Herrenschmidt
2004-12-16T14:55:22Z

On Wed, 2004-12-15 at 09:00 -0800, Jesse Barnes wrote:

> Good, because that's exactly what it does. The arch is responsible for
> returning the legacy I/O port or legacy ISA memory base address given a
> pci_dev, which is used as a base for the page offset passed into mmap. So
> e.g. mmap(..., 0xa0000) after doing ioctl(fd, PCIIOC_MMAP_IS_LEGACY_MEM, ...)
> would get you the VGA framebuffer for the device corresponding to 'fd'.

Sounds good... The only thing is a pci_dev may not be available if you
have a PCI->ISA bridge, tho you may just use the pci_dev of the
bridge...

> > There is some work done by Jon Smirl in this area (a VGA access
> > arbitration driver).
>
> I think Dave Airlie did a version of the vga class driver, and the backend
> used for /proc/bus/pci could be used for both drivers. I'm
> using /proc/bus/pci because it's available now and nearly good enough (i.e.
> this patch was all I needed to get going).
>
> Anyway, I'll post another version with Bjorn's suggestion about the ioctl for
> choosing config or legacy I/O port read/writes, since it looks like the rest
> of your concerns are dealt with.
>
> Thanks,
> Jesse
--
Benjamin Herrenschmidt <benh@kernel.crashing.org>