cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

bpf_legacy.h (781B)


      1/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
      2#ifndef __BPF_LEGACY__
      3#define __BPF_LEGACY__
      4
      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 = { }
     13
     14/* llvm builtin functions that eBPF C program may use to
     15 * emit BPF_LD_ABS and BPF_LD_IND instructions
     16 */
     17unsigned long long load_byte(void *skb,
     18			     unsigned long long off) asm("llvm.bpf.load.byte");
     19unsigned long long load_half(void *skb,
     20			     unsigned long long off) asm("llvm.bpf.load.half");
     21unsigned long long load_word(void *skb,
     22			     unsigned long long off) asm("llvm.bpf.load.word");
     23
     24#endif
     25