linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bpf: sample: define aarch64 specific registers
@ 2015-10-27  0:02 Yang Shi
  2015-10-27  3:22 ` Alexei Starovoitov
  2015-10-28  2:51 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Yang Shi @ 2015-10-27  0:02 UTC (permalink / raw)
  To: ast; +Cc: netdev, linux-kernel, linaro-kernel, yang.shi

Define aarch64 specific registers for building bpf samples correctly.

Signed-off-by: Yang Shi <yang.shi@linaro.org>
---
 samples/bpf/bpf_helpers.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/samples/bpf/bpf_helpers.h b/samples/bpf/bpf_helpers.h
index 3a44d3a..af44e56 100644
--- a/samples/bpf/bpf_helpers.h
+++ b/samples/bpf/bpf_helpers.h
@@ -86,5 +86,17 @@ static int (*bpf_l4_csum_replace)(void *ctx, int off, int from, int to, int flag
 #define PT_REGS_RC(x) ((x)->gprs[2])
 #define PT_REGS_SP(x) ((x)->gprs[15])
 
+#elif defined(__aarch64__)
+
+#define PT_REGS_PARM1(x) ((x)->regs[0])
+#define PT_REGS_PARM2(x) ((x)->regs[1])
+#define PT_REGS_PARM3(x) ((x)->regs[2])
+#define PT_REGS_PARM4(x) ((x)->regs[3])
+#define PT_REGS_PARM5(x) ((x)->regs[4])
+#define PT_REGS_RET(x) ((x)->regs[30])
+#define PT_REGS_FP(x) ((x)->regs[29]) /* Works only with CONFIG_FRAME_POINTER */
+#define PT_REGS_RC(x) ((x)->regs[0])
+#define PT_REGS_SP(x) ((x)->sp)
+
 #endif
 #endif
-- 
2.0.2


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

* Re: [PATCH] bpf: sample: define aarch64 specific registers
  2015-10-27  0:02 [PATCH] bpf: sample: define aarch64 specific registers Yang Shi
@ 2015-10-27  3:22 ` Alexei Starovoitov
  2015-10-28  2:51 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Alexei Starovoitov @ 2015-10-27  3:22 UTC (permalink / raw)
  To: Yang Shi; +Cc: ast, netdev, linux-kernel, linaro-kernel

On Mon, Oct 26, 2015 at 05:02:19PM -0700, Yang Shi wrote:
> Define aarch64 specific registers for building bpf samples correctly.
> 
> Signed-off-by: Yang Shi <yang.shi@linaro.org>

looks good to me.
Acked-by: Alexei Starovoitov <ast@kernel.org>


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

* Re: [PATCH] bpf: sample: define aarch64 specific registers
  2015-10-27  0:02 [PATCH] bpf: sample: define aarch64 specific registers Yang Shi
  2015-10-27  3:22 ` Alexei Starovoitov
@ 2015-10-28  2:51 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-10-28  2:51 UTC (permalink / raw)
  To: yang.shi; +Cc: ast, netdev, linux-kernel, linaro-kernel

From: Yang Shi <yang.shi@linaro.org>
Date: Mon, 26 Oct 2015 17:02:19 -0700

> Define aarch64 specific registers for building bpf samples correctly.
> 
> Signed-off-by: Yang Shi <yang.shi@linaro.org>

Applied.

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

end of thread, other threads:[~2015-10-28  2:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-27  0:02 [PATCH] bpf: sample: define aarch64 specific registers Yang Shi
2015-10-27  3:22 ` Alexei Starovoitov
2015-10-28  2:51 ` David Miller

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).