From mboxrd@z Thu Jan 1 00:00:00 1970 From: Samuel Thibault Subject: [PATCH] minios: clear the event before calling the handler Date: Thu, 8 May 2008 11:27:13 +0100 Message-ID: <20080508102713.GE4365@implementation.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org minios: clear the event before calling the handler since (especially in the SMP case) the handler may make another domain send an event again, and that must not be lost. Signed-off-by: Samuel Thibault diff -r 4965e711fee8 extras/mini-os/events.c --- a/extras/mini-os/events.c Wed May 07 15:36:32 2008 +0100 +++ b/extras/mini-os/events.c Thu May 08 11:26:26 2008 +0100 @@ -58,9 +58,12 @@ int do_event(evtchn_port_t port, struct int do_event(evtchn_port_t port, struct pt_regs *regs) { ev_action_t *action; + + clear_evtchn(port); + if (port >= NR_EVS) { printk("Port number too large: %d\n", port); - goto out; + return 1; } action = &ev_actions[port]; @@ -68,9 +71,6 @@ int do_event(evtchn_port_t port, struct /* call the handler */ action->handler(port, regs, action->data); - - out: - clear_evtchn(port); return 1;