From patchwork Mon Jan 7 12:07:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Barabash X-Patchwork-Id: 209902 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 C39432C0098 for ; Mon, 7 Jan 2013 23:07:30 +1100 (EST) Received: from localhost ([::1]:53024 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsBUG-0003zt-Sq for incoming@patchwork.ozlabs.org; Mon, 07 Jan 2013 07:07:28 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsBU9-0003xv-3q for qemu-devel@nongnu.org; Mon, 07 Jan 2013 07:07:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsBU7-0001pY-Ml for qemu-devel@nongnu.org; Mon, 07 Jan 2013 07:07:21 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:39975) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsBU7-0001pP-GZ for qemu-devel@nongnu.org; Mon, 07 Jan 2013 07:07:19 -0500 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1TsBU5-0000ku-TG from Alexander_Barabash@mentor.com for qemu-devel@nongnu.org; Mon, 07 Jan 2013 04:07:17 -0800 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 7 Jan 2013 04:07:17 -0800 Received: from galileo.isr.mentorg.com (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.1.289.1; Mon, 7 Jan 2013 12:07:16 +0000 From: Alexander Barabash To: Date: Mon, 7 Jan 2013 14:07:05 +0200 Message-ID: <1357560425-15950-1-git-send-email-alexander_barabash@mentor.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-OriginalArrivalTime: 07 Jan 2013 12:07:17.0768 (UTC) FILETIME=[89C97880:01CDECCF] X-detected-operating-system: by eggs.gnu.org: Windows NT kernel [generic] [fuzzy] X-Received-From: 192.94.38.131 Cc: Alexander Barabash Subject: [Qemu-devel] [PATCH 1/1] Added address_space_init2(). 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 address_space_init2: initializes a named address space. Signed-off-by: Alexander Barabash --- include/exec/memory.h | 9 +++++++++ memory.c | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/include/exec/memory.h b/include/exec/memory.h index 2322732..8f8a31d 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -820,6 +820,15 @@ void mtree_info(fprintf_function mon_printf, void *f); */ void address_space_init(AddressSpace *as, MemoryRegion *root); +/** + * address_space_init2: initializes a named address space + * + * @as: an uninitialized #AddressSpace + * @root: a #MemoryRegion that routes addesses for the address space + * @name: used for debugging + */ +void address_space_init2(AddressSpace *as, MemoryRegion *root, + const char *name); /** * address_space_destroy: destroy an address space diff --git a/memory.c b/memory.c index 410c5f8..1652c10 100644 --- a/memory.c +++ b/memory.c @@ -1574,6 +1574,12 @@ void address_space_init(AddressSpace *as, MemoryRegion *root) address_space_init_dispatch(as); } +void address_space_init2(AddressSpace *as, MemoryRegion *root, const char *name) +{ + address_space_init(as, root); + as->name = g_strdup(name); +} + void address_space_destroy(AddressSpace *as) { /* Flush out anything from MemoryListeners listening in on this */