From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JMiL8-0003nJ-2S for qemu-devel@nongnu.org; Wed, 06 Feb 2008 06:21:18 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JMiL5-0003kW-VN for qemu-devel@nongnu.org; Wed, 06 Feb 2008 06:21:17 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JMiL5-0003k8-H5 for qemu-devel@nongnu.org; Wed, 06 Feb 2008 06:21:15 -0500 Received: from smtp7-g19.free.fr ([212.27.42.64]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JMiL5-0008PB-6w for qemu-devel@nongnu.org; Wed, 06 Feb 2008 06:21:15 -0500 Received: from smtp7-g19.free.fr (localhost [127.0.0.1]) by smtp7-g19.free.fr (Postfix) with ESMTP id 99B37322823 for ; Wed, 6 Feb 2008 12:21:14 +0100 (CET) Received: from [127.0.0.1] (rob92-4-82-225-201-66.fbx.proxad.net [82.225.201.66]) by smtp7-g19.free.fr (Postfix) with ESMTP id 194C3322801 for ; Wed, 6 Feb 2008 12:21:14 +0100 (CET) Message-ID: <47A99829.8000808@reactos.org> Date: Wed, 06 Feb 2008 12:21:13 +0100 From: =?ISO-8859-1?Q?Herv=E9_Poussineau?= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080503020408010305060302" Subject: [Qemu-devel] [PATCH] Enhance PC kbd debugging Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------080503020408010305060302 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Hi, Attached patch adds a debug print when keyboard data register is read,=20 and removes a dead define at top of file. It also diminishes registred memory address range when i8042 is=20 memory-mapped. Indeed, i8042 only has 2 ports (data and control), and=20 it_shift parameter can be used to widen this range again. Memory-mapped i8042 is only used in MIPS Pica 61 emulation, which=20 doesn't suffer from this change. Herv=E9 --------------080503020408010305060302 Content-Type: text/plain; name="pckbd.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pckbd.patch" 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); --------------080503020408010305060302--