File Index
Files and directories
Sign in
FILE

bpf_test_modorder_x.c

File preview with syntax highlighting.

linux-6.19.14/tools/testing/selftests/bpf/test_kmods/bpf_test_modorder_x.c C
 1// SPDX-License-Identifier: GPL-2.0
 2#include <linux/bpf.h>
 3#include <linux/btf.h>
 4#include <linux/module.h>
 5#include <linux/init.h>
 6
 7__bpf_kfunc_start_defs();
 8
 9__bpf_kfunc int bpf_test_modorder_retx(void)
10{
11	return 'x';
12}
13
14__bpf_kfunc_end_defs();
15
16BTF_KFUNCS_START(bpf_test_modorder_kfunc_x_ids)
17BTF_ID_FLAGS(func, bpf_test_modorder_retx);
18BTF_KFUNCS_END(bpf_test_modorder_kfunc_x_ids)
19
20static const struct btf_kfunc_id_set bpf_test_modorder_x_set = {
21	.owner = THIS_MODULE,
22	.set = &bpf_test_modorder_kfunc_x_ids,
23};
24
25static int __init bpf_test_modorder_x_init(void)
26{
27	return register_btf_kfunc_id_set(BPF_PROG_TYPE_SCHED_CLS,
28					 &bpf_test_modorder_x_set);
29}
30
31static void __exit bpf_test_modorder_x_exit(void)
32{
33}
34
35module_init(bpf_test_modorder_x_init);
36module_exit(bpf_test_modorder_x_exit);
37
38MODULE_DESCRIPTION("BPF selftest ordertest module X");
39MODULE_LICENSE("GPL");
~/ Read-only file preview.