lkml.org 
[lkml]   [2003]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 2.5] VGA IO on systems with multiple PCI IO domains
On Mon, Jan 27, 2003 at 10:46:45AM +0100, Martin Mares wrote:
> > What about some kind of ioport_remap() that would take a pci_bus and an
> > port range as arguments ? If pci_bus is NULL, that would match a
> > "legacy" ISA bus (non-PCI machine or default ISA bus for machines where
> > that makes sense).
> >
> > What do you think ?
>
> Looks good, but maybe we should use some other functions than iob() et al.
> to do I/O on the remapped addresses.

What about this (what we'd have on alpha):

int
legacy_ioport_remap(struct resource *res)
{
switch (res->start) {
case 0x3c0: /* VGA */
res->start += pci_vga_hose->io_space->start;
res->end += pci_vga_hose->io_space->start;
case ???
...
default:
return -ENODEV;
}
return request_resource(pci_vga_hose->io_space, res);
}

void
legacy_ioport_unmap(struct resource *res)
{
release_resource(res);
}

Then vgacon.c would be changed like this:

...
- request_resource(&ioport_resource, &vga_console_resource);
+ if (legacy_ioport_remap(&vga_console_resource) < 0)
+ goto failure;
...

And all in/out port calls would use respective resource.start+offset:
...
- outb_p(6, 0x3ce)
+ outb_p(6, vga_console_resource.start + 0xe);

No need for other special IO functions then.

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

\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.948 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site