diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2011-02-23 10:08:33 -0500 |
---|---|---|
committer | Nicolas Pitre <nicolas.pitre@linaro.org> | 2011-02-23 10:08:33 -0500 |
commit | a010ae86cc27ef660afdcc7e7d4cdbc2b38fce09 (patch) | |
tree | 50fb5ee861b3b0e79e31529f3bebb67baf12b7af /arch/arm/plat-omap/sram.c | |
parent | 239a14a340ad4a81cfff4075625382d7f78f5258 (diff) | |
parent | 4760195df00982b4e388e859b41a63feed6d0cab (diff) |
Merge branch 'for-linaro-2.6.38/dirty/arm/omap-thumb2+merged' of git://git.linaro.org/people/dmart/linux-2.6-arm into linaro-2.6.38linaro-linux-2.6.38-upstream-23Feb2011
Diffstat (limited to 'arch/arm/plat-omap/sram.c')
-rw-r--r-- | arch/arm/plat-omap/sram.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index e26e50487d6..68fcc7dc56e 100644 --- a/arch/arm/plat-omap/sram.c +++ b/arch/arm/plat-omap/sram.c @@ -242,7 +242,14 @@ static void __init omap_map_sram(void) omap_sram_size - SRAM_BOOTLOADER_SZ); } -void * omap_sram_push(void * start, unsigned long size) +/* + * Memory allocator for SRAM: calculates the new ceiling address + * for pushing a function using the fncpy API. + * + * Note that fncpy requires the returned address to be aligned + * to an 8-byte boundary. + */ +void *omap_sram_push_address(unsigned long size) { if (size > (omap_sram_ceil - (omap_sram_base + SRAM_BOOTLOADER_SZ))) { printk(KERN_ERR "Not enough space in SRAM\n"); @@ -250,10 +257,7 @@ void * omap_sram_push(void * start, unsigned long size) } omap_sram_ceil -= size; - omap_sram_ceil = ROUND_DOWN(omap_sram_ceil, sizeof(void *)); - memcpy((void *)omap_sram_ceil, start, size); - flush_icache_range((unsigned long)omap_sram_ceil, - (unsigned long)(omap_sram_ceil + size)); + omap_sram_ceil = ROUND_DOWN(omap_sram_ceil, FNCPY_ALIGN); return (void *)omap_sram_ceil; } |