From a2b3afb2f7437d3c84a5ebdeb2ff957deadaee57 Mon Sep 17 00:00:00 2001 From: xieliujie Date: Fri, 2 Jul 2021 20:34:05 +0800 Subject: [PATCH] ANDROID: android: Add symbols to debug_symbols driver in our vendor driver, we need the following three kernel variables: include/linuc/mm.h: extern unsigned long stack_guard_gap; extern int sysctl_legacy_va_layout; include/linux/security.h: extern unsigned long mmap_min_addr; Bug: 191439466 Signed-off-by: xieliujie Change-Id: I9d1759d8157ddd214475742e417dfb9e870d4b2e --- drivers/android/debug_symbols.c | 9 +++++++++ include/linux/android_debug_symbols.h | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/android/debug_symbols.c b/drivers/android/debug_symbols.c index 61e55575ed5f..6a4a6f8992f2 100644 --- a/drivers/android/debug_symbols.c +++ b/drivers/android/debug_symbols.c @@ -16,6 +16,8 @@ #include #include #include +#include +#include struct ads_entry { char *name; @@ -59,6 +61,13 @@ static const struct ads_entry ads_entries[ADS_END] = { #ifdef CONFIG_SWAP ADS_ENTRY(ADS_NR_SWAP_PAGES, &nr_swap_pages), #endif +#ifdef CONFIG_MMU + ADS_ENTRY(ADS_MMAP_MIN_ADDR, &mmap_min_addr), +#endif + ADS_ENTRY(ADS_STACK_GUARD_GAP, &stack_guard_gap), +#ifdef CONFIG_SYSCTL + ADS_ENTRY(ADS_SYSCTL_LEGACY_VA_LAYOUT, &sysctl_legacy_va_layout), +#endif }; /* diff --git a/include/linux/android_debug_symbols.h b/include/linux/android_debug_symbols.h index 3fc44fb36fb7..c80f063ffef4 100644 --- a/include/linux/android_debug_symbols.h +++ b/include/linux/android_debug_symbols.h @@ -29,6 +29,13 @@ enum android_debug_symbol { #endif #ifdef CONFIG_SWAP ADS_NR_SWAP_PAGES, +#endif +#ifdef CONFIG_MMU + ADS_MMAP_MIN_ADDR, +#endif + ADS_STACK_GUARD_GAP, +#ifdef CONFIG_SYSCTL + ADS_SYSCTL_LEGACY_VA_LAYOUT, #endif ADS_END };