Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fw3ZU-0001P3-54 for qemu-devel@nongnu.org; Thu, 29 Jun 2006 16:57:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fw3ZS-0001Ng-7h for qemu-devel@nongnu.org; Thu, 29 Jun 2006 16:57:07 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fw3ZS-0001Nd-3F for qemu-devel@nongnu.org; Thu, 29 Jun 2006 16:57:06 -0400 Received: from [213.25.173.251] (helo=ns.pers.pl) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Fw3m4-0005Fj-Jr for qemu-devel@nongnu.org; Thu, 29 Jun 2006 17:10:08 -0400 Received: from localhost ([127.0.0.1]) by ns.pers.pl with esmtp (Exim 4.61) (envelope-from ) id 1Fw3ZK-0006AT-Eq for qemu-devel@nongnu.org; Thu, 29 Jun 2006 22:56:58 +0200 Received: from ns.pers.pl ([127.0.0.1]) by localhost (ns.pers.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 19727-17 for ; Thu, 29 Jun 2006 22:56:56 +0200 (CEST) Received: from aow214.internetdsl.tpnet.pl ([83.17.130.214] helo=[10.0.0.21]) by ns.pers.pl with esmtpsa (SSLv3:AES256-SHA:256) (Exim 4.61) (envelope-from ) id 1Fw3ZI-0006AM-Gx for qemu-devel@nongnu.org; Thu, 29 Jun 2006 22:56:56 +0200 From: =?utf-8?q?Rafa=C5=82_Cygnarowski?= Subject: Re: [Qemu-devel] qemu kbd emulation Date: Thu, 29 Jun 2006 22:56:55 +0200 References: <200606281027.31617.zswi@pers.pl> <200606281416.57021.zswi@pers.pl> <20060628142851.GA16101@jbrown.mylinuxbox.org> In-Reply-To: <20060628142851.GA16101@jbrown.mylinuxbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200606292256.55462.zswi@pers.pl> 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 > I have an ugly hack that fixes the code so there are no more key repeats, > but I was never able to figure out what caused the key drops. I suppose that I have same ugly hack as you: uint32_t ps2_read_data(void *opaque) { [...] if (q->count =3D=3D 0) { [...] } else { val =3D q->data[q->rptr]; if (++q->rptr =3D=3D PS2_QUEUE_SIZE) q->rptr =3D 0; q->count--; /* reading deasserts IRQ */ /* If I comment out following line: s->update_irq(s->update_arg, 0); repeating keys disapear. I didn't notice negative=20 effects of this so far. */ /* reassert IRQs if data left */ s->update_irq(s->update_arg, q->count !=3D 0); } return val; } BTW: what happens when update_irq is called?=20 AFAIK some interraption should be emulated but I don't know how. Becouse ps2_queue can grow (q->count can be sth more than 1) and=20 becouse every time at the end of ps2_queue function update_irq is called, I suppose that irqs are emulated by another thread.=20 So how they are synchronized? =2D-=20 Rafa=C5=82 Cygnarowski rafi@pers.pl