Blame view

arch/x86/include/asm/ftrace.h 1.07 KB
1965aae3c   H. Peter Anvin   x86: Fix ASM_X86_...
1
2
  #ifndef _ASM_X86_FTRACE_H
  #define _ASM_X86_FTRACE_H
395a59d0f   Abhishek Sagar   ftrace: store mco...
3

d680fe447   Cyrill Gorcunov   x86: entry_64 - i...
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  #ifdef __ASSEMBLY__
  
  	.macro MCOUNT_SAVE_FRAME
  	/* taken from glibc */
  	subq $0x38, %rsp
  	movq %rax, (%rsp)
  	movq %rcx, 8(%rsp)
  	movq %rdx, 16(%rsp)
  	movq %rsi, 24(%rsp)
  	movq %rdi, 32(%rsp)
  	movq %r8, 40(%rsp)
  	movq %r9, 48(%rsp)
  	.endm
  
  	.macro MCOUNT_RESTORE_FRAME
  	movq 48(%rsp), %r9
  	movq 40(%rsp), %r8
  	movq 32(%rsp), %rdi
  	movq 24(%rsp), %rsi
  	movq 16(%rsp), %rdx
  	movq 8(%rsp), %rcx
  	movq (%rsp), %rax
  	addq $0x38, %rsp
  	.endm
  
  #endif
606576ce8   Steven Rostedt   ftrace: rename FT...
30
  #ifdef CONFIG_FUNCTION_TRACER
395a59d0f   Abhishek Sagar   ftrace: store mco...
31
32
33
34
35
  #define MCOUNT_ADDR		((long)(mcount))
  #define MCOUNT_INSN_SIZE	5 /* sizeof mcount call */
  
  #ifndef __ASSEMBLY__
  extern void mcount(void);
68bf21aa1   Steven Rostedt   ftrace: mcount ca...
36
37
38
39
  
  static inline unsigned long ftrace_call_adjust(unsigned long addr)
  {
  	/*
521ccb5c4   Martin Schwidefsky   ftrace/x86: mcoun...
40
41
  	 * addr is the address of the mcount call instruction.
  	 * recordmcount does the necessary offset calculation.
68bf21aa1   Steven Rostedt   ftrace: mcount ca...
42
  	 */
521ccb5c4   Martin Schwidefsky   ftrace/x86: mcoun...
43
  	return addr;
68bf21aa1   Steven Rostedt   ftrace: mcount ca...
44
  }
31e889098   Steven Rostedt   ftrace: pass modu...
45
46
47
48
49
50
51
52
  
  #ifdef CONFIG_DYNAMIC_FTRACE
  
  struct dyn_arch_ftrace {
  	/* No extra data needed for x86 */
  };
  
  #endif /*  CONFIG_DYNAMIC_FTRACE */
a26a2a273   Steven Rostedt   ftrace: nmi safe ...
53
  #endif /* __ASSEMBLY__ */
606576ce8   Steven Rostedt   ftrace: rename FT...
54
  #endif /* CONFIG_FUNCTION_TRACER */
395a59d0f   Abhishek Sagar   ftrace: store mco...
55

1965aae3c   H. Peter Anvin   x86: Fix ASM_X86_...
56
  #endif /* _ASM_X86_FTRACE_H */