On 8 February 2013 04:03, Peter Crosthwaite
<peter.crosthwa...@xilinx.com> wrote:
> In QEMU emulation, there is no functional difference between the ARM mpcore
> private timers and watchdogs. Removed all the distinction between the two from
> arm_mptimer.c and converted it to be just the mptimer. a9mpcore and 
> arm11mpcore
> just instantiate the same mptimer object twice to get both timer and WDT.
>
> If in the future we want to make the WDT functionally different then we can 
> use
> either QOM heirachy to derive WDT from from mptimer, or we can add a property

"hierarchy".

> "is-wdt" or some such.
>
> Signed-off-by: Peter Crosthwaite <peter.crosthwa...@xilinx.com>

I was sceptical about this change initially but you're right that it's much
cleaner this way.

One minor nit:

>  static const VMStateDescription vmstate_arm_mptimer = {
>      .name = "arm_mptimer",
> -    .version_id = 1,
> -    .minimum_version_id = 1,
> +    .version_id = 2,
> +    .minimum_version_id = 2,
>      .fields = (VMStateField[]) {
> -        VMSTATE_STRUCT_ARRAY(timerblock, ARMMPTimerState, (MAX_CPUS * 2),
> -                             1, vmstate_timerblock, TimerBlock),
> +        VMSTATE_STRUCT_VARRAY_UINT32(timerblock, ARMMPTimerState, num_cpu,
> +                                     2, vmstate_timerblock, TimerBlock),
>          VMSTATE_END_OF_LIST()
>      }

This changes us from sending every timerblock to only the ones
that actually exist on this machine config, which renders the
comment in arm_mptimer_reset() irrelevant, so it should be deleted.

-- PMM

Reply via email to