.. | .. |
---|
164 | 164 | .off = OFF, \ |
---|
165 | 165 | .imm = 0 }) |
---|
166 | 166 | |
---|
| 167 | +/* Like BPF_JMP_REG, but with 32-bit wide operands for comparison. */ |
---|
| 168 | + |
---|
| 169 | +#define BPF_JMP32_REG(OP, DST, SRC, OFF) \ |
---|
| 170 | + ((struct bpf_insn) { \ |
---|
| 171 | + .code = BPF_JMP32 | BPF_OP(OP) | BPF_X, \ |
---|
| 172 | + .dst_reg = DST, \ |
---|
| 173 | + .src_reg = SRC, \ |
---|
| 174 | + .off = OFF, \ |
---|
| 175 | + .imm = 0 }) |
---|
| 176 | + |
---|
167 | 177 | /* Conditional jumps against immediates, if (dst_reg 'op' imm32) goto pc + off16 */ |
---|
168 | 178 | |
---|
169 | 179 | #define BPF_JMP_IMM(OP, DST, IMM, OFF) \ |
---|
.. | .. |
---|
174 | 184 | .off = OFF, \ |
---|
175 | 185 | .imm = IMM }) |
---|
176 | 186 | |
---|
| 187 | +/* Like BPF_JMP_IMM, but with 32-bit wide operands for comparison. */ |
---|
| 188 | + |
---|
| 189 | +#define BPF_JMP32_IMM(OP, DST, IMM, OFF) \ |
---|
| 190 | + ((struct bpf_insn) { \ |
---|
| 191 | + .code = BPF_JMP32 | BPF_OP(OP) | BPF_K, \ |
---|
| 192 | + .dst_reg = DST, \ |
---|
| 193 | + .src_reg = 0, \ |
---|
| 194 | + .off = OFF, \ |
---|
| 195 | + .imm = IMM }) |
---|
| 196 | + |
---|
177 | 197 | /* Raw code statement block */ |
---|
178 | 198 | |
---|
179 | 199 | #define BPF_RAW_INSN(CODE, DST, SRC, OFF, IMM) \ |
---|