blob: 195583e62ea2976328213d16ccd28916e78e7357 [file] [log] [blame]
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Prasad Sodagudi <psodagud@codeaurora.org>
Date: Mon, 21 Dec 2020 13:09:29 -0800
Subject: NOUPSTREAM: ANDROID: mm: Memory Management Exports
per_cpu_ptr_to_phys symbols is needed for vendor loadable modules
to find the per cpu physical address of symbols.
[CPNOTE: 01/07/21] Lee: Vendor GKI export
Squash:
NOUPSTREAM: ANDROID: mm/memory.c: export mm_trace_rss_stat
NOUPSTREAM: ANDROID: mm/memblock: export memblock_end_of_DRAM
NOUPSTREAM: ANDROID: GKI: export cma symbols for cma heap as a module
Bug: 176125613
Bug: 171499373
Bug: 140294230
Change-Id: Ifc23a8a9cae8eb11c94107eb9b9237a838f830bc
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
mm/cma.c | 5 +++++
mm/memblock.c | 1 +
mm/memory.c | 1 +
mm/percpu.c | 1 +
4 files changed, 8 insertions(+)
diff --git a/mm/cma.c b/mm/cma.c
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -24,6 +24,7 @@
#include <linux/memblock.h>
#include <linux/err.h>
#include <linux/mm.h>
+#include <linux/module.h>
#include <linux/sizes.h>
#include <linux/slab.h>
#include <linux/log2.h>
@@ -54,6 +55,7 @@ const char *cma_get_name(const struct cma *cma)
{
return cma->name;
}
+EXPORT_SYMBOL_GPL(cma_get_name);
static unsigned long cma_bitmap_aligned_mask(const struct cma *cma,
unsigned int align_order)
@@ -547,6 +549,7 @@ struct page *cma_alloc(struct cma *cma, unsigned long count,
return page;
}
+EXPORT_SYMBOL_GPL(cma_alloc);
bool cma_pages_valid(struct cma *cma, const struct page *pages,
unsigned long count)
@@ -597,6 +600,7 @@ bool cma_release(struct cma *cma, const struct page *pages,
return true;
}
+EXPORT_SYMBOL_GPL(cma_release);
int cma_for_each_area(int (*it)(struct cma *cma, void *data), void *data)
{
@@ -611,3 +615,4 @@ int cma_for_each_area(int (*it)(struct cma *cma, void *data), void *data)
return 0;
}
+EXPORT_SYMBOL_GPL(cma_for_each_area);
diff --git a/mm/memblock.c b/mm/memblock.c
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -1648,6 +1648,7 @@ phys_addr_t __init_memblock memblock_end_of_DRAM(void)
return (memblock.memory.regions[idx].base + memblock.memory.regions[idx].size);
}
+EXPORT_SYMBOL_GPL(memblock_end_of_DRAM);
static phys_addr_t __init_memblock __find_max_addr(phys_addr_t limit)
{
diff --git a/mm/memory.c b/mm/memory.c
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -172,6 +172,7 @@ void mm_trace_rss_stat(struct mm_struct *mm, int member, long count)
{
trace_rss_stat(mm, member, count);
}
+EXPORT_SYMBOL_GPL(mm_trace_rss_stat);
#if defined(SPLIT_RSS_COUNTING)
diff --git a/mm/percpu.c b/mm/percpu.c
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -2419,6 +2419,7 @@ phys_addr_t per_cpu_ptr_to_phys(void *addr)
return page_to_phys(pcpu_addr_to_page(addr)) +
offset_in_page(addr);
}
+EXPORT_SYMBOL_GPL(per_cpu_ptr_to_phys);
/**
* pcpu_alloc_alloc_info - allocate percpu allocation info