diff options
author | Andreas Färber <afaerber@suse.de> | 2013-02-06 17:18:12 +0100 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-02-16 14:50:59 +0100 |
commit | 6ae064fc671f1c475b1371c067fa3100ec6daf80 (patch) | |
tree | c59c99d795dbe712de6a9e5cdb4f1b00079bf699 /target-cris/translate.c | |
parent | cb3fb38e91caacfcb0f86e8c587ed74ffa34fe8e (diff) |
target-cris: Introduce CRISCPU subclasses
Use class_init functions to initialize the VR in preparation for
overriding v32+ behavior there.
Move cpu_cris_init() to cpu.c and hook up a class_by_name callback.
This change leads to unknown -cpu model names no longer falling back
to a CPU with VR 32 but instead returning NULL.
Acked-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-cris/translate.c')
-rw-r--r-- | target-cris/translate.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/target-cris/translate.c b/target-cris/translate.c index 25a43faf35..04a5379775 100644 --- a/target-cris/translate.c +++ b/target-cris/translate.c @@ -3513,54 +3513,6 @@ void cpu_dump_state (CPUCRISState *env, FILE *f, fprintf_function cpu_fprintf, } -struct -{ - uint32_t vr; - const char *name; -} cris_cores[] = { - {8, "crisv8"}, - {9, "crisv9"}, - {10, "crisv10"}, - {11, "crisv11"}, - {32, "crisv32"}, -}; - -void cris_cpu_list(FILE *f, fprintf_function cpu_fprintf) -{ - unsigned int i; - - (*cpu_fprintf)(f, "Available CPUs:\n"); - for (i = 0; i < ARRAY_SIZE(cris_cores); i++) { - (*cpu_fprintf)(f, " %s\n", cris_cores[i].name); - } -} - -static uint32_t vr_by_name(const char *name) -{ - unsigned int i; - for (i = 0; i < ARRAY_SIZE(cris_cores); i++) { - if (strcmp(name, cris_cores[i].name) == 0) { - return cris_cores[i].vr; - } - } - return 32; -} - -CRISCPU *cpu_cris_init(const char *cpu_model) -{ - CRISCPU *cpu; - CPUCRISState *env; - - cpu = CRIS_CPU(object_new(TYPE_CRIS_CPU)); - env = &cpu->env; - - env->pregs[PR_VR] = vr_by_name(cpu_model); - - object_property_set_bool(OBJECT(cpu), true, "realized", NULL); - - return cpu; -} - void cris_initialize_tcg(void) { int i; |