[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/3] vmmouse: replace PROP_PTR property with gpi
From: |
Paul Brook |
Subject: |
Re: [Qemu-devel] [PATCH 3/3] vmmouse: replace PROP_PTR property with gpio pin to i8042 |
Date: |
Thu, 9 Feb 2012 00:48:18 +0000 |
User-agent: |
KMail/1.13.7 (Linux/3.1.0-1-amd64; KDE/4.6.5; x86_64; ; ) |
> +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