Skip to contentSkip to conversation

minios: clear the event before calling the handler

PATCH New Samuel Thibault 1 participant 1 message May 8, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 minios: clear the event before calling the handler

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.

extras/mini-os/events.c +4 -4
diff -r 4965e711fee8 extras/mini-os/events.c
@@ -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;