On 12/20/20 12:26 PM, Laurent Vivier wrote: > Signed-off-by: Laurent Vivier <laur...@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 <laur...@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é <f4...@amsat.org> > +}; > +