diff options
| author | Eduard Zingerman <eddyz87@gmail.com> | 2023-03-25 04:54:43 +0200 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2023-03-25 17:02:02 -0700 |
| commit | 207b1ba3019100d862931e97b49f76ff1e0a89f2 (patch) | |
| tree | e3be60c0708851eb931e9b300bae9f86aa5ddf33 /tools/testing/selftests/bpf/prog_tests/prog_array_init.c | |
| parent | selftests/bpf: Report program name on parse_test_spec error (diff) | |
| download | linux-207b1ba3019100d862931e97b49f76ff1e0a89f2.tar.gz linux-207b1ba3019100d862931e97b49f76ff1e0a89f2.zip | |
selftests/bpf: __imm_insn & __imm_const macro for bpf_misc.h
Add two convenience macro for BPF test cases,
allowing the following usage:
#include <linux/filter.h>
...
asm volatile (
...
".8byte %[raw_insn];"
...
"r1 += %[st_foo_offset];"
...
:
: __imm_insn(raw_insn, BPF_RAW_INSN(...)),
__imm_const(st_foo_offset, offsetof(struct st, foo))
: __clobber_all);
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20230325025524.144043-3-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/prog_array_init.c')
0 files changed, 0 insertions, 0 deletions
