@@ -177,6 +177,7 @@ struct arm64_ftr_reg {
.ftr_bits = &((ftr_table)[0]), \
}
+#define read_system_cpuid(id) read_system_reg(SYS_##id)
/*
* Records attributes of an individual CPU.
*/
@@ -226,4 +227,5 @@ static inline u64 arm64_ftr_value(struct arm64_ftr_bits *ftrp, u64 reg)
return ((reg >> ftrp->shift) & ftrp->mask);
}
+u64 read_system_reg(enum sys_id id);
#endif /* __ASM_CPU_H */
@@ -310,6 +310,15 @@ static struct arm64_ftr_reg* get_arm64_sys_reg(enum sys_id sys_id)
return NULL;
}
+u64 read_system_reg(enum sys_id id)
+{
+ struct arm64_ftr_reg *regp = get_arm64_sys_reg(id);
+
+ /* We shouldn't get a request for an unsupported register */
+ BUG_ON(!regp);
+ return regp->sys_val;
+}
+
static u64 arm64_ftr_set_value(struct arm64_ftr_bits *ftrp, u64 reg, u64 ftr_val)
{
u64 mask = ftrp->mask << ftrp->shift;