From patchwork Sun Jul 10 18:14:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 104092 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 9CA55B6F90 for ; Mon, 11 Jul 2011 05:27:50 +1000 (EST) Received: from localhost ([::1]:51968 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfzfO-0005H4-An for incoming@patchwork.ozlabs.org; Sun, 10 Jul 2011 15:27:46 -0400 Received: from eggs.gnu.org ([140.186.70.92]:46987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfyXQ-0004Gw-Uo for qemu-devel@nongnu.org; Sun, 10 Jul 2011 14:15:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QfyXL-0007c7-AW for qemu-devel@nongnu.org; Sun, 10 Jul 2011 14:15:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64212) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QfyXE-0007Ws-8K for qemu-devel@nongnu.org; Sun, 10 Jul 2011 14:15:17 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6AIFF2t027529 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 10 Jul 2011 14:15:15 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p6AIFEMW030607; Sun, 10 Jul 2011 14:15:15 -0400 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 5C9DC250B49; Sun, 10 Jul 2011 21:15:11 +0300 (IDT) From: Avi Kivity To: qemu-devel@nongnu.org Date: Sun, 10 Jul 2011 21:14:39 +0300 Message-Id: <1310321709-30770-27-git-send-email-avi@redhat.com> In-Reply-To: <1310321709-30770-1-git-send-email-avi@redhat.com> References: <1310321709-30770-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kvm@vger.kernel.org Subject: [Qemu-devel] [RFC v3 26/56] Integrate I/O memory regions into qemu 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 get_system_io() returns the root I/O memory region. Signed-off-by: Avi Kivity --- exec-memory.h | 2 ++ exec.c | 10 ++++++++++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/exec-memory.h b/exec-memory.h index aad21b5..3acb15f 100644 --- a/exec-memory.h +++ b/exec-memory.h @@ -15,6 +15,8 @@ */ MemoryRegion *get_system_memory(void); +MemoryRegion *get_system_io(void); + /* Set the root memory region. This region is the system memory map. */ void set_system_memory_map(MemoryRegion *mr); diff --git a/exec.c b/exec.c index f274ec9..e949c91 100644 --- a/exec.c +++ b/exec.c @@ -113,6 +113,7 @@ static int in_migration; RAMList ram_list = { .blocks = QLIST_HEAD_INITIALIZER(ram_list) }; static MemoryRegion *system_memory; +static MemoryRegion *system_io; #endif @@ -3817,6 +3818,10 @@ static void memory_map_init(void) system_memory = qemu_malloc(sizeof(*system_memory)); memory_region_init(system_memory, "system", UINT64_MAX); set_system_memory_map(system_memory); + + system_io = qemu_malloc(sizeof(*system_io)); + memory_region_init(system_memory, "io", 65536); + set_system_io_map(system_io); } MemoryRegion *get_system_memory(void) @@ -3824,6 +3829,11 @@ MemoryRegion *get_system_memory(void) return system_memory; } +MemoryRegion *get_system_io(void) +{ + return system_io; +} + #endif /* !defined(CONFIG_USER_ONLY) */ /* physical memory access (slow version, mainly for debug) */