linux-stable/include/linux/ftrace_regs.h
Masami Hiramatsu (Google) 2d17932da4 ftrace: Rename ftrace_regs_return_value to ftrace_regs_get_return_value
Rename ftrace_regs_return_value to ftrace_regs_get_return_value as same as
other ftrace_regs_get/set_* APIs. arm64 and riscv are already using this
new name.

Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Florent Revest <revest@chromium.org>
Cc: Martin KaFai Lau <martin.lau@linux.dev>
Cc: bpf <bpf@vger.kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Alan Maguire <alan.maguire@oracle.com>
Link: https://lore.kernel.org/172895573350.107311.7564634260652361511.stgit@devnote2
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2024-10-15 17:22:35 -04:00

37 lines
1.2 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_FTRACE_REGS_H
#define _LINUX_FTRACE_REGS_H
/*
* For archs that just copy pt_regs in ftrace regs, it can use this default.
* If an architecture does not use pt_regs, it must define all the below
* accessor functions.
*/
#ifndef HAVE_ARCH_FTRACE_REGS
struct __arch_ftrace_regs {
struct pt_regs regs;
};
#define arch_ftrace_regs(fregs) ((struct __arch_ftrace_regs *)(fregs))
struct ftrace_regs;
#define ftrace_regs_get_instruction_pointer(fregs) \
instruction_pointer(&arch_ftrace_regs(fregs)->regs)
#define ftrace_regs_get_argument(fregs, n) \
regs_get_kernel_argument(&arch_ftrace_regs(fregs)->regs, n)
#define ftrace_regs_get_stack_pointer(fregs) \
kernel_stack_pointer(&arch_ftrace_regs(fregs)->regs)
#define ftrace_regs_get_return_value(fregs) \
regs_return_value(&arch_ftrace_regs(fregs)->regs)
#define ftrace_regs_set_return_value(fregs, ret) \
regs_set_return_value(&arch_ftrace_regs(fregs)->regs, ret)
#define ftrace_override_function_with_return(fregs) \
override_function_with_return(&arch_ftrace_regs(fregs)->regs)
#define ftrace_regs_query_register_offset(name) \
regs_query_register_offset(name)
#endif /* HAVE_ARCH_FTRACE_REGS */
#endif /* _LINUX_FTRACE_REGS_H */