ia64/xen-unstable

changeset 17612:72e70f9041c2

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>
author Keir Fraser <keir.fraser@citrix.com>
date Thu May 08 11:27:22 2008 +0100 (2008-05-08)
parents 36694cae3927
children addfc2db07a3
files extras/mini-os/hypervisor.c
line diff
     1.1 --- a/extras/mini-os/hypervisor.c	Thu May 08 11:20:04 2008 +0100
     1.2 +++ b/extras/mini-os/hypervisor.c	Thu May 08 11:27:22 2008 +0100
     1.3 @@ -58,7 +58,7 @@ void do_hypervisor_callback(struct pt_re
     1.4              l2i = __ffs(l2);
     1.5              l2 &= ~(1 << l2i);
     1.6  
     1.7 -            port = (l1i << 5) + l2i;
     1.8 +            port = (l1i * (sizeof(unsigned long) * 8)) + l2i;
     1.9  			do_event(port, regs);
    1.10          }
    1.11      }
    1.12 @@ -100,7 +100,8 @@ inline void unmask_evtchn(u32 port)
    1.13       * a real IO-APIC we 'lose the interrupt edge' if the channel is masked.
    1.14       */
    1.15      if (  synch_test_bit        (port,    &s->evtchn_pending[0]) && 
    1.16 -         !synch_test_and_set_bit(port>>5, &vcpu_info->evtchn_pending_sel) )
    1.17 +         !synch_test_and_set_bit(port / (sizeof(unsigned long) * 8),
    1.18 +              &vcpu_info->evtchn_pending_sel) )
    1.19      {
    1.20          vcpu_info->evtchn_upcall_pending = 1;
    1.21          if ( !vcpu_info->evtchn_upcall_mask )