2022-06-04 16:50:19 +00:00
|
|
|
From 90504b74523733c7f9c256f1df8c70a1144c56ac Mon Sep 17 00:00:00 2001
|
2020-07-22 20:41:00 +00:00
|
|
|
From: Ben Hutchings <ben@decadent.org.uk>
|
|
|
|
Date: Fri, 22 Jun 2018 17:27:00 +0100
|
2021-03-04 15:12:32 +00:00
|
|
|
Subject: [PATCH 2/2] android: Enable building ashmem and binder as modules
|
2020-07-22 20:41:00 +00:00
|
|
|
|
|
|
|
We want to enable use of the Android ashmem and binder drivers to
|
|
|
|
support Anbox, but they should not be built-in as that would waste
|
|
|
|
resources and increase security attack surface on systems that don't
|
|
|
|
need them.
|
|
|
|
|
|
|
|
- Add a MODULE_LICENSE declaration to ashmem
|
|
|
|
- Change the Makefiles to build each driver as an object with the
|
|
|
|
"_linux" suffix (which is what Anbox expects)
|
|
|
|
- Change config symbol types to tristate
|
2022-06-04 16:50:19 +00:00
|
|
|
|
|
|
|
Update:
|
|
|
|
In upstream commit 721412ed3d titled "staging: remove ashmem" the ashmem
|
|
|
|
driver was removed entirely. Secondary commit message:
|
|
|
|
"The mainline replacement for ashmem is memfd, so remove the legacy
|
|
|
|
code from drivers/staging/"
|
|
|
|
Consequently, the ashmem part of this patch has been removed.
|
2020-07-22 20:41:00 +00:00
|
|
|
---
|
2022-06-04 16:50:19 +00:00
|
|
|
drivers/android/Kconfig | 2 +-
|
|
|
|
drivers/android/Makefile | 7 ++++---
|
|
|
|
drivers/android/binder_alloc.c | 2 +-
|
|
|
|
3 files changed, 6 insertions(+), 5 deletions(-)
|
2020-07-22 20:41:00 +00:00
|
|
|
|
2021-03-04 15:12:32 +00:00
|
|
|
diff --git a/drivers/android/Kconfig b/drivers/android/Kconfig
|
|
|
|
index 53b22e26266c..f3c50236e8d1 100644
|
|
|
|
--- a/drivers/android/Kconfig
|
|
|
|
+++ b/drivers/android/Kconfig
|
2020-07-22 20:41:00 +00:00
|
|
|
@@ -9,7 +9,7 @@ config ANDROID
|
|
|
|
if ANDROID
|
|
|
|
|
|
|
|
config ANDROID_BINDER_IPC
|
|
|
|
- bool "Android Binder IPC Driver"
|
|
|
|
+ tristate "Android Binder IPC Driver"
|
|
|
|
depends on MMU
|
|
|
|
default n
|
|
|
|
help
|
2021-03-04 15:12:32 +00:00
|
|
|
diff --git a/drivers/android/Makefile b/drivers/android/Makefile
|
|
|
|
index c9d3d0c99c25..55411d9a9c2a 100644
|
|
|
|
--- a/drivers/android/Makefile
|
|
|
|
+++ b/drivers/android/Makefile
|
2020-07-22 20:41:00 +00:00
|
|
|
@@ -1,6 +1,7 @@
|
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
|
|
|
ccflags-y += -I$(src) # needed for trace events
|
|
|
|
|
|
|
|
-obj-$(CONFIG_ANDROID_BINDERFS) += binderfs.o
|
|
|
|
-obj-$(CONFIG_ANDROID_BINDER_IPC) += binder.o binder_alloc.o
|
|
|
|
-obj-$(CONFIG_ANDROID_BINDER_IPC_SELFTEST) += binder_alloc_selftest.o
|
|
|
|
+obj-$(CONFIG_ANDROID_BINDER_IPC) += binder_linux.o
|
|
|
|
+binder_linux-y := binder.o binder_alloc.o
|
|
|
|
+binder_linux-$(CONFIG_ANDROID_BINDERFS) += binderfs.o
|
|
|
|
+binder_linux-$(CONFIG_ANDROID_BINDER_IPC_SELFTEST) += binder_alloc_selftest.o
|
2021-03-04 15:12:32 +00:00
|
|
|
diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
|
2022-06-04 16:50:19 +00:00
|
|
|
index 2ac1008a5f39..0dbb30487a6e 100644
|
2021-03-04 15:12:32 +00:00
|
|
|
--- a/drivers/android/binder_alloc.c
|
|
|
|
+++ b/drivers/android/binder_alloc.c
|
2020-07-22 20:41:00 +00:00
|
|
|
@@ -38,7 +38,7 @@ enum {
|
|
|
|
};
|
|
|
|
static uint32_t binder_alloc_debug_mask = BINDER_DEBUG_USER_ERROR;
|
|
|
|
|
|
|
|
-module_param_named(debug_mask, binder_alloc_debug_mask,
|
|
|
|
+module_param_named(alloc_debug_mask, binder_alloc_debug_mask,
|
|
|
|
uint, 0644);
|
|
|
|
|
|
|
|
#define binder_alloc_debug(mask, x...) \
|
2021-03-04 15:12:32 +00:00
|
|
|
--
|
2022-06-04 16:50:19 +00:00
|
|
|
2.36.1
|
2021-03-04 15:12:32 +00:00
|
|
|
|