Lines Matching refs:t

227 struct btf_record *btf_parse_fields(const struct btf *btf, const struct btf_type *t,
230 bool btf_type_is_void(const struct btf_type *t);
242 const char *btf_type_str(const struct btf_type *t);
254 static inline bool btf_type_is_ptr(const struct btf_type *t) in btf_type_is_ptr() argument
256 return BTF_INFO_KIND(t->info) == BTF_KIND_PTR; in btf_type_is_ptr()
259 static inline bool btf_type_is_int(const struct btf_type *t) in btf_type_is_int() argument
261 return BTF_INFO_KIND(t->info) == BTF_KIND_INT; in btf_type_is_int()
264 static inline bool btf_type_is_small_int(const struct btf_type *t) in btf_type_is_small_int() argument
266 return btf_type_is_int(t) && t->size <= sizeof(u64); in btf_type_is_small_int()
269 static inline u8 btf_int_encoding(const struct btf_type *t) in btf_int_encoding() argument
271 return BTF_INT_ENCODING(*(u32 *)(t + 1)); in btf_int_encoding()
274 static inline bool btf_type_is_signed_int(const struct btf_type *t) in btf_type_is_signed_int() argument
276 return btf_type_is_int(t) && (btf_int_encoding(t) & BTF_INT_SIGNED); in btf_type_is_signed_int()
279 static inline bool btf_type_is_enum(const struct btf_type *t) in btf_type_is_enum() argument
281 return BTF_INFO_KIND(t->info) == BTF_KIND_ENUM; in btf_type_is_enum()
284 static inline bool btf_is_any_enum(const struct btf_type *t) in btf_is_any_enum() argument
286 return BTF_INFO_KIND(t->info) == BTF_KIND_ENUM || in btf_is_any_enum()
287 BTF_INFO_KIND(t->info) == BTF_KIND_ENUM64; in btf_is_any_enum()
302 static inline u16 btf_kind(const struct btf_type *t) in btf_kind() argument
304 return BTF_INFO_KIND(t->info); in btf_kind()
307 static inline bool btf_is_enum(const struct btf_type *t) in btf_is_enum() argument
309 return btf_kind(t) == BTF_KIND_ENUM; in btf_is_enum()
312 static inline bool btf_is_enum64(const struct btf_type *t) in btf_is_enum64() argument
314 return btf_kind(t) == BTF_KIND_ENUM64; in btf_is_enum64()
322 static inline bool btf_is_composite(const struct btf_type *t) in btf_is_composite() argument
324 u16 kind = btf_kind(t); in btf_is_composite()
329 static inline bool btf_is_array(const struct btf_type *t) in btf_is_array() argument
331 return btf_kind(t) == BTF_KIND_ARRAY; in btf_is_array()
334 static inline bool btf_is_int(const struct btf_type *t) in btf_is_int() argument
336 return btf_kind(t) == BTF_KIND_INT; in btf_is_int()
339 static inline bool btf_is_ptr(const struct btf_type *t) in btf_is_ptr() argument
341 return btf_kind(t) == BTF_KIND_PTR; in btf_is_ptr()
344 static inline u8 btf_int_offset(const struct btf_type *t) in btf_int_offset() argument
346 return BTF_INT_OFFSET(*(u32 *)(t + 1)); in btf_int_offset()
349 static inline __u8 btf_int_bits(const struct btf_type *t) in btf_int_bits() argument
351 return BTF_INT_BITS(*(__u32 *)(t + 1)); in btf_int_bits()
354 static inline bool btf_type_is_scalar(const struct btf_type *t) in btf_type_is_scalar() argument
356 return btf_type_is_int(t) || btf_type_is_enum(t); in btf_type_is_scalar()
359 static inline bool btf_type_is_fwd(const struct btf_type *t) in btf_type_is_fwd() argument
361 return BTF_INFO_KIND(t->info) == BTF_KIND_FWD; in btf_type_is_fwd()
364 static inline bool btf_type_is_typedef(const struct btf_type *t) in btf_type_is_typedef() argument
366 return BTF_INFO_KIND(t->info) == BTF_KIND_TYPEDEF; in btf_type_is_typedef()
369 static inline bool btf_type_is_volatile(const struct btf_type *t) in btf_type_is_volatile() argument
371 return BTF_INFO_KIND(t->info) == BTF_KIND_VOLATILE; in btf_type_is_volatile()
374 static inline bool btf_type_is_func(const struct btf_type *t) in btf_type_is_func() argument
376 return BTF_INFO_KIND(t->info) == BTF_KIND_FUNC; in btf_type_is_func()
379 static inline bool btf_type_is_func_proto(const struct btf_type *t) in btf_type_is_func_proto() argument
381 return BTF_INFO_KIND(t->info) == BTF_KIND_FUNC_PROTO; in btf_type_is_func_proto()
384 static inline bool btf_type_is_var(const struct btf_type *t) in btf_type_is_var() argument
386 return BTF_INFO_KIND(t->info) == BTF_KIND_VAR; in btf_type_is_var()
389 static inline bool btf_type_is_type_tag(const struct btf_type *t) in btf_type_is_type_tag() argument
391 return BTF_INFO_KIND(t->info) == BTF_KIND_TYPE_TAG; in btf_type_is_type_tag()
397 static inline bool btf_type_is_struct(const struct btf_type *t) in btf_type_is_struct() argument
399 u8 kind = BTF_INFO_KIND(t->info); in btf_type_is_struct()
404 static inline bool __btf_type_is_struct(const struct btf_type *t) in __btf_type_is_struct() argument
406 return BTF_INFO_KIND(t->info) == BTF_KIND_STRUCT; in __btf_type_is_struct()
409 static inline bool btf_type_is_array(const struct btf_type *t) in btf_type_is_array() argument
411 return BTF_INFO_KIND(t->info) == BTF_KIND_ARRAY; in btf_type_is_array()
414 static inline u16 btf_type_vlen(const struct btf_type *t) in btf_type_vlen() argument
416 return BTF_INFO_VLEN(t->info); in btf_type_vlen()
419 static inline u16 btf_vlen(const struct btf_type *t) in btf_vlen() argument
421 return btf_type_vlen(t); in btf_vlen()
424 static inline u16 btf_func_linkage(const struct btf_type *t) in btf_func_linkage() argument
426 return BTF_INFO_VLEN(t->info); in btf_func_linkage()
429 static inline bool btf_type_kflag(const struct btf_type *t) in btf_type_kflag() argument
431 return BTF_INFO_KFLAG(t->info); in btf_type_kflag()
448 static inline struct btf_member *btf_members(const struct btf_type *t) in btf_members() argument
450 return (struct btf_member *)(t + 1); in btf_members()
453 static inline u32 btf_member_bit_offset(const struct btf_type *t, u32 member_idx) in btf_member_bit_offset() argument
455 const struct btf_member *m = btf_members(t) + member_idx; in btf_member_bit_offset()
457 return __btf_member_bit_offset(t, m); in btf_member_bit_offset()
460 static inline u32 btf_member_bitfield_size(const struct btf_type *t, u32 member_idx) in btf_member_bitfield_size() argument
462 const struct btf_member *m = btf_members(t) + member_idx; in btf_member_bitfield_size()
464 return __btf_member_bitfield_size(t, m); in btf_member_bitfield_size()
467 static inline const struct btf_member *btf_type_member(const struct btf_type *t) in btf_type_member() argument
469 return (const struct btf_member *)(t + 1); in btf_type_member()
472 static inline struct btf_array *btf_array(const struct btf_type *t) in btf_array() argument
474 return (struct btf_array *)(t + 1); in btf_array()
477 static inline struct btf_enum *btf_enum(const struct btf_type *t) in btf_enum() argument
479 return (struct btf_enum *)(t + 1); in btf_enum()
482 static inline struct btf_enum64 *btf_enum64(const struct btf_type *t) in btf_enum64() argument
484 return (struct btf_enum64 *)(t + 1); in btf_enum64()
488 const struct btf_type *t) in btf_type_var_secinfo() argument
490 return (const struct btf_var_secinfo *)(t + 1); in btf_type_var_secinfo()
493 static inline struct btf_param *btf_params(const struct btf_type *t) in btf_params() argument
495 return (struct btf_param *)(t + 1); in btf_params()
498 static inline struct btf_decl_tag *btf_decl_tag(const struct btf_type *t) in btf_decl_tag() argument
500 return (struct btf_decl_tag *)(t + 1); in btf_decl_tag()
566 int btf_field_iter_init(struct btf_field_iter *it, struct btf_type *t,
587 const struct btf_type *t, enum bpf_prog_type prog_type,
594 static inline bool btf_type_is_struct_ptr(struct btf *btf, const struct btf_type *t) in btf_type_is_struct_ptr() argument
596 if (!btf_type_is_ptr(t)) in btf_type_is_struct_ptr()
599 t = btf_type_skip_modifiers(btf, t->type, NULL); in btf_type_is_struct_ptr()
601 return btf_type_is_struct(t); in btf_type_is_struct_ptr()
620 static inline int btf_field_iter_init(struct btf_field_iter *it, struct btf_type *t, in btf_field_iter_init() argument
663 const struct btf_type *t, enum bpf_prog_type prog_type, in btf_is_prog_ctx_type() argument