fmem: reserve memory for fmem
Fmem will use a block of contiguous memory at the end of the memory bank with the greatest physical address. Change-Id: I74d93f356e1e24b76e7b8f3432c3b021503fd387 Signed-off-by: Larry Bassel <lbassel@codeaurora.org>
This commit is contained in:
committed by
Laura Abbott
parent
1daa0f027e
commit
1eb58f0a2f
@@ -62,4 +62,6 @@ struct reserve_info {
|
||||
};
|
||||
|
||||
extern struct reserve_info *reserve_info;
|
||||
|
||||
unsigned long __init reserve_memory_for_fmem(unsigned long);
|
||||
#endif
|
||||
|
||||
@@ -304,6 +304,24 @@ static void __init reserve_memory_for_mempools(void)
|
||||
}
|
||||
}
|
||||
|
||||
unsigned long __init reserve_memory_for_fmem(unsigned long fmem_size)
|
||||
{
|
||||
struct membank *mb;
|
||||
int ret;
|
||||
unsigned long fmem_phys;
|
||||
|
||||
if (!fmem_size)
|
||||
return 0;
|
||||
|
||||
mb = &meminfo.bank[meminfo.nr_banks - 1];
|
||||
fmem_phys = mb->start + (mb->size - fmem_size);
|
||||
ret = memblock_remove(fmem_phys, fmem_size);
|
||||
BUG_ON(ret);
|
||||
|
||||
pr_info("fmem start %lx size %lx\n", fmem_phys, fmem_size);
|
||||
return fmem_phys;
|
||||
}
|
||||
|
||||
static void __init initialize_mempools(void)
|
||||
{
|
||||
struct mem_pool *mpool;
|
||||
|
||||
Reference in New Issue
Block a user