1/* 2 * Copyright IBM Corp. 2008, 2009 3 * 4 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>, 5 * 6 */ 7 8#include <linux/linkage.h> 9#include <asm/asm-offsets.h> 10 11 .section .kprobes.text, "ax" 12 13ENTRY(ftrace_stub) 14 br %r14 15 16ENTRY(_mcount) 17#ifdef CONFIG_DYNAMIC_FTRACE 18 br %r14 19 20ENTRY(ftrace_caller) 21#endif 22 stm %r2,%r5,16(%r15) 23 bras %r1,2f 240: .long ftrace_trace_function 251: .long function_trace_stop 262: l %r2,1b-0b(%r1) 27 icm %r2,0xf,0(%r2) 28 jnz 3f 29 st %r14,56(%r15) 30 lr %r0,%r15 31 ahi %r15,-96 32 l %r3,100(%r15) 33 la %r2,0(%r14) 34 st %r0,__SF_BACKCHAIN(%r15) 35 la %r3,0(%r3) 36 l %r14,0b-0b(%r1) 37 l %r14,0(%r14) 38 basr %r14,%r14 39#ifdef CONFIG_FUNCTION_GRAPH_TRACER 40 l %r2,100(%r15) 41 l %r3,152(%r15) 42ENTRY(ftrace_graph_caller) 43# The bras instruction gets runtime patched to call prepare_ftrace_return. 44# See ftrace_enable_ftrace_graph_caller. The patched instruction is: 45# bras %r14,prepare_ftrace_return 46 bras %r14,0f 470: st %r2,100(%r15) 48#endif 49 ahi %r15,96 50 l %r14,56(%r15) 513: lm %r2,%r5,16(%r15) 52 br %r14 53 54#ifdef CONFIG_FUNCTION_GRAPH_TRACER 55 56ENTRY(return_to_handler) 57 stm %r2,%r5,16(%r15) 58 st %r14,56(%r15) 59 lr %r0,%r15 60 ahi %r15,-96 61 st %r0,__SF_BACKCHAIN(%r15) 62 bras %r1,0f 63 .long ftrace_return_to_handler 640: l %r2,0b-0b(%r1) 65 basr %r14,%r2 66 lr %r14,%r2 67 ahi %r15,96 68 lm %r2,%r5,16(%r15) 69 br %r14 70 71#endif 72