From 0abc74db1acf858c4baeeb648335ba2f3b8a231b Mon Sep 17 00:00:00 2001 From: Ramji Jiyani Date: Thu, 20 Jul 2023 18:15:27 -0700 Subject: [PATCH] ANDROID: GKI: Move GKI module headers to generated includes Change build time generated GKI module headers location From :- kernel/module/gki_module_*.h To :- include/generated/gki_module_*.h This prevents the kernel source from being contaminated. By placing the header files in a generated directory, the default filters that ignore certain files will work without any special handling required. Bug: 286529877 Test: Manual verification & TH Change-Id: Ie247d1c132ddae54906de2e2850e95d7ae9edd50 Signed-off-by: Ramji Jiyani (cherry picked from commit e9cba885543fc50a5b59ff7234d02b74a380573c) --- kernel/module/Makefile | 8 ++++---- kernel/module/gki_module.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/module/Makefile b/kernel/module/Makefile index a23e93c6ef10..458cb6e44e85 100644 --- a/kernel/module/Makefile +++ b/kernel/module/Makefile @@ -25,12 +25,12 @@ obj-$(CONFIG_MODULE_UNLOAD_TAINT_TRACKING) += tracking.o # ANDROID: GKI: Generate headerfiles required for gki_module.o # # Dependencies on generated files need to be listed explicitly -$(obj)/gki_module.o: $(obj)/gki_module_protected_exports.h \ - $(obj)/gki_module_unprotected.h +$(obj)/gki_module.o: include/generated/gki_module_protected_exports.h \ + include/generated/gki_module_unprotected.h ALL_KMI_SYMBOLS := all_kmi_symbols -$(obj)/gki_module_unprotected.h: $(ALL_KMI_SYMBOLS) \ +include/generated/gki_module_unprotected.h: $(ALL_KMI_SYMBOLS) \ $(srctree)/scripts/gen_gki_modules_headers.sh $(Q)$(CONFIG_SHELL) $(srctree)/scripts/gen_gki_modules_headers.sh $@ \ "$(srctree)" \ @@ -48,7 +48,7 @@ else ABI_PROTECTED_EXPORTS_FILE := $(wildcard $(srctree)/android/abi_gki_protected_exports_$(ARCH)) endif -$(obj)/gki_module_protected_exports.h: $(ABI_PROTECTED_EXPORTS_FILE) \ +include/generated/gki_module_protected_exports.h: $(ABI_PROTECTED_EXPORTS_FILE) \ $(srctree)/scripts/gen_gki_modules_headers.sh $(Q)$(CONFIG_SHELL) $(srctree)/scripts/gen_gki_modules_headers.sh $@ \ "$(srctree)" \ diff --git a/kernel/module/gki_module.c b/kernel/module/gki_module.c index 4f124f9a14ec..65a2883b539e 100644 --- a/kernel/module/gki_module.c +++ b/kernel/module/gki_module.c @@ -16,8 +16,8 @@ * gki_module_protected_exports.h -- Symbols protected from _export_ by unsigned modules * gki_module_unprotected.h -- Symbols allowed to _access_ by unsigned modules */ -#include "gki_module_protected_exports.h" -#include "gki_module_unprotected.h" +#include +#include #define MAX_STRCMP_LEN (max(MAX_UNPROTECTED_NAME_LEN, MAX_PROTECTED_EXPORTS_NAME_LEN))