On Sun, 6 Jun 2021, Philippe Mathieu-Daudé wrote: > 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 >> --- >> 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... I've only moved vars to the new machine state that will be needed outside of the init method for VOF and rom isn't so that's kept local. It could be put there for consistency but not really needed so I've left it here. > Reviewed-by: Philippe Mathieu-Daudé Thanks. By the way, even though this series allows loading Linux and MorphOS without the board ROM I'd prefer to keep the test using the ROM as implemented in your series because that excercies the emulation more than booting without ROM as the firmware inits more devices and uses more facilities that VOF mostly bypasses so for a test the board firmware is more complete. Regards, BALATON Zoltan