aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/ftrace.h
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/include/asm/ftrace.h
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/include/asm/ftrace.h')
-rw-r--r--arch/x86/include/asm/ftrace.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
index 7e61b4ceb9a4..b55b4a7fbefd 100644
--- a/arch/x86/include/asm/ftrace.h
+++ b/arch/x86/include/asm/ftrace.h
@@ -1,6 +1,33 @@
1#ifndef _ASM_X86_FTRACE_H 1#ifndef _ASM_X86_FTRACE_H
2#define _ASM_X86_FTRACE_H 2#define _ASM_X86_FTRACE_H
3 3
4#ifdef __ASSEMBLY__
5
6 .macro MCOUNT_SAVE_FRAME
7 /* taken from glibc */
8 subq $0x38, %rsp
9 movq %rax, (%rsp)
10 movq %rcx, 8(%rsp)
11 movq %rdx, 16(%rsp)
12 movq %rsi, 24(%rsp)
13 movq %rdi, 32(%rsp)
14 movq %r8, 40(%rsp)
15 movq %r9, 48(%rsp)
16 .endm
17
18 .macro MCOUNT_RESTORE_FRAME
19 movq 48(%rsp), %r9
20 movq 40(%rsp), %r8
21 movq 32(%rsp), %rdi
22 movq 24(%rsp), %rsi
23 movq 16(%rsp), %rdx
24 movq 8(%rsp), %rcx
25 movq (%rsp), %rax
26 addq $0x38, %rsp
27 .endm
28
29#endif
30
4#ifdef CONFIG_FUNCTION_TRACER 31#ifdef CONFIG_FUNCTION_TRACER
5#define MCOUNT_ADDR ((long)(mcount)) 32#define MCOUNT_ADDR ((long)(mcount))
6#define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */ 33#define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */
@@ -46,7 +73,7 @@ struct ftrace_ret_stack {
46/* 73/*
47 * Primary handler of a function return. 74 * Primary handler of a function return.
48 * It relays on ftrace_return_to_handler. 75 * It relays on ftrace_return_to_handler.
49 * Defined in entry32.S 76 * Defined in entry_32/64.S
50 */ 77 */
51extern void return_to_handler(void); 78extern void return_to_handler(void);
52 79