aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/progs/bpf_misc.h
diff options
context:
space:
mode:
authorAndrii Nakryiko <[email protected]>2023-03-08 18:41:19 +0000
committerAlexei Starovoitov <[email protected]>2023-03-09 00:19:51 +0000
commit57400dcce6c2cf3985120c4ee28b37a1f4238dbb (patch)
tree21e862f484486441f2e7553df38dba6faa6bdf4a /tools/testing/selftests/bpf/progs/bpf_misc.h
parentselftests/bpf: add bpf_for_each(), bpf_for(), and bpf_repeat() macros (diff)
downloadkernel-57400dcce6c2cf3985120c4ee28b37a1f4238dbb.tar.gz
kernel-57400dcce6c2cf3985120c4ee28b37a1f4238dbb.zip
selftests/bpf: add iterators tests
Add various tests for open-coded iterators. Some of them excercise various possible coding patterns in C, some go down to low-level assembly for more control over various conditions, especially invalid ones. We also make use of bpf_for(), bpf_for_each(), bpf_repeat() macros in some of these tests. Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/bpf_misc.h')
-rw-r--r--tools/testing/selftests/bpf/progs/bpf_misc.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/bpf_misc.h b/tools/testing/selftests/bpf/progs/bpf_misc.h
index 597688a188ae..43b154a639e7 100644
--- a/tools/testing/selftests/bpf/progs/bpf_misc.h
+++ b/tools/testing/selftests/bpf/progs/bpf_misc.h
@@ -36,6 +36,7 @@
#define __clobber_common "r0", "r1", "r2", "r3", "r4", "r5", "memory"
#define __imm(name) [name]"i"(name)
#define __imm_addr(name) [name]"i"(&name)
+#define __imm_ptr(name) [name]"p"(&name)
#if defined(__TARGET_ARCH_x86)
#define SYSCALL_WRAPPER 1