From a3088573812836ca54e195be29c259f62bb96791 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Fri, 26 Jun 2015 15:27:10 +0300 Subject: [PATCH] nvidia-drivers adopted for 4.0+ kernels. --- x11-drivers/nvidia-drivers/files/4.0_kernel.patch | 12 ++++++++++++ .../nvidia-drivers/nvidia-drivers-331.113.ebuild | 4 ++++ 2 files changed, 16 insertions(+) create mode 100644 x11-drivers/nvidia-drivers/files/4.0_kernel.patch diff --git a/x11-drivers/nvidia-drivers/files/4.0_kernel.patch b/x11-drivers/nvidia-drivers/files/4.0_kernel.patch new file mode 100644 index 00000000..187856e1 --- /dev/null +++ b/x11-drivers/nvidia-drivers/files/4.0_kernel.patch @@ -0,0 +1,12 @@ +--- kernel/nv-linux.h 2015-06-26 15:17:49.851273250 +0300 ++++ kernel/nv-linux.h 2015-06-26 15:22:51.119150159 +0300 +@@ -1864,4 +1864,9 @@ + #define f_dentry f_path.dentry + #endif + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 0, 0) ++#define read_cr4 __read_cr4 ++#define write_cr4 __write_cr4 ++#endif ++ + #endif /* _NV_LINUX_H_ */ diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-331.113.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-331.113.ebuild index 3f25ded1..cb3ecee5 100644 --- a/x11-drivers/nvidia-drivers/nvidia-drivers-331.113.ebuild +++ b/x11-drivers/nvidia-drivers/nvidia-drivers-331.113.ebuild @@ -180,6 +180,10 @@ src_prepare() { epatch "${FILESDIR}"/3.19_kernel.patch fi + if kernel_is gt 4 0 0 ; then + epatch "${FILESDIR}"/4.0_kernel.patch + fi + # If greater than 2.6.5 use M= instead of SUBDIR= # convert_to_m "${NV_SRC}"/Makefile.kbuild fi