mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
cpu: Introduce cpu_set_cpustate_pointers
Consolidate some boilerplate from foo_cpu_initfn. Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
677c4d69ac
commit
7506ed902e
22 changed files with 37 additions and 48 deletions
|
@ -774,12 +774,11 @@ static void sparc_cpu_realizefn(DeviceState *dev, Error **errp)
|
|||
|
||||
static void sparc_cpu_initfn(Object *obj)
|
||||
{
|
||||
CPUState *cs = CPU(obj);
|
||||
SPARCCPU *cpu = SPARC_CPU(obj);
|
||||
SPARCCPUClass *scc = SPARC_CPU_GET_CLASS(obj);
|
||||
CPUSPARCState *env = &cpu->env;
|
||||
|
||||
cs->env_ptr = env;
|
||||
cpu_set_cpustate_pointers(cpu);
|
||||
|
||||
if (scc->cpu_def) {
|
||||
env->def = *scc->cpu_def;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue