summaryrefslogtreecommitdiffstats
path: root/samples/bpf/bpf_helpers.h
diff options
context:
space:
mode:
authorYang Shi2015-10-27 01:02:19 +0100
committerDavid S. Miller2015-10-28 03:51:10 +0100
commit85ff8a43f39fa6d2f970b5e1e5c03df87abde242 (patch)
tree40a588ba392a81aefc89dccfb47ffc42378135a6 /samples/bpf/bpf_helpers.h
parentamd-xgbe: Fix race between access of desc and desc index (diff)
downloadkernel-qcow2-linux-85ff8a43f39fa6d2f970b5e1e5c03df87abde242.tar.gz
kernel-qcow2-linux-85ff8a43f39fa6d2f970b5e1e5c03df87abde242.tar.xz
kernel-qcow2-linux-85ff8a43f39fa6d2f970b5e1e5c03df87abde242.zip
bpf: sample: define aarch64 specific registers
Define aarch64 specific registers for building bpf samples correctly. Signed-off-by: Yang Shi <yang.shi@linaro.org> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/bpf/bpf_helpers.h')
-rw-r--r--samples/bpf/bpf_helpers.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/samples/bpf/bpf_helpers.h b/samples/bpf/bpf_helpers.h
index 3a44d3a272af..af44e564d6dd 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