the system is started up. This prevents from getting spurious events
between hypercall to bind an event-channel and registering
appropriate event handler.
Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
ev_action_t *action;
if (port >= NR_EVS) {
printk("Port number too large: %d\n", port);
- return 0;
+ goto out;
}
action = &ev_actions[port];
action->count++;
if (!action->handler)
+ {
+ printk("Spurious event on port %d\n", port);
goto out;
+ }
if (action->status & EVS_DISABLED)
+ {
+ printk("Event on port %d disabled\n", port);
goto out;
+ }
/* call the handler */
action->handler(port, regs);
-
- clear_evtchn(port);
out:
+ clear_evtchn(port);
return 1;
}
{
ev_actions[i].status = EVS_DISABLED;
ev_actions[i].handler = default_handler;
+ mask_evtchn(i);
}
}