mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-18 23:52:14 -06:00
ppc/pnv: Add pointer from PnvCPUState to PnvCore
This helps move core state from CPU to core structures. Reviewed-by: Cédric Le Goater <clg@redhat.com> Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
This commit is contained in:
parent
7f516cdeef
commit
060e614367
2 changed files with 4 additions and 0 deletions
|
@ -278,6 +278,7 @@ static void pnv_core_realize(DeviceState *dev, Error **errp)
|
||||||
pc->threads = g_new(PowerPCCPU *, cc->nr_threads);
|
pc->threads = g_new(PowerPCCPU *, cc->nr_threads);
|
||||||
for (i = 0; i < cc->nr_threads; i++) {
|
for (i = 0; i < cc->nr_threads; i++) {
|
||||||
PowerPCCPU *cpu;
|
PowerPCCPU *cpu;
|
||||||
|
PnvCPUState *pnv_cpu;
|
||||||
|
|
||||||
obj = object_new(typename);
|
obj = object_new(typename);
|
||||||
cpu = POWERPC_CPU(obj);
|
cpu = POWERPC_CPU(obj);
|
||||||
|
@ -288,6 +289,8 @@ static void pnv_core_realize(DeviceState *dev, Error **errp)
|
||||||
object_property_add_child(OBJECT(pc), name, obj);
|
object_property_add_child(OBJECT(pc), name, obj);
|
||||||
|
|
||||||
cpu->machine_data = g_new0(PnvCPUState, 1);
|
cpu->machine_data = g_new0(PnvCPUState, 1);
|
||||||
|
pnv_cpu = pnv_cpu_state(cpu);
|
||||||
|
pnv_cpu->pnv_core = pc;
|
||||||
|
|
||||||
object_unref(obj);
|
object_unref(obj);
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,7 @@ struct PnvCoreClass {
|
||||||
#define PNV_CORE_TYPE_NAME(cpu_model) cpu_model PNV_CORE_TYPE_SUFFIX
|
#define PNV_CORE_TYPE_NAME(cpu_model) cpu_model PNV_CORE_TYPE_SUFFIX
|
||||||
|
|
||||||
typedef struct PnvCPUState {
|
typedef struct PnvCPUState {
|
||||||
|
PnvCore *pnv_core;
|
||||||
Object *intc;
|
Object *intc;
|
||||||
} PnvCPUState;
|
} PnvCPUState;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue