mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09:00
bpf: btf: Add BTF_FMODEL_SIGNED_ARG flag
s390x eBPF JIT needs to know whether a function return value is signed and which function arguments are signed, in order to generate code compliant with the s390x ABI. Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Link: https://lore.kernel.org/r/20230128000650.1516334-26-iii@linux.ibm.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
committed by
Alexei Starovoitov
parent
0f0e5f5bd5
commit
49f67f393f
@@ -236,6 +236,16 @@ static inline bool btf_type_is_small_int(const struct btf_type *t)
|
||||
return btf_type_is_int(t) && t->size <= sizeof(u64);
|
||||
}
|
||||
|
||||
static inline u8 btf_int_encoding(const struct btf_type *t)
|
||||
{
|
||||
return BTF_INT_ENCODING(*(u32 *)(t + 1));
|
||||
}
|
||||
|
||||
static inline bool btf_type_is_signed_int(const struct btf_type *t)
|
||||
{
|
||||
return btf_type_is_int(t) && (btf_int_encoding(t) & BTF_INT_SIGNED);
|
||||
}
|
||||
|
||||
static inline bool btf_type_is_enum(const struct btf_type *t)
|
||||
{
|
||||
return BTF_INFO_KIND(t->info) == BTF_KIND_ENUM;
|
||||
@@ -306,11 +316,6 @@ static inline u8 btf_int_offset(const struct btf_type *t)
|
||||
return BTF_INT_OFFSET(*(u32 *)(t + 1));
|
||||
}
|
||||
|
||||
static inline u8 btf_int_encoding(const struct btf_type *t)
|
||||
{
|
||||
return BTF_INT_ENCODING(*(u32 *)(t + 1));
|
||||
}
|
||||
|
||||
static inline bool btf_type_is_scalar(const struct btf_type *t)
|
||||
{
|
||||
return btf_type_is_int(t) || btf_type_is_enum(t);
|
||||
|
||||
Reference in New Issue
Block a user