Revision 51fb256a
b/include/exec/cpu-defs.h | ||
---|---|---|
178 | 178 |
\ |
179 | 179 |
/* user data */ \ |
180 | 180 |
void *opaque; \ |
181 |
\ |
|
182 |
const char *cpu_model_str; |
|
183 | 181 |
|
184 | 182 |
#endif |
b/linux-user/main.c | ||
---|---|---|
42 | 42 |
const char *argv0; |
43 | 43 |
int gdbstub_port; |
44 | 44 |
envlist_t *envlist; |
45 |
const char *cpu_model; |
|
45 |
static const char *cpu_model;
|
|
46 | 46 |
unsigned long mmap_min_addr; |
47 | 47 |
#if defined(CONFIG_USE_GUEST_BASE) |
48 | 48 |
unsigned long guest_base; |
... | ... | |
3287 | 3287 |
|
3288 | 3288 |
CPUArchState *cpu_copy(CPUArchState *env) |
3289 | 3289 |
{ |
3290 |
CPUArchState *new_env = cpu_init(env->cpu_model_str);
|
|
3290 |
CPUArchState *new_env = cpu_init(cpu_model);
|
|
3291 | 3291 |
#if defined(TARGET_HAS_ICE) |
3292 | 3292 |
CPUBreakpoint *bp; |
3293 | 3293 |
CPUWatchpoint *wp; |
b/target-alpha/cpu.c | ||
---|---|---|
131 | 131 |
AlphaCPU *cpu_alpha_init(const char *cpu_model) |
132 | 132 |
{ |
133 | 133 |
AlphaCPU *cpu; |
134 |
CPUAlphaState *env; |
|
135 | 134 |
ObjectClass *cpu_class; |
136 | 135 |
|
137 | 136 |
cpu_class = alpha_cpu_class_by_name(cpu_model); |
... | ... | |
140 | 139 |
cpu_class = object_class_by_name(TYPE("ev67")); |
141 | 140 |
} |
142 | 141 |
cpu = ALPHA_CPU(object_new(object_class_get_name(cpu_class))); |
143 |
env = &cpu->env; |
|
144 |
|
|
145 |
env->cpu_model_str = cpu_model; |
|
146 | 142 |
|
147 | 143 |
object_property_set_bool(OBJECT(cpu), true, "realized", NULL); |
148 | 144 |
|
b/target-arm/helper.c | ||
---|---|---|
1749 | 1749 |
ARMCPU *cpu_arm_init(const char *cpu_model) |
1750 | 1750 |
{ |
1751 | 1751 |
ARMCPU *cpu; |
1752 |
CPUARMState *env; |
|
1753 | 1752 |
ObjectClass *oc; |
1754 | 1753 |
|
1755 | 1754 |
oc = cpu_class_by_name(TYPE_ARM_CPU, cpu_model); |
... | ... | |
1757 | 1756 |
return NULL; |
1758 | 1757 |
} |
1759 | 1758 |
cpu = ARM_CPU(object_new(object_class_get_name(oc))); |
1760 |
env = &cpu->env; |
|
1761 |
env->cpu_model_str = cpu_model; |
|
1762 | 1759 |
|
1763 | 1760 |
/* TODO this should be set centrally, once possible */ |
1764 | 1761 |
object_property_set_bool(OBJECT(cpu), true, "realized", NULL); |
b/target-i386/cpu.c | ||
---|---|---|
1899 | 1899 |
Error **errp) |
1900 | 1900 |
{ |
1901 | 1901 |
X86CPU *cpu = NULL; |
1902 |
CPUX86State *env; |
|
1903 | 1902 |
gchar **model_pieces; |
1904 | 1903 |
char *name, *features; |
1905 | 1904 |
char *typename; |
... | ... | |
1922 | 1921 |
qdev_set_parent_bus(DEVICE(cpu), qdev_get_child_bus(icc_bridge, "icc")); |
1923 | 1922 |
object_unref(OBJECT(cpu)); |
1924 | 1923 |
#endif |
1925 |
env = &cpu->env; |
|
1926 |
env->cpu_model_str = cpu_model; |
|
1927 | 1924 |
|
1928 | 1925 |
cpu_x86_register(cpu, name, &error); |
1929 | 1926 |
if (error) { |
b/target-m68k/helper.c | ||
---|---|---|
110 | 110 |
} |
111 | 111 |
cpu = M68K_CPU(object_new(object_class_get_name(oc))); |
112 | 112 |
env = &cpu->env; |
113 |
env->cpu_model_str = cpu_model; |
|
114 | 113 |
|
115 | 114 |
register_m68k_insns(env); |
116 | 115 |
|
b/target-mips/translate.c | ||
---|---|---|
15907 | 15907 |
cpu = MIPS_CPU(object_new(TYPE_MIPS_CPU)); |
15908 | 15908 |
env = &cpu->env; |
15909 | 15909 |
env->cpu_model = def; |
15910 |
env->cpu_model_str = cpu_model; |
|
15911 | 15910 |
|
15912 | 15911 |
#ifndef CONFIG_USER_ONLY |
15913 | 15912 |
mmu_init(env, def); |
b/target-moxie/cpu.c | ||
---|---|---|
138 | 138 |
return NULL; |
139 | 139 |
} |
140 | 140 |
cpu = MOXIE_CPU(object_new(object_class_get_name(oc))); |
141 |
cpu->env.cpu_model_str = cpu_model; |
|
142 | 141 |
|
143 | 142 |
object_property_set_bool(OBJECT(cpu), true, "realized", NULL); |
144 | 143 |
|
b/target-openrisc/cpu.c | ||
---|---|---|
209 | 209 |
return NULL; |
210 | 210 |
} |
211 | 211 |
cpu = OPENRISC_CPU(object_new(object_class_get_name(oc))); |
212 |
cpu->env.cpu_model_str = cpu_model; |
|
213 | 212 |
|
214 | 213 |
object_property_set_bool(OBJECT(cpu), true, "realized", NULL); |
215 | 214 |
|
b/target-ppc/translate_init.c | ||
---|---|---|
8267 | 8267 |
PowerPCCPU *cpu_ppc_init(const char *cpu_model) |
8268 | 8268 |
{ |
8269 | 8269 |
PowerPCCPU *cpu; |
8270 |
CPUPPCState *env; |
|
8271 | 8270 |
ObjectClass *oc; |
8272 | 8271 |
Error *err = NULL; |
8273 | 8272 |
|
... | ... | |
8277 | 8276 |
} |
8278 | 8277 |
|
8279 | 8278 |
cpu = POWERPC_CPU(object_new(object_class_get_name(oc))); |
8280 |
env = &cpu->env; |
|
8281 |
env->cpu_model_str = cpu_model; |
|
8282 | 8279 |
|
8283 | 8280 |
object_property_set_bool(OBJECT(cpu), true, "realized", &err); |
8284 | 8281 |
if (err != NULL) { |
b/target-s390x/helper.c | ||
---|---|---|
73 | 73 |
S390CPU *cpu_s390x_init(const char *cpu_model) |
74 | 74 |
{ |
75 | 75 |
S390CPU *cpu; |
76 |
CPUS390XState *env; |
|
77 | 76 |
|
78 | 77 |
cpu = S390_CPU(object_new(TYPE_S390_CPU)); |
79 |
env = &cpu->env; |
|
80 |
env->cpu_model_str = cpu_model; |
|
81 | 78 |
|
82 | 79 |
object_property_set_bool(OBJECT(cpu), true, "realized", NULL); |
83 | 80 |
|
b/target-sh4/cpu.c | ||
---|---|---|
144 | 144 |
SuperHCPU *cpu_sh4_init(const char *cpu_model) |
145 | 145 |
{ |
146 | 146 |
SuperHCPU *cpu; |
147 |
CPUSH4State *env; |
|
148 | 147 |
ObjectClass *oc; |
149 | 148 |
|
150 | 149 |
oc = superh_cpu_class_by_name(cpu_model); |
... | ... | |
152 | 151 |
return NULL; |
153 | 152 |
} |
154 | 153 |
cpu = SUPERH_CPU(object_new(object_class_get_name(oc))); |
155 |
env = &cpu->env; |
|
156 |
env->cpu_model_str = cpu_model; |
|
157 | 154 |
|
158 | 155 |
object_property_set_bool(OBJECT(cpu), true, "realized", NULL); |
159 | 156 |
|
b/target-sparc/cpu.c | ||
---|---|---|
84 | 84 |
env->def->features |= CPU_FEATURE_FLOAT128; |
85 | 85 |
} |
86 | 86 |
#endif |
87 |
env->cpu_model_str = cpu_model; |
|
88 | 87 |
env->version = def->iu_version; |
89 | 88 |
env->fsr = def->fpu_version; |
90 | 89 |
env->nwindows = def->nwindows; |
b/target-unicore32/helper.c | ||
---|---|---|
37 | 37 |
} |
38 | 38 |
cpu = UNICORE32_CPU(object_new(object_class_get_name(oc))); |
39 | 39 |
env = &cpu->env; |
40 |
env->cpu_model_str = cpu_model; |
|
41 | 40 |
|
42 | 41 |
object_property_set_bool(OBJECT(cpu), true, "realized", NULL); |
43 | 42 |
|
Also available in: Unified diff