aboutsummaryrefslogtreecommitdiff
path: root/hw/mips_jazz.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2010-05-22 08:00:52 +0000
committerBlue Swirl <blauwirbel@gmail.com>2010-05-22 08:00:52 +0000
commit4556bd8b2514a55d48c15b1adb17537f49657744 (patch)
tree67314570081e4b10e768aec2457d1a1d5748a2db /hw/mips_jazz.c
parentc86d2c23879da1534a257eecb572a76f1ead5d93 (diff)
Compile dma only once
Use a qemu_irq to request CPU exit. 7 compilations less for the full build. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/mips_jazz.c')
-rw-r--r--hw/mips_jazz.c13
1 files changed, 12 insertions, 1 deletions
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);