From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtWiq-0007vO-Lj for qemu-devel@nongnu.org; Thu, 19 Dec 2013 01:04:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtWil-0002mS-Rt for qemu-devel@nongnu.org; Thu, 19 Dec 2013 01:04:36 -0500 Received: from mail-pd0-x22c.google.com ([2607:f8b0:400e:c02::22c]:62504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtWil-0002lu-GR for qemu-devel@nongnu.org; Thu, 19 Dec 2013 01:04:31 -0500 Received: by mail-pd0-f172.google.com with SMTP id g10so676992pdj.31 for ; Wed, 18 Dec 2013 22:04:30 -0800 (PST) From: edgar.iglesias@gmail.com Date: Thu, 19 Dec 2013 15:51:32 +1000 Message-Id: <1387432293-17711-22-git-send-email-edgar.iglesias@gmail.com> In-Reply-To: <1387432293-17711-1-git-send-email-edgar.iglesias@gmail.com> References: <1387432293-17711-1-git-send-email-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v2 21/22] petalogix-ml605: Create the CPU with object_new() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, blauwirbel@gmail.com, aliguori@amazon.com, pcrost@xilinx.com, pbonzini@redhat.com, afaerber@suse.de, aurelien@aurel32.net, rth@twiddle.net From: "Edgar E. Iglesias" This is to allow future patches to set properties before cpu::realize(). Reviewed-by: Andreas Färber Signed-off-by: Edgar E. Iglesias --- hw/microblaze/petalogix_ml605_mmu.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_ml605_mmu.c index 10970e0..4009ff5 100644 --- a/hw/microblaze/petalogix_ml605_mmu.c +++ b/hw/microblaze/petalogix_ml605_mmu.c @@ -76,7 +76,7 @@ static void petalogix_ml605_init(QEMUMachineInitArgs *args) { ram_addr_t ram_size = args->ram_size; - const char *cpu_model = args->cpu_model; + Error *err = NULL; MemoryRegion *address_space_mem = get_system_memory(); DeviceState *dev, *dma, *eth0; Object *ds, *cs; @@ -91,10 +91,13 @@ petalogix_ml605_init(QEMUMachineInitArgs *args) qemu_irq irq[32], *cpu_irq; /* init CPUs */ - if (cpu_model == NULL) { - cpu_model = "microblaze"; + cpu = MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU)); + object_property_set_bool(OBJECT(cpu), true, "realized", &err); + if (err) { + error_report("%s", error_get_pretty(err)); + exit(EXIT_FAILURE); } - cpu = cpu_mb_init(cpu_model); + env = &cpu->env; /* Attach emulated BRAM through the LMB. */ -- 1.7.10.4