diff options
| author | Andrii Nakryiko <[email protected]> | 2022-05-09 00:41:46 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2022-05-09 15:15:32 +0000 |
| commit | f760d0537925e2973ed3adc2e590aa2968d0e8dc (patch) | |
| tree | a19c4f25b7f75e27bf680927ff6e28efe5f1f60b /tools/testing/selftests/bpf/progs/loop5.c | |
| parent | selftests/bpf: Add bpf_core_field_offset() tests (diff) | |
| download | kernel-f760d0537925e2973ed3adc2e590aa2968d0e8dc.tar.gz kernel-f760d0537925e2973ed3adc2e590aa2968d0e8dc.zip | |
libbpf: Provide barrier() and barrier_var() in bpf_helpers.h
Add barrier() and barrier_var() macros into bpf_helpers.h to be used by
end users. While a bit advanced and specialized instruments, they are
sometimes indispensable. Instead of requiring each user to figure out
exact asm volatile incantations for themselves, provide them from
bpf_helpers.h.
Also remove conflicting definitions from selftests. Some tests rely on
barrier_var() definition being nothing, those will still work as libbpf
does the #ifndef/#endif guarding for barrier() and barrier_var(),
allowing users to redefine them, if necessary.
Signed-off-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/progs/loop5.c')
| -rw-r--r-- | tools/testing/selftests/bpf/progs/loop5.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/progs/loop5.c b/tools/testing/selftests/bpf/progs/loop5.c index 913791923fa3..1b13f37f85ec 100644 --- a/tools/testing/selftests/bpf/progs/loop5.c +++ b/tools/testing/selftests/bpf/progs/loop5.c @@ -2,7 +2,6 @@ // Copyright (c) 2019 Facebook #include <linux/bpf.h> #include <bpf/bpf_helpers.h> -#define barrier() __asm__ __volatile__("": : :"memory") char _license[] SEC("license") = "GPL"; |
