mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-18 07:32:06 -06:00
target/nios2: Implement cpuid
Copy the existing cpu_index into the space reserved for CR_CPUID. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220421151735.31996-39-richard.henderson@linaro.org>
This commit is contained in:
parent
796945d596
commit
b05550af11
1 changed files with 4 additions and 0 deletions
|
@ -163,6 +163,7 @@ static void realize_cr_status(CPUState *cs)
|
||||||
static void nios2_cpu_realizefn(DeviceState *dev, Error **errp)
|
static void nios2_cpu_realizefn(DeviceState *dev, Error **errp)
|
||||||
{
|
{
|
||||||
CPUState *cs = CPU(dev);
|
CPUState *cs = CPU(dev);
|
||||||
|
Nios2CPU *cpu = NIOS2_CPU(cs);
|
||||||
Nios2CPUClass *ncc = NIOS2_CPU_GET_CLASS(dev);
|
Nios2CPUClass *ncc = NIOS2_CPU_GET_CLASS(dev);
|
||||||
Error *local_err = NULL;
|
Error *local_err = NULL;
|
||||||
|
|
||||||
|
@ -176,6 +177,9 @@ static void nios2_cpu_realizefn(DeviceState *dev, Error **errp)
|
||||||
qemu_init_vcpu(cs);
|
qemu_init_vcpu(cs);
|
||||||
cpu_reset(cs);
|
cpu_reset(cs);
|
||||||
|
|
||||||
|
/* We have reserved storage for cpuid; might as well use it. */
|
||||||
|
cpu->env.ctrl[CR_CPUID] = cs->cpu_index;
|
||||||
|
|
||||||
ncc->parent_realize(dev, errp);
|
ncc->parent_realize(dev, errp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue