1 /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
6 * legacy bpf_map_def with extra fields supported only by bpf_load(), do not
7 * use outside of samples/bpf
9 struct bpf_map_def_legacy
{
11 unsigned int key_size
;
12 unsigned int value_size
;
13 unsigned int max_entries
;
14 unsigned int map_flags
;
15 unsigned int inner_map_idx
;
16 unsigned int numa_node
;
19 #define BPF_ANNOTATE_KV_PAIR(name, type_key, type_val) \
20 struct ____btf_map_##name { \
24 struct ____btf_map_##name \
25 __attribute__ ((section(".maps." #name), used)) \
26 ____btf_map_##name = { }
28 /* llvm builtin functions that eBPF C program may use to
29 * emit BPF_LD_ABS and BPF_LD_IND instructions
31 unsigned long long load_byte(void *skb
,
32 unsigned long long off
) asm("llvm.bpf.load.byte");
33 unsigned long long load_half(void *skb
,
34 unsigned long long off
) asm("llvm.bpf.load.half");
35 unsigned long long load_word(void *skb
,
36 unsigned long long off
) asm("llvm.bpf.load.word");