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

Function eval_rsh

dpdk/lib/bpf/bpf_validate.c:325–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323}
324
325static void
326eval_rsh(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, size_t opsz,
327 uint64_t msk)
328{
329 /* check if shift value is less then max result bits */
330 if (rs->u.max >= opsz) {
331 eval_max_bound(rd, msk);
332 return;
333 }
334
335 rd->u.max >>= rs->u.min;
336 rd->u.min >>= rs->u.max;
337
338 /* check that dreg values are always positive */
339 if ((uint64_t)rd->s.min >> (opsz - 1) != 0)
340 eval_smax_bound(rd, msk);
341 else {
342 rd->s.max >>= rs->u.min;
343 rd->s.min >>= rs->u.max;
344 }
345}
346
347static void
348eval_arsh(struct bpf_reg_val *rd, const struct bpf_reg_val *rs, size_t opsz,

Callers 1

eval_aluFunction · 0.85

Calls 2

eval_max_boundFunction · 0.85
eval_smax_boundFunction · 0.85

Tested by

no test coverage detected