nvidia driver 331.13 with kernel >=3.11 (on Gentoo)

To get nvidia-drivers (up to 331.13) running with my kernels newer then 3.10 (>=3.11) i need to patch it because num_physpages seems not any longer available in the kernel (noiw using get_num_physpages).

Solved it with this:

--- kernel.orig/nv-linux.h   2013-09-30 05:47:18.000000000 +0200
+++ kernel/nv-linux.h     2013-10-14 10:27:14.520070619 +0200
@@ -956,7 +956,11 @@
 #endif
 
 #if !defined(NV_VMWARE)
-#define NV_NUM_PHYSPAGES                num_physpages
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
+#define NV_NUM_PHYSPAGES               get_num_physpages
+#else
+#define NV_NUM_PHYSPAGES               num_physpages
+#endif
 #define NV_GET_CURRENT_PROCESS()        current->tgid
 #define NV_IN_ATOMIC()                  in_atomic()
 #define NV_LOCAL_BH_DISABLE()           local_bh_disable()

hth,
best regards,

Niels Dettenbach.
Syndicat IT & Internet
http://syndicat.com

Please don’t use this patch. I described why it’s wrong in this post: https://devtalk.nvidia.com/default/topic/616962/linux/331-13-beta-drivers-feedback-thread/post/3964459/#3964459