From 17d7f04e7cb8cca664dfccd27c3848d105c56b5e Mon Sep 17 00:00:00 2001 From: Andrii Nakryiko Date: Mon, 1 Nov 2021 14:25:04 -0700 Subject: [PATCH] include: add BPF_ALU32_IMM macro implementation BPF_ALU32_IMM is now used in gen_loader.c. Add its definition to include/linux/filter.h header. Signed-off-by: Andrii Nakryiko --- include/linux/filter.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/filter.h b/include/linux/filter.h index 8c25a00..e7e3373 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h @@ -13,6 +13,14 @@ .off = OFF, \ .imm = IMM }) +#define BPF_ALU32_IMM(OP, DST, IMM) \ + ((struct bpf_insn) { \ + .code = BPF_ALU | BPF_OP(OP) | BPF_K, \ + .dst_reg = DST, \ + .src_reg = 0, \ + .off = 0, \ + .imm = IMM }) + #define BPF_ALU64_IMM(OP, DST, IMM) \ ((struct bpf_insn) { \ .code = BPF_ALU64 | BPF_OP(OP) | BPF_K, \