On Wed, Nov 27, 2013 at 5:58 PM, Li Guang <lig.f...@cn.fujitsu.com> wrote: > Peter Crosthwaite wrote: >> >> On Wed, Nov 27, 2013 at 4:12 PM, liguang<lig.f...@cn.fujitsu.com> wrote: >> >>> >>> Signed-off-by: liguang<lig.f...@cn.fujitsu.com> >>> --- >>> default-configs/arm-softmmu.mak | 1 + >>> hw/intc/Makefile.objs | 1 + >>> hw/intc/sunxi-pic.c | 247 >>> +++++++++++++++++++++++++++++++++++++++ >>> include/hw/intc/sunxi-pic.h | 20 +++ >>> 4 files changed, 269 insertions(+), 0 deletions(-) >>> create mode 100644 hw/intc/sunxi-pic.c >>> create mode 100644 include/hw/intc/sunxi-pic.h >>> >>> diff --git a/default-configs/arm-softmmu.mak >>> b/default-configs/arm-softmmu.mak >>> index 7bf5ad0..bbe00e4 100644 >>> --- a/default-configs/arm-softmmu.mak >>> +++ b/default-configs/arm-softmmu.mak >>> @@ -83,3 +83,4 @@ CONFIG_SDHCI=y >>> CONFIG_INTEGRATOR_DEBUG=y >>> >>> CONFIG_SUNXI_PIT=y >>> +CONFIG_SUNXI_PIC=y >>> diff --git a/hw/intc/Makefile.objs b/hw/intc/Makefile.objs >>> index 47ac442..dad8c43 100644 >>> --- a/hw/intc/Makefile.objs >>> +++ b/hw/intc/Makefile.objs >>> @@ -12,6 +12,7 @@ common-obj-$(CONFIG_IOAPIC) += ioapic_common.o >>> common-obj-$(CONFIG_ARM_GIC) += arm_gic_common.o >>> common-obj-$(CONFIG_ARM_GIC) += arm_gic.o >>> common-obj-$(CONFIG_OPENPIC) += openpic.o >>> +common-obj-$(CONFIG_SUNXI_PIC) += sunxi-pic.o >>> >>> obj-$(CONFIG_APIC) += apic.o apic_common.o >>> obj-$(CONFIG_ARM_GIC_KVM) += arm_gic_kvm.o >>> diff --git a/hw/intc/sunxi-pic.c b/hw/intc/sunxi-pic.c >>> new file mode 100644 >>> index 0000000..a588c30 >>> --- /dev/null >>> +++ b/hw/intc/sunxi-pic.c >>> @@ -0,0 +1,247 @@ >>> +/* >>> + * Allwinner sunxi interrupt controller device emulation >>> + * >>> + * Copyright (C) 2013 Li Guang >>> + * Written by Li Guang<lig.f...@cn.fujitsu.com> >>> + * >>> + * This program is free software; you can redistribute it and/or modify >>> it >>> + * under the terms of the GNU General Public License as published by the >>> + * Free Software Foundation; either version 2 of the License, or >>> + * (at your option) any later version. >>> + * >>> + * This program is distributed in the hope that it will be useful, but >>> WITHOUT >>> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or >>> + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License >>> + * for more details. >>> + */ >>> + >>> +#include "hw/sysbus.h" >>> +#include "hw/devices.h" >>> +#include "sysemu/sysemu.h" >>> +#include "hw/intc/sunxi-pic.h" >>> + >>> + >>> +typedef struct SunxiPICState { >>> + /*< private>*/ >>> + SysBusDevice parent_obj; >>> + /*< public>*/ >>> + MemoryRegion iomem; >>> + qemu_irq parent_fiq; >>> + qemu_irq parent_irq; >>> + >>> + uint32_t vector; >>> + uint32_t base_addr; >>> + uint32_t protect; >>> + uint32_t nmi; >>> + uint32_t irq_pending[SUNXI_PIC_REG_IDX]; >>> >> >> IDX is a wierd choice of suffix here. Is this really a "_NUM". I'm >> happy as is though. >> >> > > > maybe, does this struct need to move to sunxi-pic.h? >
Yes, that will be inline with Andreas' latest refactorings. Regards, Peter