diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-06-20 12:58:36 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-06-20 12:58:36 +0000 |
commit | d7d02e3c3a50782c0fa6b17d16f9957f1cc82a65 (patch) | |
tree | f07209fb39574448a87f576dfaefb655568d1c86 /hw/pckbd.c | |
parent | bb0c6722b6606ad34da75d093d95a9bdfe42bc98 (diff) | |
download | qemu-d7d02e3c3a50782c0fa6b17d16f9957f1cc82a65.tar.gz qemu-d7d02e3c3a50782c0fa6b17d16f9957f1cc82a65.tar.bz2 qemu-d7d02e3c3a50782c0fa6b17d16f9957f1cc82a65.zip |
new reset API
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@938 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/pckbd.c')
-rw-r--r-- | hw/pckbd.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/hw/pckbd.c b/hw/pckbd.c index 8b809bd820..0d7b5ff098 100644 --- a/hw/pckbd.c +++ b/hw/pckbd.c @@ -139,7 +139,6 @@ typedef struct KBDState { } KBDState; KBDState kbd_state; -int reset_requested; /* update irq and KBD_STAT_[MOUSE_]OBF */ /* XXX: not generating the irqs if KBD_MODE_DISABLE_KBD is set may be @@ -274,8 +273,7 @@ static void kbd_write_command(void *opaque, uint32_t addr, uint32_t val) break; #endif case KBD_CCMD_RESET: - reset_requested = 1; - cpu_interrupt(cpu_single_env, CPU_INTERRUPT_EXIT); + qemu_system_reset_request(); break; case 0xff: /* ignore that - I don't know what is its use */ @@ -617,8 +615,7 @@ void kbd_write_data(void *opaque, uint32_t addr, uint32_t val) cpu_x86_set_a20(cpu_single_env, (val >> 1) & 1); #endif if (!(val & 1)) { - reset_requested = 1; - cpu_interrupt(cpu_single_env, CPU_INTERRUPT_EXIT); + qemu_system_reset_request(); } break; case KBD_CCMD_WRITE_MOUSE: @@ -630,8 +627,9 @@ void kbd_write_data(void *opaque, uint32_t addr, uint32_t val) s->write_cmd = 0; } -void kbd_reset(KBDState *s) +static void kbd_reset(void *opaque) { + KBDState *s = opaque; KBDQueue *q; s->kbd_write_cmd = -1; @@ -656,4 +654,5 @@ void kbd_init(void) qemu_add_kbd_event_handler(pc_kbd_put_keycode, s); qemu_add_mouse_event_handler(pc_kbd_mouse_event, s); + qemu_register_reset(kbd_reset, s); } |