Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\btf.c Create Date:2022-07-28 13:19:22
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:btf_enum_check_kflag_member

Proto:static int btf_enum_check_kflag_member(struct btf_verifier_env *env, const struct btf_type *struct_type, const struct btf_member *member, const struct btf_type *member_type)

Type:int

Parameter:

TypeParameterName
struct btf_verifier_env *env
const struct btf_type *struct_type
const struct btf_member *member
const struct btf_type *member_type
2401  int_bitsize = sizeof(int) * BITS_PER_BYTE
2403  struct_bits_off = BTF_MEMBER_BIT_OFFSET(If the type info kind_flag is set, the btf_member offset* contains both member bitfield size and bit offset. The* bitfield size is set for bitfield members. If the type* info kind_flag is not set, the offset contains only bit* offset.)
2404  nr_bits = If the struct/union type info kind_flag is set, the* following two macros are used to access bitfield_size* and bit_offset from btf_member.offset.(If the type info kind_flag is set, the btf_member offset* contains both member bitfield size and bit offset. The* bitfield size is set for bitfield members. If the type* info kind_flag is not set, the offset contains only bit* offset.)
2405  If Not nr_bits Then
2407  btf_verifier_log_member(env, struct_type, member, "Member is not byte aligned")
2409  Return -EINVAL
2412  nr_bits = int_bitsize
2413  Else if nr_bits > int_bitsize Then
2414  btf_verifier_log_member(env, struct_type, member, "Invalid member bitfield_size")
2416  Return -EINVAL
2419  struct_size = size
2420  bytes_end = BITS_ROUNDUP_BYTES(struct_bits_off + nr_bits)
2421  If struct_size < bytes_end Then
2422  btf_verifier_log_member(env, struct_type, member, "Member exceeds struct_size")
2424  Return -EINVAL
2427  Return 0