1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_POWERPC_FTRACE
3 #define _ASM_POWERPC_FTRACE
7 #ifdef CONFIG_FUNCTION_TRACER
8 #define MCOUNT_ADDR ((unsigned long)(_mcount))
9 #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
13 /* Based off of objdump optput from glibc */
15 #define MCOUNT_SAVE_FRAME \
31 #define MCOUNT_RESTORE_FRAME \
48 #else /* !__ASSEMBLY__ */
49 extern void _mcount(void);
51 #ifdef CONFIG_DYNAMIC_FTRACE
52 # define FTRACE_ADDR ((unsigned long)ftrace_caller)
53 # define FTRACE_REGS_ADDR FTRACE_ADDR
54 static inline unsigned long ftrace_call_adjust(unsigned long addr
)
56 /* reloction of mcount call site is the same as the address */
60 struct dyn_arch_ftrace
{
63 #endif /* CONFIG_DYNAMIC_FTRACE */
64 #endif /* __ASSEMBLY__ */
66 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
67 #define ARCH_SUPPORTS_FTRACE_OPS 1
71 #if defined(CONFIG_FTRACE_SYSCALLS) && !defined(__ASSEMBLY__)
72 #ifdef PPC64_ELF_ABI_v1
73 #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
74 static inline bool arch_syscall_match_sym_name(const char *sym
, const char *name
)
77 * Compare the symbol name with the system call name. Skip the .sys or .SyS
78 * prefix from the symbol name and the sys prefix from the system call name and
79 * just match the rest. This is only needed on ppc64 since symbol names on
80 * 32bit do not start with a period so the generic function will work.
82 return !strcmp(sym
+ 4, name
+ 3);
85 #endif /* CONFIG_FTRACE_SYSCALLS && !__ASSEMBLY__ */
87 #endif /* _ASM_POWERPC_FTRACE */