From patchwork Mon Dec 16 08:06:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 301538 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45BB42C009A for ; Mon, 16 Dec 2013 19:32:59 +1100 (EST) Received: from localhost ([::1]:54487 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsTQF-0004QT-4o for incoming@patchwork.ozlabs.org; Mon, 16 Dec 2013 03:21:03 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsTOS-0002Gv-W8 for qemu-devel@nongnu.org; Mon, 16 Dec 2013 03:19:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsTON-0006Rt-1C for qemu-devel@nongnu.org; Mon, 16 Dec 2013 03:19:12 -0500 Received: from mail-pb0-x22f.google.com ([2607:f8b0:400e:c01::22f]:35014) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsTOM-0006RZ-Pw for qemu-devel@nongnu.org; Mon, 16 Dec 2013 03:19:06 -0500 Received: by mail-pb0-f47.google.com with SMTP id um1so5141809pbc.34 for ; Mon, 16 Dec 2013 00:19:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=llmBPwBYvxbHuu5Ng5w4C1Oq0tgh6+2LpR3iaqYojrw=; b=g33qxJTh9W69IgBFQj8IolhfPWL8MIxz606TkFfgv9ZB+Khwi1ig4mXGXbKCPazxgF KpDL52A07LKWYmnRRakJ3A9FE6NyalohdEuIHEeV4J5QR1H3p8ooMzTK1PaZY+FT7ozB hl7dlY2w9H+wgv6RgKsGcO3jJ7zHxjv8zwSsZMvea4foCJ8wAlazy3hkvwjPBurTKItw mvCnn8PL44/k/9x0lto2nUef1TJ7tlDouVuAXFsnnqQbOfmfkgyUdlr7RYj24p5FLOG6 qMBqz3OzzgGr3eGz2UcACb8zRO9MiGN6NcXVdLf/dMMqSeB/uZhbpvCen+k4W0P5Yla1 IRUA== X-Received: by 10.66.156.106 with SMTP id wd10mr18568618pab.125.1387181945948; Mon, 16 Dec 2013 00:19:05 -0800 (PST) Received: from localhost ([149.199.62.254]) by mx.google.com with ESMTPSA id qp15sm24112685pbb.2.2013.12.16.00.19.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 16 Dec 2013 00:19:05 -0800 (PST) From: edgar.iglesias@gmail.com To: qemu-devel@nongnu.org Date: Mon, 16 Dec 2013 18:06:09 +1000 Message-Id: <1387181170-23267-22-git-send-email-edgar.iglesias@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1387181170-23267-1-git-send-email-edgar.iglesias@gmail.com> References: <1387181170-23267-1-git-send-email-edgar.iglesias@gmail.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::22f 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 Subject: [Qemu-devel] [PATCH v1 21/22] petalogix-ml605: Create the CPU with object_new() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: "Edgar E. Iglesias" This is to allow future patches to set properties before cpu::realize(). Signed-off-by: Edgar E. Iglesias Reviewed-by: Andreas Färber --- 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. */