mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-02 22:59:07 +08:00
libbpf: move libbpf_sha256() implementation into libbpf_utils.c
Move sha256 implementation out of already large and unwieldy libbpf.c into libbpf_utils.c where we'll keep reusable helpers. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/r/20251001171326.3883055-5-andrii@kernel.org Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Eduard Zingerman <eddyz87@gmail.com>
This commit is contained in:
committed by
Andrii Nakryiko
parent
6fcb2c1963
commit
84aad03545
@@ -722,6 +722,11 @@ static inline bool is_pow_of_2(size_t x)
|
||||
return x && (x & (x - 1)) == 0;
|
||||
}
|
||||
|
||||
static inline __u32 ror32(__u32 v, int bits)
|
||||
{
|
||||
return (v >> bits) | (v << (32 - bits));
|
||||
}
|
||||
|
||||
#define PROG_LOAD_ATTEMPTS 5
|
||||
int sys_bpf_prog_load(union bpf_attr *attr, unsigned int size, int attempts);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user