aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrii Nakryiko <[email protected]>2023-01-20 20:08:56 +0000
committerDaniel Borkmann <[email protected]>2023-01-23 19:53:00 +0000
commitb13ed8ca7fba3d3e61621be021fdccd5c44b2634 (patch)
tree9dc3dd3b5e181999f92230e87ddddddb47752902
parentlibbpf: Complete sparc spec in bpf_tracing.h (diff)
downloadkernel-b13ed8ca7fba3d3e61621be021fdccd5c44b2634.tar.gz
kernel-b13ed8ca7fba3d3e61621be021fdccd5c44b2634.zip
libbpf: Complete riscv arch spec in bpf_tracing.h
Add PARM6 through PARM8 definitions for RISC V (riscv) arch. Leave the link for ABI doc for future reference. Signed-off-by: Andrii Nakryiko <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Tested-by: Pu Lehui <[email protected]> # RISC-V Link: https://lore.kernel.org/bpf/[email protected]
-rw-r--r--tools/lib/bpf/bpf_tracing.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h
index 0f9640ddbe1c..579e2f830532 100644
--- a/tools/lib/bpf/bpf_tracing.h
+++ b/tools/lib/bpf/bpf_tracing.h
@@ -268,12 +268,19 @@ struct pt_regs___arm64 {
#elif defined(bpf_target_riscv)
+/*
+ * https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc#risc-v-calling-conventions
+ */
+
#define __PT_REGS_CAST(x) ((const struct user_regs_struct *)(x))
#define __PT_PARM1_REG a0
#define __PT_PARM2_REG a1
#define __PT_PARM3_REG a2
#define __PT_PARM4_REG a3
#define __PT_PARM5_REG a4
+#define __PT_PARM6_REG a5
+#define __PT_PARM7_REG a6
+#define __PT_PARM8_REG a7
#define __PT_RET_REG ra
#define __PT_FP_REG s0
#define __PT_RC_REG a0