From patchwork Mon Oct 17 14:02:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 120232 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 09841B6F88 for ; Tue, 18 Oct 2011 02:25:33 +1100 (EST) Received: from localhost ([::1]:60598 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFnnR-00051Y-8A for incoming@patchwork.ozlabs.org; Mon, 17 Oct 2011 10:04:05 -0400 Received: from eggs.gnu.org ([140.186.70.92]:53807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFnmZ-0002Yn-8F for qemu-devel@nongnu.org; Mon, 17 Oct 2011 10:03:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RFnmU-00038I-VR for qemu-devel@nongnu.org; Mon, 17 Oct 2011 10:03:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:19198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFnmU-00037a-LO for qemu-devel@nongnu.org; Mon, 17 Oct 2011 10:03:06 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9HE355i028404 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 17 Oct 2011 10:03:05 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p9HE32OS010038 for ; Mon, 17 Oct 2011 10:03:05 -0400 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 72D8F250B92; Mon, 17 Oct 2011 16:02:55 +0200 (IST) From: Avi Kivity To: qemu-devel@nongnu.org Date: Mon, 17 Oct 2011 16:02:45 +0200 Message-Id: <1318860167-14014-17-git-send-email-avi@redhat.com> In-Reply-To: <1318860167-14014-1-git-send-email-avi@redhat.com> References: <1318860167-14014-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 16/18] syborg: convert to memory API 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 Signed-off-by: Avi Kivity --- hw/syborg.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/syborg.c b/hw/syborg.c index bc200e4..248de54 100644 --- a/hw/syborg.c +++ b/hw/syborg.c @@ -26,6 +26,7 @@ #include "boards.h" #include "arm-misc.h" #include "net.h" +#include "exec-memory.h" static struct arm_boot_info syborg_binfo; @@ -35,9 +36,10 @@ static void syborg_init(ram_addr_t ram_size, const char *initrd_filename, const char *cpu_model) { CPUState *env; + MemoryRegion *sysmem = get_system_memory(); + MemoryRegion *ram = g_new(MemoryRegion, 1); qemu_irq *cpu_pic; qemu_irq pic[64]; - ram_addr_t ram_addr; DeviceState *dev; int i; @@ -50,8 +52,8 @@ static void syborg_init(ram_addr_t ram_size, } /* RAM at address zero. */ - ram_addr = qemu_ram_alloc(NULL, "syborg.ram", ram_size); - cpu_register_physical_memory(0, ram_size, ram_addr | IO_MEM_RAM); + memory_region_init_ram(ram, NULL, "syborg.ram", ram_size); + memory_region_add_subregion(sysmem, 0, ram); cpu_pic = arm_pic_init_cpu(env); dev = sysbus_create_simple("syborg,interrupt", 0xC0000000,