mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
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. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
e8070a23a8
commit
2ceb98c007
3 changed files with 14 additions and 0 deletions
|
@ -107,5 +107,6 @@ static inline ARMCPU *arm_env_get_cpu(CPUARMState *env)
|
||||||
#define ENV_GET_CPU(e) CPU(arm_env_get_cpu(e))
|
#define ENV_GET_CPU(e) CPU(arm_env_get_cpu(e))
|
||||||
|
|
||||||
void arm_cpu_realize(ARMCPU *cpu);
|
void arm_cpu_realize(ARMCPU *cpu);
|
||||||
|
void register_cp_regs_for_features(ARMCPU *cpu);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -216,6 +216,8 @@ void arm_cpu_realize(ARMCPU *cpu)
|
||||||
if (arm_feature(env, ARM_FEATURE_VFP3)) {
|
if (arm_feature(env, ARM_FEATURE_VFP3)) {
|
||||||
set_feature(env, ARM_FEATURE_VFP);
|
set_feature(env, ARM_FEATURE_VFP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
register_cp_regs_for_features(cpu);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CPU models */
|
/* CPU models */
|
||||||
|
|
|
@ -56,6 +56,17 @@ static int vfp_gdb_set_reg(CPUARMState *env, uint8_t *buf, int reg)
|
||||||
return 0;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
ARMCPU *cpu_arm_init(const char *cpu_model)
|
ARMCPU *cpu_arm_init(const char *cpu_model)
|
||||||
{
|
{
|
||||||
ARMCPU *cpu;
|
ARMCPU *cpu;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue