diff options
Diffstat (limited to 'arch/arm/mm/init.c')
-rw-r--r-- | arch/arm/mm/init.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index e34ea8adc1f9..6ec1226fc62d 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/memblock.h> | 22 | #include <linux/memblock.h> |
23 | 23 | ||
24 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
25 | #include <asm/memblock.h> | ||
25 | #include <asm/prom.h> | 26 | #include <asm/prom.h> |
26 | #include <asm/sections.h> | 27 | #include <asm/sections.h> |
27 | #include <asm/setup.h> | 28 | #include <asm/setup.h> |
@@ -307,6 +308,21 @@ static void arm_memory_present(void) | |||
307 | } | 308 | } |
308 | #endif | 309 | #endif |
309 | 310 | ||
311 | static bool arm_memblock_steal_permitted = true; | ||
312 | |||
313 | phys_addr_t arm_memblock_steal(phys_addr_t size, phys_addr_t align) | ||
314 | { | ||
315 | phys_addr_t phys; | ||
316 | |||
317 | BUG_ON(!arm_memblock_steal_permitted); | ||
318 | |||
319 | phys = memblock_alloc(size, align); | ||
320 | memblock_free(phys, size); | ||
321 | memblock_remove(phys, size); | ||
322 | |||
323 | return phys; | ||
324 | } | ||
325 | |||
310 | void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc) | 326 | void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc) |
311 | { | 327 | { |
312 | int i; | 328 | int i; |
@@ -349,6 +365,7 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc) | |||
349 | if (mdesc->reserve) | 365 | if (mdesc->reserve) |
350 | mdesc->reserve(); | 366 | mdesc->reserve(); |
351 | 367 | ||
368 | arm_memblock_steal_permitted = false; | ||
352 | memblock_allow_resize(); | 369 | memblock_allow_resize(); |
353 | memblock_dump_all(); | 370 | memblock_dump_all(); |
354 | } | 371 | } |