diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-11-15 17:41:21 +0100 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-11-15 17:41:21 +0100 |
commit | 8dbd2879e33be37adf40f747a5fb80ef1a6cd150 (patch) | |
tree | c688d7980be8c1c0dbf5e411caaf2c102120102e /mm/memblock.c | |
parent | b770ea523d95837e968d46c7fe09a3f5edd9bb27 (diff) | |
parent | d308ba50a1234b299a00e63a95e61fdeb2f1a2df (diff) | |
download | kernel_goldelico_gta04-8dbd2879e33be37adf40f747a5fb80ef1a6cd150.zip kernel_goldelico_gta04-8dbd2879e33be37adf40f747a5fb80ef1a6cd150.tar.gz kernel_goldelico_gta04-8dbd2879e33be37adf40f747a5fb80ef1a6cd150.tar.bz2 |
Merge branch 'omap/dt' into next/drivers
Needed for the omap timer changes.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'mm/memblock.c')
-rw-r--r-- | mm/memblock.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mm/memblock.c b/mm/memblock.c index 931eef1..6259055 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -930,6 +930,30 @@ int __init_memblock memblock_is_region_reserved(phys_addr_t base, phys_addr_t si return memblock_overlaps_region(&memblock.reserved, base, size) >= 0; } +void __init_memblock memblock_trim_memory(phys_addr_t align) +{ + int i; + phys_addr_t start, end, orig_start, orig_end; + struct memblock_type *mem = &memblock.memory; + + for (i = 0; i < mem->cnt; i++) { + orig_start = mem->regions[i].base; + orig_end = mem->regions[i].base + mem->regions[i].size; + start = round_up(orig_start, align); + end = round_down(orig_end, align); + + if (start == orig_start && end == orig_end) + continue; + + if (start < end) { + mem->regions[i].base = start; + mem->regions[i].size = end - start; + } else { + memblock_remove_region(mem, i); + i--; + } + } +} void __init_memblock memblock_set_current_limit(phys_addr_t limit) { |