aboutsummaryrefslogtreecommitdiffstats
path: root/extras/mini-os/arch
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2008-03-18 11:29:18 +0000
committerKeir Fraser <keir.fraser@citrix.com>2008-03-18 11:29:18 +0000
commitb9d1950675c67f10870debe164a226eef64f65d5 (patch)
treeacd93ea007ed7289d7bacc728997d698e050c276 /extras/mini-os/arch
parent62341d01ee88ecc87d6995000383446e3bf43ec7 (diff)
downloadxen-b9d1950675c67f10870debe164a226eef64f65d5.tar.gz
xen-b9d1950675c67f10870debe164a226eef64f65d5.tar.bz2
xen-b9d1950675c67f10870debe164a226eef64f65d5.zip
minios: Fix lost events
evtchn_bind_interdomain used to clear any already pending event before binding a handler, because else the handler may be called before it is ready. That however leads to missed events, which I had to workaround for the HVM case. This changes the semantics of bind_evtchn, and thus of all the event channel binding functions (bind_virq, evtchn_alloc_unbound, evtchn_bind_interdomain) into not unmasking the event itself, hence letting the caller initialize properly before unmasking the port (e.g. record the port number in an appropriate place). Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Diffstat (limited to 'extras/mini-os/arch')
-rw-r--r--extras/mini-os/arch/ia64/time.c9
-rw-r--r--extras/mini-os/arch/x86/time.c4
2 files changed, 8 insertions, 5 deletions
diff --git a/extras/mini-os/arch/ia64/time.c b/extras/mini-os/arch/ia64/time.c
index 9fb3157fb6..bbaa6b1864 100644
--- a/extras/mini-os/arch/ia64/time.c
+++ b/extras/mini-os/arch/ia64/time.c
@@ -246,7 +246,7 @@ init_time(void)
{
uint64_t new;
efi_time_t tm;
- int err = 0;
+ evtchn_port_t port = 0;
printk("Initialising time\n");
calculate_frequencies();
@@ -267,11 +267,12 @@ init_time(void)
} else
printk("efi_get_time() failed\n");
- err = bind_virq(VIRQ_ITC, timer_interrupt, NULL);
- if (err == -1) {
- printk("XEN timer request chn bind failed %i\n", err);
+ port = bind_virq(VIRQ_ITC, timer_interrupt, NULL);
+ if (port == -1) {
+ printk("XEN timer request chn bind failed %i\n", port);
return;
}
+ unmask_evtchn(port);
itc_alt = ia64_get_itc();
itc_at_boot = itc_alt;
new = ia64_get_itc() + itm_val;
diff --git a/extras/mini-os/arch/x86/time.c b/extras/mini-os/arch/x86/time.c
index c8313705ae..a396dc279f 100644
--- a/extras/mini-os/arch/x86/time.c
+++ b/extras/mini-os/arch/x86/time.c
@@ -222,6 +222,8 @@ static void timer_handler(evtchn_port_t ev, struct pt_regs *regs, void *ign)
void init_time(void)
{
+ evtchn_port_t port;
printk("Initialising timer interface\n");
- bind_virq(VIRQ_TIMER, &timer_handler, NULL);
+ port = bind_virq(VIRQ_TIMER, &timer_handler, NULL);
+ unmask_evtchn(port);
}