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/