bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf] libbpf: Fix register in PT_REGS MIPS macros
@ 2020-07-30 11:44 Jerry Cruntime
  2020-07-30 19:55 ` Andrii Nakryiko
  2020-07-30 23:00 ` Daniel Borkmann
  0 siblings, 2 replies; 7+ messages in thread
From: Jerry Cruntime @ 2020-07-30 11:44 UTC (permalink / raw)
  To: bpf

The o32, n32 and n64 calling conventions require the return
value to be stored in $v0 which maps to $2 register, i.e.,
the second register.

Fixes: c1932cd ("bpf: Add MIPS support to samples/bpf.")
---
  tools/lib/bpf/bpf_tracing.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h
index 58eceb884..ae205dcf8 100644
--- a/tools/lib/bpf/bpf_tracing.h
+++ b/tools/lib/bpf/bpf_tracing.h
@@ -215,7 +215,7 @@ struct pt_regs;
  #define PT_REGS_PARM5(x) ((x)->regs[8])
  #define PT_REGS_RET(x) ((x)->regs[31])
  #define PT_REGS_FP(x) ((x)->regs[30]) /* Works only with
CONFIG_FRAME_POINTER */
-#define PT_REGS_RC(x) ((x)->regs[1])
+#define PT_REGS_RC(x) ((x)->regs[2])
  #define PT_REGS_SP(x) ((x)->regs[29])
  #define PT_REGS_IP(x) ((x)->cp0_epc)

--
2.17.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-07-31 10:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-30 11:44 [PATCH bpf] libbpf: Fix register in PT_REGS MIPS macros Jerry Cruntime
2020-07-30 19:55 ` Andrii Nakryiko
2020-07-30 20:38   ` Jerry Cruntime
2020-07-30 20:43     ` Andrii Nakryiko
2020-07-30 23:00 ` Daniel Borkmann
2020-07-31  9:56   ` Jerry Crunchtime
2020-07-31 10:31     ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).