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-changelog

[Xen-changelog] Turn pirq_mask into a generic bitmap type.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Turn pirq_mask into a generic bitmap type.
From: Xen patchbot -3.0-testing <patchbot-3.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 28 Apr 2006 14:28:18 +0000
Delivery-date: Fri, 28 Apr 2006 07:29:22 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 83e4c180f09439baaa89fee900d77b47969565d7
# Parent  b5d43db157469c745c781f7ecbbd038e3daf9604
Turn pirq_mask into a generic bitmap type.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
xen-unstable changeset: 9583:3b0d07af46cb0c456912b287a0365172746ae9e0
xen-unstable date: Fri Apr  7 14:27:46 2006 +0100

Fix my slightly broken change to pirq_mask logic -- we must
pass the last seen bit *plus 1* to find_next_bit().

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
xen-unstable changeset: 9585:05db1d61e031d2fb48e561b185fa42981547db9a
xen-unstable date: Fri Apr  7 16:15:44 2006 +0100

diff -r b5d43db15746 -r 83e4c180f094 xen/arch/ia64/xen/irq.c
--- a/xen/arch/ia64/xen/irq.c   Thu Apr 27 14:14:26 2006 +0100
+++ b/xen/arch/ia64/xen/irq.c   Fri Apr 28 14:04:56 2006 +0100
@@ -1358,25 +1358,20 @@ int pirq_guest_unmask(struct domain *d)
 int pirq_guest_unmask(struct domain *d)
 {
     irq_desc_t    *desc;
-    int            i, j, pirq;
-    u32            m;
+    int            pirq;
     shared_info_t *s = d->shared_info;
 
-    for ( i = 0; i < ARRAY_SIZE(d->pirq_mask); i++ )
+    for ( pirq = find_first_bit(d->pirq_mask, NR_PIRQS);
+          pirq < NR_PIRQS;
+          pirq = find_next_bit(d->pirq_mask, NR_PIRQS, pirq+1) )
     {
-        m = d->pirq_mask[i];
-        while ( (j = ffs(m)) != 0 )
-        {
-            m &= ~(1 << --j);
-            pirq = (i << 5) + j;
-            desc = &irq_desc[pirq];
-            spin_lock_irq(&desc->lock);
-            if ( !test_bit(d->pirq_to_evtchn[pirq], &s->evtchn_mask[0]) &&
-                 test_and_clear_bit(pirq, &d->pirq_mask) &&
-                 (--((irq_guest_action_t *)desc->action)->in_flight == 0) )
-                desc->handler->end(pirq);
-            spin_unlock_irq(&desc->lock);
-        }
+        desc = &irq_desc[pirq];
+        spin_lock_irq(&desc->lock);
+        if ( !test_bit(d->pirq_to_evtchn[pirq], &s->evtchn_mask[0]) &&
+             test_and_clear_bit(pirq, &d->pirq_mask) &&
+             (--((irq_guest_action_t *)desc->action)->in_flight == 0) )
+            desc->handler->end(pirq);
+        spin_unlock_irq(&desc->lock);
     }
 
     return 0;
diff -r b5d43db15746 -r 83e4c180f094 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Thu Apr 27 14:14:26 2006 +0100
+++ b/xen/arch/x86/irq.c        Fri Apr 28 14:04:56 2006 +0100
@@ -171,26 +171,20 @@ int pirq_guest_unmask(struct domain *d)
 int pirq_guest_unmask(struct domain *d)
 {
     irq_desc_t    *desc;
-    unsigned int   i, j, pirq;
-    u32            m;
+    unsigned int   pirq;
     shared_info_t *s = d->shared_info;
 
-    for ( i = 0; i < ARRAY_SIZE(d->pirq_mask); i++ )
-    {
-        m = d->pirq_mask[i];
-        while ( m != 0 )
-        {
-            j = find_first_set_bit(m);
-            m &= ~(1 << j);
-            pirq = (i << 5) + j;
-            desc = &irq_desc[irq_to_vector(pirq)];
-            spin_lock_irq(&desc->lock);
-            if ( !test_bit(d->pirq_to_evtchn[pirq], &s->evtchn_mask[0]) &&
-                 test_and_clear_bit(pirq, &d->pirq_mask) &&
-                 (--((irq_guest_action_t *)desc->action)->in_flight == 0) )
-                desc->handler->end(irq_to_vector(pirq));
-            spin_unlock_irq(&desc->lock);
-        }
+    for ( pirq = find_first_bit(d->pirq_mask, NR_PIRQS);
+          pirq < NR_PIRQS;
+          pirq = find_next_bit(d->pirq_mask, NR_PIRQS, pirq+1) )
+    {
+        desc = &irq_desc[irq_to_vector(pirq)];
+        spin_lock_irq(&desc->lock);
+        if ( !test_bit(d->pirq_to_evtchn[pirq], &s->evtchn_mask[0]) &&
+             test_and_clear_bit(pirq, &d->pirq_mask) &&
+             (--((irq_guest_action_t *)desc->action)->in_flight == 0) )
+            desc->handler->end(irq_to_vector(pirq));
+        spin_unlock_irq(&desc->lock);
     }
 
     return 0;
diff -r b5d43db15746 -r 83e4c180f094 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h   Thu Apr 27 14:14:26 2006 +0100
+++ b/xen/include/xen/sched.h   Fri Apr 28 14:04:56 2006 +0100
@@ -133,7 +133,7 @@ struct domain
      */
 #define NR_PIRQS 256 /* Put this somewhere sane! */
     u16              pirq_to_evtchn[NR_PIRQS];
-    u32              pirq_mask[NR_PIRQS/32];
+    DECLARE_BITMAP(pirq_mask, NR_PIRQS);
 
     /* I/O capabilities (access to IRQs and memory-mapped I/O). */
     struct rangeset *iomem_caps;

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

<Prev in Thread] Current Thread [Next in Thread>