WIP FPC-III support
[linux/fpc-iii.git] / tools / testing / selftests / bpf / bpf_legacy.h
blob719ab56cdb5da391f872a70c239d0021a4adaa21
1 /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
2 #ifndef __BPF_LEGACY__
3 #define __BPF_LEGACY__
5 #define BPF_ANNOTATE_KV_PAIR(name, type_key, type_val) \
6 struct ____btf_map_##name { \
7 type_key key; \
8 type_val value; \
9 }; \
10 struct ____btf_map_##name \
11 __attribute__ ((section(".maps." #name), used)) \
12 ____btf_map_##name = { }
14 /* llvm builtin functions that eBPF C program may use to
15 * emit BPF_LD_ABS and BPF_LD_IND instructions
17 unsigned long long load_byte(void *skb,
18 unsigned long long off) asm("llvm.bpf.load.byte");
19 unsigned long long load_half(void *skb,
20 unsigned long long off) asm("llvm.bpf.load.half");
21 unsigned long long load_word(void *skb,
22 unsigned long long off) asm("llvm.bpf.load.word");
24 #endif