WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] minios: fix port selection shifts

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] minios: fix port selection shifts
From: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
Date: Thu, 8 May 2008 11:23:52 +0100
Delivery-date: Thu, 08 May 2008 03:24:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Mail-followup-to: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.12-2006-07-14
minios: fix port selection shifts

Event selectors span unsigned longs, whose size is not always 32 bits.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>

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 )

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] minios: fix port selection shifts, Samuel Thibault <=