blob: 96c14a9102b8beadc324ae8b50cf8c81806af420 [file] [log] [blame]
Heiko Carstens5d360a72008-12-25 13:38:56 +01001#ifndef _ASM_S390_FTRACE_H
2#define _ASM_S390_FTRACE_H
3
4#ifndef __ASSEMBLY__
Heiko Carstensdfd9f7a2009-06-12 10:26:44 +02005
Heiko Carstens5d360a72008-12-25 13:38:56 +01006extern void _mcount(void);
Heiko Carstensdfd9f7a2009-06-12 10:26:44 +02007extern unsigned long ftrace_dyn_func;
8
9struct dyn_arch_ftrace { };
10
11#define MCOUNT_ADDR ((long)_mcount)
12
13#ifdef CONFIG_64BIT
Heiko Carstens88dbd202009-06-12 10:26:46 +020014#define MCOUNT_OFFSET_RET 18
15#define MCOUNT_INSN_SIZE 24
16#define MCOUNT_OFFSET 14
Heiko Carstensdfd9f7a2009-06-12 10:26:44 +020017#else
Heiko Carstens88dbd202009-06-12 10:26:46 +020018#define MCOUNT_OFFSET_RET 26
19#define MCOUNT_INSN_SIZE 30
20#define MCOUNT_OFFSET 8
Heiko Carstens5d360a72008-12-25 13:38:56 +010021#endif
22
Heiko Carstensdfd9f7a2009-06-12 10:26:44 +020023static inline unsigned long ftrace_call_adjust(unsigned long addr)
24{
25 return addr - MCOUNT_OFFSET;
26}
27
28#endif /* __ASSEMBLY__ */
Heiko Carstens5d360a72008-12-25 13:38:56 +010029#endif /* _ASM_S390_FTRACE_H */