--- x/hw/xfree86/os-support/linux/lnx_video.c.ori 2007-09-26 22:06:36.000000000 +0800 +++ x/hw/xfree86/os-support/linux/lnx_video.c 2007-09-26 22:07:19.000000000 +0800 @@ -544,6 +544,10 @@ int fd; unsigned int ioBase_phys; #endif +#if defined(__mips__) + int fd; + extern unsigned int IOPortBase; +#endif if (ExtendedEnabled) return TRUE; @@ -567,6 +571,21 @@ #endif } close(fd); +#elif defined(__mips__) + fd = open("/dev/mem", O_RDWR); + IOPortBase = (volatile unsigned char *)mmap(0, 0x20000, + PROT_READ | PROT_WRITE, MAP_SHARED, fd, + 0x1fd00000); + if (IOPortBase == MAP_FAILED) { + xf86Msg(X_WARNING, + "xf86EnableIOPorts: Failed to map iobase (%s)\n", + strerror(errno)); + return FALSE; + } + close(fd); + xf86Msg(X_WARNING, + "xf86EnableIOPorts: map iobase (%x)\n", + IOPortBase); #elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) if (ioperm(0, 1024, 1) || iopl(3)) { if (errno == ENODEV)