Lines Matching refs:t
207 struct btf_record *btf_parse_fields(const struct btf *btf, const struct btf_type *t,
210 bool btf_type_is_void(const struct btf_type *t);
222 const char *btf_type_str(const struct btf_type *t);
234 static inline bool btf_type_is_ptr(const struct btf_type *t) in btf_type_is_ptr() argument
236 return BTF_INFO_KIND(t->info) == BTF_KIND_PTR; in btf_type_is_ptr()
239 static inline bool btf_type_is_int(const struct btf_type *t) in btf_type_is_int() argument
241 return BTF_INFO_KIND(t->info) == BTF_KIND_INT; in btf_type_is_int()
244 static inline bool btf_type_is_small_int(const struct btf_type *t) in btf_type_is_small_int() argument
246 return btf_type_is_int(t) && t->size <= sizeof(u64); in btf_type_is_small_int()
249 static inline u8 btf_int_encoding(const struct btf_type *t) in btf_int_encoding() argument
251 return BTF_INT_ENCODING(*(u32 *)(t + 1)); in btf_int_encoding()
254 static inline bool btf_type_is_signed_int(const struct btf_type *t) in btf_type_is_signed_int() argument
256 return btf_type_is_int(t) && (btf_int_encoding(t) & BTF_INT_SIGNED); in btf_type_is_signed_int()
259 static inline bool btf_type_is_enum(const struct btf_type *t) in btf_type_is_enum() argument
261 return BTF_INFO_KIND(t->info) == BTF_KIND_ENUM; in btf_type_is_enum()
264 static inline bool btf_is_any_enum(const struct btf_type *t) in btf_is_any_enum() argument
266 return BTF_INFO_KIND(t->info) == BTF_KIND_ENUM || in btf_is_any_enum()
267 BTF_INFO_KIND(t->info) == BTF_KIND_ENUM64; in btf_is_any_enum()
282 static inline u16 btf_kind(const struct btf_type *t) in btf_kind() argument
284 return BTF_INFO_KIND(t->info); in btf_kind()
287 static inline bool btf_is_enum(const struct btf_type *t) in btf_is_enum() argument
289 return btf_kind(t) == BTF_KIND_ENUM; in btf_is_enum()
292 static inline bool btf_is_enum64(const struct btf_type *t) in btf_is_enum64() argument
294 return btf_kind(t) == BTF_KIND_ENUM64; in btf_is_enum64()
302 static inline bool btf_is_composite(const struct btf_type *t) in btf_is_composite() argument
304 u16 kind = btf_kind(t); in btf_is_composite()
309 static inline bool btf_is_array(const struct btf_type *t) in btf_is_array() argument
311 return btf_kind(t) == BTF_KIND_ARRAY; in btf_is_array()
314 static inline bool btf_is_int(const struct btf_type *t) in btf_is_int() argument
316 return btf_kind(t) == BTF_KIND_INT; in btf_is_int()
319 static inline bool btf_is_ptr(const struct btf_type *t) in btf_is_ptr() argument
321 return btf_kind(t) == BTF_KIND_PTR; in btf_is_ptr()
324 static inline u8 btf_int_offset(const struct btf_type *t) in btf_int_offset() argument
326 return BTF_INT_OFFSET(*(u32 *)(t + 1)); in btf_int_offset()
329 static inline bool btf_type_is_scalar(const struct btf_type *t) in btf_type_is_scalar() argument
331 return btf_type_is_int(t) || btf_type_is_enum(t); in btf_type_is_scalar()
334 static inline bool btf_type_is_typedef(const struct btf_type *t) in btf_type_is_typedef() argument
336 return BTF_INFO_KIND(t->info) == BTF_KIND_TYPEDEF; in btf_type_is_typedef()
339 static inline bool btf_type_is_volatile(const struct btf_type *t) in btf_type_is_volatile() argument
341 return BTF_INFO_KIND(t->info) == BTF_KIND_VOLATILE; in btf_type_is_volatile()
344 static inline bool btf_type_is_func(const struct btf_type *t) in btf_type_is_func() argument
346 return BTF_INFO_KIND(t->info) == BTF_KIND_FUNC; in btf_type_is_func()
349 static inline bool btf_type_is_func_proto(const struct btf_type *t) in btf_type_is_func_proto() argument
351 return BTF_INFO_KIND(t->info) == BTF_KIND_FUNC_PROTO; in btf_type_is_func_proto()
354 static inline bool btf_type_is_var(const struct btf_type *t) in btf_type_is_var() argument
356 return BTF_INFO_KIND(t->info) == BTF_KIND_VAR; in btf_type_is_var()
359 static inline bool btf_type_is_type_tag(const struct btf_type *t) in btf_type_is_type_tag() argument
361 return BTF_INFO_KIND(t->info) == BTF_KIND_TYPE_TAG; in btf_type_is_type_tag()
367 static inline bool btf_type_is_struct(const struct btf_type *t) in btf_type_is_struct() argument
369 u8 kind = BTF_INFO_KIND(t->info); in btf_type_is_struct()
374 static inline bool __btf_type_is_struct(const struct btf_type *t) in __btf_type_is_struct() argument
376 return BTF_INFO_KIND(t->info) == BTF_KIND_STRUCT; in __btf_type_is_struct()
379 static inline bool btf_type_is_array(const struct btf_type *t) in btf_type_is_array() argument
381 return BTF_INFO_KIND(t->info) == BTF_KIND_ARRAY; in btf_type_is_array()
384 static inline u16 btf_type_vlen(const struct btf_type *t) in btf_type_vlen() argument
386 return BTF_INFO_VLEN(t->info); in btf_type_vlen()
389 static inline u16 btf_vlen(const struct btf_type *t) in btf_vlen() argument
391 return btf_type_vlen(t); in btf_vlen()
394 static inline u16 btf_func_linkage(const struct btf_type *t) in btf_func_linkage() argument
396 return BTF_INFO_VLEN(t->info); in btf_func_linkage()
399 static inline bool btf_type_kflag(const struct btf_type *t) in btf_type_kflag() argument
401 return BTF_INFO_KFLAG(t->info); in btf_type_kflag()
418 static inline struct btf_member *btf_members(const struct btf_type *t) in btf_members() argument
420 return (struct btf_member *)(t + 1); in btf_members()
423 static inline u32 btf_member_bit_offset(const struct btf_type *t, u32 member_idx) in btf_member_bit_offset() argument
425 const struct btf_member *m = btf_members(t) + member_idx; in btf_member_bit_offset()
427 return __btf_member_bit_offset(t, m); in btf_member_bit_offset()
430 static inline u32 btf_member_bitfield_size(const struct btf_type *t, u32 member_idx) in btf_member_bitfield_size() argument
432 const struct btf_member *m = btf_members(t) + member_idx; in btf_member_bitfield_size()
434 return __btf_member_bitfield_size(t, m); in btf_member_bitfield_size()
437 static inline const struct btf_member *btf_type_member(const struct btf_type *t) in btf_type_member() argument
439 return (const struct btf_member *)(t + 1); in btf_type_member()
442 static inline struct btf_array *btf_array(const struct btf_type *t) in btf_array() argument
444 return (struct btf_array *)(t + 1); in btf_array()
447 static inline struct btf_enum *btf_enum(const struct btf_type *t) in btf_enum() argument
449 return (struct btf_enum *)(t + 1); in btf_enum()
452 static inline struct btf_enum64 *btf_enum64(const struct btf_type *t) in btf_enum64() argument
454 return (struct btf_enum64 *)(t + 1); in btf_enum64()
458 const struct btf_type *t) in btf_type_var_secinfo() argument
460 return (const struct btf_var_secinfo *)(t + 1); in btf_type_var_secinfo()
463 static inline struct btf_param *btf_params(const struct btf_type *t) in btf_params() argument
465 return (struct btf_param *)(t + 1); in btf_params()
505 const struct btf_type *t, enum bpf_prog_type prog_type,
548 const struct btf_type *t, enum bpf_prog_type prog_type, in btf_get_prog_ctx_type() argument
564 static inline bool btf_type_is_struct_ptr(struct btf *btf, const struct btf_type *t) in btf_type_is_struct_ptr() argument
566 if (!btf_type_is_ptr(t)) in btf_type_is_struct_ptr()
569 t = btf_type_skip_modifiers(btf, t->type, NULL); in btf_type_is_struct_ptr()
571 return btf_type_is_struct(t); in btf_type_is_struct_ptr()