aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/entry_64.S
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2008-12-12 16:09:08 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-16 18:26:38 -0500
commitd680fe44775ed17a80035462d9898f5e77bfd7dd (patch)
treedddee638e2a44d5008684c6a59b44edcae98ba8f /arch/x86/kernel/entry_64.S
parent66896a85cf2890b6bbbc4c9ccdcd296600ffbf89 (diff)
x86: entry_64 - introduce FTRACE_ frame macro v2
Impact: clean up Itroduce MCOUNT_SAVE/RESTORE_FRAME which allow us to save a number of lines on source level. Also fix a comment in ftrace.h. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/entry_64.S')
-rw-r--r--arch/x86/kernel/entry_64.S57
1 files changed, 7 insertions, 50 deletions
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 54e0bbdccb99..303dd84d2a98 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -71,15 +71,7 @@ ENTRY(ftrace_caller)
71 cmpl $0, function_trace_stop 71 cmpl $0, function_trace_stop
72 jne ftrace_stub 72 jne ftrace_stub
73 73
74 /* taken from glibc */ 74 MCOUNT_SAVE_FRAME
75 subq $0x38, %rsp
76 movq %rax, (%rsp)
77 movq %rcx, 8(%rsp)
78 movq %rdx, 16(%rsp)
79 movq %rsi, 24(%rsp)
80 movq %rdi, 32(%rsp)
81 movq %r8, 40(%rsp)
82 movq %r9, 48(%rsp)
83 75
84 movq 0x38(%rsp), %rdi 76 movq 0x38(%rsp), %rdi
85 movq 8(%rbp), %rsi 77 movq 8(%rbp), %rsi
@@ -89,14 +81,7 @@ ENTRY(ftrace_caller)
89ftrace_call: 81ftrace_call:
90 call ftrace_stub 82 call ftrace_stub
91 83
92 movq 48(%rsp), %r9 84 MCOUNT_RESTORE_FRAME
93 movq 40(%rsp), %r8
94 movq 32(%rsp), %rdi
95 movq 24(%rsp), %rsi
96 movq 16(%rsp), %rdx
97 movq 8(%rsp), %rcx
98 movq (%rsp), %rax
99 addq $0x38, %rsp
100 85
101#ifdef CONFIG_FUNCTION_GRAPH_TRACER 86#ifdef CONFIG_FUNCTION_GRAPH_TRACER
102.globl ftrace_graph_call 87.globl ftrace_graph_call
@@ -130,15 +115,7 @@ ftrace_stub:
130 retq 115 retq
131 116
132trace: 117trace:
133 /* taken from glibc */ 118 MCOUNT_SAVE_FRAME
134 subq $0x38, %rsp
135 movq %rax, (%rsp)
136 movq %rcx, 8(%rsp)
137 movq %rdx, 16(%rsp)
138 movq %rsi, 24(%rsp)
139 movq %rdi, 32(%rsp)
140 movq %r8, 40(%rsp)
141 movq %r9, 48(%rsp)
142 119
143 movq 0x38(%rsp), %rdi 120 movq 0x38(%rsp), %rdi
144 movq 8(%rbp), %rsi 121 movq 8(%rbp), %rsi
@@ -146,14 +123,7 @@ trace:
146 123
147 call *ftrace_trace_function 124 call *ftrace_trace_function
148 125
149 movq 48(%rsp), %r9 126 MCOUNT_RESTORE_FRAME
150 movq 40(%rsp), %r8
151 movq 32(%rsp), %rdi
152 movq 24(%rsp), %rsi
153 movq 16(%rsp), %rdx
154 movq 8(%rsp), %rcx
155 movq (%rsp), %rax
156 addq $0x38, %rsp
157 127
158 jmp ftrace_stub 128 jmp ftrace_stub
159END(mcount) 129END(mcount)
@@ -165,14 +135,7 @@ ENTRY(ftrace_graph_caller)
165 cmpl $0, function_trace_stop 135 cmpl $0, function_trace_stop
166 jne ftrace_stub 136 jne ftrace_stub
167 137
168 subq $0x38, %rsp 138 MCOUNT_SAVE_FRAME
169 movq %rax, (%rsp)
170 movq %rcx, 8(%rsp)
171 movq %rdx, 16(%rsp)
172 movq %rsi, 24(%rsp)
173 movq %rdi, 32(%rsp)
174 movq %r8, 40(%rsp)
175 movq %r9, 48(%rsp)
176 139
177 leaq 8(%rbp), %rdi 140 leaq 8(%rbp), %rdi
178 movq 0x38(%rsp), %rsi 141 movq 0x38(%rsp), %rsi
@@ -180,14 +143,8 @@ ENTRY(ftrace_graph_caller)
180 143
181 call prepare_ftrace_return 144 call prepare_ftrace_return
182 145
183 movq 48(%rsp), %r9 146 MCOUNT_RESTORE_FRAME
184 movq 40(%rsp), %r8 147
185 movq 32(%rsp), %rdi
186 movq 24(%rsp), %rsi
187 movq 16(%rsp), %rdx
188 movq 8(%rsp), %rcx
189 movq (%rsp), %rax
190 addq $0x38, %rsp
191 retq 148 retq
192END(ftrace_graph_caller) 149END(ftrace_graph_caller)
193 150