aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2017-11-23 17:23:32 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2017-12-21 09:30:31 +0100
commit80ceb07a83375e3a0091591f96bd47bce2f640ce (patch)
tree98b54a1e8eac1adac80dde4350d0fd2f57334619 /exec.c
parent7ce32f3005afef1feb6f6cd3a7e4f36a3ff300ab (diff)
cpu: refactor cpu_address_space_init()
Normally we create an address space for that CPU and pass that address space into the function. Let's just do it inside to unify address space creations. It'll simplify my next patch to rename those address spaces. Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20171123092333.16085-3-peterx@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/exec.c b/exec.c
index 3e7c57e914..3ab515e47c 100644
--- a/exec.c
+++ b/exec.c
@@ -705,9 +705,14 @@ CPUState *qemu_get_cpu(int index)
}
#if !defined(CONFIG_USER_ONLY)
-void cpu_address_space_init(CPUState *cpu, AddressSpace *as, int asidx)
+void cpu_address_space_init(CPUState *cpu, int asidx,
+ const char *prefix, MemoryRegion *mr)
{
CPUAddressSpace *newas;
+ AddressSpace *as = g_new0(AddressSpace, 1);
+
+ assert(mr);
+ address_space_init(as, mr, prefix);
/* Target code should have set num_ases before calling us */
assert(asidx < cpu->num_ases);