[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 3/7] intc: add goldfish-pic
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v2 3/7] intc: add goldfish-pic |
Date: |
Sun, 24 Jan 2021 01:08:31 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 |
On 12/20/20 12:26 PM, Laurent Vivier wrote:
> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
> ---
> include/hw/intc/goldfish_pic.h | 33 +++++
> hw/intc/goldfish_pic.c | 214 +++++++++++++++++++++++++++++++++
> hw/intc/Kconfig | 3 +
> hw/intc/meson.build | 1 +
> hw/intc/trace-events | 8 ++
> 5 files changed, 259 insertions(+)
> create mode 100644 include/hw/intc/goldfish_pic.h
> create mode 100644 hw/intc/goldfish_pic.c
>
> diff --git a/include/hw/intc/goldfish_pic.h b/include/hw/intc/goldfish_pic.h
> new file mode 100644
> index 000000000000..26e7ca75a3ec
> --- /dev/null
> +++ b/include/hw/intc/goldfish_pic.h
> @@ -0,0 +1,33 @@
> +/*
> + * SPDX-License-Identifer: GPL-2.0-or-later
> + *
> + * Goldfish PIC
> + *
> + * (c) 2020 Laurent Vivier <laurent@vivier.eu>
> + *
> + */
> +
> +#ifndef HW_INTC_GOLDFISH_PIC_H
> +#define HW_INTC_GOLDFISH_PIC_H
> +
> +#define TYPE_GOLDFISH_PIC "goldfish_pic"
> +OBJECT_DECLARE_SIMPLE_TYPE(GoldfishPICState, GOLDFISH_PIC)
> +
> +#define GOLDFISH_PIC_IRQ_NB 32
> +
> +struct GoldfishPICState {
> + SysBusDevice parent_obj;
> +
> + MemoryRegion iomem;
> + qemu_irq irq;
> +
> + uint32_t pending;
> + uint32_t enabled;
> +
> + /* statistics */
> + uint64_t stats_irq_count[32];
GOLDFISH_PIC_IRQ_NB?
> + /* for tracing */
> + int idx;
> +};
> +
> +#endif
> diff --git a/hw/intc/goldfish_pic.c b/hw/intc/goldfish_pic.c
> +static const MemoryRegionOps goldfish_pic_ops = {
> + .read = goldfish_pic_read,
> + .write = goldfish_pic_write,
> + .endianness = DEVICE_NATIVE_ENDIAN,
> + .valid.max_access_size = 4,
> + .impl.max_access_size = 4,
Missing:
.impl.min_access_size = 4,
Otherwise:
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> +};
> +
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v2 3/7] intc: add goldfish-pic,
Philippe Mathieu-Daudé <=