/* When a retprobed function returns, trampoline_handler() is called, calling the kretprobe's handler. We construct a struct pt_regs to give a view of registers r0-r11 to the user return-handler. This is not a complete pt_regs structure, but that should be plenty sufficient for kretprobe handlers which should normally be interested in r0 only anyway.  */
void __naked __kprobes kretprobe_trampoline(void)
/* When a retprobed function returns, trampoline_handler() is called, calling the kretprobe's handler. We construct a struct pt_regs to give a view of registers r0-r11 to the user return-handler. This is not a complete pt_regs structure, but that should be plenty sufficient for kretprobe handlers which should normally be interested in r0 only anyway.  */
void __naked __kprobes kretprobe_trampoline(void)
{
	__asm__ __volatile__ (
		"stmdb	sp!, {r0 - r11}		\n\t"
		"mov	r0, sp			\n\t"
		"bl	trampoline_handler	\n\t"
		"mov	lr, r0			\n\t"
		"ldmia	sp!, {r0 - r11}		\n\t"
		"mov	pc, lr			\n\t"
		: : : "memory");
}