mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
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:
7
exec.c
7
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);
|
||||
|
||||
Reference in New Issue
Block a user