From 9262685b818512215f0829f0dc95c2363898a1ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Tue, 4 Mar 2014 03:17:10 +0100 Subject: cpu: Factor out cpu_generic_init() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All targets using it gain the ability to set -cpu name,key=value,... options via the default TYPE_CPU CPUClass::parse_features() implementation. Signed-off-by: Andreas Färber --- target-unicore32/helper.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'target-unicore32') diff --git a/target-unicore32/helper.c b/target-unicore32/helper.c index 9bf4fea5db..a1f86b0d13 100644 --- a/target-unicore32/helper.c +++ b/target-unicore32/helper.c @@ -28,19 +28,12 @@ CPUUniCore32State *uc32_cpu_init(const char *cpu_model) { UniCore32CPU *cpu; - CPUUniCore32State *env; - ObjectClass *oc; - oc = cpu_class_by_name(TYPE_UNICORE32_CPU, cpu_model); - if (oc == NULL) { + cpu = UNICORE32_CPU(cpu_generic_init(TYPE_UNICORE32_CPU, cpu_model)); + if (cpu == NULL) { return NULL; } - cpu = UNICORE32_CPU(object_new(object_class_get_name(oc))); - env = &cpu->env; - - object_property_set_bool(OBJECT(cpu), true, "realized", NULL); - - return env; + return &cpu->env; } uint32_t HELPER(clo)(uint32_t x) -- cgit v1.2.1