cpu: Drop cpu_model_str from CPU_COMMON

Since this is only read in cpu_copy() and linux-user has a global
cpu_model, drop the field from generic code.

Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
Andreas Färber 2013-07-02 18:26:11 +02:00
parent 30ba0ee52d
commit 51fb256ab5
14 changed files with 2 additions and 29 deletions

View file

@ -178,7 +178,5 @@ typedef struct CPUWatchpoint {
\ \
/* user data */ \ /* user data */ \
void *opaque; \ void *opaque; \
\
const char *cpu_model_str;
#endif #endif

View file

@ -42,7 +42,7 @@ const char *filename;
const char *argv0; const char *argv0;
int gdbstub_port; int gdbstub_port;
envlist_t *envlist; envlist_t *envlist;
const char *cpu_model; static const char *cpu_model;
unsigned long mmap_min_addr; unsigned long mmap_min_addr;
#if defined(CONFIG_USE_GUEST_BASE) #if defined(CONFIG_USE_GUEST_BASE)
unsigned long guest_base; unsigned long guest_base;
@ -3287,7 +3287,7 @@ void init_task_state(TaskState *ts)
CPUArchState *cpu_copy(CPUArchState *env) CPUArchState *cpu_copy(CPUArchState *env)
{ {
CPUArchState *new_env = cpu_init(env->cpu_model_str); CPUArchState *new_env = cpu_init(cpu_model);
#if defined(TARGET_HAS_ICE) #if defined(TARGET_HAS_ICE)
CPUBreakpoint *bp; CPUBreakpoint *bp;
CPUWatchpoint *wp; CPUWatchpoint *wp;

View file

@ -131,7 +131,6 @@ static ObjectClass *alpha_cpu_class_by_name(const char *cpu_model)
AlphaCPU *cpu_alpha_init(const char *cpu_model) AlphaCPU *cpu_alpha_init(const char *cpu_model)
{ {
AlphaCPU *cpu; AlphaCPU *cpu;
CPUAlphaState *env;
ObjectClass *cpu_class; ObjectClass *cpu_class;
cpu_class = alpha_cpu_class_by_name(cpu_model); cpu_class = alpha_cpu_class_by_name(cpu_model);
@ -140,9 +139,6 @@ AlphaCPU *cpu_alpha_init(const char *cpu_model)
cpu_class = object_class_by_name(TYPE("ev67")); cpu_class = object_class_by_name(TYPE("ev67"));
} }
cpu = ALPHA_CPU(object_new(object_class_get_name(cpu_class))); cpu = ALPHA_CPU(object_new(object_class_get_name(cpu_class)));
env = &cpu->env;
env->cpu_model_str = cpu_model;
object_property_set_bool(OBJECT(cpu), true, "realized", NULL); object_property_set_bool(OBJECT(cpu), true, "realized", NULL);

View file

@ -1749,7 +1749,6 @@ void register_cp_regs_for_features(ARMCPU *cpu)
ARMCPU *cpu_arm_init(const char *cpu_model) ARMCPU *cpu_arm_init(const char *cpu_model)
{ {
ARMCPU *cpu; ARMCPU *cpu;
CPUARMState *env;
ObjectClass *oc; ObjectClass *oc;
oc = cpu_class_by_name(TYPE_ARM_CPU, cpu_model); oc = cpu_class_by_name(TYPE_ARM_CPU, cpu_model);
@ -1757,8 +1756,6 @@ ARMCPU *cpu_arm_init(const char *cpu_model)
return NULL; return NULL;
} }
cpu = ARM_CPU(object_new(object_class_get_name(oc))); cpu = ARM_CPU(object_new(object_class_get_name(oc)));
env = &cpu->env;
env->cpu_model_str = cpu_model;
/* TODO this should be set centrally, once possible */ /* TODO this should be set centrally, once possible */
object_property_set_bool(OBJECT(cpu), true, "realized", NULL); object_property_set_bool(OBJECT(cpu), true, "realized", NULL);

View file

@ -1899,7 +1899,6 @@ X86CPU *cpu_x86_create(const char *cpu_model, DeviceState *icc_bridge,
Error **errp) Error **errp)
{ {
X86CPU *cpu = NULL; X86CPU *cpu = NULL;
CPUX86State *env;
gchar **model_pieces; gchar **model_pieces;
char *name, *features; char *name, *features;
char *typename; char *typename;
@ -1922,8 +1921,6 @@ X86CPU *cpu_x86_create(const char *cpu_model, DeviceState *icc_bridge,
qdev_set_parent_bus(DEVICE(cpu), qdev_get_child_bus(icc_bridge, "icc")); qdev_set_parent_bus(DEVICE(cpu), qdev_get_child_bus(icc_bridge, "icc"));
object_unref(OBJECT(cpu)); object_unref(OBJECT(cpu));
#endif #endif
env = &cpu->env;
env->cpu_model_str = cpu_model;
cpu_x86_register(cpu, name, &error); cpu_x86_register(cpu, name, &error);
if (error) { if (error) {

View file

@ -110,7 +110,6 @@ M68kCPU *cpu_m68k_init(const char *cpu_model)
} }
cpu = M68K_CPU(object_new(object_class_get_name(oc))); cpu = M68K_CPU(object_new(object_class_get_name(oc)));
env = &cpu->env; env = &cpu->env;
env->cpu_model_str = cpu_model;
register_m68k_insns(env); register_m68k_insns(env);

View file

@ -15907,7 +15907,6 @@ MIPSCPU *cpu_mips_init(const char *cpu_model)
cpu = MIPS_CPU(object_new(TYPE_MIPS_CPU)); cpu = MIPS_CPU(object_new(TYPE_MIPS_CPU));
env = &cpu->env; env = &cpu->env;
env->cpu_model = def; env->cpu_model = def;
env->cpu_model_str = cpu_model;
#ifndef CONFIG_USER_ONLY #ifndef CONFIG_USER_ONLY
mmu_init(env, def); mmu_init(env, def);

View file

@ -138,7 +138,6 @@ MoxieCPU *cpu_moxie_init(const char *cpu_model)
return NULL; return NULL;
} }
cpu = MOXIE_CPU(object_new(object_class_get_name(oc))); cpu = MOXIE_CPU(object_new(object_class_get_name(oc)));
cpu->env.cpu_model_str = cpu_model;
object_property_set_bool(OBJECT(cpu), true, "realized", NULL); object_property_set_bool(OBJECT(cpu), true, "realized", NULL);

View file

@ -209,7 +209,6 @@ OpenRISCCPU *cpu_openrisc_init(const char *cpu_model)
return NULL; return NULL;
} }
cpu = OPENRISC_CPU(object_new(object_class_get_name(oc))); cpu = OPENRISC_CPU(object_new(object_class_get_name(oc)));
cpu->env.cpu_model_str = cpu_model;
object_property_set_bool(OBJECT(cpu), true, "realized", NULL); object_property_set_bool(OBJECT(cpu), true, "realized", NULL);

View file

@ -8267,7 +8267,6 @@ static ObjectClass *ppc_cpu_class_by_name(const char *name)
PowerPCCPU *cpu_ppc_init(const char *cpu_model) PowerPCCPU *cpu_ppc_init(const char *cpu_model)
{ {
PowerPCCPU *cpu; PowerPCCPU *cpu;
CPUPPCState *env;
ObjectClass *oc; ObjectClass *oc;
Error *err = NULL; Error *err = NULL;
@ -8277,8 +8276,6 @@ PowerPCCPU *cpu_ppc_init(const char *cpu_model)
} }
cpu = POWERPC_CPU(object_new(object_class_get_name(oc))); cpu = POWERPC_CPU(object_new(object_class_get_name(oc)));
env = &cpu->env;
env->cpu_model_str = cpu_model;
object_property_set_bool(OBJECT(cpu), true, "realized", &err); object_property_set_bool(OBJECT(cpu), true, "realized", &err);
if (err != NULL) { if (err != NULL) {

View file

@ -73,11 +73,8 @@ void s390x_cpu_timer(void *opaque)
S390CPU *cpu_s390x_init(const char *cpu_model) S390CPU *cpu_s390x_init(const char *cpu_model)
{ {
S390CPU *cpu; S390CPU *cpu;
CPUS390XState *env;
cpu = S390_CPU(object_new(TYPE_S390_CPU)); cpu = S390_CPU(object_new(TYPE_S390_CPU));
env = &cpu->env;
env->cpu_model_str = cpu_model;
object_property_set_bool(OBJECT(cpu), true, "realized", NULL); object_property_set_bool(OBJECT(cpu), true, "realized", NULL);

View file

@ -144,7 +144,6 @@ static ObjectClass *superh_cpu_class_by_name(const char *cpu_model)
SuperHCPU *cpu_sh4_init(const char *cpu_model) SuperHCPU *cpu_sh4_init(const char *cpu_model)
{ {
SuperHCPU *cpu; SuperHCPU *cpu;
CPUSH4State *env;
ObjectClass *oc; ObjectClass *oc;
oc = superh_cpu_class_by_name(cpu_model); oc = superh_cpu_class_by_name(cpu_model);
@ -152,8 +151,6 @@ SuperHCPU *cpu_sh4_init(const char *cpu_model)
return NULL; return NULL;
} }
cpu = SUPERH_CPU(object_new(object_class_get_name(oc))); cpu = SUPERH_CPU(object_new(object_class_get_name(oc)));
env = &cpu->env;
env->cpu_model_str = cpu_model;
object_property_set_bool(OBJECT(cpu), true, "realized", NULL); object_property_set_bool(OBJECT(cpu), true, "realized", NULL);

View file

@ -84,7 +84,6 @@ static int cpu_sparc_register(CPUSPARCState *env, const char *cpu_model)
env->def->features |= CPU_FEATURE_FLOAT128; env->def->features |= CPU_FEATURE_FLOAT128;
} }
#endif #endif
env->cpu_model_str = cpu_model;
env->version = def->iu_version; env->version = def->iu_version;
env->fsr = def->fpu_version; env->fsr = def->fpu_version;
env->nwindows = def->nwindows; env->nwindows = def->nwindows;

View file

@ -37,7 +37,6 @@ CPUUniCore32State *uc32_cpu_init(const char *cpu_model)
} }
cpu = UNICORE32_CPU(object_new(object_class_get_name(oc))); cpu = UNICORE32_CPU(object_new(object_class_get_name(oc)));
env = &cpu->env; env = &cpu->env;
env->cpu_model_str = cpu_model;
object_property_set_bool(OBJECT(cpu), true, "realized", NULL); object_property_set_bool(OBJECT(cpu), true, "realized", NULL);