File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -449,6 +449,14 @@ enum bpf_func_id {
449
449
.off = 0, \
450
450
.imm = 0 })
451
451
452
+ #define BPF_ALU32_REG (OP , DST , SRC ) \
453
+ ((struct bpf_insn) { \
454
+ .code = BPF_ALU | BPF_OP(OP) | BPF_X, \
455
+ .dst_reg = DST, \
456
+ .src_reg = SRC, \
457
+ .off = 0, \
458
+ .imm = 0 })
459
+
452
460
#define BPF_ALU64_IMM (OP , DST , IMM ) \
453
461
((struct bpf_insn) { \
454
462
.code = BPF_ALU64 | BPF_OP(OP) | BPF_K, \
@@ -457,6 +465,14 @@ enum bpf_func_id {
457
465
.off = 0, \
458
466
.imm = IMM })
459
467
468
+ #define BPF_ALU32_IMM (OP , DST , IMM ) \
469
+ ((struct bpf_insn) { \
470
+ .code = BPF_ALU | BPF_OP(OP) | BPF_K, \
471
+ .dst_reg = DST, \
472
+ .src_reg = 0, \
473
+ .off = 0, \
474
+ .imm = IMM })
475
+
460
476
#define BPF_MOV64_REG (DST , SRC ) \
461
477
((struct bpf_insn) { \
462
478
.code = BPF_ALU64 | BPF_MOV | BPF_X, \
@@ -465,6 +481,14 @@ enum bpf_func_id {
465
481
.off = 0, \
466
482
.imm = 0 })
467
483
484
+ #define BPF_MOV32_REG (DST , SRC ) \
485
+ ((struct bpf_insn) { \
486
+ .code = BPF_ALU | BPF_MOV | BPF_X, \
487
+ .dst_reg = DST, \
488
+ .src_reg = SRC, \
489
+ .off = 0, \
490
+ .imm = 0 })
491
+
468
492
#define BPF_LD_IMM64 (DST , IMM ) \
469
493
BPF_LD_IMM64_RAW(DST, 0, IMM)
470
494
You can’t perform that action at this time.
0 commit comments