diff mbox

[v3,10/39] Integrate I/O memory regions into qemu

Message ID 1312463195-13605-11-git-send-email-avi@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Avi Kivity Aug. 4, 2011, 1:06 p.m. UTC
get_system_io() returns the root I/O memory region.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Avi Kivity <avi@redhat.com>
---
 exec-memory.h |    2 ++
 exec.c        |   10 ++++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

Comments

Anthony Liguori Aug. 5, 2011, 2:15 p.m. UTC | #1
On 08/04/2011 08:06 AM, Avi Kivity wrote:
> get_system_io() returns the root I/O memory region.
>
> Reviewed-by: Richard Henderson<rth@twiddle.net>
> Signed-off-by: Avi Kivity<avi@redhat.com>
> ---
>   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);
> +

Could you add a doc comment for this function?

Regards,

Anthony Liguori
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Avi Kivity Aug. 7, 2011, 8:27 a.m. UTC | #2
On 08/05/2011 05:15 PM, Anthony Liguori wrote:
>>    */
>>   MemoryRegion *get_system_memory(void);
>>
>> +MemoryRegion *get_system_io(void);
>> +
> @@ -28,6 +28,8 @@
>
> Could you add a doc comment for this function?

Done.
diff mbox

Patch

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 751fd89..c93c980 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", INT64_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) */