| .. | .. |
|---|
| 20 | 20 | |
|---|
| 21 | 21 | ENTRY(ftrace_stub) |
|---|
| 22 | 22 | BR_EX %r14 |
|---|
| 23 | +ENDPROC(ftrace_stub) |
|---|
| 23 | 24 | |
|---|
| 24 | 25 | #define STACK_FRAME_SIZE (STACK_FRAME_OVERHEAD + __PT_SIZE) |
|---|
| 25 | 26 | #define STACK_PTREGS (STACK_FRAME_OVERHEAD) |
|---|
| .. | .. |
|---|
| 34 | 35 | |
|---|
| 35 | 36 | ENTRY(_mcount) |
|---|
| 36 | 37 | BR_EX %r14 |
|---|
| 37 | | - |
|---|
| 38 | +ENDPROC(_mcount) |
|---|
| 38 | 39 | EXPORT_SYMBOL(_mcount) |
|---|
| 39 | 40 | |
|---|
| 40 | 41 | ENTRY(ftrace_caller) |
|---|
| 41 | 42 | .globl ftrace_regs_caller |
|---|
| 42 | 43 | .set ftrace_regs_caller,ftrace_caller |
|---|
| 43 | 44 | stg %r14,(__SF_GPRS+8*8)(%r15) # save traced function caller |
|---|
| 45 | + lghi %r14,0 # save condition code |
|---|
| 46 | + ipm %r14 # don't put any instructions |
|---|
| 47 | + sllg %r14,%r14,16 # clobbering CC before this point |
|---|
| 44 | 48 | lgr %r1,%r15 |
|---|
| 45 | 49 | #if !(defined(CC_USING_HOTPATCH) || defined(CC_USING_NOP_MCOUNT)) |
|---|
| 46 | 50 | aghi %r0,MCOUNT_RETURN_FIXUP |
|---|
| .. | .. |
|---|
| 53 | 57 | # allocate pt_regs and stack frame for ftrace_trace_function |
|---|
| 54 | 58 | aghi %r15,-STACK_FRAME_SIZE |
|---|
| 55 | 59 | stg %r1,(STACK_PTREGS_GPRS+15*8)(%r15) |
|---|
| 60 | + stg %r14,(STACK_PTREGS_PSW)(%r15) |
|---|
| 61 | + lg %r14,(__SF_GPRS+8*8)(%r1) # restore original return address |
|---|
| 62 | + stosm (STACK_PTREGS_PSW)(%r15),0 |
|---|
| 56 | 63 | aghi %r1,-TRACED_FUNC_FRAME_SIZE |
|---|
| 57 | 64 | stg %r1,__SF_BACKCHAIN(%r15) |
|---|
| 58 | 65 | stg %r0,(STACK_PTREGS_PSW+8)(%r15) |
|---|
| .. | .. |
|---|
| 75 | 82 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
|---|
| 76 | 83 | # The j instruction gets runtime patched to a nop instruction. |
|---|
| 77 | 84 | # See ftrace_enable_ftrace_graph_caller. |
|---|
| 78 | | -ENTRY(ftrace_graph_caller) |
|---|
| 85 | + .globl ftrace_graph_caller |
|---|
| 86 | +ftrace_graph_caller: |
|---|
| 79 | 87 | j ftrace_graph_caller_end |
|---|
| 80 | | - lg %r2,(STACK_PTREGS_GPRS+14*8)(%r15) |
|---|
| 81 | | - lg %r3,(STACK_PTREGS_PSW+8)(%r15) |
|---|
| 88 | + lmg %r2,%r3,(STACK_PTREGS_GPRS+14*8)(%r15) |
|---|
| 89 | + lg %r4,(STACK_PTREGS_PSW+8)(%r15) |
|---|
| 82 | 90 | brasl %r14,prepare_ftrace_return |
|---|
| 83 | 91 | stg %r2,(STACK_PTREGS_GPRS+14*8)(%r15) |
|---|
| 84 | 92 | ftrace_graph_caller_end: |
|---|
| .. | .. |
|---|
| 87 | 95 | lg %r1,(STACK_PTREGS_PSW+8)(%r15) |
|---|
| 88 | 96 | lmg %r2,%r15,(STACK_PTREGS_GPRS+2*8)(%r15) |
|---|
| 89 | 97 | BR_EX %r1 |
|---|
| 98 | +ENDPROC(ftrace_caller) |
|---|
| 90 | 99 | |
|---|
| 91 | 100 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
|---|
| 92 | 101 | |
|---|
| .. | .. |
|---|
| 100 | 109 | lgr %r14,%r2 |
|---|
| 101 | 110 | lmg %r2,%r5,32(%r15) |
|---|
| 102 | 111 | BR_EX %r14 |
|---|
| 112 | +ENDPROC(return_to_handler) |
|---|
| 103 | 113 | |
|---|
| 104 | 114 | #endif |
|---|