aboutsummaryrefslogtreecommitdiff
path: root/hw/pckbd.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-02-10 13:39:24 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-02-10 13:39:24 +0000
commite41c0f263f0daefa338812f161bd59de5a94ccb6 (patch)
tree9f30cbbd00c7da676b70bc03974c19d6e5c554d6 /hw/pckbd.c
parent52ccc5e0c5d6e001c51dd38755d4d577b7b51592 (diff)
Enhance PC kbd debugging (patch from Hervé Poussineau)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3972 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/pckbd.c')
-rw-r--r--hw/pckbd.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/hw/pckbd.c b/hw/pckbd.c
index 266c7f9b17..f58950ea78 100644
--- a/hw/pckbd.c
+++ b/hw/pckbd.c
@@ -30,9 +30,6 @@
/* debug PC keyboard */
//#define DEBUG_KBD
-/* debug PC keyboard : only mouse */
-//#define DEBUG_MOUSE
-
/* Keyboard Controller Commands */
#define KBD_CCMD_READ_MODE 0x20 /* Read mode bits */
#define KBD_CCMD_WRITE_MODE 0x60 /* Write mode bits */
@@ -283,11 +280,17 @@ static void kbd_write_command(void *opaque, uint32_t addr, uint32_t val)
static uint32_t kbd_read_data(void *opaque, uint32_t addr)
{
KBDState *s = opaque;
+ uint32_t val;
if (s->pending == KBD_PENDING_AUX)
- return ps2_read_data(s->mouse);
+ val = ps2_read_data(s->mouse);
+ else
+ val = ps2_read_data(s->kbd);
- return ps2_read_data(s->kbd);
+#if defined(DEBUG_KBD)
+ printf("kbd: read data=0x%02x\n", val);
+#endif
+ return val;
}
static void kbd_write_data(void *opaque, uint32_t addr, uint32_t val)
@@ -439,7 +442,7 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
kbd_reset(s);
register_savevm("pckbd", 0, 3, kbd_save, kbd_load, s);
s_io_memory = cpu_register_io_memory(0, kbd_mm_read, kbd_mm_write, s);
- cpu_register_physical_memory(base, 8 << it_shift, s_io_memory);
+ cpu_register_physical_memory(base, 2 << it_shift, s_io_memory);
s->kbd = ps2_kbd_init(kbd_update_kbd_irq, s);
s->mouse = ps2_mouse_init(kbd_update_aux_irq, s);