From: Samuel Thibault <samuel.thibault@eu.citrix.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] minios: fix port selection shifts
Date: Thu, 8 May 2008 11:23:52 +0100 [thread overview]
Message-ID: <20080508102352.GD4365@implementation.uk.xensource.com> (raw)
minios: fix port selection shifts
Event selectors span unsigned longs, whose size is not always 32 bits.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
diff -r 4965e711fee8 extras/mini-os/hypervisor.c
--- a/extras/mini-os/hypervisor.c Wed May 07 15:36:32 2008 +0100
+++ b/extras/mini-os/hypervisor.c Thu May 08 11:23:07 2008 +0100
@@ -58,7 +58,7 @@
l2i = __ffs(l2);
l2 &= ~(1 << l2i);
- port = (l1i << 5) + l2i;
+ port = (l1i * (sizeof(unsigned long) * 8)) + l2i;
do_event(port, regs);
}
}
@@ -100,7 +100,8 @@
* a real IO-APIC we 'lose the interrupt edge' if the channel is masked.
*/
if ( synch_test_bit (port, &s->evtchn_pending[0]) &&
- !synch_test_and_set_bit(port>>5, &vcpu_info->evtchn_pending_sel) )
+ !synch_test_and_set_bit(port / (sizeof(unsigned long) * 8),
+ &vcpu_info->evtchn_pending_sel) )
{
vcpu_info->evtchn_upcall_pending = 1;
if ( !vcpu_info->evtchn_upcall_mask )
reply other threads:[~2008-05-08 10:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080508102352.GD4365@implementation.uk.xensource.com \
--to=samuel.thibault@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.