From 1a0edc5d439de56fd5abbefe546111a00412c30f Mon Sep 17 00:00:00 2001
From: Joerg Schirottke <master@kanotix.com>
Date: Sun, 1 Apr 2012 14:12:39 +0200
Subject: [PATCH] nvidia kernel 3.4 dkms hotfix

---
 dkms.conf                       |    2 ++
 patches/nvidia-kernel-3.4.patch |   24 ++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 0 deletions(-)
 create mode 100644 patches/nvidia-kernel-3.4.patch

diff --git a/dkms.conf b/dkms.conf
index 279a9e4..22b820f 100644
--- a/dkms.conf
+++ b/dkms.conf
@@ -6,3 +6,5 @@ DEST_MODULE_NAME[0]="nvidia"
 MAKE[0]="make SYSSRC=${kernel_source_dir} module IGNORE_XEN_PRESENCE=1"
 CLEAN="make -f Makefile.kbuild clean"
 AUTOINSTALL="yes"
+PATCH[0]="nvidia-kernel-3.4.patch"
+PATCH_MATCH[0]="^3.[4-9]"
diff --git a/patches/nvidia-kernel-3.4.patch b/patches/nvidia-kernel-3.4.patch
new file mode 100644
index 0000000..72ecc01
--- /dev/null
+++ b/patches/nvidia-kernel-3.4.patch
@@ -0,0 +1,24 @@
+diff -Nru nvidia-295.33.orig/conftest.sh nvidia-295.33/conftest.sh
+--- nvidia-295.33.orig/conftest.sh	2012-04-01 13:55:27.793231058 +0200
++++ nvidia-295.33/conftest.sh	2012-04-01 13:56:01.257231021 +0200
+@@ -512,7 +512,7 @@
+             # and if it as an 'event' member.
+             #
+             echo "$CONFTEST_PREAMBLE
+-            #include <asm/system.h>
++            #include <asm/switch_to.h>
+             #include <linux/pm.h>
+             void conftest_pm_message_t(pm_message_t state) {
+                 pm_message_t *p = &state;
+diff -Nru nvidia-295.33.orig/nv-linux.h nvidia-295.33/nv-linux.h
+--- nvidia-295.33.orig/nv-linux.h	2012-04-01 13:55:27.817231055 +0200
++++ nvidia-295.33/nv-linux.h	2012-04-01 13:56:28.301230989 +0200
+@@ -111,7 +111,7 @@
+ #include <linux/timer.h>
+ 
+ #include <asm/div64.h>              /* do_div()                         */
+-#include <asm/system.h>             /* cli, sli, save_flags             */
++#include <asm/switch_to.h>             /* cli, sli, save_flags             */
+ #include <asm/io.h>                 /* ioremap, virt_to_phys            */
+ #include <asm/uaccess.h>            /* access_ok                        */
+ #include <asm/page.h>               /* PAGE_OFFSET                      */
-- 
1.7.9

