qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v1 6/9] hw/intc: sifive_plic: Add a reset function


From: Bin Meng
Subject: Re: [PATCH v1 6/9] hw/intc: sifive_plic: Add a reset function
Date: Thu, 21 Oct 2021 15:37:03 +0800

On Mon, Oct 18, 2021 at 10:40 AM Alistair Francis
<alistair.francis@opensource.wdc.com> wrote:
>
> From: Alistair Francis <alistair.francis@wdc.com>
>
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
>  hw/intc/sifive_plic.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/hw/intc/sifive_plic.c b/hw/intc/sifive_plic.c
> index 877e76877c..5444368ad4 100644
> --- a/hw/intc/sifive_plic.c
> +++ b/hw/intc/sifive_plic.c
> @@ -355,6 +355,18 @@ static const MemoryRegionOps sifive_plic_ops = {
>      }
>  };
>
> +static void sifive_plic_reset(DeviceState *dev)
> +{
> +    SiFivePLICState *s = SIFIVE_PLIC(dev);
> +
> +    memset(s->claimed, 0, sizeof(uint32_t) * s->bitfield_words);

This line should be removed.

> +    memset(s->source_priority, 0, sizeof(uint32_t) * s->num_sources);
> +    memset(s->target_priority, 0, sizeof(uint32_t) * s->num_addrs);
> +    memset(s->pending, 0, sizeof(uint32_t) * s->bitfield_words);
> +    memset(s->claimed, 0, sizeof(uint32_t) * s->bitfield_words);
> +    memset(s->enable, 0, sizeof(uint32_t) * s->num_enables);
> +}
> +
>  /*
>   * parse PLIC hart/mode address offset config
>   *
> @@ -501,6 +513,7 @@ static void sifive_plic_class_init(ObjectClass *klass, 
> void *data)
>  {
>      DeviceClass *dc = DEVICE_CLASS(klass);
>
> +    dc->reset = sifive_plic_reset;
>      device_class_set_props(dc, sifive_plic_properties);
>      dc->realize = sifive_plic_realize;
>      dc->vmsd = &vmstate_sifive_plic;

Regards,
Bin



reply via email to

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