aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMatteo Croce <[email protected]>2022-02-04 01:55:18 +0100
committerAlexei Starovoitov <[email protected]>2022-02-04 11:26:26 -0800
commite70e13e7d4ab8f932f49db1c9500b30a34a6d420 (patch)
tree09970a466f1760a876c05dd41d9655e511faa29d /include/linux
parentb5e975d256dbfebd62413eb04fbff6803f02a43c (diff)
bpf: Implement bpf_core_types_are_compat().
Adopt libbpf's bpf_core_types_are_compat() for kernel duty by adding explicit recursion limit of 2 which is enough to handle 2 levels of function prototypes. Signed-off-by: Matteo Croce <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/btf.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/btf.h b/include/linux/btf.h
index f6c43dd513fa..36bc09b8e890 100644
--- a/include/linux/btf.h
+++ b/include/linux/btf.h
@@ -327,6 +327,11 @@ static inline const struct btf_var_secinfo *btf_type_var_secinfo(
return (const struct btf_var_secinfo *)(t + 1);
}
+static inline struct btf_param *btf_params(const struct btf_type *t)
+{
+ return (struct btf_param *)(t + 1);
+}
+
#ifdef CONFIG_BPF_SYSCALL
struct bpf_prog;