return ret;
}
-static void parallel_reset(ParallelState *s, qemu_irq irq, CharDriverState *chr)
+static void parallel_reset(void *opaque)
{
+ ParallelState *s = opaque;
+
s->datar = ~0;
s->dataw = ~0;
s->status = PARA_STS_BUSY;
s->control = PARA_CTR_SELECT;
s->control |= PARA_CTR_INIT;
s->control |= 0xc0;
- s->irq = irq;
s->irq_pending = 0;
- s->chr = chr;
s->hw_driver = 0;
s->epp_timeout = 0;
s->last_read_offset = ~0U;
s = qemu_mallocz(sizeof(ParallelState));
if (!s)
return NULL;
- parallel_reset(s, irq, chr);
+ s->irq = irq;
+ s->chr = chr;
+ parallel_reset(s);
+ qemu_register_reset(parallel_reset, s);
if (qemu_chr_ioctl(chr, CHR_IOCTL_PP_READ_STATUS, &dummy) == 0) {
s->hw_driver = 1;
s = qemu_mallocz(sizeof(ParallelState));
if (!s)
return NULL;
- parallel_reset(s, irq, chr);
+ s->irq = irq;
+ s->chr = chr;
s->it_shift = it_shift;
+ parallel_reset(s);
+ qemu_register_reset(parallel_reset, s);
io_sw = cpu_register_io_memory(0, parallel_mm_read_sw, parallel_mm_write_sw, s);
cpu_register_physical_memory(base, 8 << it_shift, io_sw);