WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / bpf / progs / test_ksyms.c
blob6c9cbb5a3bdf4655c32a89ebf70445bd9acbd63c
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2019 Facebook */
4 #include <stdbool.h>
5 #include <linux/bpf.h>
6 #include <bpf/bpf_helpers.h>
8 __u64 out__bpf_link_fops = -1;
9 __u64 out__bpf_link_fops1 = -1;
10 __u64 out__btf_size = -1;
11 __u64 out__per_cpu_start = -1;
13 extern const void bpf_link_fops __ksym;
14 extern const void __start_BTF __ksym;
15 extern const void __stop_BTF __ksym;
16 extern const void __per_cpu_start __ksym;
17 /* non-existing symbol, weak, default to zero */
18 extern const void bpf_link_fops1 __ksym __weak;
20 SEC("raw_tp/sys_enter")
21 int handler(const void *ctx)
23 out__bpf_link_fops = (__u64)&bpf_link_fops;
24 out__btf_size = (__u64)(&__stop_BTF - &__start_BTF);
25 out__per_cpu_start = (__u64)&__per_cpu_start;
27 out__bpf_link_fops1 = (__u64)&bpf_link_fops1;
29 return 0;
32 char _license[] SEC("license") = "GPL";