On 3/1/23 19:16, Richard Henderson wrote:
Create a features member in ARMCPUClass and copy to the instance in
arm_cpu_init. Settings of this value will come in a future patch.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/cpu-qom.h | 18 ++++++++++++++++++
target/arm/cpu.c | 1 +
2 files changed, 19 insertions(+)
diff --git a/target/arm/cpu-qom.h b/target/arm/cpu-qom.h
index 5509ef9d85..ac58cc3a87 100644
--- a/target/arm/cpu-qom.h
+++ b/target/arm/cpu-qom.h
@@ -74,8 +74,26 @@ struct ARMCPUClass {
/* 'compatible' string for this CPU for Linux device trees */
const char *dtb_compatible;
+
+ /* Internal CPU feature flags. */
+ uint64_t features;
};
+static inline int arm_class_feature(ARMCPUClass *acc, int feature)
+{
+ return (acc->features & (1ULL << feature)) != 0;
+}
+
+static inline void set_class_feature(ARMCPUClass *acc, int feature)
+{
+ acc->features |= 1ULL << feature;
+}
+
+static inline void unset_class_feature(ARMCPUClass *acc, int feature)
+{
+ acc->features &= ~(1ULL << feature);
+}
These helpers are not used until patch #19 "target/arm: Move most cpu
initialization to the class".