Skip to content

Instantly share code, notes, and snippets.

@yomguy
Last active December 30, 2018 17:40
Show Gist options
  • Save yomguy/d40ffd9a3f3986e09e7a061b15874463 to your computer and use it in GitHub Desktop.
Save yomguy/d40ffd9a3f3986e09e7a061b15874463 to your computer and use it in GitHub Desktop.
Nvidia driver 390.87 patches needed for Linux RT kernel and related to the install method described here http://linuxaudioproduction.blogspot.com/2015/09/how-to-patching-and-compiling-nvidia.html
--- nv-linux.h.bak 2018-12-30 11:31:22.677374865 +0100
+++ nv-linux.h 2018-12-30 11:35:16.447873828 +0100
@@ -43,6 +43,8 @@
#include <linux/version.h>
#include <linux/utsname.h>
+#define CONFIG_PREEMPT_RT_FULL 1
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 9)
#error "This driver does not support kernels older than 2.6.9!"
#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 7, 0)
@@ -361,10 +363,6 @@
#endif
#endif
-#if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_PREEMPT_RT_FULL)
-#define NV_CONFIG_PREEMPT_RT 1
-#endif
-
#if defined(NVCPU_X86)
#ifndef write_cr4
#define write_cr4(x) __asm__ ("movl %0,%%cr4" :: "r" (x));
--- nv-lock.h.bak 2018-12-30 11:31:31.841314906 +0100
+++ nv-lock.h 2018-12-30 11:35:57.527615218 +0100
@@ -21,7 +21,9 @@
#include <asm/semaphore.h>
#endif
-#if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_PREEMPT_RT_FULL)
+#define CONFIG_PREEMPT_RT_FULL 1
+
+#if defined(CONFIG_PREEMPT_RT_FULL)
typedef raw_spinlock_t nv_spinlock_t;
#define NV_SPIN_LOCK_INIT(lock) raw_spin_lock_init(lock)
#define NV_SPIN_LOCK_IRQ(lock) raw_spin_lock_irq(lock)
@@ -43,7 +45,7 @@
#define NV_SPIN_UNLOCK_WAIT(lock) spin_unlock_wait(lock)
#endif
-#if defined(NV_CONFIG_PREEMPT_RT)
+#if defined(CONFIG_PREEMPT_RT_FULL)
#define NV_INIT_SEMA(sema, val) sema_init(sema,val)
#else
#if !defined(__SEMAPHORE_INITIALIZER) && defined(__COMPAT_SEMAPHORE_INITIALIZER)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment