From: Andrii Nakryiko Date: Fri, 5 Jul 2019 15:50:10 +0000 (-0700) Subject: selftests/bpf: add __uint and __type macro for BTF-defined maps X-Git-Tag: v5.4-rc1~616^2~28^2~13^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=00acd00814527a1856c92beda17475205bddaba6;p=platform%2Fkernel%2Flinux-rpi.git selftests/bpf: add __uint and __type macro for BTF-defined maps Add simple __uint and __type macro that hide details of how type and integer values are captured in BTF-defined maps. Signed-off-by: Andrii Nakryiko Acked-by: Song Liu Acked-by: Yonghong Song Signed-off-by: Daniel Borkmann --- diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h index 1a5b1ac..5a3d92c 100644 --- a/tools/testing/selftests/bpf/bpf_helpers.h +++ b/tools/testing/selftests/bpf/bpf_helpers.h @@ -8,6 +8,9 @@ */ #define SEC(NAME) __attribute__((section(NAME), used)) +#define __uint(name, val) int (*name)[val] +#define __type(name, val) val *name + /* helper macro to print out debug messages */ #define bpf_printk(fmt, ...) \ ({ \