mirror of https://gitee.com/openkylin/linux.git
arm64: Handle width of a cpuid feature
Introduce a helper to extract cpuid feature for any given width. Signed-off-by: Suzuki K. Poulose <suzuki.poulose@arm.com> Tested-by: Dave Martin <Dave.Martin@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
This commit is contained in:
parent
12d11817ea
commit
ce98a677d8
|
@ -76,10 +76,16 @@ static inline void cpus_set_cap(unsigned int num)
|
||||||
__set_bit(num, cpu_hwcaps);
|
__set_bit(num, cpu_hwcaps);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int __attribute_const__ cpuid_feature_extract_field(u64 features,
|
static inline int __attribute_const__
|
||||||
int field)
|
cpuid_feature_extract_field_width(u64 features, int field, int width)
|
||||||
{
|
{
|
||||||
return (s64)(features << (64 - 4 - field)) >> (64 - 4);
|
return (s64)(features << (64 - width - field)) >> (64 - width);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int __attribute_const__
|
||||||
|
cpuid_feature_extract_field(u64 features, int field)
|
||||||
|
{
|
||||||
|
return cpuid_feature_extract_field_width(features, field, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool id_aa64mmfr0_mixed_endian_el0(u64 mmfr0)
|
static inline bool id_aa64mmfr0_mixed_endian_el0(u64 mmfr0)
|
||||||
|
|
Loading…
Reference in New Issue