From: "Hervé Poussineau" <hpoussin@reactos.org>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Enhance PC kbd debugging
Date: Wed, 06 Feb 2008 12:21:13 +0100 [thread overview]
Message-ID: <47A99829.8000808@reactos.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 433 bytes --]
Hi,
Attached patch adds a debug print when keyboard data register is read,
and removes a dead define at top of file.
It also diminishes registred memory address range when i8042 is
memory-mapped. Indeed, i8042 only has 2 ports (data and control), and
it_shift parameter can be used to widen this range again.
Memory-mapped i8042 is only used in MIPS Pica 61 emulation, which
doesn't suffer from this change.
Hervé
[-- Attachment #2: pckbd.patch --]
[-- Type: text/plain, Size: 1471 bytes --]
Index: pckbd.c
===================================================================
RCS file: /sources/qemu/qemu/hw/pckbd.c,v
retrieving revision 1.26
diff -u -r1.26 hw/pckbd.c
--- hw/pckbd.c 18 Nov 2007 01:44:37 -0000 1.26
+++ hw/pckbd.c 31 Jan 2008 16:49:47 -0000
@@ -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 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 @@
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);
reply other threads:[~2008-02-06 11:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47A99829.8000808@reactos.org \
--to=hpoussin@reactos.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).