mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-03-04 09:04:39 -07: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:
parent
7ce32f3005
commit
80ceb07a83
5 changed files with 16 additions and 25 deletions
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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue