From 6e6b73631301d41e8b18de4d35937bc78b0117f3 Mon Sep 17 00:00:00 2001 From: blueswir1 Date: Sun, 28 Dec 2008 18:27:10 +0000 Subject: Register reset handlers git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6136 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/cuda.c | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'hw/cuda.c') diff --git a/hw/cuda.c b/hw/cuda.c index c894908..2163877 100644 --- a/hw/cuda.c +++ b/hw/cuda.c @@ -633,6 +633,33 @@ static CPUReadMemoryFunc *cuda_read[] = { &cuda_readl, }; +static void cuda_reset(void *opaque) +{ + CUDAState *s = opaque; + + s->b = 0; + s->a = 0; + s->dirb = 0; + s->dira = 0; + s->sr = 0; + s->acr = 0; + s->pcr = 0; + s->ifr = 0; + s->ier = 0; + // s->ier = T1_INT | SR_INT; + s->anh = 0; + s->data_in_size = 0; + s->data_in_index = 0; + s->data_out_index = 0; + s->autopoll = 0; + + s->timers[0].latch = 0xffff; + set_counter(s, &s->timers[0], 0xffff); + + s->timers[1].latch = 0; + set_counter(s, &s->timers[1], 0xffff); +} + void cuda_init (int *cuda_mem_index, qemu_irq irq) { CUDAState *s = &cuda_state; @@ -641,15 +668,11 @@ void cuda_init (int *cuda_mem_index, qemu_irq irq) s->timers[0].index = 0; s->timers[0].timer = qemu_new_timer(vm_clock, cuda_timer1, s); - s->timers[0].latch = 0xffff; - set_counter(s, &s->timers[0], 0xffff); s->timers[1].index = 1; - s->timers[1].latch = 0; - // s->ier = T1_INT | SR_INT; - s->ier = 0; - set_counter(s, &s->timers[1], 0xffff); s->adb_poll_timer = qemu_new_timer(vm_clock, cuda_adb_poll, s); *cuda_mem_index = cpu_register_io_memory(0, cuda_read, cuda_write, s); + qemu_register_reset(cuda_reset, s); + cuda_reset(s); } -- cgit v1.1