target-sparc: Use sparc_cpu_parse_features() directly

Make SPARC target use sparc_cpu_parse_features() directly
so it won't get in the way of switching other propertified
targets to handling features as global properties.

Backports commit fb02d56e96d553088c5b4267a3c954a3e952a50a from qemu
This commit is contained in:
Igor Mammedov 2018-02-25 02:27:16 -05:00 committed by Lioncash
parent e4d123caa9
commit 78f9128dbb
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -93,9 +93,11 @@ static bool sparc_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
return false; return false;
} }
static void sparc_cpu_parse_features(CPUState *cs, char *features,
Error **errp);
static int cpu_sparc_register(struct uc_struct *uc, SPARCCPU *cpu, const char *cpu_model) static int cpu_sparc_register(struct uc_struct *uc, SPARCCPU *cpu, const char *cpu_model)
{ {
CPUClass *cc = CPU_GET_CLASS(uc, cpu);
CPUSPARCState *env = &cpu->env; CPUSPARCState *env = &cpu->env;
char *s = g_strdup(cpu_model); char *s = g_strdup(cpu_model);
char *featurestr, *name = strtok(s, ","); char *featurestr, *name = strtok(s, ",");
@ -111,7 +113,7 @@ static int cpu_sparc_register(struct uc_struct *uc, SPARCCPU *cpu, const char *c
memcpy(env->def, def, sizeof(*def)); memcpy(env->def, def, sizeof(*def));
featurestr = strtok(NULL, ","); featurestr = strtok(NULL, ",");
cc->parse_features(CPU(cpu), featurestr, &err); sparc_cpu_parse_features(CPU(cpu), featurestr, &err);
g_free(s); g_free(s);
if (err) { if (err) {
//error_report("%s", error_get_pretty(err)); //error_report("%s", error_get_pretty(err));
@ -879,7 +881,6 @@ static void sparc_cpu_class_init(struct uc_struct *uc, ObjectClass *oc, void *da
scc->parent_reset = cc->reset; scc->parent_reset = cc->reset;
cc->reset = sparc_cpu_reset; cc->reset = sparc_cpu_reset;
cc->parse_features = sparc_cpu_parse_features;
cc->has_work = sparc_cpu_has_work; cc->has_work = sparc_cpu_has_work;
cc->do_interrupt = sparc_cpu_do_interrupt; cc->do_interrupt = sparc_cpu_do_interrupt;
cc->cpu_exec_interrupt = sparc_cpu_exec_interrupt; cc->cpu_exec_interrupt = sparc_cpu_exec_interrupt;