]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/sh/include/asm/ftrace.h
Merge remote-tracking branches 'asoc/topic/max98925', 'asoc/topic/max98927', 'asoc...
[mirror_ubuntu-bionic-kernel.git] / arch / sh / include / asm / ftrace.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
4b4cf759
PM
2#ifndef __ASM_SH_FTRACE_H
3#define __ASM_SH_FTRACE_H
4
fad57feb
MF
5#ifdef CONFIG_FUNCTION_TRACER
6
7#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
c68e3206 8#define FTRACE_SYSCALL_MAX NR_syscalls
fad57feb 9
4b4cf759
PM
10#ifndef __ASSEMBLY__
11extern void mcount(void);
fad57feb 12
c93bf928 13#define MCOUNT_ADDR ((unsigned long)(mcount))
fad57feb
MF
14
15#ifdef CONFIG_DYNAMIC_FTRACE
ca0d1727 16#define CALL_ADDR ((long)(ftrace_call))
fad57feb 17#define STUB_ADDR ((long)(ftrace_stub))
327933f5
MF
18#define GRAPH_ADDR ((long)(ftrace_graph_call))
19#define CALLER_ADDR ((long)(ftrace_caller))
fad57feb 20
ca0d1727 21#define MCOUNT_INSN_OFFSET ((STUB_ADDR - CALL_ADDR) - 4)
327933f5 22#define GRAPH_INSN_OFFSET ((CALLER_ADDR - GRAPH_ADDR) - 4)
22f131aa
PM
23
24struct dyn_arch_ftrace {
25 /* No extra data needed on sh */
26};
27
28#endif /* CONFIG_DYNAMIC_FTRACE */
fad57feb
MF
29
30static inline unsigned long ftrace_call_adjust(unsigned long addr)
31{
32 /* 'addr' is the memory table address. */
33 return addr;
34}
4b4cf759 35
36c87199
PM
36#endif /* __ASSEMBLY__ */
37#endif /* CONFIG_FUNCTION_TRACER */
38
39#ifndef __ASSEMBLY__
40
ac4fac8c
PM
41/* arch/sh/kernel/return_address.c */
42extern void *return_address(unsigned int);
d26cddbb 43
eed542d6 44#define ftrace_return_address(n) return_address(n)
d26cddbb 45
22f131aa 46#endif /* __ASSEMBLY__ */
fad57feb 47
4b4cf759 48#endif /* __ASM_SH_FTRACE_H */