xref: /linux/tools/testing/selftests/bpf/bpf_legacy.h (revision fb2ac84f8acccdec644d26dfc8ba6554f30cd6c0)
1 /* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
2 #ifndef __BPF_LEGACY__
3 #define __BPF_LEGACY__
4 
5 /* llvm builtin functions that eBPF C program may use to
6  * emit BPF_LD_ABS and BPF_LD_IND instructions
7  */
8 unsigned long long load_byte(void *skb,
9 			     unsigned long long off) asm("llvm.bpf.load.byte");
10 unsigned long long load_half(void *skb,
11 			     unsigned long long off) asm("llvm.bpf.load.half");
12 unsigned long long load_word(void *skb,
13 			     unsigned long long off) asm("llvm.bpf.load.word");
14 
15 #endif
16 
17