ARM: 6649/1: omap: use fncpy to copy the PM code functions to SRAM
[pandora-kernel.git] / arch / arm / plat-omap / include / plat / sram.h
index 9967d5e..f500fc3 100644 (file)
 #define __ARCH_ARM_OMAP_SRAM_H
 
 #ifndef __ASSEMBLY__
-extern void * omap_sram_push(void * start, unsigned long size);
+#include <asm/fncpy.h>
+
+extern void *omap_sram_push_address(unsigned long size);
+
+/* Macro to push a function to the internal SRAM, using the fncpy API */
+#define omap_sram_push(funcp, size) ({                         \
+       typeof(&(funcp)) _res = NULL;                           \
+       void *_sram_address = omap_sram_push_address(size);     \
+       if (_sram_address)                                      \
+               _res = fncpy(_sram_address, &(funcp), size);    \
+       _res;                                                   \
+})
+
 extern void omap_sram_reprogram_clock(u32 dpllctl, u32 ckctl);
 
 extern void omap2_sram_ddr_init(u32 *slow_dll_ctrl, u32 fast_dll_ctrl,