On 6/6/21 5:46 PM, BALATON Zoltan wrote: > Add own machine state structure which will be used to store state > needed for firmware emulation. > > Signed-off-by: BALATON Zoltan <bala...@eik.bme.hu> > --- > hw/ppc/pegasos2.c | 50 +++++++++++++++++++++++++++++++++++------------ > 1 file changed, 37 insertions(+), 13 deletions(-)
> +struct Pegasos2MachineState { > + MachineState parent_obj; > + PowerPCCPU *cpu; > + DeviceState *mv; > +}; > + > static void pegasos2_cpu_reset(void *opaque) > { > PowerPCCPU *cpu = opaque; > @@ -51,9 +60,9 @@ static void pegasos2_cpu_reset(void *opaque) > > static void pegasos2_init(MachineState *machine) > { > - PowerPCCPU *cpu = NULL; > + Pegasos2MachineState *pm = PEGASOS2_MACHINE(machine); > + CPUPPCState *env; > MemoryRegion *rom = g_new(MemoryRegion, 1); It would be nice to have the 'rom' variable also in the machine state. Can be done later... Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org>