diff mbox

[1/3] Compile some MIPS devices only once

Message ID f43fc5581003251324l4b5d45c1re5b8f3d7a527e675@mail.gmail.com
State New
Headers show

Commit Message

Blue Swirl March 25, 2010, 8:24 p.m. UTC
Move CPU specific declarations to a separate file.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 Makefile.objs                        |    6 ++++++
 Makefile.target                      |    8 +++-----
 default-configs/mips-softmmu.mak     |    5 +++++
 default-configs/mips64-softmmu.mak   |    5 +++++
 default-configs/mips64el-softmmu.mak |    5 +++++
 default-configs/mipsel-softmmu.mak   |    5 +++++
 hw/mips.h                            |   10 ----------
 hw/mips_addr.c                       |    2 +-
 hw/mips_cpudevs.h                    |   15 +++++++++++++++
 hw/mips_int.c                        |    2 +-
 hw/mips_jazz.c                       |    1 +
 hw/mips_malta.c                      |    1 +
 hw/mips_mipssim.c                    |    1 +
 hw/mips_r4k.c                        |    1 +
 hw/mips_timer.c                      |    2 +-
 15 files changed, 51 insertions(+), 18 deletions(-)
 create mode 100644 hw/mips_cpudevs.h

Comments

Aurelien Jarno March 26, 2010, 9:13 p.m. UTC | #1
On Thu, Mar 25, 2010 at 10:24:12PM +0200, Blue Swirl wrote:
> Move CPU specific declarations to a separate file.

This basically looks ok, but I haven't been able to test it as the patch
doesn't apply anymore.

> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
> ---
>  Makefile.objs                        |    6 ++++++
>  Makefile.target                      |    8 +++-----
>  default-configs/mips-softmmu.mak     |    5 +++++
>  default-configs/mips64-softmmu.mak   |    5 +++++
>  default-configs/mips64el-softmmu.mak |    5 +++++
>  default-configs/mipsel-softmmu.mak   |    5 +++++
>  hw/mips.h                            |   10 ----------
>  hw/mips_addr.c                       |    2 +-
>  hw/mips_cpudevs.h                    |   15 +++++++++++++++
>  hw/mips_int.c                        |    2 +-
>  hw/mips_jazz.c                       |    1 +
>  hw/mips_malta.c                      |    1 +
>  hw/mips_mipssim.c                    |    1 +
>  hw/mips_r4k.c                        |    1 +
>  hw/mips_timer.c                      |    2 +-
>  15 files changed, 51 insertions(+), 18 deletions(-)
>  create mode 100644 hw/mips_cpudevs.h
> 
> diff --git a/Makefile.objs b/Makefile.objs
> index fe81f6c..77d1fb9 100644
> --- a/Makefile.objs
> +++ b/Makefile.objs
> @@ -178,6 +178,12 @@ hw-obj-$(CONFIG_QDEV_ADDR) += qdev-addr.o
>  # VGA
>  hw-obj-$(CONFIG_VGA_PCI) += vga-pci.o
>  hw-obj-$(CONFIG_VGA_ISA) += vga-isa.o
> +hw-obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o
> +
> +hw-obj-$(CONFIG_RC4030) += rc4030.o
> +hw-obj-$(CONFIG_DP8393X) += dp8393x.o
> +hw-obj-$(CONFIG_DS1225Y) += ds1225y.o
> +hw-obj-$(CONFIG_MIPSNET) += mipsnet.o
> 
>  # Sound
>  sound-obj-y =
> diff --git a/Makefile.target b/Makefile.target
> index a17de90..db9f50c 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -211,12 +211,10 @@ obj-ppc-$(CONFIG_FDT) += device_tree.o
> 
>  obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
>  obj-mips-y += mips_addr.o mips_timer.o mips_int.o
> -obj-mips-y += dma.o vga.o i8259.o rc4030.o
> -obj-mips-y += vga-isa-mm.o
> -obj-mips-y += g364fb.o jazz_led.o dp8393x.o
> -obj-mips-y += gt64xxx.o pckbd.o mc146818rtc.o acpi.o ds1225y.o
> +obj-mips-y += dma.o vga.o i8259.o
> +obj-mips-y += g364fb.o jazz_led.o
> +obj-mips-y += gt64xxx.o pckbd.o mc146818rtc.o acpi.o
>  obj-mips-y += piix4.o cirrus_vga.o
> -obj-mips-y += mipsnet.o
>  obj-mips-y += pflash_cfi01.o
>  obj-mips-y += vmware_vga.o
> 
> diff --git a/default-configs/mips-softmmu.mak b/default-configs/mips-softmmu.mak
> index cb48ed1..c438c1c 100644
> --- a/default-configs/mips-softmmu.mak
> +++ b/default-configs/mips-softmmu.mak
> @@ -4,6 +4,7 @@ CONFIG_ISA_MMIO=y
>  CONFIG_ESP=y
>  CONFIG_VGA_PCI=y
>  CONFIG_VGA_ISA=y
> +CONFIG_VGA_ISA_MM=y
>  CONFIG_SERIAL=y
>  CONFIG_PARALLEL=y
>  CONFIG_I8254=y
> @@ -17,3 +18,7 @@ CONFIG_IDE_ISA=y
>  CONFIG_IDE_PIIX=y
>  CONFIG_NE2000_ISA=y
>  CONFIG_SOUND=y
> +CONFIG_RC4030=y
> +CONFIG_DP8393X=y
> +CONFIG_DS1225Y=y
> +CONFIG_MIPSNET=y
> diff --git a/default-configs/mips64-softmmu.mak
> b/default-configs/mips64-softmmu.mak
> index 585d6bb..a0d7f31 100644
> --- a/default-configs/mips64-softmmu.mak
> +++ b/default-configs/mips64-softmmu.mak
> @@ -4,6 +4,7 @@ CONFIG_ISA_MMIO=y
>  CONFIG_ESP=y
>  CONFIG_VGA_PCI=y
>  CONFIG_VGA_ISA=y
> +CONFIG_VGA_ISA_MM=y
>  CONFIG_SERIAL=y
>  CONFIG_PARALLEL=y
>  CONFIG_I8254=y
> @@ -17,3 +18,7 @@ CONFIG_IDE_ISA=y
>  CONFIG_IDE_PIIX=y
>  CONFIG_NE2000_ISA=y
>  CONFIG_SOUND=y
> +CONFIG_RC4030=y
> +CONFIG_DP8393X=y
> +CONFIG_DS1225Y=y
> +CONFIG_MIPSNET=y
> diff --git a/default-configs/mips64el-softmmu.mak
> b/default-configs/mips64el-softmmu.mak
> index f68c2e0..5ff0581 100644
> --- a/default-configs/mips64el-softmmu.mak
> +++ b/default-configs/mips64el-softmmu.mak
> @@ -4,6 +4,7 @@ CONFIG_ISA_MMIO=y
>  CONFIG_ESP=y
>  CONFIG_VGA_PCI=y
>  CONFIG_VGA_ISA=y
> +CONFIG_VGA_ISA_MM=y
>  CONFIG_SERIAL=y
>  CONFIG_PARALLEL=y
>  CONFIG_I8254=y
> @@ -17,3 +18,7 @@ CONFIG_IDE_ISA=y
>  CONFIG_IDE_PIIX=y
>  CONFIG_NE2000_ISA=y
>  CONFIG_SOUND=y
> +CONFIG_RC4030=y
> +CONFIG_DP8393X=y
> +CONFIG_DS1225Y=y
> +CONFIG_MIPSNET=y
> diff --git a/default-configs/mipsel-softmmu.mak
> b/default-configs/mipsel-softmmu.mak
> index bb4644d..d5b9d79 100644
> --- a/default-configs/mipsel-softmmu.mak
> +++ b/default-configs/mipsel-softmmu.mak
> @@ -4,6 +4,7 @@ CONFIG_ISA_MMIO=y
>  CONFIG_ESP=y
>  CONFIG_VGA_PCI=y
>  CONFIG_VGA_ISA=y
> +CONFIG_VGA_ISA_MM=y
>  CONFIG_SERIAL=y
>  CONFIG_PARALLEL=y
>  CONFIG_I8254=y
> @@ -17,3 +18,7 @@ CONFIG_IDE_ISA=y
>  CONFIG_IDE_PIIX=y
>  CONFIG_NE2000_ISA=y
>  CONFIG_SOUND=y
> +CONFIG_RC4030=y
> +CONFIG_DP8393X=y
> +CONFIG_DS1225Y=y
> +CONFIG_MIPSNET=y
> diff --git a/hw/mips.h b/hw/mips.h
> index 9484ea7..30791a8 100644
> --- a/hw/mips.h
> +++ b/hw/mips.h
> @@ -20,16 +20,6 @@ void mipsnet_init(int base, qemu_irq irq, NICInfo *nd);
>  /* jazz_led.c */
>  extern void jazz_led_init(target_phys_addr_t base);
> 
> -/* mips_addr.c */
> -uint64_t cpu_mips_kseg0_to_phys(void *opaque, uint64_t addr);
> -uint64_t cpu_mips_phys_to_kseg0(void *opaque, uint64_t addr);
> -
> -/* mips_int.c */
> -extern void cpu_mips_irq_init_cpu(CPUState *env);
> -
> -/* mips_timer.c */
> -extern void cpu_mips_clock_init(CPUState *);
> -
>  /* rc4030.c */
>  typedef struct rc4030DMAState *rc4030_dma;
>  void rc4030_dma_memory_rw(void *opaque, target_phys_addr_t addr,
> uint8_t *buf, int len, int is_write);
> diff --git a/hw/mips_addr.c b/hw/mips_addr.c
> index b96fea0..aa1c7d8 100644
> --- a/hw/mips_addr.c
> +++ b/hw/mips_addr.c
> @@ -21,7 +21,7 @@
>   */
> 
>  #include "hw.h"
> -#include "mips.h"
> +#include "mips_cpudevs.h"
> 
>  uint64_t cpu_mips_kseg0_to_phys(void *opaque, uint64_t addr)
>  {
> diff --git a/hw/mips_cpudevs.h b/hw/mips_cpudevs.h
> new file mode 100644
> index 0000000..db82b41
> --- /dev/null
> +++ b/hw/mips_cpudevs.h
> @@ -0,0 +1,15 @@
> +#ifndef HW_MIPS_CPUDEVS_H
> +#define HW_MIPS_CPUDEVS_H
> +/* Definitions for MIPS CPU internal devices.  */
> +
> +/* mips_addr.c */
> +uint64_t cpu_mips_kseg0_to_phys(void *opaque, uint64_t addr);
> +uint64_t cpu_mips_phys_to_kseg0(void *opaque, uint64_t addr);
> +
> +/* mips_int.c */
> +void cpu_mips_irq_init_cpu(CPUState *env);
> +
> +/* mips_timer.c */
> +void cpu_mips_clock_init(CPUState *);
> +
> +#endif
> diff --git a/hw/mips_int.c b/hw/mips_int.c
> index 87204ee..c30954c 100644
> --- a/hw/mips_int.c
> +++ b/hw/mips_int.c
> @@ -21,7 +21,7 @@
>   */
> 
>  #include "hw.h"
> -#include "mips.h"
> +#include "mips_cpudevs.h"
>  #include "cpu.h"
> 
>  /* Raise IRQ to CPU if necessary. It must be called every time the active
> diff --git a/hw/mips_jazz.c b/hw/mips_jazz.c
> index e8a81b1..5609597 100644
> --- a/hw/mips_jazz.c
> +++ b/hw/mips_jazz.c
> @@ -24,6 +24,7 @@
> 
>  #include "hw.h"
>  #include "mips.h"
> +#include "mips_cpudevs.h"
>  #include "pc.h"
>  #include "isa.h"
>  #include "fdc.h"
> diff --git a/hw/mips_malta.c b/hw/mips_malta.c
> index 96e3bc0..9a35d0c 100644
> --- a/hw/mips_malta.c
> +++ b/hw/mips_malta.c
> @@ -31,6 +31,7 @@
>  #include "block.h"
>  #include "flash.h"
>  #include "mips.h"
> +#include "mips_cpudevs.h"
>  #include "pci.h"
>  #include "usb-uhci.h"
>  #include "vmware_vga.h"
> diff --git a/hw/mips_mipssim.c b/hw/mips_mipssim.c
> index 98d1a01..a747de5 100644
> --- a/hw/mips_mipssim.c
> +++ b/hw/mips_mipssim.c
> @@ -26,6 +26,7 @@
>   */
>  #include "hw.h"
>  #include "mips.h"
> +#include "mips_cpudevs.h"
>  #include "pc.h"
>  #include "isa.h"
>  #include "net.h"
> diff --git a/hw/mips_r4k.c b/hw/mips_r4k.c
> index c29615c..34b4506 100644
> --- a/hw/mips_r4k.c
> +++ b/hw/mips_r4k.c
> @@ -9,6 +9,7 @@
>  */
>  #include "hw.h"
>  #include "mips.h"
> +#include "mips_cpudevs.h"
>  #include "pc.h"
>  #include "isa.h"
>  #include "net.h"
> diff --git a/hw/mips_timer.c b/hw/mips_timer.c
> index 4e03435..e3beee8 100644
> --- a/hw/mips_timer.c
> +++ b/hw/mips_timer.c
> @@ -21,7 +21,7 @@
>   */
> 
>  #include "hw.h"
> -#include "mips.h"
> +#include "mips_cpudevs.h"
>  #include "qemu-timer.h"
> 
>  #define TIMER_FREQ       100 * 1000 * 1000
> -- 
> 1.6.2.4
> 
> 
>
Blue Swirl March 26, 2010, 9:37 p.m. UTC | #2
On 3/26/10, Aurelien Jarno <aurelien@aurel32.net> wrote:
> On Thu, Mar 25, 2010 at 10:24:12PM +0200, Blue Swirl wrote:
>  > Move CPU specific declarations to a separate file.
>
>
> This basically looks ok, but I haven't been able to test it as the patch
>  doesn't apply anymore.

You need to apply the earlier ide/core patch first, then it should apply.
Aurelien Jarno March 26, 2010, 10:32 p.m. UTC | #3
On Fri, Mar 26, 2010 at 11:37:08PM +0200, Blue Swirl wrote:
> On 3/26/10, Aurelien Jarno <aurelien@aurel32.net> wrote:
> > On Thu, Mar 25, 2010 at 10:24:12PM +0200, Blue Swirl wrote:
> >  > Move CPU specific declarations to a separate file.
> >
> >
> > This basically looks ok, but I haven't been able to test it as the patch
> >  doesn't apply anymore.
> 
> You need to apply the earlier ide/core patch first, then it should apply.
> 

I confirm it works fine.
Blue Swirl March 27, 2010, 7:40 a.m. UTC | #4
On 3/27/10, Aurelien Jarno <aurelien@aurel32.net> wrote:
> On Fri, Mar 26, 2010 at 11:37:08PM +0200, Blue Swirl wrote:
>  > On 3/26/10, Aurelien Jarno <aurelien@aurel32.net> wrote:
>  > > On Thu, Mar 25, 2010 at 10:24:12PM +0200, Blue Swirl wrote:
>  > >  > Move CPU specific declarations to a separate file.
>  > >
>  > >
>  > > This basically looks ok, but I haven't been able to test it as the patch
>  > >  doesn't apply anymore.
>  >
>  > You need to apply the earlier ide/core patch first, then it should apply.
>  >
>
>
> I confirm it works fine.

Thanks, I applied the patch then.
diff mbox

Patch

diff --git a/Makefile.objs b/Makefile.objs
index fe81f6c..77d1fb9 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -178,6 +178,12 @@  hw-obj-$(CONFIG_QDEV_ADDR) += qdev-addr.o
 # VGA
 hw-obj-$(CONFIG_VGA_PCI) += vga-pci.o
 hw-obj-$(CONFIG_VGA_ISA) += vga-isa.o
+hw-obj-$(CONFIG_VGA_ISA_MM) += vga-isa-mm.o
+
+hw-obj-$(CONFIG_RC4030) += rc4030.o
+hw-obj-$(CONFIG_DP8393X) += dp8393x.o
+hw-obj-$(CONFIG_DS1225Y) += ds1225y.o
+hw-obj-$(CONFIG_MIPSNET) += mipsnet.o

 # Sound
 sound-obj-y =
diff --git a/Makefile.target b/Makefile.target
index a17de90..db9f50c 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -211,12 +211,10 @@  obj-ppc-$(CONFIG_FDT) += device_tree.o

 obj-mips-y = mips_r4k.o mips_jazz.o mips_malta.o mips_mipssim.o
 obj-mips-y += mips_addr.o mips_timer.o mips_int.o
-obj-mips-y += dma.o vga.o i8259.o rc4030.o
-obj-mips-y += vga-isa-mm.o
-obj-mips-y += g364fb.o jazz_led.o dp8393x.o
-obj-mips-y += gt64xxx.o pckbd.o mc146818rtc.o acpi.o ds1225y.o
+obj-mips-y += dma.o vga.o i8259.o
+obj-mips-y += g364fb.o jazz_led.o
+obj-mips-y += gt64xxx.o pckbd.o mc146818rtc.o acpi.o
 obj-mips-y += piix4.o cirrus_vga.o
-obj-mips-y += mipsnet.o
 obj-mips-y += pflash_cfi01.o
 obj-mips-y += vmware_vga.o

diff --git a/default-configs/mips-softmmu.mak b/default-configs/mips-softmmu.mak
index cb48ed1..c438c1c 100644
--- a/default-configs/mips-softmmu.mak
+++ b/default-configs/mips-softmmu.mak
@@ -4,6 +4,7 @@  CONFIG_ISA_MMIO=y
 CONFIG_ESP=y
 CONFIG_VGA_PCI=y
 CONFIG_VGA_ISA=y
+CONFIG_VGA_ISA_MM=y
 CONFIG_SERIAL=y
 CONFIG_PARALLEL=y
 CONFIG_I8254=y
@@ -17,3 +18,7 @@  CONFIG_IDE_ISA=y
 CONFIG_IDE_PIIX=y
 CONFIG_NE2000_ISA=y
 CONFIG_SOUND=y
+CONFIG_RC4030=y
+CONFIG_DP8393X=y
+CONFIG_DS1225Y=y
+CONFIG_MIPSNET=y
diff --git a/default-configs/mips64-softmmu.mak
b/default-configs/mips64-softmmu.mak
index 585d6bb..a0d7f31 100644
--- a/default-configs/mips64-softmmu.mak
+++ b/default-configs/mips64-softmmu.mak
@@ -4,6 +4,7 @@  CONFIG_ISA_MMIO=y
 CONFIG_ESP=y
 CONFIG_VGA_PCI=y
 CONFIG_VGA_ISA=y
+CONFIG_VGA_ISA_MM=y
 CONFIG_SERIAL=y
 CONFIG_PARALLEL=y
 CONFIG_I8254=y
@@ -17,3 +18,7 @@  CONFIG_IDE_ISA=y
 CONFIG_IDE_PIIX=y
 CONFIG_NE2000_ISA=y
 CONFIG_SOUND=y
+CONFIG_RC4030=y
+CONFIG_DP8393X=y
+CONFIG_DS1225Y=y
+CONFIG_MIPSNET=y
diff --git a/default-configs/mips64el-softmmu.mak
b/default-configs/mips64el-softmmu.mak
index f68c2e0..5ff0581 100644
--- a/default-configs/mips64el-softmmu.mak
+++ b/default-configs/mips64el-softmmu.mak
@@ -4,6 +4,7 @@  CONFIG_ISA_MMIO=y
 CONFIG_ESP=y
 CONFIG_VGA_PCI=y
 CONFIG_VGA_ISA=y
+CONFIG_VGA_ISA_MM=y
 CONFIG_SERIAL=y
 CONFIG_PARALLEL=y
 CONFIG_I8254=y
@@ -17,3 +18,7 @@  CONFIG_IDE_ISA=y
 CONFIG_IDE_PIIX=y
 CONFIG_NE2000_ISA=y
 CONFIG_SOUND=y
+CONFIG_RC4030=y
+CONFIG_DP8393X=y
+CONFIG_DS1225Y=y
+CONFIG_MIPSNET=y
diff --git a/default-configs/mipsel-softmmu.mak
b/default-configs/mipsel-softmmu.mak
index bb4644d..d5b9d79 100644
--- a/default-configs/mipsel-softmmu.mak
+++ b/default-configs/mipsel-softmmu.mak
@@ -4,6 +4,7 @@  CONFIG_ISA_MMIO=y
 CONFIG_ESP=y
 CONFIG_VGA_PCI=y
 CONFIG_VGA_ISA=y
+CONFIG_VGA_ISA_MM=y
 CONFIG_SERIAL=y
 CONFIG_PARALLEL=y
 CONFIG_I8254=y
@@ -17,3 +18,7 @@  CONFIG_IDE_ISA=y
 CONFIG_IDE_PIIX=y
 CONFIG_NE2000_ISA=y
 CONFIG_SOUND=y
+CONFIG_RC4030=y
+CONFIG_DP8393X=y
+CONFIG_DS1225Y=y
+CONFIG_MIPSNET=y
diff --git a/hw/mips.h b/hw/mips.h
index 9484ea7..30791a8 100644
--- a/hw/mips.h
+++ b/hw/mips.h
@@ -20,16 +20,6 @@  void mipsnet_init(int base, qemu_irq irq, NICInfo *nd);
 /* jazz_led.c */
 extern void jazz_led_init(target_phys_addr_t base);

-/* mips_addr.c */
-uint64_t cpu_mips_kseg0_to_phys(void *opaque, uint64_t addr);
-uint64_t cpu_mips_phys_to_kseg0(void *opaque, uint64_t addr);
-
-/* mips_int.c */
-extern void cpu_mips_irq_init_cpu(CPUState *env);
-
-/* mips_timer.c */
-extern void cpu_mips_clock_init(CPUState *);
-
 /* rc4030.c */
 typedef struct rc4030DMAState *rc4030_dma;
 void rc4030_dma_memory_rw(void *opaque, target_phys_addr_t addr,
uint8_t *buf, int len, int is_write);
diff --git a/hw/mips_addr.c b/hw/mips_addr.c
index b96fea0..aa1c7d8 100644
--- a/hw/mips_addr.c
+++ b/hw/mips_addr.c
@@ -21,7 +21,7 @@ 
  */

 #include "hw.h"
-#include "mips.h"
+#include "mips_cpudevs.h"

 uint64_t cpu_mips_kseg0_to_phys(void *opaque, uint64_t addr)
 {
diff --git a/hw/mips_cpudevs.h b/hw/mips_cpudevs.h
new file mode 100644
index 0000000..db82b41
--- /dev/null
+++ b/hw/mips_cpudevs.h
@@ -0,0 +1,15 @@ 
+#ifndef HW_MIPS_CPUDEVS_H
+#define HW_MIPS_CPUDEVS_H
+/* Definitions for MIPS CPU internal devices.  */
+
+/* mips_addr.c */
+uint64_t cpu_mips_kseg0_to_phys(void *opaque, uint64_t addr);
+uint64_t cpu_mips_phys_to_kseg0(void *opaque, uint64_t addr);
+
+/* mips_int.c */
+void cpu_mips_irq_init_cpu(CPUState *env);
+
+/* mips_timer.c */
+void cpu_mips_clock_init(CPUState *);
+
+#endif
diff --git a/hw/mips_int.c b/hw/mips_int.c
index 87204ee..c30954c 100644
--- a/hw/mips_int.c
+++ b/hw/mips_int.c
@@ -21,7 +21,7 @@ 
  */

 #include "hw.h"
-#include "mips.h"
+#include "mips_cpudevs.h"
 #include "cpu.h"

 /* Raise IRQ to CPU if necessary. It must be called every time the active
diff --git a/hw/mips_jazz.c b/hw/mips_jazz.c
index e8a81b1..5609597 100644
--- a/hw/mips_jazz.c
+++ b/hw/mips_jazz.c
@@ -24,6 +24,7 @@ 

 #include "hw.h"
 #include "mips.h"
+#include "mips_cpudevs.h"
 #include "pc.h"
 #include "isa.h"
 #include "fdc.h"
diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index 96e3bc0..9a35d0c 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -31,6 +31,7 @@ 
 #include "block.h"
 #include "flash.h"
 #include "mips.h"
+#include "mips_cpudevs.h"
 #include "pci.h"
 #include "usb-uhci.h"
 #include "vmware_vga.h"
diff --git a/hw/mips_mipssim.c b/hw/mips_mipssim.c
index 98d1a01..a747de5 100644
--- a/hw/mips_mipssim.c
+++ b/hw/mips_mipssim.c
@@ -26,6 +26,7 @@ 
  */
 #include "hw.h"
 #include "mips.h"
+#include "mips_cpudevs.h"
 #include "pc.h"
 #include "isa.h"
 #include "net.h"
diff --git a/hw/mips_r4k.c b/hw/mips_r4k.c
index c29615c..34b4506 100644
--- a/hw/mips_r4k.c
+++ b/hw/mips_r4k.c
@@ -9,6 +9,7 @@ 
 */
 #include "hw.h"
 #include "mips.h"
+#include "mips_cpudevs.h"
 #include "pc.h"
 #include "isa.h"
 #include "net.h"
diff --git a/hw/mips_timer.c b/hw/mips_timer.c
index 4e03435..e3beee8 100644
--- a/hw/mips_timer.c
+++ b/hw/mips_timer.c
@@ -21,7 +21,7 @@ 
  */

 #include "hw.h"
-#include "mips.h"
+#include "mips_cpudevs.h"
 #include "qemu-timer.h"

 #define TIMER_FREQ       100 * 1000 * 1000