--- /dev/null
+--- NVIDIA-Linux-x86_64-346.35-no-compat32/kernel/nv-linux.h~ 2015-01-11 05:30:46.000000000 +0100
++++ NVIDIA-Linux-x86_64-346.35-no-compat32/kernel/nv-linux.h 2015-04-19 13:51:50.919754915 +0200
+@@ -336,6 +336,11 @@
+ #define NV_SPIN_UNLOCK(lock) spin_unlock(lock)
+ #define NV_SPIN_UNLOCK_WAIT(lock) spin_unlock_wait(lock)
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0)
++#define read_cr4 __read_cr4
++#define write_cr4 __write_cr4
++#endif
++
+ #if defined(NVCPU_X86)
+ #ifndef write_cr4
+ #define write_cr4(x) __asm__ ("movl %0,%%cr4" :: "r" (x));
%define no_install_post_check_so 1
-%define rel 2
+%define rel 3
%define mname nvidia-legacy-304xx
%define pname xorg-driver-video-%{mname}
Summary: Linux Drivers for nVidia GeForce/Quadro Chips
Patch0: X11-driver-nvidia-GL.patch
Patch1: X11-driver-nvidia-desktop.patch
Patch2: linux-3.19.patch
+Patch3: linux-4.0.patch
URL: http://www.nvidia.com/object/unix.html
BuildRequires: rpmbuild(macros) >= 1.701
%{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
%build
%{?with_kernel:%{expand:%build_kernel_packages}}