summaryrefslogtreecommitdiff
path: root/package/xorg-server/patches/patch-hw_xfree86_os-support_linux_lnx_video_c
blob: 4dbf015899d8bfe2658afa8112d033acf0416e63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
--- xorg-server-1.12.2.orig/hw/xfree86/os-support/linux/lnx_video.c	2012-05-17 19:09:03.000000000 +0200
+++ xorg-server-1.12.2/hw/xfree86/os-support/linux/lnx_video.c	2013-04-30 10:49:01.000000000 +0200
@@ -472,7 +472,7 @@ unmapVidMem(int ScreenNum, pointer Base,
 /* I/O Permissions section                                                 */
 /***************************************************************************/
 
-#if defined(__powerpc__)
+#if defined(__powerpc__) || defined(__mips__)
 volatile unsigned char *ioBase = NULL;
 
 #ifndef __NR_pciconfig_iobase
@@ -484,7 +484,7 @@ volatile unsigned char *ioBase = NULL;
 Bool
 xf86EnableIO(void)
 {
-#if defined(__powerpc__)
+#if defined(__powerpc__) || defined(__mips__)
     int fd;
     unsigned int ioBase_phys;
 #endif
@@ -492,8 +492,12 @@ xf86EnableIO(void)
     if (ExtendedEnabled)
         return TRUE;
 
-#if defined(__powerpc__)
+#if defined(__powerpc__) || defined(__mips__)
+#ifdef __powerpc__
     ioBase_phys = syscall(__NR_pciconfig_iobase, 2, 0, 0);
+#else
+    ioBase_phys = 0x1fd00000;
+#endif	
 
     fd = open("/dev/mem", O_RDWR);
     if (ioBase == NULL) {
@@ -511,7 +515,7 @@ xf86EnableIO(void)
 #endif
     }
     close(fd);
-#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__arm__) && !defined(__m32r__) && !defined(__nds32__)
+#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__arm__) && !defined(__m32r__) && !defined(__nds32__)
     if (ioperm(0, 1024, 1) || iopl(3)) {
         if (errno == ENODEV)
             ErrorF("xf86EnableIOPorts: no I/O ports found\n");
@@ -537,10 +541,10 @@ xf86DisableIO(void)
 {
     if (!ExtendedEnabled)
         return;
-#if defined(__powerpc__)
+#if defined(__powerpc__) || defined(__mips__)
     munmap(ioBase, 0x20000);
     ioBase = NULL;
-#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__) && !defined(__m32r__) && !defined(__nds32__)
+#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__) && !defined(__m32r__) && !defined(__nds32__)
     iopl(0);
     ioperm(0, 1024, 0);
 #endif