1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* Copyright (c) 2020 Facebook */ 3 #ifndef _BPF_TESTMOD_H 4 #define _BPF_TESTMOD_H 5 6 #include <linux/types.h> 7 8 struct task_struct; 9 10 struct bpf_testmod_test_read_ctx { 11 char *buf; 12 loff_t off; 13 size_t len; 14 }; 15 16 struct bpf_testmod_test_write_ctx { 17 char *buf; 18 loff_t off; 19 size_t len; 20 }; 21 22 struct bpf_testmod_test_writable_ctx { 23 bool early_ret; 24 int val; 25 }; 26 27 /* BPF iter that returns *value* *n* times in a row */ 28 struct bpf_iter_testmod_seq { 29 s64 value; 30 int cnt; 31 }; 32 33 struct bpf_testmod_ops { 34 int (*test_1)(void); 35 void (*test_2)(int a, int b); 36 /* Used to test nullable arguments. */ 37 int (*test_maybe_null)(int dummy, struct task_struct *task); 38 39 /* The following fields are used to test shadow copies. */ 40 char onebyte; 41 struct { 42 int a; 43 int b; 44 } unsupported; 45 int data; 46 47 /* The following pointers are used to test the maps having multiple 48 * pages of trampolines. 49 */ 50 int (*tramp_1)(int value); 51 int (*tramp_2)(int value); 52 int (*tramp_3)(int value); 53 int (*tramp_4)(int value); 54 int (*tramp_5)(int value); 55 int (*tramp_6)(int value); 56 int (*tramp_7)(int value); 57 int (*tramp_8)(int value); 58 int (*tramp_9)(int value); 59 int (*tramp_10)(int value); 60 int (*tramp_11)(int value); 61 int (*tramp_12)(int value); 62 int (*tramp_13)(int value); 63 int (*tramp_14)(int value); 64 int (*tramp_15)(int value); 65 int (*tramp_16)(int value); 66 int (*tramp_17)(int value); 67 int (*tramp_18)(int value); 68 int (*tramp_19)(int value); 69 int (*tramp_20)(int value); 70 int (*tramp_21)(int value); 71 int (*tramp_22)(int value); 72 int (*tramp_23)(int value); 73 int (*tramp_24)(int value); 74 int (*tramp_25)(int value); 75 int (*tramp_26)(int value); 76 int (*tramp_27)(int value); 77 int (*tramp_28)(int value); 78 int (*tramp_29)(int value); 79 int (*tramp_30)(int value); 80 int (*tramp_31)(int value); 81 int (*tramp_32)(int value); 82 int (*tramp_33)(int value); 83 int (*tramp_34)(int value); 84 int (*tramp_35)(int value); 85 int (*tramp_36)(int value); 86 int (*tramp_37)(int value); 87 int (*tramp_38)(int value); 88 int (*tramp_39)(int value); 89 int (*tramp_40)(int value); 90 }; 91 92 struct bpf_testmod_ops2 { 93 int (*test_1)(void); 94 }; 95 96 #endif /* _BPF_TESTMOD_H */ 97
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.