diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-17 00:34:44 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-17 00:34:44 +0100 |
commit | 5b3fcfed35735af507be36a4c3f3bbeb9bc7bbf6 (patch) | |
tree | f956ebeec64d7c4249a8886585dc8416e51d72a3 /arch/arm/mm/init.c | |
parent | Merge tag 'nfs-for-3.3-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs (diff) | |
parent | ARM: sa11x0: assabet: fix build warning (diff) | |
download | linux-5b3fcfed35735af507be36a4c3f3bbeb9bc7bbf6.tar.xz linux-5b3fcfed35735af507be36a4c3f3bbeb9bc7bbf6.zip |
Merge branch 'fixes' of git://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-arm
* 'fixes' of git://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-arm:
ARM: sa11x0: assabet: fix build warning
ARM: Add arm_memblock_steal() to allocate memory away from the kernel
ARM: 7275/1: LPAE: Check the CPU support for the long descriptor format
ARM: 7274/1: NUC900: Rename nuc900-audio platform device to nuc900-ac97
ARM: 7272/1: S3C24XX: Fix build error for missing <mach/system-reset.h>
ARM: 7271/1: Fix typo in conversion of ARCH_NR_GPIOS to Kconfig
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 @@ #include <linux/memblock.h> #include <asm/mach-types.h> +#include <asm/memblock.h> #include <asm/prom.h> #include <asm/sections.h> #include <asm/setup.h> @@ -307,6 +308,21 @@ static void arm_memory_present(void) } #endif +static bool arm_memblock_steal_permitted = true; + +phys_addr_t arm_memblock_steal(phys_addr_t size, phys_addr_t align) +{ + phys_addr_t phys; + + BUG_ON(!arm_memblock_steal_permitted); + + phys = memblock_alloc(size, align); + memblock_free(phys, size); + memblock_remove(phys, size); + + return phys; +} + void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc) { int i; @@ -349,6 +365,7 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc) if (mdesc->reserve) mdesc->reserve(); + arm_memblock_steal_permitted = false; memblock_allow_resize(); memblock_dump_all(); } |