qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: patches@linaro.org, Eduardo Habkost <ehabkost@redhat.com>
Subject: [Qemu-devel] [PATCH 3/4] hw/arm/integrator: Use new cpu_generic_new()
Date: Mon, 13 Feb 2017 14:28:18 +0000	[thread overview]
Message-ID: <1486996099-15820-4-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1486996099-15820-1-git-send-email-peter.maydell@linaro.org>

Use the new cpu_generic_new() function rather than doing the
work of creating it and calling parse_features by hand.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/integratorcp.c | 22 ++--------------------
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c
index 5610ffc..beffaf4 100644
--- a/hw/arm/integratorcp.c
+++ b/hw/arm/integratorcp.c
@@ -577,42 +577,24 @@ static void integratorcp_init(MachineState *machine)
     const char *kernel_filename = machine->kernel_filename;
     const char *kernel_cmdline = machine->kernel_cmdline;
     const char *initrd_filename = machine->initrd_filename;
-    char **cpustr;
-    ObjectClass *cpu_oc;
-    CPUClass *cc;
     Object *cpuobj;
     ARMCPU *cpu;
-    const char *typename;
     MemoryRegion *address_space_mem = get_system_memory();
     MemoryRegion *ram = g_new(MemoryRegion, 1);
     MemoryRegion *ram_alias = g_new(MemoryRegion, 1);
     qemu_irq pic[32];
     DeviceState *dev, *sic, *icp;
     int i;
-    Error *err = NULL;
 
     if (!cpu_model) {
         cpu_model = "arm926";
     }
 
-    cpustr = g_strsplit(cpu_model, ",", 2);
-
-    cpu_oc = cpu_class_by_name(TYPE_ARM_CPU, cpustr[0]);
-    if (!cpu_oc) {
+    cpuobj = OBJECT(cpu_generic_new(TYPE_ARM_CPU, cpu_model));
+    if (!cpuobj) {
         fprintf(stderr, "Unable to find CPU definition\n");
         exit(1);
     }
-    typename = object_class_get_name(cpu_oc);
-
-    cc = CPU_CLASS(cpu_oc);
-    cc->parse_features(typename, cpustr[1], &err);
-    g_strfreev(cpustr);
-    if (err) {
-        error_report_err(err);
-        exit(1);
-    }
-
-    cpuobj = object_new(typename);
 
     /* By default ARM1176 CPUs have EL3 enabled.  This board does not
      * currently support EL3 so the CPU EL3 property is disabled before
-- 
2.7.4

  parent reply	other threads:[~2017-02-13 14:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-13 14:28 [Qemu-devel] [PATCH 0/4] cpu: Implement cpu_generic_new() Peter Maydell
2017-02-13 14:28 ` [Qemu-devel] [PATCH 1/4] cpu: add cpu_generic_new() Peter Maydell
2017-02-21 18:35   ` Eduardo Habkost
2017-02-13 14:28 ` [Qemu-devel] [PATCH 2/4] cpu: Clarify TODO comment in cpu_generic_new() Peter Maydell
2017-02-13 14:28 ` Peter Maydell [this message]
2017-02-13 14:28 ` [Qemu-devel] [PATCH 4/4] hw/arm/virt: Use new cpu_generic_new() Peter Maydell
2017-02-20 19:10   ` Igor Mammedov
2017-02-21 16:09     ` Eduardo Habkost
2017-02-16 16:40 ` [Qemu-devel] [Qemu-arm] [PATCH 0/4] cpu: Implement cpu_generic_new() Peter Maydell
2017-02-21 15:58   ` Eduardo Habkost
2017-02-21 17:48     ` Peter Maydell
2017-02-17 19:05 ` [Qemu-devel] " Igor Mammedov
2017-02-21 16:01   ` Eduardo Habkost
2017-06-26 13:28 ` [Qemu-devel] [Qemu-arm] " Alex Bennée
2017-06-27  2:33   ` Eduardo Habkost
2017-06-27  8:32     ` Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1486996099-15820-4-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=ehabkost@redhat.com \
    --cc=patches@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).