View Single Post
Old 05-08-12, 01:59 AM   #5
Gusar
Registered User
 
Join Date: Apr 2006
Posts: 277
Default Re: 302.07/295.49 patches for linux-3.4.0+

That one is incomplete, the nv-pat.c part is missing. This should do it:
Code:
--- kernel/conftest.sh.orig
+++ kernel/conftest.sh
@@ -512,7 +512,6 @@
             # and if it as an 'event' member.
             #
             echo "$CONFTEST_PREAMBLE
-            #include <asm/system.h>
             #include <linux/pm.h>
             void conftest_pm_message_t(pm_message_t state) {
                 pm_message_t *p = &state;
--- kernel/nv-linux.h.orig
+++ kernel/nv-linux.h
@@ -111,7 +111,6 @@
 #include <linux/timer.h>
 
 #include <asm/div64.h>              /* do_div()                         */
-#include <asm/system.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                      */
@@ -992,9 +991,19 @@
 #  define NV_IS_SUSER()                 capable(CAP_SYS_ADMIN)
 #  define NV_PCI_DEVICE_NAME(dev)       ((dev)->pretty_name)
 #  define NV_NUM_CPUS()                 num_online_cpus()
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
+# include <asm/system.h>
 #  define NV_CLI()                      local_irq_disable()
 #  define NV_SAVE_FLAGS(eflags)         local_save_flags(eflags)
 #  define NV_RESTORE_FLAGS(eflags)      local_irq_restore(eflags)
+#else
+# include <asm/irqflags.h>
+# define NV_CLI()                       arch_local_irq_disable()
+# define NV_SAVE_FLAGS()                arch_local_save_flags()
+# define NV_RESTORE_FLAGS(eflags)       arch_local_irq_restore(eflags)
+#endif
+
 #  define NV_MAY_SLEEP()                (!irqs_disabled() && !in_interrupt() && !NV_IN_ATOMIC())
 #  define NV_MODULE_PARAMETER(x)        module_param(x, int, 0)
 #  define NV_MODULE_STRING_PARAMETER(x) module_param(x, charp, 0)
--- kernel/nv-pat.c.orig
+++ kernel/nv-pat.c
@@ -109,7 +109,11 @@
         return;
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
     NV_SAVE_FLAGS(eflags);
+#else
+    eflags = NV_SAVE_FLAGS();
+#endif
     NV_CLI();
     nv_disable_caches(&cr4);
 
@@ -135,7 +139,11 @@
         return;
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
     NV_SAVE_FLAGS(eflags);
+#else
+    eflags = NV_SAVE_FLAGS();
+#endif
     NV_CLI();
     nv_disable_caches(&cr4);
Gusar is offline   Reply With Quote