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 -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 07 Apr 2006 17:12:08 +0000
Delivery-date: Fri, 07 Apr 2006 10:13:09 -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 3b0d07af46cb0c456912b287a0365172746ae9e0
# Parent  b84517e3fc3042f4bfe822d39eca87be0fad5932
Turn pirq_mask into a generic bitmap type.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r b84517e3fc30 -r 3b0d07af46cb xen/arch/ia64/xen/irq.c
--- a/xen/arch/ia64/xen/irq.c   Fri Apr  7 13:26:02 2006
+++ b/xen/arch/ia64/xen/irq.c   Fri Apr  7 13:27:46 2006
@@ -1358,25 +1358,20 @@
 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) )
     {
-        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 b84517e3fc30 -r 3b0d07af46cb xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Fri Apr  7 13:26:02 2006
+++ b/xen/arch/x86/irq.c        Fri Apr  7 13:27:46 2006
@@ -171,26 +171,20 @@
 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) )
+    {
+        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 b84517e3fc30 -r 3b0d07af46cb xen/include/xen/sched.h
--- a/xen/include/xen/sched.h   Fri Apr  7 13:26:02 2006
+++ b/xen/include/xen/sched.h   Fri Apr  7 13:27:46 2006
@@ -134,7 +134,7 @@
      */
 #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>