pc: grab system_memory

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

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Avi Kivity 2011-07-26 14:26:16 +03:00 committed by Anthony Liguori
parent bf3fb0e12a
commit 4aa63af149
3 changed files with 12 additions and 3 deletions

View File

@ -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 *kernel_cmdline,
const char *initrd_filename, const char *initrd_filename,
ram_addr_t below_4g_mem_size, ram_addr_t below_4g_mem_size,

View File

@ -6,6 +6,7 @@
#include "isa.h" #include "isa.h"
#include "fdc.h" #include "fdc.h"
#include "net.h" #include "net.h"
#include "memory.h"
/* PC-style peripherals (also used by other machines). */ /* 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_acpi_smi_interrupt(void *opaque, int irq, int level);
void pc_cpus_init(const char *cpu_model); 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 *kernel_cmdline,
const char *initrd_filename, const char *initrd_filename,
ram_addr_t below_4g_mem_size, ram_addr_t below_4g_mem_size,

View File

@ -39,6 +39,8 @@
#include "blockdev.h" #include "blockdev.h"
#include "smbus.h" #include "smbus.h"
#include "xen.h" #include "xen.h"
#include "memory.h"
#include "exec-memory.h"
#ifdef CONFIG_XEN #ifdef CONFIG_XEN
# include <xen/hvm/hvm_info_table.h> # include <xen/hvm/hvm_info_table.h>
#endif #endif
@ -89,6 +91,9 @@ static void pc_init1(ram_addr_t ram_size,
DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
BusState *idebus[MAX_IDE_BUS]; BusState *idebus[MAX_IDE_BUS];
ISADevice *rtc_state; ISADevice *rtc_state;
MemoryRegion *system_memory;
system_memory = get_system_memory();
pc_cpus_init(cpu_model); pc_cpus_init(cpu_model);
@ -106,7 +111,8 @@ static void pc_init1(ram_addr_t ram_size,
/* allocate ram and load rom/bios */ /* allocate ram and load rom/bios */
if (!xen_enabled()) { 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); below_4g_mem_size, above_4g_mem_size);
} }