mirror of
https://github.com/archlinux-jerry/nvidia-340xx
synced 2024-11-27 18:10:40 +08:00
57 lines
1.7 KiB
Diff
57 lines
1.7 KiB
Diff
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"
|