summarylogtreecommitdiffstats
path: root/arch-fglrx-3.7.patch
blob: 47cd425aa5cf2d1a6d8b6f83072d03d3b7954e5e (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
--- 12.9/common/lib/modules/fglrx/build_mod/firegl_public.c	2012-09-26 15:04:28.000000000 +0200
+++ 12.9/common/lib/modules/fglrx/build_mod/firegl_public.c	2012-10-16 20:30:42.146523753 +0200
@@ -3892,7 +3892,11 @@
                 KCL_DEBUG_ERROR(REMAP_PAGE_RANGE_STR " failed\n");
                 return -EAGAIN;
             }
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
             vma->vm_flags |= VM_SHM | VM_RESERVED; /* Don't swap */
+#else
+            vma->vm_flags |= VM_SHM | VM_DONTEXPAND | VM_DONTDUMP; /* Don't swap */
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) */
             vma->vm_ops = &vm_ops;
 			break;
 
@@ -3922,14 +3926,22 @@
                 KCL_DEBUG_ERROR(REMAP_PAGE_RANGE_STR " failed\n");
                 return -EAGAIN;
             }
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
             vma->vm_flags |= VM_SHM | VM_RESERVED; /* Don't swap */
+#else
+            vma->vm_flags |= VM_SHM | VM_DONTEXPAND | VM_DONTDUMP; /* Don't swap */
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) */
             vma->vm_ops = &vm_ops;
             }
 			break;
 #endif                    
 
         case __KE_SHM:
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
             vma->vm_flags |= VM_SHM | VM_RESERVED; /* Don't swap */
+#else
+            vma->vm_flags |= VM_SHM | VM_DONTEXPAND | VM_DONTDUMP; /* Don't swap */
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) */
             vma->vm_ops = &vm_shm_ops;
             break;
 
@@ -3937,7 +3949,11 @@
 
             pages = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
             vma->vm_flags |= VM_RESERVED;
+#else
+            vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) */
 
             //vma->vm_flags |=  VM_SHM | VM_LOCKED; /* DDDDDDDDDDon't swap */
             //vma->vm_mm->locked_vm += pages; /* Kernel tracks aqmount of locked pages */
@@ -3946,14 +3962,22 @@
 
         case __KE_CTX:
             pages = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
             vma->vm_flags |= VM_LOCKED | VM_SHM | VM_RESERVED; /* Don't swap */
+#else
+            vma->vm_flags |= VM_LOCKED | VM_SHM | VM_DONTEXPAND | VM_DONTDUMP; /* Don't swap */
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) */
             vma->vm_mm->locked_vm += pages; /* Kernel tracks aqmount of locked pages */
             vma->vm_ops = &vm_ctx_ops;
             break;
 
         case __KE_PCI_BQS:
             pages = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
             vma->vm_flags |= VM_LOCKED | VM_SHM | VM_RESERVED; /* Don't swap */
+#else
+            vma->vm_flags |= VM_LOCKED | VM_SHM | VM_DONTEXPAND | VM_DONTDUMP; /* Don't swap */
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) */
             vma->vm_mm->locked_vm += pages; /* Kernel tracks aqmount of locked pages */
             vma->vm_ops = &vm_pci_bq_ops;
             break;
@@ -3984,9 +4008,17 @@
                     return -EAGAIN;
                 }
 #ifdef __x86_64__
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
                 vma->vm_flags |= VM_RESERVED;
 #else
+                vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) */
+#else
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
                 vma->vm_flags |= VM_SHM | VM_RESERVED; /* Don't swap */
+#else
+                vma->vm_flags |= VM_SHM | VM_DONTEXPAND | VM_DONTDUMP; /* Don't swap */
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) */
 #endif
                 vma->vm_ops = &vm_ops;
             }
@@ -4015,9 +4047,17 @@
                     return -EAGAIN;
                 }
 #ifdef __x86_64__
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
                 vma->vm_flags |= VM_RESERVED;
 #else
+                vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) */
+#else
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
                 vma->vm_flags |= VM_SHM | VM_RESERVED; /* Don't swap */
+#else
+                vma->vm_flags |= VM_SHM | VM_DONTEXPAND | VM_DONTDUMP; /* Don't swap */
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) */
 #endif
                 vma->vm_ops = &vm_agp_bq_ops;
             }
@@ -4025,7 +4065,11 @@
 #endif /* __AGP__BUILTIN__ */
 
         case __KE_KMAP:
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
 		    vma->vm_flags |= VM_SHM | VM_RESERVED;
+#else
+		    vma->vm_flags |= VM_SHM | VM_DONTEXPAND | VM_DONTDUMP;
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) */
             vma->vm_ops = &vm_kmap_ops;
             if (readonly && (vma->vm_flags & VM_WRITE))
             {
@@ -4046,7 +4090,11 @@
 #endif            
             // fall through
          case __KE_GART_CACHEABLE:
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
              vma->vm_flags |= VM_RESERVED;
+#else
+             vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) */
              vma->vm_ops = &vm_gart_ops;
              break;
         default: