Introduce data-structures required for the ARM property layer. There are
four classes of properties:
    STRING: Multi-bit fields with arch-defined named values, such as
            ("off", "aes", "pmull", ...).
    BOOLEAN: 1-bit fields.
    NUMERIC: Numeric values like cache geometry, debug counter widths, etc.
    FRACTIONAL: Paired (base, frac) fields exposed as a single "M.F" string
          (e.g., CSV2/CSV2_FRAC, MPAM/MPAM_FRAC, RAS/RAS_FRAC, NV/NV_FRAC).

Co-authored-by: Khushit Shah <[email protected]>
Signed-off-by: Shaju Abraham <[email protected]>
---
 target/arm/arm-cpu-props.h | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 target/arm/arm-cpu-props.h

diff --git a/target/arm/arm-cpu-props.h b/target/arm/arm-cpu-props.h
new file mode 100644
index 0000000000..1dc3786ea9
--- /dev/null
+++ b/target/arm/arm-cpu-props.h
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later
+ *
+ * ARM CPU feature properties.
+ *
+ * User-facing QOM properties that map to fields of the AArch64 ID
+ * registers described in cpu-idregs.inc.h.
+ *
+ */
+
+#ifndef ARM_CPU_PROPS_H
+#define ARM_CPU_PROPS_H
+
+#include "cpu-idregs.h"
+
+typedef enum ArmCpuPropType {
+    ARM_PROP_STRING,
+    ARM_PROP_BOOLEAN,
+    ARM_PROP_NUMERIC,
+    ARM_PROP_FRACTIONAL,
+} ArmCpuPropType;
+
+typedef struct ArmFracVal {
+    const char *name;
+    uint64_t base_val;
+    uint64_t frac_val;
+} ArmFracVal;
+
+typedef struct ArmCpuPropDesc {
+    const char *name;
+    ArmCpuPropType type;
+    ArmFieldIdx base_field;
+    ArmFieldIdx frac_field;
+    const ArmFracVal *vals;
+} ArmCpuPropDesc;
+
+#endif
-- 
2.52.0


Reply via email to