From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvIBZ-0001ft-Go for qemu-devel@nongnu.org; Wed, 08 Feb 2012 19:48:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RvIBV-0007nD-9Q for qemu-devel@nongnu.org; Wed, 08 Feb 2012 19:48:29 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:61140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvIBV-0007mi-0T for qemu-devel@nongnu.org; Wed, 08 Feb 2012 19:48:25 -0500 From: Paul Brook Date: Thu, 9 Feb 2012 00:48:18 +0000 References: <1328342612-25826-1-git-send-email-pbonzini@redhat.com> <1328342612-25826-4-git-send-email-pbonzini@redhat.com> In-Reply-To: <1328342612-25826-4-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Message-Id: <201202090048.19347.paul@codesourcery.com> Subject: Re: [Qemu-devel] [PATCH 3/3] vmmouse: replace PROP_PTR property with gpio pin to i8042 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini > +static void i8042_isa_mouse_fake_event(void *opaque, int n, int level) > { > ISADevice *dev = opaque; > KBDState *s = &(DO_UPCAST(ISAKBDState, dev, dev)->kbd); > > - ps2_mouse_fake_event(s->mouse); > + if (level) { > + ps2_mouse_fake_event(s->mouse); > + } > } >... > @@ -99,7 +99,7 @@ static void vmmouse_mouse_event(void *opaque, int x, int > /* need to still generate PS2 events to notify driver to > read from queue */ > - i8042_isa_mouse_fake_event(s->ps2_mouse); > + qemu_set_irq(s->ps2_mouse_event, 1); > } Both of these are wrong. qemu_irq represents a state. It is not an messge passing API. Currently we don't discard duplicate sets, but that may change in the future. If you want to convey an event via an IRQ line you need to actually cause and detect state changes. i.e. i8042_isa_mouse_fake_event needs to remember the previous state, and only act on a low-high transition. vmmouse_mouse_event should use qemu_irq_pulse. Paul