summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/mcount_64.S
diff options
context:
space:
mode:
authorSteven Rostedt (Red Hat)2014-11-24 17:30:58 +0100
committerSteven Rostedt2014-12-01 20:07:16 +0100
commit4bcdf1522fb11b6c3a3dabe4432b54da2bd6bc0e (patch)
tree46343572932223c431d3188b4e8b6ed54874178d /arch/x86/kernel/mcount_64.S
parentftrace/x86: Have static tracing also use ftrace_caller_setup (diff)
downloadkernel-qcow2-linux-4bcdf1522fb11b6c3a3dabe4432b54da2bd6bc0e.tar.gz
kernel-qcow2-linux-4bcdf1522fb11b6c3a3dabe4432b54da2bd6bc0e.tar.xz
kernel-qcow2-linux-4bcdf1522fb11b6c3a3dabe4432b54da2bd6bc0e.zip
ftrace/x86: Move MCOUNT_SAVE_FRAME out of header file
Linus pointed out that MCOUNT_SAVE_FRAME is used in only a single file and that there's no reason that it should be in a header file. Move the macro to the code that uses it. Link: http://lkml.kernel.org/r/CA+55aFwF+qCGSKdGaEgW4p6N65GZ5_XTV=1NbtWDvxnd5yYLiw@mail.gmail.com Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1411262304010.3961@nanos Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'arch/x86/kernel/mcount_64.S')
-rw-r--r--arch/x86/kernel/mcount_64.S29
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/x86/kernel/mcount_64.S b/arch/x86/kernel/mcount_64.S
index 24842c701660..94fe46725fe0 100644
--- a/arch/x86/kernel/mcount_64.S
+++ b/arch/x86/kernel/mcount_64.S
@@ -21,6 +21,35 @@
# define function_hook mcount
#endif
+/* skip is set if the stack was already partially adjusted */
+.macro MCOUNT_SAVE_FRAME skip=0
+ /*
+ * We add enough stack to save all regs.
+ */
+ subq $(SS+8-\skip), %rsp
+ movq %rax, RAX(%rsp)
+ movq %rcx, RCX(%rsp)
+ movq %rdx, RDX(%rsp)
+ movq %rsi, RSI(%rsp)
+ movq %rdi, RDI(%rsp)
+ movq %r8, R8(%rsp)
+ movq %r9, R9(%rsp)
+ /* Move RIP to its proper location */
+ movq SS+8(%rsp), %rdx
+ movq %rdx, RIP(%rsp)
+ .endm
+
+.macro MCOUNT_RESTORE_FRAME skip=0
+ movq R9(%rsp), %r9
+ movq R8(%rsp), %r8
+ movq RDI(%rsp), %rdi
+ movq RSI(%rsp), %rsi
+ movq RDX(%rsp), %rdx
+ movq RCX(%rsp), %rcx
+ movq RAX(%rsp), %rax
+ addq $(SS+8-\skip), %rsp
+ .endm
+
/* skip is set if stack has been adjusted */
.macro ftrace_caller_setup trace_label skip=0
MCOUNT_SAVE_FRAME \skip