ANDROID: rust_binder: Switch Rust Binder to GKI Module

Convert Rust Binder to be buildable as a GKI module.

Bug: 347787965
Change-Id: I9caa8582a6240db52933de40cdf2afb46b69817a
Signed-off-by: Matthew Maurer <mmaurer@google.com>
This commit is contained in:
Matthew Maurer 2024-06-03 21:37:25 +00:00
parent b511e79bc5
commit cb0bef6d8e
6 changed files with 13 additions and 10 deletions

View File

@ -1,4 +1,5 @@
arch/arm64/geniezone/gzvm.ko
drivers/android/rust_binder.ko
drivers/bluetooth/btbcm.ko
drivers/bluetooth/btqca.ko
drivers/bluetooth/btsdio.ko

View File

@ -26,7 +26,7 @@ config ANDROID_BINDER_IPC_C
If unsure, pick the C implementation.
config ANDROID_BINDER_IPC_RUST
bool "Android Binder IPC Driver in Rust"
tristate "Android Binder IPC Driver in Rust"
depends on ANDROID_BINDER_IPC && RUST
help
Enable the Rust implementation of the Android Binder IPC Driver.

View File

@ -5,8 +5,12 @@ obj-$(CONFIG_ANDROID_BINDER_IPC) += binder_pick_impl.o
obj-$(CONFIG_ANDROID_BINDERFS_C) += binderfs.o
obj-$(CONFIG_ANDROID_BINDER_IPC_C) += binder.o binder_alloc.o
obj-$(CONFIG_ANDROID_BINDER_IPC_SELFTEST) += binder_alloc_selftest.o
obj-$(CONFIG_ANDROID_BINDERFS_RUST) += binder/rust_binderfs.o
obj-$(CONFIG_ANDROID_BINDER_IPC_RUST) += binder/rust_binder.o
obj-$(CONFIG_ANDROID_DEBUG_SYMBOLS) += android_debug_symbols.o
obj-$(CONFIG_ANDROID_VENDOR_HOOKS) += vendor_hooks.o
obj-$(CONFIG_ANDROID_DEBUG_KINFO) += debug_kinfo.o
obj-$(CONFIG_ANDROID_BINDER_IPC_RUST) += rust_binder.o
rust_binder-objs := binder/rust_binder.o
ifeq ($(CONFIG_ANDROID_BINDERFS_RUST),y)
rust_binder-objs += binder/rust_binderfs.o
endif

View File

@ -36,6 +36,8 @@
#include "binder_internal.h"
MODULE_IMPORT_NS(VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver);
#define FIRST_INODE 1
#define SECOND_INODE 2
#define INODE_OFFSET 3

View File

@ -22,12 +22,6 @@
#endif
#endif
#ifndef CONFIG_ANDROID_BINDER_IPC_RUST
#ifdef CONFIG_ANDROID_BINDER_IPC_DEFAULT_IS_RUST
#error "The default Binder driver implementation is Rust, but the Rust implementation is disabled"
#endif
#endif
#ifndef CONFIG_ANDROID_BINDER_IPC_C
#ifndef CONFIG_ANDROID_BINDER_IPC_DEFAULT_IS_RUST
#error "The default Binder driver implementation is C, but the C implementation is disabled"
@ -35,7 +29,9 @@
#endif
bool binder_use_rust = IS_ENABLED(CONFIG_ANDROID_BINDER_IPC_DEFAULT_IS_RUST);
EXPORT_SYMBOL_GPL(binder_use_rust);
bool binder_driver_initialized;
EXPORT_SYMBOL_GPL(binder_driver_initialized);
static int binder_param_set(const char *buffer, const struct kernel_param *kp)
{

View File

@ -369,7 +369,7 @@ $(obj)/bindings/bindings_helpers_generated.rs: $(src)/helpers.c FORCE
quiet_cmd_exports = EXPORTS $@
cmd_exports = \
$(NM) -p --defined-only $< \
| awk '$$2~/(T|R|D)/ && $$3!~/__cfi/ {printf "EXPORT_SYMBOL_RUST_GPL(%s);\n",$$3}' > $@
| awk '$$2~/(T|R|D|B)/ && $$3!~/__cfi/ {printf "EXPORT_SYMBOL_RUST_GPL(%s);\n",$$3}' > $@
$(obj)/exports_core_generated.h: $(obj)/core.o FORCE
$(call if_changed,exports)