1 #ifndef _ASM_POWERPC_FTRACE
2 #define _ASM_POWERPC_FTRACE
4 #ifdef CONFIG_FUNCTION_TRACER
5 #define MCOUNT_ADDR ((unsigned long)(_mcount))
6 #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
10 /* Based off of objdump optput from glibc */
12 #define MCOUNT_SAVE_FRAME \
28 #define MCOUNT_RESTORE_FRAME \
45 #else /* !__ASSEMBLY__ */
46 extern void _mcount(void);
48 #ifdef CONFIG_DYNAMIC_FTRACE
49 static inline unsigned long ftrace_call_adjust(unsigned long addr)
51 /* reloction of mcount call site is the same as the address */
55 struct dyn_arch_ftrace {
58 #endif /* CONFIG_DYNAMIC_FTRACE */
59 #endif /* __ASSEMBLY__ */
63 #if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_PPC64) && !defined(__ASSEMBLY__)
64 #if !defined(_CALL_ELF) || _CALL_ELF != 2
65 #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
66 static inline bool arch_syscall_match_sym_name(const char *sym, const char *name)
69 * Compare the symbol name with the system call name. Skip the .sys or .SyS
70 * prefix from the symbol name and the sys prefix from the system call name and
71 * just match the rest. This is only needed on ppc64 since symbol names on
72 * 32bit do not start with a period so the generic function will work.
74 return !strcmp(sym + 4, name + 3);
77 #endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_PPC64 && !__ASSEMBLY__ */
79 #endif /* _ASM_POWERPC_FTRACE */