diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-05-08 11:27:22 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-05-08 11:27:22 +0100 |
commit | f095afd3f6e061d8cc1077442c3b2c2a32e466bb (patch) | |
tree | dbf2ec7842df1e57cb55c4306126260addb8677e /extras/mini-os/hypervisor.c | |
parent | 5e5a6aa9bec5ae555976dfea75c3339a98ed5b6d (diff) | |
download | xen-f095afd3f6e061d8cc1077442c3b2c2a32e466bb.tar.gz xen-f095afd3f6e061d8cc1077442c3b2c2a32e466bb.tar.bz2 xen-f095afd3f6e061d8cc1077442c3b2c2a32e466bb.zip |
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>
Diffstat (limited to 'extras/mini-os/hypervisor.c')
-rw-r--r-- | extras/mini-os/hypervisor.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/extras/mini-os/hypervisor.c b/extras/mini-os/hypervisor.c index 2840d789ef..3bb47a424d 100644 --- a/extras/mini-os/hypervisor.c +++ b/extras/mini-os/hypervisor.c @@ -58,7 +58,7 @@ void do_hypervisor_callback(struct pt_regs *regs) 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 @@ inline void unmask_evtchn(u32 port) * 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 ) |