ia64/xen-unstable

changeset 10412:a1c0c1e797a6

[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 <gm281@cam.ac.uk>
author kaf24@firebug.cl.cam.ac.uk
date Thu Jun 15 13:20:43 2006 +0100 (2006-06-15)
parents 4f0bc5744557
children 73c73fb8875c
files extras/mini-os/events.c
line diff
     1.1 --- a/extras/mini-os/events.c	Thu Jun 15 13:19:04 2006 +0100
     1.2 +++ b/extras/mini-os/events.c	Thu Jun 15 13:20:43 2006 +0100
     1.3 @@ -35,24 +35,29 @@ int do_event(u32 port, struct pt_regs *r
     1.4      ev_action_t  *action;
     1.5      if (port >= NR_EVS) {
     1.6          printk("Port number too large: %d\n", port);
     1.7 -        return 0;
     1.8 +        goto out;
     1.9      }
    1.10  
    1.11      action = &ev_actions[port];
    1.12      action->count++;
    1.13  
    1.14      if (!action->handler)
    1.15 +    {
    1.16 +        printk("Spurious event on port %d\n", port);
    1.17          goto out;
    1.18 +    }
    1.19      
    1.20      if (action->status & EVS_DISABLED)
    1.21 +    {
    1.22 +        printk("Event on port %d disabled\n", port);
    1.23          goto out;
    1.24 +    }
    1.25      
    1.26      /* call the handler */
    1.27      action->handler(port, regs);
    1.28 -
    1.29 -	clear_evtchn(port);
    1.30      
    1.31   out:
    1.32 +	clear_evtchn(port);
    1.33      return 1;
    1.34  
    1.35  }
    1.36 @@ -135,6 +140,7 @@ void init_events(void)
    1.37      {
    1.38          ev_actions[i].status  = EVS_DISABLED;
    1.39          ev_actions[i].handler = default_handler;
    1.40 +        mask_evtchn(i);
    1.41      }
    1.42  }
    1.43