From 334ab475d2f27dbf6fbf836c2d4fb86dbb02a15c Mon Sep 17 00:00:00 2001 From: Jun Nakajima Date: Wed, 2 Feb 2011 23:49:59 -0800 Subject: x86: Add x86 support. Rebase the change (20906/1) due to a minor conflict. Change-Id: Ic73cca0fc6c6e5cf74f63daa6080d00aa7c392bb Signed-off-by: Xiaohui Xin Signed-off-by: Yunhong Jiang Signed-off-by: Jun Nakajima --- hw/goldfish_events_device.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'hw/goldfish_events_device.c') diff --git a/hw/goldfish_events_device.c b/hw/goldfish_events_device.c index 549fe4b..afc1724 100644 --- a/hw/goldfish_events_device.c +++ b/hw/goldfish_events_device.c @@ -149,7 +149,23 @@ static unsigned dequeue_event(events_state *s) if(s->first == s->last) { qemu_irq_lower(s->irq); } - +#ifdef TARGET_I386 + /* + * Adding the logic to handle edge-triggered interrupts for x86 + * because the exisiting goldfish events device basically provides + * level-trigger interrupts only. + * + * Logic: When an event (including the type/code/value) is fetched + * by the driver, if there is still another event in the event + * queue, the goldfish event device will re-assert the IRQ so that + * the driver can be notified to fetch the event again. + */ + else if (((s->first + 2) & (MAX_EVENTS - 1)) < s->last || + (s->first & (MAX_EVENTS - 1)) > s->last) { /* if there still is an event */ + qemu_irq_lower(s->irq); + qemu_irq_raise(s->irq); + } +#endif return n; } -- cgit v1.1