7
7
8
8
#include <linux/linkage.h>
9
9
#include <asm-generic/export.h>
10
+ #include <asm/assembler.h>
10
11
11
12
; ftrace placeholder, just return to caller
12
13
ENTRY(ftrace_stub)
13
14
j_s [blink]
14
15
ENDPROC(ftrace_stub)
15
16
16
17
.macro SAVE_ABI
17
- push blink
18
+ PUSHR blink
19
+ PUSHR fp
18
20
.endm
19
21
20
22
.macro LOAD_ABI
21
- pop blink
23
+ POPR fp
24
+ POPR blink
22
25
.endm
23
26
24
27
.macro SAVE_ABI_RET
25
- push r0
26
- push r1
28
+ PUSHR r0
29
+ PUSHR r1
27
30
.endm
28
31
29
32
.macro LOAD_ABI_RET
30
- pop r1
31
- pop r0
33
+ POPR r1
34
+ POPR r0
32
35
.endm
33
36
34
37
; r0 has the frompc (targets parent ip)
@@ -38,17 +41,23 @@ ENTRY(_mcount)
38
41
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
39
42
40
43
; *ftrace_graph_return != ftrace_stub
41
- ld r3 , [ ftrace_graph_return ]
42
- brne r3 , @ftrace_stub , @do_ftrace_graph_caller
44
+ MOVA r3, ftrace_graph_return
45
+ LDR r3, r3
46
+ MOVA r4, @ftrace_stub
47
+ brne r3, r4, @do_ftrace_graph_caller
43
48
; *ftrace_graph_entry != *ftrace_graph_entry_stub
44
- ld r3 , [ ftrace_graph_entry ]
45
- brne r3 , @ftrace_graph_entry_stub , @do_ftrace_graph_caller
49
+ MOVA r3, @ftrace_graph_entry
50
+ LDR r3, r3
51
+ MOVA r4, @ftrace_graph_entry_stub
52
+ brne r3, r4, @do_ftrace_graph_caller
46
53
47
54
#endif
48
55
49
56
; *ftrace_trace_function != ftrace_stub
50
- ld r2 , [ ftrace_trace_function ]
51
- brne r2 , @ftrace_stub , @do_trace
57
+ MOVA r2, ftrace_trace_function
58
+ LDR r2, r2
59
+ MOVA r3, @ftrace_stub
60
+ brne r2, r3, @do_trace
52
61
; Return
53
62
j_s [blink]
54
63
@@ -61,31 +70,40 @@ ENTRY(return_to_handler)
61
70
; Save return value (if any) from handled routine
62
71
SAVE_ABI_RET
63
72
; Will return true blink on r0
64
- jl ftrace_return_to_handler
65
- mov r2 , r0
73
+ MOVA r0, @ftrace_return_to_handler
74
+ jl [r0]
75
+ MOVR r2, r0
66
76
LOAD_ABI_RET
67
77
j [r2]
68
78
69
79
ENDPROC(return_to_handler)
70
80
71
81
do_ftrace_graph_caller:
82
+
83
+ #ifndef CONFIG_ISA_ARCV3
72
84
; ABI does not allow us to infer blink location
73
85
; ARC GCC port inserts into r1 the delta between the pushed blink and
74
86
; the sp at call time
75
87
; We perform calculation before any push (sp change) happens
76
- add r0 , r1 , sp
88
+ ADDR r0, r1, sp
89
+ SAVE_ABI
90
+ SUBR r0, r0, REGSZASM
91
+ #else
77
92
SAVE_ABI
78
- sub r0 , r0 , 4
79
- mov r1 , blink
80
- jl prepare_ftrace_return
93
+ ADDR r0, fp, REGSZASM
94
+ #endif
95
+
96
+ MOVR r1, blink
97
+ MOVA r2, @prepare_ftrace_return
98
+ jl [r2]
81
99
LOAD_ABI
82
100
j_s [blink]
83
101
#endif
84
102
85
103
do_trace:
86
104
SAVE_ABI
87
- mov r1 , r0
88
- mov r0 , blink
105
+ MOVR r1, r0
106
+ MOVR r0, blink
89
107
jl [r2]
90
108
; load ABI state and jump to blink (in stack)
91
109
LOAD_ABI
0 commit comments