diff mbox

[qom-cpu,v2,26/29] intc/sh_intc: Build sh_intc only once

Message ID 1371398269-6213-27-git-send-email-afaerber@suse.de
State New
Headers show

Commit Message

Andreas Färber June 16, 2013, 3:57 p.m. UTC
Since converting first_cpu to CPUState and making CPU_INTERRUPT_HARD
available through qom/cpu.h, it no longer depends on CPUSH4State.

This allows sharing across sh4 and sh4eb.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 hw/intc/Makefile.objs | 2 +-
 hw/intc/sh_intc.c     | 1 +
 include/hw/sh4/sh.h   | 2 ++
 3 files changed, 4 insertions(+), 1 deletion(-)

Comments

Richard Henderson June 17, 2013, 9:08 p.m. UTC | #1
On 06/16/2013 08:57 AM, Andreas Färber wrote:
> Since converting first_cpu to CPUState and making CPU_INTERRUPT_HARD
> available through qom/cpu.h, it no longer depends on CPUSH4State.

Re 25/, how is CPU_INTERRUPT_HARD any less target dependent than
CPU_INTERRUPT_TGT_EXT_0?  Both require knowledge of how the system delivers
interrupts.


r~
Andreas Färber June 17, 2013, 9:17 p.m. UTC | #2
Am 17.06.2013 23:08, schrieb Richard Henderson:
> On 06/16/2013 08:57 AM, Andreas Färber wrote:
>> Since converting first_cpu to CPUState and making CPU_INTERRUPT_HARD
>> available through qom/cpu.h, it no longer depends on CPUSH4State.
> 
> Re 25/, how is CPU_INTERRUPT_HARD any less target dependent than
> CPU_INTERRUPT_TGT_EXT_0?  Both require knowledge of how the system delivers
> interrupts.

CPU_INTERRUPT_HARD is semantically well-defined for all targets, whereas
CPU_INTERRUPT_TGT_{INT,EXT}_* can mean pretty much anything.

That said, I don't insist on this patch. It compiles the file one time
less than without but still rebuilds whenever I change qom/cpu.h.

Andreas
diff mbox

Patch

diff --git a/hw/intc/Makefile.objs b/hw/intc/Makefile.objs
index 3e68d2e..9e92a0b 100644
--- a/hw/intc/Makefile.objs
+++ b/hw/intc/Makefile.objs
@@ -10,6 +10,7 @@  common-obj-$(CONFIG_REALVIEW) += realview_gic.o
 common-obj-$(CONFIG_SLAVIO) += slavio_intctl.o
 common-obj-$(CONFIG_IOAPIC) += ioapic_common.o
 common-obj-$(CONFIG_ARM_GIC) += arm_gic_common.o
+common-obj-$(CONFIG_SH4) += sh_intc.o
 
 obj-$(CONFIG_APIC) += apic.o apic_common.o
 obj-$(CONFIG_ARM_GIC) += arm_gic.o
@@ -20,4 +21,3 @@  obj-$(CONFIG_GRLIB) += grlib_irqmp.o
 obj-$(CONFIG_IOAPIC) += ioapic.o
 obj-$(CONFIG_OMAP) += omap_intc.o
 obj-$(CONFIG_OPENPIC) += openpic.o
-obj-$(CONFIG_SH4) += sh_intc.o
diff --git a/hw/intc/sh_intc.c b/hw/intc/sh_intc.c
index f1138e3..b8d9ff0 100644
--- a/hw/intc/sh_intc.c
+++ b/hw/intc/sh_intc.c
@@ -11,6 +11,7 @@ 
 #include "hw/sh4/sh_intc.h"
 #include "hw/hw.h"
 #include "hw/sh4/sh.h"
+#include "qom/cpu.h"
 
 //#define DEBUG_INTC
 //#define DEBUG_INTC_SOURCES
diff --git a/include/hw/sh4/sh.h b/include/hw/sh4/sh.h
index e61de9a..4ebafcc 100644
--- a/include/hw/sh4/sh.h
+++ b/include/hw/sh4/sh.h
@@ -11,7 +11,9 @@ 
 struct SH7750State;
 struct MemoryRegion;
 
+#ifdef CONFIG_SOFTMMU
 struct SH7750State *sh7750_init(SuperHCPU *cpu, struct MemoryRegion *sysmem);
+#endif
 
 typedef struct {
     /* The callback will be triggered if any of the designated lines change */