Add a helper that generates a short snippet of code that loads the stack pointer and calls a c (or asm) function. The code gets placed into a SRAM section for loading into SRAM. Signed-off-by: Russ Dill <Russ.Dill@xxxxxx> --- arch/arm/include/asm/suspend.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/arm/include/asm/suspend.h b/arch/arm/include/asm/suspend.h index cd20029..d23d004 100644 --- a/arch/arm/include/asm/suspend.h +++ b/arch/arm/include/asm/suspend.h @@ -9,4 +9,18 @@ struct sleep_save_sp { extern void cpu_resume(void); extern int cpu_suspend(unsigned long, int (*)(unsigned long)); +/* + * Generate a SRAM trampoline for resume. + * @proc: SoC, should match argument used with SRAM_SECTIONS(). + * @func: C or asm function to call at resume. + * @stack: Stack to use before calling func. + */ +#define ARM_SRAM_RESUME(proc, func, stack) \ +void __naked __noreturn __sram_##proc proc##_resume_trampoline(void) \ +{ \ + __asm__ __volatile__("mov sp, %0" : : "r"((stack)) : "sp"); \ + func(); \ +} + + #endif -- 1.8.3.2 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html