mtd: spear_smi: Fix Write Burst mode
[linux/fpc-iii.git] / arch / x86 / include / asm / ftrace.h
blobc38a66661576bf7f800de5860b16bd8bae02ccf0
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_X86_FTRACE_H
3 #define _ASM_X86_FTRACE_H
5 #ifdef CONFIG_FUNCTION_TRACER
6 #ifndef CC_USING_FENTRY
7 # error Compiler does not support fentry?
8 #endif
9 # define MCOUNT_ADDR ((unsigned long)(__fentry__))
10 #define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */
12 #ifdef CONFIG_DYNAMIC_FTRACE
13 #define ARCH_SUPPORTS_FTRACE_OPS 1
14 #endif
16 #define HAVE_FUNCTION_GRAPH_RET_ADDR_PTR
18 #ifndef __ASSEMBLY__
19 extern atomic_t modifying_ftrace_code;
20 extern void __fentry__(void);
22 static inline unsigned long ftrace_call_adjust(unsigned long addr)
25 * addr is the address of the mcount call instruction.
26 * recordmcount does the necessary offset calculation.
28 return addr;
31 #ifdef CONFIG_DYNAMIC_FTRACE
33 struct dyn_arch_ftrace {
34 /* No extra data needed for x86 */
37 int ftrace_int3_handler(struct pt_regs *regs);
39 #define FTRACE_GRAPH_TRAMP_ADDR FTRACE_GRAPH_ADDR
41 #endif /* CONFIG_DYNAMIC_FTRACE */
42 #endif /* __ASSEMBLY__ */
43 #endif /* CONFIG_FUNCTION_TRACER */
46 #ifndef __ASSEMBLY__
48 #define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
49 static inline bool arch_syscall_match_sym_name(const char *sym, const char *name)
52 * Compare the symbol name with the system call name. Skip the
53 * "__x64_sys", "__ia32_sys" or simple "sys" prefix.
55 return !strcmp(sym + 3, name + 3) ||
56 (!strncmp(sym, "__x64_", 6) && !strcmp(sym + 9, name + 3)) ||
57 (!strncmp(sym, "__ia32_", 7) && !strcmp(sym + 10, name + 3));
60 #ifndef COMPILE_OFFSETS
62 #if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_IA32_EMULATION)
63 #include <linux/compat.h>
66 * Because ia32 syscalls do not map to x86_64 syscall numbers
67 * this screws up the trace output when tracing a ia32 task.
68 * Instead of reporting bogus syscalls, just do not trace them.
70 * If the user really wants these, then they should use the
71 * raw syscall tracepoints with filtering.
73 #define ARCH_TRACE_IGNORE_COMPAT_SYSCALLS 1
74 static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs)
76 return in_32bit_syscall();
78 #endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_IA32_EMULATION */
79 #endif /* !COMPILE_OFFSETS */
80 #endif /* !__ASSEMBLY__ */
82 #endif /* _ASM_X86_FTRACE_H */