From: Sam Ravnborg Date: Wed, 5 Oct 2011 00:42:59 +0000 (+1100) Subject: memblock: add memblock_start_of_DRAM() X-Git-Tag: next-20111007~1^2~183 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=533cad4b4592d6b822abd17dc35cc0c1bf08ffc8;p=karo-tx-linux.git memblock: add memblock_start_of_DRAM() SPARC32 require access to the start address. Add a new helper memblock_start_of_DRAM() to give access to the address of the first memblock - which contains the lowest address. The awkward name was chosen to match the already present memblock_end_of_DRAM(). Signed-off-by: Sam Ravnborg Cc: "David S. Miller" Cc: Yinghai Lu Acked-by: Tejun Heo Cc: "H. Peter Anvin" Signed-off-by: Andrew Morton --- diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 7525e38c434d..e6b843e16e81 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h @@ -80,6 +80,7 @@ extern phys_addr_t __memblock_alloc_base(phys_addr_t size, phys_addr_t align, phys_addr_t max_addr); extern phys_addr_t memblock_phys_mem_size(void); +extern phys_addr_t memblock_start_of_DRAM(void); extern phys_addr_t memblock_end_of_DRAM(void); extern void memblock_enforce_memory_limit(phys_addr_t memory_limit); extern int memblock_is_memory(phys_addr_t addr); diff --git a/mm/memblock.c b/mm/memblock.c index ccbf97339592..b7ed63633581 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -626,6 +626,12 @@ phys_addr_t __init memblock_phys_mem_size(void) return memblock.memory_size; } +/* lowest address */ +phys_addr_t __init_memblock memblock_start_of_DRAM(void) +{ + return memblock.memory.regions[0].base; +} + phys_addr_t __init_memblock memblock_end_of_DRAM(void) { int idx = memblock.memory.cnt - 1;