From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qnn8d-0000bP-Co for qemu-devel@nongnu.org; Mon, 01 Aug 2011 03:42:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qnn8b-0002G3-W4 for qemu-devel@nongnu.org; Mon, 01 Aug 2011 03:42:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44673) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qnn8b-0002Fz-Os for qemu-devel@nongnu.org; Mon, 01 Aug 2011 03:42:09 -0400 From: Avi Kivity Date: Mon, 1 Aug 2011 10:42:03 +0300 Message-Id: <1312184523-26986-1-git-send-email-avi@redhat.com> In-Reply-To: <4E35F128.2020309@twiddle.net> References: <4E35F128.2020309@twiddle.net> Subject: [Qemu-devel] [PATCH v2 09/39] Integrate I/O memory regions into qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori , qemu-devel@nongnu.org Cc: Richard Henderson , kvm@vger.kernel.org, "Michael S. Tsirkin" get_system_io() returns the root I/O memory region. Signed-off-by: Avi Kivity --- Replaces v1 patches 9 and 10. 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 c439aba..999fd69 100644 --- a/exec-memory.h +++ b/exec-memory.h @@ -28,6 +28,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 476b507..11f6641 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 @@ -3820,6 +3821,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_io, "io", 65536); + set_system_io_map(system_io); } MemoryRegion *get_system_memory(void) @@ -3827,6 +3832,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) */ -- 1.7.5.3