From patchwork Mon Jun 4 09:57:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 162745 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 232C8B700A for ; Mon, 4 Jun 2012 21:33:21 +1000 (EST) Received: from localhost ([::1]:40849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbU4s-0002bb-DZ for incoming@patchwork.ozlabs.org; Mon, 04 Jun 2012 05:59:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbU34-0008Te-5C for qemu-devel@nongnu.org; Mon, 04 Jun 2012 05:58:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbU2q-0004bz-7S for qemu-devel@nongnu.org; Mon, 04 Jun 2012 05:58:05 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:46504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbU2p-0004as-UE for qemu-devel@nongnu.org; Mon, 04 Jun 2012 05:57:52 -0400 Received: from ps.local.valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with SMTP id 59A8048984; Mon, 4 Jun 2012 18:57:45 +0900 (JST) Received: (nullmailer pid 5116 invoked by uid 1000); Mon, 04 Jun 2012 09:57:44 -0000 From: Isaku Yamahata To: qemu-devel@nongnu.org, kvm@vger.kernel.org Date: Mon, 4 Jun 2012 18:57:16 +0900 Message-Id: X-Mailer: git-send-email 1.7.1.1 In-Reply-To: References: In-Reply-To: References: X-Virus-Scanned: clamav-milter 0.95.2 at va-mail.local.valinux.co.jp X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 210.128.90.3 Cc: benoit.hudzia@gmail.com, aarcange@redhat.com, aliguori@us.ibm.com, quintela@redhat.com, stefanha@gmail.com, t.hirofuchi@aist.go.jp, dlaor@redhat.com, satoshi.itoh@aist.go.jp, mdroth@linux.vnet.ibm.com, yoshikawa.takuya@oss.ntt.co.jp, owasserm@redhat.com, avi@redhat.com, pbonzini@redhat.com Subject: [Qemu-devel] [PATCH v2 14/41] exec.c: export last_ram_offset() 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: Isaku Yamahata --- exec-obsolete.h | 1 + exec.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/exec-obsolete.h b/exec-obsolete.h index 792c831..fb21dd7 100644 --- a/exec-obsolete.h +++ b/exec-obsolete.h @@ -25,6 +25,7 @@ #ifndef CONFIG_USER_ONLY +ram_addr_t qemu_last_ram_offset(void); ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void *host, MemoryRegion *mr); ram_addr_t qemu_ram_alloc(ram_addr_t size, MemoryRegion *mr); diff --git a/exec.c b/exec.c index 7f44893..78eeee5 100644 --- a/exec.c +++ b/exec.c @@ -2576,7 +2576,7 @@ static ram_addr_t find_ram_offset(ram_addr_t size) return offset; } -static ram_addr_t last_ram_offset(void) +ram_addr_t qemu_last_ram_offset(void) { RAMBlock *block; ram_addr_t last = 0; @@ -2672,7 +2672,7 @@ ram_addr_t qemu_ram_alloc_from_ptr(ram_addr_t size, void *host, QLIST_INSERT_HEAD(&ram_list.blocks, new_block, next); ram_list.phys_dirty = g_realloc(ram_list.phys_dirty, - last_ram_offset() >> TARGET_PAGE_BITS); + qemu_last_ram_offset() >> TARGET_PAGE_BITS); memset(ram_list.phys_dirty + (new_block->offset >> TARGET_PAGE_BITS), 0xff, size >> TARGET_PAGE_BITS);