x86: ptrace: Add function argument access API
authorMasami Hiramatsu <mhiramat@kernel.org>
Wed, 25 Apr 2018 12:20:57 +0000 (21:20 +0900)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 11 Oct 2018 02:19:11 +0000 (22:19 -0400)
commit3c88ee194c288205733d248b51f0aca516ff4940
treeceef87990d31031cf3da6146678096bd86ba4cdf
parent40b53b771806b1770837169cd32d1bf167fbccaf
x86: ptrace: Add function argument access API

Add regs_get_argument() which returns N th argument of the
function call.
Note that this chooses most probably assignment, in some case
it can be incorrect (e.g. passing data structure or floating
point etc.)

This is expected to be called from kprobes or ftrace with regs
where the top of stack is the return address.

Link: http://lkml.kernel.org/r/152465885737.26224.2822487520472783854.stgit@devbox
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
arch/Kconfig
arch/x86/Kconfig
arch/x86/include/asm/ptrace.h