mirror of https://github.com/xemu-project/xemu.git
exec.c: initialize memory map
Allocate the root memory region and initialize it. Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
4ef4db8603
commit
62152b8a01
19
exec.c
19
exec.c
|
@ -33,6 +33,8 @@
|
||||||
#include "kvm.h"
|
#include "kvm.h"
|
||||||
#include "hw/xen.h"
|
#include "hw/xen.h"
|
||||||
#include "qemu-timer.h"
|
#include "qemu-timer.h"
|
||||||
|
#include "memory.h"
|
||||||
|
#include "exec-memory.h"
|
||||||
#if defined(CONFIG_USER_ONLY)
|
#if defined(CONFIG_USER_ONLY)
|
||||||
#include <qemu.h>
|
#include <qemu.h>
|
||||||
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||||
|
@ -109,6 +111,9 @@ int phys_ram_fd;
|
||||||
static int in_migration;
|
static int in_migration;
|
||||||
|
|
||||||
RAMList ram_list = { .blocks = QLIST_HEAD_INITIALIZER(ram_list) };
|
RAMList ram_list = { .blocks = QLIST_HEAD_INITIALIZER(ram_list) };
|
||||||
|
|
||||||
|
static MemoryRegion *system_memory;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CPUState *first_cpu;
|
CPUState *first_cpu;
|
||||||
|
@ -197,6 +202,7 @@ typedef struct PhysPageDesc {
|
||||||
static void *l1_phys_map[P_L1_SIZE];
|
static void *l1_phys_map[P_L1_SIZE];
|
||||||
|
|
||||||
static void io_mem_init(void);
|
static void io_mem_init(void);
|
||||||
|
static void memory_map_init(void);
|
||||||
|
|
||||||
/* io memory support */
|
/* io memory support */
|
||||||
CPUWriteMemoryFunc *io_mem_write[IO_MEM_NB_ENTRIES][4];
|
CPUWriteMemoryFunc *io_mem_write[IO_MEM_NB_ENTRIES][4];
|
||||||
|
@ -571,6 +577,7 @@ void cpu_exec_init_all(unsigned long tb_size)
|
||||||
code_gen_ptr = code_gen_buffer;
|
code_gen_ptr = code_gen_buffer;
|
||||||
page_init();
|
page_init();
|
||||||
#if !defined(CONFIG_USER_ONLY)
|
#if !defined(CONFIG_USER_ONLY)
|
||||||
|
memory_map_init();
|
||||||
io_mem_init();
|
io_mem_init();
|
||||||
#endif
|
#endif
|
||||||
#if !defined(CONFIG_USER_ONLY) || !defined(CONFIG_USE_GUEST_BASE)
|
#if !defined(CONFIG_USER_ONLY) || !defined(CONFIG_USE_GUEST_BASE)
|
||||||
|
@ -3807,6 +3814,18 @@ static void io_mem_init(void)
|
||||||
DEVICE_NATIVE_ENDIAN);
|
DEVICE_NATIVE_ENDIAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
MemoryRegion *get_system_memory(void)
|
||||||
|
{
|
||||||
|
return system_memory;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* !defined(CONFIG_USER_ONLY) */
|
#endif /* !defined(CONFIG_USER_ONLY) */
|
||||||
|
|
||||||
/* physical memory access (slow version, mainly for debug) */
|
/* physical memory access (slow version, mainly for debug) */
|
||||||
|
|
Loading…
Reference in New Issue