From: Laura Abbott Date: Thu, 27 Feb 2014 00:23:43 +0000 (+0100) Subject: ARM: 7993/1: mm/memblock: add memblock_get_current_limit X-Git-Tag: v3.15-rc6~39^2~3^2~11 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=fec510141088ca1f15d1b79f9f6838810d668b77;p=~emulex%2Finfiniband.git ARM: 7993/1: mm/memblock: add memblock_get_current_limit Apart from setting the limit of memblock, it's also useful to be able to get the limit to avoid recalculating it every time. Add the function to do so. Acked-by: Catalin Marinas Acked-by: Santosh Shilimkar Acked-by: Andrew Morton Acked-by: Nicolas Pitre Signed-off-by: Laura Abbott Signed-off-by: Russell King --- diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 1ef66360f0b..8a20a51ed42 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -252,6 +252,8 @@ static inline void memblock_dump_all(void) void memblock_set_current_limit(phys_addr_t limit); +phys_addr_t memblock_get_current_limit(void); + /* * pfn conversion functions * diff --git a/mm/memblock.c b/mm/memblock.c index 39a31e7f004..7fe5354e755 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -1407,6 +1407,11 @@ void __init_memblock memblock_set_current_limit(phys_addr_t limit) memblock.current_limit = limit; } +phys_addr_t __init_memblock memblock_get_current_limit(void) +{ + return memblock.current_limit; +} + static void __init_memblock memblock_dump(struct memblock_type *type, char *name) { unsigned long long base, size;