bpf: sync with latest bpf-next tree (#5)

sync with latest bpf-next tree.
the include/linux/filter.h is created as libbpf.c tries
to use various insn define macros.

Signed-off-by: Yonghong Song <yhs@fb.com>
This commit is contained in:
yonghong-song
2018-11-26 14:32:21 -08:00
committed by GitHub
parent 319ff2f0f6
commit 556e0a0def
11 changed files with 1173 additions and 112 deletions

24
include/linux/filter.h Normal file
View File

@@ -0,0 +1,24 @@
/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */
#ifndef __LINUX_FILTER_H
#define __LINUX_FILTER_H
#include <linux/bpf.h>
#define BPF_MOV64_IMM(DST, IMM) \
((struct bpf_insn) { \
.code = BPF_ALU64 | BPF_MOV | BPF_K, \
.dst_reg = DST, \
.src_reg = 0, \
.off = 0, \
.imm = IMM })
#define BPF_EXIT_INSN() \
((struct bpf_insn) { \
.code = BPF_JMP | BPF_EXIT, \
.dst_reg = 0, \
.src_reg = 0, \
.off = 0, \
.imm = 0 })
#endif