From bda5f62ba4b0b77b2355917ba9637fe0c660907b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Sun, 19 Apr 2015 13:58:31 +0200 Subject: [PATCH] - fix building with linux 4.0 - rel 2 --- linux-4.0.patch | 14 ++++++++++++++ xorg-driver-video-nvidia-legacy-340xx.spec | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 linux-4.0.patch diff --git a/linux-4.0.patch b/linux-4.0.patch new file mode 100644 index 0000000..fcbc23b --- /dev/null +++ b/linux-4.0.patch @@ -0,0 +1,14 @@ +--- 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)); diff --git a/xorg-driver-video-nvidia-legacy-340xx.spec b/xorg-driver-video-nvidia-legacy-340xx.spec index 3220ef0..6073a20 100644 --- a/xorg-driver-video-nvidia-legacy-340xx.spec +++ b/xorg-driver-video-nvidia-legacy-340xx.spec @@ -25,7 +25,7 @@ exit 1 %define no_install_post_check_so 1 -%define rel 1 +%define rel 2 %define pname xorg-driver-video-nvidia-legacy-340xx Summary: Linux Drivers for nVidia GeForce/Quadro Chips Summary(hu.UTF-8): Linux meghajtók nVidia GeForce/Quadro chipekhez @@ -47,6 +47,7 @@ Source4: 10-nvidia.conf Source5: 10-nvidia-modules.conf Patch0: X11-driver-nvidia-GL.patch Patch1: X11-driver-nvidia-desktop.patch +Patch2: 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}} @@ -248,6 +249,7 @@ rm -rf NVIDIA-Linux-x86*-%{version}* %endif %patch0 -p1 %patch1 -p1 +%patch2 -p1 echo 'EXTRA_CFLAGS += -Wno-pointer-arith -Wno-sign-compare -Wno-unused' >> kernel/Makefile.kbuild %build -- 2.44.0