From 89f1d989d24d23141971c4fb47af356388be6bb2 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Thu, 15 Jun 2006 13:20:43 +0100 Subject: [MINI-OS] Fix for event initialisation in Mini-OS. All events are masked when 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 --- extras/mini-os/events.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'extras/mini-os/events.c') diff --git a/extras/mini-os/events.c b/extras/mini-os/events.c index e45a1364fe..2aa5349b37 100644 --- a/extras/mini-os/events.c +++ b/extras/mini-os/events.c @@ -35,24 +35,29 @@ int do_event(u32 port, struct pt_regs *regs) 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; } @@ -135,6 +140,7 @@ void init_events(void) { ev_actions[i].status = EVS_DISABLED; ev_actions[i].handler = default_handler; + mask_evtchn(i); } } -- cgit v1.2.3