MCPcopy Create free account
hub / github.com/F-Stack/f-stack / eval_ld_imm64

Function eval_ld_imm64

dpdk/lib/bpf/bpf_validate.c:193–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193static const char *
194eval_ld_imm64(struct bpf_verifier *bvf, const struct ebpf_insn *ins)
195{
196 uint32_t i;
197 uint64_t val;
198 struct bpf_reg_val *rd;
199
200 val = (uint32_t)ins[0].imm | (uint64_t)(uint32_t)ins[1].imm << 32;
201
202 rd = bvf->evst->rv + ins->dst_reg;
203 rd->v.type = RTE_BPF_ARG_RAW;
204 eval_fill_imm64(rd, UINT64_MAX, val);
205
206 for (i = 0; i != bvf->prm->nb_xsym; i++) {
207
208 /* load of external variable */
209 if (bvf->prm->xsym[i].type == RTE_BPF_XTYPE_VAR &&
210 (uintptr_t)bvf->prm->xsym[i].var.val == val) {
211 rd->v = bvf->prm->xsym[i].var.desc;
212 eval_fill_imm64(rd, UINT64_MAX, 0);
213 break;
214 }
215 }
216
217 return NULL;
218}
219
220static void
221eval_apply_mask(struct bpf_reg_val *rv, uint64_t mask)

Callers

nothing calls this directly

Calls 1

eval_fill_imm64Function · 0.85

Tested by

no test coverage detected