summaryrefslogtreecommitdiff
path: root/arch/xtensa/mm
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2014-03-23 03:17:43 +0400
committerMax Filippov <jcmvbkbc@gmail.com>2014-04-02 01:35:51 +0400
commit9ba067f93f1eec0d241f002812806b873dd4f802 (patch)
tree423c136a38f9290bf8fba0ede928f9bc8e9bc3a8 /arch/xtensa/mm
parent25df8198f4b257cf6db4d4f000c53accfa9c28f8 (diff)
xtensa: split bootparam and kernel meminfo
Bootparam meminfo is a bootloader ABI, kernel meminfo is for the kernel bookkeeping, keep them separate. Kernel doesn't care of memory region types, so drop the type field and don't pass it to add_sysmem_bank. Move kernel sysmem structures and prototypes to asm/sysmem.h and sysmem variable and add_sysmem_bank to mm/init.c Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/mm')
-rw-r--r--arch/xtensa/mm/init.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/xtensa/mm/init.c b/arch/xtensa/mm/init.c
index aff108df92d3..4f78264e8bd8 100644
--- a/arch/xtensa/mm/init.c
+++ b/arch/xtensa/mm/init.c
@@ -27,6 +27,23 @@
#include <asm/bootparam.h>
#include <asm/page.h>
#include <asm/sections.h>
+#include <asm/sysmem.h>
+
+struct sysmem_info sysmem __initdata;
+
+int __init add_sysmem_bank(unsigned long start, unsigned long end)
+{
+ if (sysmem.nr_banks >= SYSMEM_BANKS_MAX) {
+ pr_warn("Ignoring memory bank 0x%08lx size %ldKB\n",
+ start, end - start);
+ return -EINVAL;
+ }
+ sysmem.bank[sysmem.nr_banks].start = PAGE_ALIGN(start);
+ sysmem.bank[sysmem.nr_banks].end = end & PAGE_MASK;
+ sysmem.nr_banks++;
+
+ return 0;
+}
/*
* mem_reserve(start, end, must_exist)