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>
This commit is contained in:
Peter Xu
2017-11-23 17:23:32 +08:00
committed by Paolo Bonzini
parent 7ce32f3005
commit 80ceb07a83
5 changed files with 16 additions and 25 deletions

7
exec.c
View File

@@ -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);