[S390] ftrace: add dynamic ftrace support
[linux-2.6.git] / arch / s390 / include / asm / ftrace.h
1 #ifndef _ASM_S390_FTRACE_H
2 #define _ASM_S390_FTRACE_H
3
4 #ifndef __ASSEMBLY__
5
6 extern void _mcount(void);
7 extern unsigned long ftrace_dyn_func;
8
9 struct dyn_arch_ftrace { };
10
11 #define MCOUNT_ADDR ((long)_mcount)
12
13 #ifdef CONFIG_64BIT
14 #define MCOUNT_INSN_SIZE 24
15 #define MCOUNT_OFFSET    14
16 #else
17 #define MCOUNT_INSN_SIZE 30
18 #define MCOUNT_OFFSET     8
19 #endif
20
21 static inline unsigned long ftrace_call_adjust(unsigned long addr)
22 {
23         return addr - MCOUNT_OFFSET;
24 }
25
26 #endif /* __ASSEMBLY__ */
27 #endif /* _ASM_S390_FTRACE_H */