diff options
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 e26e50487d60..68fcc7dc56e7 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) | |||
242 | omap_sram_size - SRAM_BOOTLOADER_SZ); | 242 | omap_sram_size - SRAM_BOOTLOADER_SZ); |
243 | } | 243 | } |
244 | 244 | ||
245 | void * omap_sram_push(void * start, unsigned long size) | 245 | /* |
246 | * Memory allocator for SRAM: calculates the new ceiling address | ||
247 | * for pushing a function using the fncpy API. | ||
248 | * | ||
249 | * Note that fncpy requires the returned address to be aligned | ||
250 | * to an 8-byte boundary. | ||
251 | */ | ||
252 | void *omap_sram_push_address(unsigned long size) | ||
246 | { | 253 | { |
247 | if (size > (omap_sram_ceil - (omap_sram_base + SRAM_BOOTLOADER_SZ))) { | 254 | if (size > (omap_sram_ceil - (omap_sram_base + SRAM_BOOTLOADER_SZ))) { |
248 | printk(KERN_ERR "Not enough space in SRAM\n"); | 255 | printk(KERN_ERR "Not enough space in SRAM\n"); |
@@ -250,10 +257,7 @@ void * omap_sram_push(void * start, unsigned long size) | |||
250 | } | 257 | } |
251 | 258 | ||
252 | omap_sram_ceil -= size; | 259 | omap_sram_ceil -= size; |
253 | omap_sram_ceil = ROUND_DOWN(omap_sram_ceil, sizeof(void *)); | 260 | omap_sram_ceil = ROUND_DOWN(omap_sram_ceil, FNCPY_ALIGN); |
254 | memcpy((void *)omap_sram_ceil, start, size); | ||
255 | flush_icache_range((unsigned long)omap_sram_ceil, | ||
256 | (unsigned long)(omap_sram_ceil + size)); | ||
257 | 261 | ||
258 | return (void *)omap_sram_ceil; | 262 | return (void *)omap_sram_ceil; |
259 | } | 263 | } |