|
|
|
@ -1,59 +1,68 @@
|
|
|
|
|
From 4f64fe52b50af7f79a59eb89f8bfd4983dce5ea3 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From 92371030adbe10c12861ff9917fd251b51618fa8 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: tigro <tigro@msvsphere-os.ru>
|
|
|
|
|
Date: Sat, 18 Nov 2023 22:59:08 +0300
|
|
|
|
|
Date: Mon, 21 Oct 2024 12:06:03 +0300
|
|
|
|
|
Subject: [PATCH] Fix build on RedHat 9.3 kernel
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
ashmem/ashmem.c | 2 +-
|
|
|
|
|
ashmem/ashmem.c | 4 ++--
|
|
|
|
|
binder/binder.c | 2 +-
|
|
|
|
|
binder/binder_alloc.c | 2 +-
|
|
|
|
|
binder/deps.c | 6 +++---
|
|
|
|
|
4 files changed, 6 insertions(+), 6 deletions(-)
|
|
|
|
|
4 files changed, 7 insertions(+), 7 deletions(-)
|
|
|
|
|
|
|
|
|
|
diff --git a/ashmem/ashmem.c b/ashmem/ashmem.c
|
|
|
|
|
index 9c38c9e..5589bfd 100644
|
|
|
|
|
index df9cf90..009a04e 100644
|
|
|
|
|
--- a/ashmem/ashmem.c
|
|
|
|
|
+++ b/ashmem/ashmem.c
|
|
|
|
|
@@ -874,7 +874,7 @@ static int __init ashmem_init(void)
|
|
|
|
|
return ret;
|
|
|
|
|
@@ -390,7 +390,7 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma)
|
|
|
|
|
ret = -EPERM;
|
|
|
|
|
goto out;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,0,0))
|
|
|
|
|
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
|
|
|
|
|
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)
|
|
|
|
|
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 14, 0)
|
|
|
|
|
vm_flags_clear(vma, calc_vm_may_flags(~asma->prot_mask));
|
|
|
|
|
#else
|
|
|
|
|
vma->vm_flags &= ~calc_vm_may_flags(~asma->prot_mask);
|
|
|
|
|
@@ -897,7 +897,7 @@ static int __init ashmem_init(void)
|
|
|
|
|
} else {
|
|
|
|
|
return -ENOMEM;
|
|
|
|
|
}
|
|
|
|
|
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6,0,0))
|
|
|
|
|
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
|
|
|
|
|
register_shrinker(&ashmem_shrinker, "android-ashmem");
|
|
|
|
|
#else
|
|
|
|
|
register_shrinker(&ashmem_shrinker);
|
|
|
|
|
diff --git a/binder/binder.c b/binder/binder.c
|
|
|
|
|
index 99f47c3..45aa600 100644
|
|
|
|
|
index c0f6f12..45fa723 100644
|
|
|
|
|
--- a/binder/binder.c
|
|
|
|
|
+++ b/binder/binder.c
|
|
|
|
|
@@ -2236,7 +2236,7 @@ static void binder_deferred_fd_close(int fd)
|
|
|
|
|
if (!twcb)
|
|
|
|
|
return;
|
|
|
|
|
@@ -2238,7 +2238,7 @@ static void binder_deferred_fd_close(int fd)
|
|
|
|
|
init_task_work(&twcb->twork, binder_do_fd_close);
|
|
|
|
|
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0))
|
|
|
|
|
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
|
|
|
|
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0))
|
|
|
|
|
twcb->file = file_close_fd(fd);
|
|
|
|
|
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0))
|
|
|
|
|
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
|
|
|
|
|
twcb->file = close_fd_get_file(fd);
|
|
|
|
|
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
|
|
|
|
|
close_fd_get_file(fd, &twcb->file);
|
|
|
|
|
diff --git a/binder/binder_alloc.c b/binder/binder_alloc.c
|
|
|
|
|
index 13b8b32..350edb5 100644
|
|
|
|
|
index bfdec52..4663c2a 100644
|
|
|
|
|
--- a/binder/binder_alloc.c
|
|
|
|
|
+++ b/binder/binder_alloc.c
|
|
|
|
|
@@ -1084,7 +1084,7 @@ int binder_alloc_shrinker_init(void)
|
|
|
|
|
int ret = list_lru_init(&binder_alloc_lru);
|
|
|
|
|
|
|
|
|
|
if (ret == 0) {
|
|
|
|
|
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,0,0))
|
|
|
|
|
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
|
|
|
|
|
@@ -1110,7 +1110,7 @@ int binder_alloc_shrinker_init(void)
|
|
|
|
|
} else {
|
|
|
|
|
ret = -ENOMEM;
|
|
|
|
|
}
|
|
|
|
|
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6,0,0))
|
|
|
|
|
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
|
|
|
|
|
ret = register_shrinker(&binder_shrinker, "android-binder");
|
|
|
|
|
#else
|
|
|
|
|
ret = register_shrinker(&binder_shrinker);
|
|
|
|
|
diff --git a/binder/deps.c b/binder/deps.c
|
|
|
|
|
index 232bded..95b896a 100644
|
|
|
|
|
index 63accc0..c77e720 100644
|
|
|
|
|
--- a/binder/deps.c
|
|
|
|
|
+++ b/binder/deps.c
|
|
|
|
|
@@ -70,14 +70,14 @@ static unsigned long kallsyms_lookup_name_wrapper(const char *name)
|
|
|
|
|
@@ -70,7 +70,7 @@ static unsigned long kallsyms_lookup_name_wrapper(const char *name)
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -62,15 +71,16 @@ index 232bded..95b896a 100644
|
|
|
|
|
static struct file *(*close_fd_get_file_ptr)(unsigned int fd)
|
|
|
|
|
#else
|
|
|
|
|
static int (*close_fd_get_file_ptr)(unsigned int fd, struct file **res)
|
|
|
|
|
#endif
|
|
|
|
|
= NULL;
|
|
|
|
|
@@ -79,7 +79,7 @@ static int (*close_fd_get_file_ptr)(unsigned int fd, struct file **res)
|
|
|
|
|
|
|
|
|
|
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0))
|
|
|
|
|
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
|
|
|
|
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,8,0))
|
|
|
|
|
struct file *file_close_fd(unsigned int fd)
|
|
|
|
|
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0))
|
|
|
|
|
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
|
|
|
|
|
struct file *close_fd_get_file(unsigned int fd)
|
|
|
|
|
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
|
|
|
|
|
int close_fd_get_file(unsigned int fd, struct file **res)
|
|
|
|
|
@@ -92,7 +92,7 @@ int __close_fd_get_file(unsigned int fd, struct file **res)
|
|
|
|
|
@@ -96,7 +96,7 @@ int __close_fd_get_file(unsigned int fd, struct file **res)
|
|
|
|
|
close_fd_get_file_ptr = kallsyms_lookup_name_wrapper("__close_fd_get_file");
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
@ -80,5 +90,5 @@ index 232bded..95b896a 100644
|
|
|
|
|
#else
|
|
|
|
|
return close_fd_get_file_ptr(fd, res);
|
|
|
|
|
--
|
|
|
|
|
2.41.0
|
|
|
|
|
2.47.0
|
|
|
|
|
|
|
|
|
|