Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) #include <asm/assembler.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) #include <asm/ftrace.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) #include <asm/unwind.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) #include "entry-header.S"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  * When compiling with -pg, gcc inserts a call to the mcount routine at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)  * start of every function.  In mcount, apart from the function's address (in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12)  * lr), we need to get hold of the function's caller's address.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)  * Newer GCCs (4.4+) solve this problem by using a version of mcount with call
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15)  * sites like:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)  *	push	{lr}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)  *	bl	__gnu_mcount_nc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)  * With these compilers, frame pointers are not necessary.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  * mcount can be thought of as a function called in the middle of a subroutine
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)  * call.  As such, it needs to be transparent for both the caller and the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)  * callee: the original lr needs to be restored when leaving mcount, and no
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)  * registers should be clobbered.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)  * When using dynamic ftrace, we patch out the mcount call by a "pop {lr}"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)  * instead of the __gnu_mcount_nc call (see arch/arm/kernel/ftrace.c).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) .macro mcount_adjust_addr rd, rn
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 	bic	\rd, \rn, #1		@ clear the Thumb bit if present
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	sub	\rd, \rd, #MCOUNT_INSN_SIZE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) .endm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) .macro __mcount suffix
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	mcount_enter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	ldr	r0, =ftrace_trace_function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 	ldr	r2, [r0]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 	adr	r0, .Lftrace_stub
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	cmp	r0, r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	bne	1f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) #ifdef CONFIG_FUNCTION_GRAPH_TRACER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	ldr     r1, =ftrace_graph_return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	ldr     r2, [r1]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	cmp     r0, r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	bne     ftrace_graph_caller\suffix
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	ldr     r1, =ftrace_graph_entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	ldr     r2, [r1]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	ldr     r0, =ftrace_graph_entry_stub
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	cmp     r0, r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	bne     ftrace_graph_caller\suffix
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	mcount_exit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 1: 	mcount_get_lr	r1			@ lr of instrumented func
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	mcount_adjust_addr	r0, lr		@ instrumented function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	badr	lr, 2f
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	mov	pc, r2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 2:	mcount_exit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) .endm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) .macro __ftrace_regs_caller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	str	lr, [sp, #-8]!	@ store LR as PC and make space for CPSR/OLD_R0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 				@ OLD_R0 will overwrite previous LR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 	ldr	lr, [sp, #8]    @ get previous LR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 	str	r0, [sp, #8]	@ write r0 as OLD_R0 over previous LR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 	str	lr, [sp, #-4]!	@ store previous LR as LR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	add 	lr, sp, #16	@ move in LR the value of SP as it was
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 				@ before the push {lr} of the mcount mechanism
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	push	{r0-r11, ip, lr}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	@ stack content at this point:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	@ 0  4          48   52       56            60   64    68       72
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	@ R0 | R1 | ... | IP | SP + 4 | previous LR | LR | PSR | OLD_R0 |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	mov	r3, sp				@ struct pt_regs*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	ldr r2, =function_trace_op
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	ldr r2, [r2]				@ pointer to the current
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 						@ function tracing op
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	ldr	r1, [sp, #S_LR]			@ lr of instrumented func
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	ldr	lr, [sp, #S_PC]			@ get LR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	mcount_adjust_addr	r0, lr		@ instrumented function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	.globl ftrace_regs_call
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) ftrace_regs_call:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	bl	ftrace_stub
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) #ifdef CONFIG_FUNCTION_GRAPH_TRACER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	.globl ftrace_graph_regs_call
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) ftrace_graph_regs_call:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	mov	r0, r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	@ pop saved regs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 	pop	{r0-r11, ip, lr}		@ restore r0 through r12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 	ldr	lr, [sp], #4			@ restore LR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	ldr	pc, [sp], #12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) .endm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) #ifdef CONFIG_FUNCTION_GRAPH_TRACER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) .macro __ftrace_graph_regs_caller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	sub     r0, fp, #4              @ lr of instrumented routine (parent)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 	@ called from __ftrace_regs_caller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	ldr     r1, [sp, #S_PC]		@ instrumented routine (func)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	mcount_adjust_addr	r1, r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	mov	r2, fp			@ frame pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	bl	prepare_ftrace_return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 	@ pop registers saved in ftrace_regs_caller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 	pop	{r0-r11, ip, lr}		@ restore r0 through r12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 	ldr	lr, [sp], #4			@ restore LR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) 	ldr	pc, [sp], #12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) .endm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) .macro __ftrace_caller suffix
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	mcount_enter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 	mcount_get_lr	r1			@ lr of instrumented func
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	mcount_adjust_addr	r0, lr		@ instrumented function
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	ldr r2, =function_trace_op
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	ldr r2, [r2]				@ pointer to the current
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 						@ function tracing op
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	mov r3, #0				@ regs is NULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 	.globl ftrace_call\suffix
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) ftrace_call\suffix:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	bl	ftrace_stub
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) #ifdef CONFIG_FUNCTION_GRAPH_TRACER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	.globl ftrace_graph_call\suffix
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) ftrace_graph_call\suffix:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	mov	r0, r0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 	mcount_exit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) .endm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) .macro __ftrace_graph_caller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 	sub	r0, fp, #4		@ &lr of instrumented routine (&parent)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) #ifdef CONFIG_DYNAMIC_FTRACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 	@ called from __ftrace_caller, saved in mcount_enter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	ldr	r1, [sp, #16]		@ instrumented routine (func)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 	mcount_adjust_addr	r1, r1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	@ called from __mcount, untouched in lr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 	mcount_adjust_addr	r1, lr	@ instrumented routine (func)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	mov	r2, fp			@ frame pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	bl	prepare_ftrace_return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 	mcount_exit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) .endm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)  * __gnu_mcount_nc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) .macro mcount_enter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)  * This pad compensates for the push {lr} at the call site.  Note that we are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)  * unable to unwind through a function which does not otherwise save its lr.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)  UNWIND(.pad	#4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	stmdb	sp!, {r0-r3, lr}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189)  UNWIND(.save	{r0-r3, lr})
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) .endm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) .macro mcount_get_lr reg
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	ldr	\reg, [sp, #20]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) .endm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) .macro mcount_exit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	ldmia	sp!, {r0-r3}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	ldr	lr, [sp, #4]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	ldr	pc, [sp], #8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) .endm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) ENTRY(__gnu_mcount_nc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) UNWIND(.fnstart)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) #ifdef CONFIG_DYNAMIC_FTRACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	push	{lr}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 	ldr	lr, [sp, #4]
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	ldr	pc, [sp], #8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	__mcount
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) UNWIND(.fnend)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) ENDPROC(__gnu_mcount_nc)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) #ifdef CONFIG_DYNAMIC_FTRACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) ENTRY(ftrace_caller)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) UNWIND(.fnstart)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	__ftrace_caller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) UNWIND(.fnend)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) ENDPROC(ftrace_caller)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) ENTRY(ftrace_regs_caller)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) UNWIND(.fnstart)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 	__ftrace_regs_caller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) UNWIND(.fnend)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) ENDPROC(ftrace_regs_caller)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) #ifdef CONFIG_FUNCTION_GRAPH_TRACER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) ENTRY(ftrace_graph_caller)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) UNWIND(.fnstart)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 	__ftrace_graph_caller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) UNWIND(.fnend)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) ENDPROC(ftrace_graph_caller)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) ENTRY(ftrace_graph_regs_caller)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) UNWIND(.fnstart)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 	__ftrace_graph_regs_caller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) UNWIND(.fnend)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) ENDPROC(ftrace_graph_regs_caller)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) .purgem mcount_enter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) .purgem mcount_get_lr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) .purgem mcount_exit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) #ifdef CONFIG_FUNCTION_GRAPH_TRACER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 	.globl return_to_handler
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) return_to_handler:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 	stmdb	sp!, {r0-r3}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 	mov	r0, fp			@ frame pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 	bl	ftrace_return_to_handler
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 	mov	lr, r0			@ r0 has real ret addr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 	ldmia	sp!, {r0-r3}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 	ret	lr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) ENTRY(ftrace_stub)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) .Lftrace_stub:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 	ret	lr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) ENDPROC(ftrace_stub)