aboutsummaryrefslogtreecommitdiffstats
path: root/samples/bpf/spintest_kern.c
diff options
context:
space:
mode:
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>2016-04-04 22:31:34 +0530
committerDavid S. Miller <davem@davemloft.net>2016-04-06 16:01:29 -0400
commit138d6153a139c318739f20e61309e5778427a73c (patch)
tree0faa155a8266a068779ecc3c02e8c8098ead3275 /samples/bpf/spintest_kern.c
parentsamples/bpf: Use llc in PATH, rather than a hardcoded value (diff)
downloadlinux-138d6153a139c318739f20e61309e5778427a73c.tar.xz
linux-138d6153a139c318739f20e61309e5778427a73c.zip
samples/bpf: Enable powerpc support
Add the necessary definitions for building bpf samples on ppc. Since ppc doesn't store function return address on the stack, modify how PT_REGS_RET() and PT_REGS_FP() work. Also, introduce PT_REGS_IP() to access the instruction pointer. Cc: Alexei Starovoitov <ast@fb.com> Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: David S. Miller <davem@davemloft.net> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Acked-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'samples/bpf/spintest_kern.c')
-rw-r--r--samples/bpf/spintest_kern.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/bpf/spintest_kern.c b/samples/bpf/spintest_kern.c
index 4b27619d91a4..ce0167d09cdc 100644
--- a/samples/bpf/spintest_kern.c
+++ b/samples/bpf/spintest_kern.c
@@ -34,7 +34,7 @@ struct bpf_map_def SEC("maps") stackmap = {
#define PROG(foo) \
int foo(struct pt_regs *ctx) \
{ \
- long v = ctx->ip, *val; \
+ long v = PT_REGS_IP(ctx), *val; \
\
val = bpf_map_lookup_elem(&my_map, &v); \
bpf_map_update_elem(&my_map, &v, &v, BPF_ANY); \