diff options
author | Eduard Zingerman <eddyz87@gmail.com> | 2023-01-21 05:52:37 +0530 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-01-20 17:55:03 -0800 |
commit | 91b875a5e43b3a8dec4fbdca067c8860004b5f0e (patch) | |
tree | bab8c7725800dd1098181173d86babe99d84f97c /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | 1ee72bcbe48de6dcfa44d6eba0aec6e42d04cd4d (diff) |
selftests/bpf: convenience macro for use with 'asm volatile' blocks
A set of macros useful for writing naked BPF functions using inline
assembly. E.g. as follows:
struct map_struct {
...
} map SEC(".maps");
SEC(...)
__naked int foo_test(void)
{
asm volatile(
"r0 = 0;"
"*(u64*)(r10 - 8) = r0;"
"r1 = %[map] ll;"
"r2 = r10;"
"r2 += -8;"
"call %[bpf_map_lookup_elem];"
"r0 = 0;"
"exit;"
:
: __imm(bpf_map_lookup_elem),
__imm_addr(map)
: __clobber_all);
}
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
[ Kartikeya: Add acks, include __clobber_common from Andrii ]
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20230121002241.2113993-9-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions