[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#685750: IA64 (Itanium) Wheezy, mach64, decommissioned xorg drivers, patch proposal




Earlier, in xorg-server-core 1.11.4, the ia64 architecture had an extra module hw/xfree86/os-support/shared/ia64Pci.c
which implemented inb, inw, inl, outb, outw, outl:

static int ia64_port_to_fd(unsigned long port)
{
    return (port >> 24) & 0xffffffff;
}

void outb(unsigned long port, unsigned char val)
{
    int fd = ia64_port_to_fd(port);

    if (!fd) {
	_outb(val, port & 0xffff);
	goto out;
    }
    if (lseek(fd, port & 0xffff, SEEK_SET) == -1) {
	ErrorF("I/O lseek failed\n");
	goto out;
    }
    if (write(fd, &val, 1) != 1) {
	ErrorF("I/O write failed\n");
	goto out;
    }
 out:
    return;
}

....


The high part of the port is taken as file handle for a "legacy_io file".
If the high part is 0, the _inb, _inw, _inl, _outb, _outw, _outl functions of glibc are used.

The mentioned file handle is opened in xf86MapLegacyIO() in hw/xfree86/bus/linuxPci.c in xorg-server-core 1.11.4.

The xf86MapLegacyIO() does no longer attempt to open a "legacy_io file" in 1.12.3 (now hw/xfree86/common/xf86pciBus.c).

Thus, the mentioned hw/xfree86/os-support/shared/ia64Pci.c file with inb, inw, inl, outb, outw, outl has been removed with the mentioned patch
http://cgit.freedesktop.org/xorg/xserver/commit/?id=aa0bfb0f133481c57762012e8e30c05ffa151423

This is correct so far.

It has been noticed that the xorg-server-core declares inb, inw, inl, outb, outw, outl in its compiler.h but doesn't implement these functions.
The result was the patch
http://cgit.freedesktop.org/xorg/xserver/commit/?id=644efb43e0639af648dd46d9729c2cabd9511238
which removed the declarations of inb, inw, inl, outb, outw, outl in ia64.

Some drivers need the inb, inw, inl, outb, outw, outl functions; you could read in bug#671386 what drivers these are. These driver package couldn't be build on ia64 from now and have been removed from Debian Wheezy (ugh).

The fix is simple: we need inb, inw, inl, outb, outw, outl on ia64 which are wrappers of the glibc functions _inb, _inw, _inl, _outb, _outw, _outl.
This is equivalent to the 'glicbc' fallback of the removed ia64Pci.c.

The patch defines inb, inw, inl, outb, outw, outl as inline functions in the compiler.h - similar as it is already done for alpha.

I build the xorg-server-core 1.12.3 with this patch - and the ones of bug#686152 and 686153.
After installation of the built
xserver-xorg-dev_1.12.3-1_ia64.deb
I was able to build and install the xserver-xorg-video-mach64 (6.9.1) package - without any modification.
After a startx, x started and worked.
I bet, the other affected video drivers could be built after that as well.

Please could you apply the proposed patch and revert bug#671386? This would be great.


Best regards
Stephan Schreiber


Attachment: fix_inx_outx.patch
Description: fix_inx_outx.patch


Reply to: