@@ -803,7 +803,7 @@ void *rc4030_init(qemu_irq timer, qemu_irq jazz_bus,
s = g_malloc0(sizeof(rc4030State));
- *irqs = qemu_allocate_irqs(rc4030_irq_jazz_request, s, 16);
+ *irqs = qemu_allocate_irqs(rc4030_irq_jazz_request, s, 10);
*dmas = rc4030_allocate_dmas(s, 4);
s->periodic_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, rc4030_periodic_timer, s);
@@ -261,8 +261,10 @@ static void mips_jazz_init(MachineState *machine,
break;
case JAZZ_PICA61:
isa_vga_mm_init(0x40000000, 0x60000000, 0, get_system_memory());
+ qemu_free_irq(rc4030[3]);
break;
default:
+ qemu_free_irq(rc4030[3]);
break;
}
@@ -288,6 +290,7 @@ static void mips_jazz_init(MachineState *machine,
esp_init(0x80002000, 0,
rc4030_dma_read, rc4030_dma_write, dmas[0],
rc4030[5], &esp_reset, &dma_enable);
+ g_free(dmas);
/* Floppy */
if (drive_get_max_bus(IF_FLOPPY) >= MAX_FD) {
@@ -312,18 +315,28 @@ static void mips_jazz_init(MachineState *machine,
if (serial_hds[0]) {
serial_mm_init(address_space, 0x80006000, 0, rc4030[8], 8000000/16,
serial_hds[0], DEVICE_NATIVE_ENDIAN);
+ } else {
+ qemu_free_irq(rc4030[8]);
}
+
if (serial_hds[1]) {
serial_mm_init(address_space, 0x80007000, 0, rc4030[9], 8000000/16,
serial_hds[1], DEVICE_NATIVE_ENDIAN);
+ } else {
+ qemu_free_irq(rc4030[9]);
}
/* Parallel port */
- if (parallel_hds[0])
+ if (parallel_hds[0]) {
parallel_mm_init(address_space, 0x80008000, 0, rc4030[0],
parallel_hds[0]);
+ } else {
+ qemu_free_irq(rc4030[0]);
+ }
/* FIXME: missing Jazz sound at 0x8000c000, rc4030[2] */
+ qemu_free_irq(rc4030[2]);
+ g_free(rc4030);
/* NVRAM */
dev = qdev_create(NULL, "ds1225y");