diff options
Diffstat (limited to 'system/nvidia-legacy340-kernel/patches/0009-kernel-5.17.patch')
-rw-r--r-- | system/nvidia-legacy340-kernel/patches/0009-kernel-5.17.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/system/nvidia-legacy340-kernel/patches/0009-kernel-5.17.patch b/system/nvidia-legacy340-kernel/patches/0009-kernel-5.17.patch new file mode 100644 index 0000000000000..2c55f8092b631 --- /dev/null +++ b/system/nvidia-legacy340-kernel/patches/0009-kernel-5.17.patch @@ -0,0 +1,57 @@ +diff -Naur a/kernel/conftest.sh b/kernel/conftest.sh +--- a/kernel/conftest.sh 2022-04-02 10:27:54.463179319 +0000 ++++ b/kernel/conftest.sh 2022-04-02 10:27:54.553179467 +0000 +@@ -1619,7 +1619,11 @@ + CODE=" + #include <linux/proc_fs.h> + void conftest_PDE_DATA(void) { ++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0) ++ pde_data(); ++ #else + PDE_DATA(); ++ #endif + }" + + compile_check_conftest "$CODE" "NV_PDE_DATA_PRESENT" "" "functions" +diff -Naur a/kernel/nv-linux.h b/kernel/nv-linux.h +--- a/kernel/nv-linux.h 2022-04-02 10:27:54.463179319 +0000 ++++ b/kernel/nv-linux.h 2022-04-02 10:27:54.556512806 +0000 +@@ -266,9 +266,9 @@ + #endif + + #ifdef CONFIG_PROC_FS +-#include <linux/proc_fs.h> + #include <linux/seq_file.h> + #endif ++#include <linux/proc_fs.h> + + #ifdef CONFIG_KDB + #include <linux/kdb.h> +@@ -2052,8 +2052,12 @@ + }) + + #if defined(NV_PDE_DATA_PRESENT) ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) + # define NV_PDE_DATA(inode) PDE_DATA(inode) + #else ++# define NV_PDE_DATA(inode) pde_data(inode) ++#endif ++#else + # define NV_PDE_DATA(inode) PDE(inode)->data + #endif + +diff -Naur a/kernel/uvm/conftest.sh b/kernel/uvm/conftest.sh +--- a/kernel/uvm/conftest.sh 2022-04-02 10:27:54.456512642 +0000 ++++ b/kernel/uvm/conftest.sh 2022-04-02 10:27:54.556512806 +0000 +@@ -1578,7 +1578,11 @@ + CODE=" + #include <linux/proc_fs.h> + void conftest_PDE_DATA(void) { ++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0) ++ pde_data(); ++ #else + PDE_DATA(); ++ #endif + }" + + compile_check_conftest "$CODE" "NV_PDE_DATA_PRESENT" "" "functions" |