qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: qemu-devel@nongnu.org
Cc: kvm@vger.kernel.org
Subject: [Qemu-devel] [RFC v2 06/20] pc: grab system_memory
Date: Mon, 27 Jun 2011 16:21:53 +0300	[thread overview]
Message-ID: <1309180927-19003-7-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1309180927-19003-1-git-send-email-avi@redhat.com>

While eventually this should come from the machine initialization function,
take a short cut to avoid converting all machines now.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 hw/pc.c      |    3 ++-
 hw/pc.h      |    4 +++-
 hw/pc_piix.c |    8 +++++++-
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/hw/pc.c b/hw/pc.c
index a3e8539..369566a 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -957,7 +957,8 @@ void pc_cpus_init(const char *cpu_model)
     }
 }
 
-void pc_memory_init(const char *kernel_filename,
+void pc_memory_init(MemoryRegion *system_memory,
+                    const char *kernel_filename,
                     const char *kernel_cmdline,
                     const char *initrd_filename,
                     ram_addr_t below_4g_mem_size,
diff --git a/hw/pc.h b/hw/pc.h
index 6d5730b..fa57583 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -6,6 +6,7 @@
 #include "isa.h"
 #include "fdc.h"
 #include "net.h"
+#include "memory.h"
 
 /* PC-style peripherals (also used by other machines).  */
 
@@ -129,7 +130,8 @@ void pc_cmos_set_s3_resume(void *opaque, int irq, int level);
 void pc_acpi_smi_interrupt(void *opaque, int irq, int level);
 
 void pc_cpus_init(const char *cpu_model);
-void pc_memory_init(const char *kernel_filename,
+void pc_memory_init(MemoryRegion *system_memory,
+                    const char *kernel_filename,
                     const char *kernel_cmdline,
                     const char *initrd_filename,
                     ram_addr_t below_4g_mem_size,
diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index c5c16b4..d83854c 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -39,6 +39,8 @@
 #include "blockdev.h"
 #include "smbus.h"
 #include "xen.h"
+#include "memory.h"
+#include "exec-memory.h"
 #ifdef CONFIG_XEN
 #  include <xen/hvm/hvm_info_table.h>
 #endif
@@ -89,6 +91,9 @@ static void pc_init1(ram_addr_t ram_size,
     DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
     BusState *idebus[MAX_IDE_BUS];
     ISADevice *rtc_state;
+    MemoryRegion *system_memory;
+
+    system_memory = get_system_memory();
 
     pc_cpus_init(cpu_model);
 
@@ -106,7 +111,8 @@ static void pc_init1(ram_addr_t ram_size,
 
     /* allocate ram and load rom/bios */
     if (!xen_enabled()) {
-        pc_memory_init(kernel_filename, kernel_cmdline, initrd_filename,
+        pc_memory_init(system_memory,
+                       kernel_filename, kernel_cmdline, initrd_filename,
                        below_4g_mem_size, above_4g_mem_size);
     }
 
-- 
1.7.5.3

  parent reply	other threads:[~2011-06-27 13:22 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-27 13:21 [Qemu-devel] [RFC v2 00/20] Memory API Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 01/20] Hierarchical memory region API Avi Kivity
2011-06-28 10:03   ` Michael S. Tsirkin
2011-06-28 10:28     ` Jan Kiszka
2011-06-28 11:53       ` Avi Kivity
2011-06-28 12:07         ` Jan Kiszka
2011-06-28 12:09           ` Avi Kivity
2011-06-28 12:46             ` Jan Kiszka
2011-06-28 12:53               ` Avi Kivity
2011-06-28 13:25             ` Peter Maydell
2011-06-28 13:36               ` Avi Kivity
2011-06-28 16:27             ` Olivier Galibert
2011-06-28 11:51     ` Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 02/20] memory: implement dirty tracking Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 03/20] memory: merge adjacent segments of a single memory region Avi Kivity
2011-06-27 13:56   ` Jan Kiszka
2011-06-27 14:11     ` Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 04/20] Internal interfaces for memory API Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 05/20] exec.c: initialize memory map Avi Kivity
2011-06-27 13:21 ` Avi Kivity [this message]
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 07/20] pc: convert pc_memory_init() to memory API Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 08/20] pc: move global memory map out of pc_init1() and into its callers Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 09/20] pci: pass address space to pci bus when created Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 10/20] pci: add MemoryRegion based BAR management API Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 11/20] sysbus: add MemoryRegion based memory " Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 12/20] usb-ohci: convert to MemoryRegion Avi Kivity
2011-06-27 13:22 ` [Qemu-devel] [RFC v2 13/20] pci: add API to get a BAR's mapped address Avi Kivity
2011-06-27 13:22 ` [Qemu-devel] [RFC v2 14/20] vmsvga: don't remember pci BAR address in callback any more Avi Kivity
2011-06-27 13:22 ` [Qemu-devel] [RFC v2 15/20] vga: convert vga and its derivatives to the memory API Avi Kivity
2011-06-27 13:22 ` [Qemu-devel] [RFC v2 16/20] cirrus: simplify mmio BAR access functions Avi Kivity
2011-06-27 13:22 ` [Qemu-devel] [RFC v2 17/20] cirrus: simplify bitblt " Avi Kivity
2011-06-27 13:22 ` [Qemu-devel] [RFC v2 18/20] cirrus: simplify vga window mmio " Avi Kivity
2011-06-27 13:22 ` [Qemu-devel] [RFC v2 19/20] vga: " Avi Kivity
2011-06-27 13:22 ` [Qemu-devel] [RFC v2 20/20] cirrus: simplify linear framebuffer " Avi Kivity
2011-06-27 15:13 ` [Qemu-devel] [RFC v2 00/20] Memory API Avi Kivity
2011-06-27 15:52   ` Michael S. Tsirkin
2011-06-27 15:54     ` Avi Kivity
2011-06-27 15:59       ` Michael S. Tsirkin
2011-06-27 16:10         ` Avi Kivity
2011-06-27 20:28         ` Anthony Liguori
2011-06-27 15:37 ` Anthony Liguori
2011-06-27 15:44   ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1309180927-19003-7-git-send-email-avi@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).