aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2012-03-22 19:33:29 +0000
committerPeter Maydell <peter.maydell@linaro.org>2012-03-23 13:42:17 +0000
commitcb940ee9c674e5289cebf012468cc9a7235d229c (patch)
tree3bac5e06c4eb1057e8ea2716e7db2e4617d27431
parent163fb5097ff64e42d1eaae79aaa289b5ff084a7d (diff)
downloadqemu-arm-cb940ee9c674e5289cebf012468cc9a7235d229c.tar.gz
target-arm: Add register_cp_regs_for_features()
Add new function register_cp_regs_for_features() as a place to register coprocessor registers dependent on feature flags.
-rw-r--r--target-arm/cpu-qom.h1
-rw-r--r--target-arm/cpu.c2
-rw-r--r--target-arm/helper.c11
3 files changed, 14 insertions, 0 deletions
diff --git a/target-arm/cpu-qom.h b/target-arm/cpu-qom.h
index bf2e9d4bb5..049f67a9f8 100644
--- a/target-arm/cpu-qom.h
+++ b/target-arm/cpu-qom.h
@@ -76,5 +76,6 @@ static inline ARMCPU *arm_env_get_cpu(CPUARMState *env)
#define ENV_GET_CPU(e) CPU(arm_env_get_cpu(e))
+void register_cp_regs_for_features(ARMCPU *cpu);
#endif
diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index 82a404e20e..aadafeb0ad 100644
--- a/target-arm/cpu.c
+++ b/target-arm/cpu.c
@@ -193,6 +193,8 @@ static void arm_cpu_postconfig_init(ARMCPU *cpu)
if (arm_feature(env, ARM_FEATURE_VFP3)) {
set_feature(env, ARM_FEATURE_VFP);
}
+
+ register_cp_regs_for_features(cpu);
}
/* CPU models */
diff --git a/target-arm/helper.c b/target-arm/helper.c
index bceb2e0f07..b241cb7a24 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -209,6 +209,17 @@ static int vfp_gdb_set_reg(CPUARMState *env, uint8_t *buf, int reg)
return 0;
}
+void register_cp_regs_for_features(ARMCPU *cpu)
+{
+ /* Register all the coprocessor registers based on feature bits */
+ CPUARMState *env = &cpu->env;
+ if (arm_feature(env, ARM_FEATURE_M)) {
+ /* M profile has no coprocessor registers */
+ return;
+ }
+
+}
+
CPUARMState *cpu_arm_init(const char *cpu_model)
{
ObjectClass *klass;