[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 08/45] target/arm: Name CPState type
From: |
Richard Henderson |
Subject: |
[PATCH v4 08/45] target/arm: Name CPState type |
Date: |
Sat, 30 Apr 2022 22:49:50 -0700 |
Give this enum a name and use in ARMCPRegInfo,
add_cpreg_to_hashtable and define_one_arm_cp_reg_with_opaque.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/cpregs.h | 6 +++---
target/arm/helper.c | 6 ++++--
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/target/arm/cpregs.h b/target/arm/cpregs.h
index 858c5da57d..4179a8cdd5 100644
--- a/target/arm/cpregs.h
+++ b/target/arm/cpregs.h
@@ -114,11 +114,11 @@ enum {
* Note that we rely on the values of these enums as we iterate through
* the various states in some places.
*/
-enum {
+typedef enum {
ARM_CP_STATE_AA32 = 0,
ARM_CP_STATE_AA64 = 1,
ARM_CP_STATE_BOTH = 2,
-};
+} CPState;
/*
* ARM CP register secure state flags. These flags identify security state
@@ -260,7 +260,7 @@ struct ARMCPRegInfo {
uint8_t opc1;
uint8_t opc2;
/* Execution state in which this register is visible: ARM_CP_STATE_* */
- int state;
+ CPState state;
/* Register type: ARM_CP_* bits/values */
int type;
/* Access rights: PL*_[RW] */
diff --git a/target/arm/helper.c b/target/arm/helper.c
index a19e04bb0b..d560a6a6a9 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -8502,7 +8502,7 @@ CpuDefinitionInfoList *qmp_query_cpu_definitions(Error
**errp)
}
static void add_cpreg_to_hashtable(ARMCPU *cpu, const ARMCPRegInfo *r,
- void *opaque, int state, int secstate,
+ void *opaque, CPState state, int secstate,
int crm, int opc1, int opc2,
const char *name)
{
@@ -8662,13 +8662,15 @@ void define_one_arm_cp_reg_with_opaque(ARMCPU *cpu,
* bits; the ARM_CP_64BIT* flag applies only to the AArch32 view of
* the register, if any.
*/
- int crm, opc1, opc2, state;
+ int crm, opc1, opc2;
int crmmin = (r->crm == CP_ANY) ? 0 : r->crm;
int crmmax = (r->crm == CP_ANY) ? 15 : r->crm;
int opc1min = (r->opc1 == CP_ANY) ? 0 : r->opc1;
int opc1max = (r->opc1 == CP_ANY) ? 7 : r->opc1;
int opc2min = (r->opc2 == CP_ANY) ? 0 : r->opc2;
int opc2max = (r->opc2 == CP_ANY) ? 7 : r->opc2;
+ CPState state;
+
/* 64 bit registers have only CRm and Opc1 fields */
assert(!((r->type & ARM_CP_64BIT) && (r->opc2 || r->crn)));
/* op0 only exists in the AArch64 encodings */
--
2.34.1
- [PATCH v4 00/45] target/arm: Cleanups, new features, new cpus, Richard Henderson, 2022/05/01
- [PATCH v4 02/45] target/arm: Reorg CPAccessResult and access_check_cp_reg, Richard Henderson, 2022/05/01
- [PATCH v4 04/45] target/arm: Make some more cpreg data static const, Richard Henderson, 2022/05/01
- [PATCH v4 01/45] target/arm: Split out cpregs.h, Richard Henderson, 2022/05/01
- [PATCH v4 06/45] target/arm: Avoid bare abort() or assert(0), Richard Henderson, 2022/05/01
- [PATCH v4 08/45] target/arm: Name CPState type,
Richard Henderson <=
- [PATCH v4 03/45] target/arm: Replace sentinels with ARRAY_SIZE in cpregs.h, Richard Henderson, 2022/05/01
- [PATCH v4 10/45] target/arm: Drop always-true test in define_arm_vh_e2h_redirects_aliases, Richard Henderson, 2022/05/01
- [PATCH v4 15/45] target/arm: Use bool for is64 and ns in add_cpreg_to_hashtable, Richard Henderson, 2022/05/01
- [PATCH v4 13/45] target/arm: Hoist computation of key in add_cpreg_to_hashtable, Richard Henderson, 2022/05/01
- [PATCH v4 27/45] target/arm: Set ID_DFR0.PerfMon for qemu-system-arm -cpu max, Richard Henderson, 2022/05/01
- [PATCH v4 20/45] target/arm: Handle cpreg registration for missing EL, Richard Henderson, 2022/05/01