Only use underscored versions of read_cr4 and write_cr4 in 3.18 and above.

I'm not sure precisely in what micro-version the API change was made, so
the check for 3.18.0 and above may not be quite correct. But it's at
least sufficient for every version currently included in NixOS.

+21 -6
+21 -6
pkgs/os-specific/linux/ati-drivers/kernel-api-fixes.patch
··· 1 1 diff -Nru 15.7/common/lib/modules/fglrx/build_mod/firegl_public.c 15.7.new/common/lib/modules/fglrx/build_mod/firegl_public.c 2 2 --- 15.7/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-07-04 10:31:23.000000000 -0400 3 - +++ 15.7.new/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-08-03 00:30:34.927839497 -0400 4 - @@ -3495,10 +3495,12 @@ 3 + +++ 15.7.new/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-08-03 21:21:13.893211082 -0400 4 + @@ -242,6 +242,14 @@ 5 + #endif 6 + 7 + // ============================================================ 8 + + 9 + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0) 10 + +#define __read_cr4 read_cr4 11 + +#define __write_cr4 write_cr4 12 + +#endif 13 + + 14 + +// ============================================================ 15 + + 16 + /* globals */ 17 + 18 + char* firegl = NULL; 19 + @@ -3495,10 +3503,12 @@ 5 20 KCL_PUB_InterruptHandlerWrap, 6 21 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) 7 22 ((useMSI) ? (SA_INTERRUPT) : (SA_SHIRQ)), ··· 15 30 #endif 16 31 dev_name, 17 32 context); 18 - @@ -4498,8 +4500,8 @@ 33 + @@ -4498,8 +4508,8 @@ 19 34 20 35 if (cpu_has_pge) 21 36 { ··· 26 41 } 27 42 __flush_tlb(); 28 43 29 - @@ -4512,7 +4514,7 @@ 44 + @@ -4512,7 +4522,7 @@ 30 45 write_cr0(cr0 & 0xbfffffff); 31 46 if (cpu_has_pge) 32 47 { ··· 35 50 } 36 51 local_irq_restore(flags); 37 52 38 - @@ -4539,8 +4541,8 @@ 53 + @@ -4539,8 +4549,8 @@ 39 54 40 55 if (cpu_has_pge) 41 56 { ··· 46 61 } 47 62 __flush_tlb(); 48 63 49 - @@ -4552,7 +4554,7 @@ 64 + @@ -4552,7 +4562,7 @@ 50 65 write_cr0(cr0 & 0xbfffffff); 51 66 if (cpu_has_pge) 52 67 {