Commit 51fb256a authored by Andreas Färber's avatar Andreas Färber
Browse files

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: default avatarAndreas Färber <afaerber@suse.de>
parent 30ba0ee5
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -178,7 +178,5 @@ typedef struct CPUWatchpoint {
                                                                        \
    /* user data */                                                     \
    void *opaque;                                                       \
                                                                        \
    const char *cpu_model_str;

#endif
+2 −2
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ const char *filename;
const char *argv0;
int gdbstub_port;
envlist_t *envlist;
const char *cpu_model;
static const char *cpu_model;
unsigned long mmap_min_addr;
#if defined(CONFIG_USE_GUEST_BASE)
unsigned long guest_base;
@@ -3287,7 +3287,7 @@ void init_task_state(TaskState *ts)

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)
    CPUBreakpoint *bp;
    CPUWatchpoint *wp;
+0 −4
Original line number Diff line number Diff line
@@ -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;
    CPUAlphaState *env;
    ObjectClass *cpu_class;

    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 = 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);

+0 −3
Original line number Diff line number Diff line
@@ -1749,7 +1749,6 @@ void register_cp_regs_for_features(ARMCPU *cpu)
ARMCPU *cpu_arm_init(const char *cpu_model)
{
    ARMCPU *cpu;
    CPUARMState *env;
    ObjectClass *oc;

    oc = cpu_class_by_name(TYPE_ARM_CPU, cpu_model);
@@ -1757,8 +1756,6 @@ ARMCPU *cpu_arm_init(const char *cpu_model)
        return NULL;
    }
    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 */
    object_property_set_bool(OBJECT(cpu), true, "realized", NULL);
+0 −3
Original line number Diff line number Diff line
@@ -1899,7 +1899,6 @@ X86CPU *cpu_x86_create(const char *cpu_model, DeviceState *icc_bridge,
                       Error **errp)
{
    X86CPU *cpu = NULL;
    CPUX86State *env;
    gchar **model_pieces;
    char *name, *features;
    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"));
    object_unref(OBJECT(cpu));
#endif
    env = &cpu->env;
    env->cpu_model_str = cpu_model;

    cpu_x86_register(cpu, name, &error);
    if (error) {
Loading