qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 4/6] hw/ds1338.c: Ensure state is properly in


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v2 4/6] hw/ds1338.c: Ensure state is properly initialized.
Date: Wed, 12 Dec 2012 12:05:53 +0000

On 11 December 2012 22:58, Antoine Mathys <address@hidden> wrote:
> Signed-off-by: Antoine Mathys <address@hidden>
> ---
>  hw/ds1338.c |   10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/hw/ds1338.c b/hw/ds1338.c
> index 0f88720..b4d5b74 100644
> --- a/hw/ds1338.c
> +++ b/hw/ds1338.c
> @@ -179,6 +179,15 @@ static int ds1338_init(I2CSlave *i2c)
>      return 0;
>  }
>
> +static void ds1338_reset(DeviceState *dev)
> +{
> +    DS1338State *s = FROM_I2C_SLAVE(DS1338State, I2C_SLAVE_FROM_QDEV(dev));
> +
> +    /* The clock is running and synchronized with the host */
> +    s->offset = 0;

I think we need to reset ptr and addr_byte too...

> +    memset(s->nvram, 0, NVRAM_SIZE);
> +}

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]