From 4556bd8b2514a55d48c15b1adb17537f49657744 Mon Sep 17 00:00:00 2001 From: Blue Swirl Date: Sat, 22 May 2010 08:00:52 +0000 Subject: Compile dma only once Use a qemu_irq to request CPU exit. 7 compilations less for the full build. Signed-off-by: Blue Swirl --- hw/mips_jazz.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'hw/mips_jazz.c') diff --git a/hw/mips_jazz.c b/hw/mips_jazz.c index 6e0ec8fd36..ead3a00c3d 100644 --- a/hw/mips_jazz.c +++ b/hw/mips_jazz.c @@ -114,6 +114,15 @@ static void audio_init(qemu_irq *pic) #define MAGNUM_BIOS_SIZE_MAX 0x7e000 #define MAGNUM_BIOS_SIZE (BIOS_SIZE < MAGNUM_BIOS_SIZE_MAX ? BIOS_SIZE : MAGNUM_BIOS_SIZE_MAX) +static void cpu_request_exit(void *opaque, int irq, int level) +{ + CPUState *env = cpu_single_env; + + if (env && level) { + cpu_exit(env); + } +} + static void mips_jazz_init (ram_addr_t ram_size, const char *cpu_model, @@ -130,6 +139,7 @@ void mips_jazz_init (ram_addr_t ram_size, PITState *pit; DriveInfo *fds[MAX_FD]; qemu_irq esp_reset; + qemu_irq *cpu_exit_irq; ram_addr_t ram_offset; ram_addr_t bios_offset; @@ -189,7 +199,8 @@ void mips_jazz_init (ram_addr_t ram_size, i8259 = i8259_init(env->irq[4]); isa_bus_new(NULL); isa_bus_irqs(i8259); - DMA_init(0); + cpu_exit_irq = qemu_allocate_irqs(cpu_request_exit, NULL, 1); + DMA_init(0, cpu_exit_irq); pit = pit_init(0x40, i8259[0]); pcspk_init(pit); -- cgit v1.2.3