mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
exec.c: Add cpu_get_address_space()
Add a function to return the AddressSpace for a CPU based on its numerical index. (Callers outside exec.c don't have access to the CPUAddressSpace struct so can't just fish it out of the CPUState struct directly.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
This commit is contained in:
6
exec.c
6
exec.c
@@ -564,6 +564,12 @@ void cpu_address_space_init(CPUState *cpu, AddressSpace *as, int asidx)
|
||||
memory_listener_register(&newas->tcg_as_listener, as);
|
||||
}
|
||||
}
|
||||
|
||||
AddressSpace *cpu_get_address_space(CPUState *cpu, int asidx)
|
||||
{
|
||||
/* Return the AddressSpace corresponding to the specified index */
|
||||
return cpu->cpu_ases[asidx].as;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
|
||||
Reference in New Issue
Block a user