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-ppc-devel

[XenPPC] [pushed] [ppc] use status bits for level/edge detection

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [pushed] [ppc] use status bits for level/edge detection
From: jimix@xxxxxxxxxxxxxx
Date: Wed, 19 Apr 2006 17:03:20 -0400
Delivery-date: Wed, 19 Apr 2006 14:02:51 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
changeset:   9943:a1a9a3b498d39ff29803a3d12af61a6041b35f01
tag:         tip
user:        jimix@xxxxxxxxxxxxxxxxxxxxx
date:        Wed Apr 19 17:02:59 2006 -0400
files:       xen/arch/ppc/mpic.c xen/arch/x86/irq.c xen/include/xen/irq.h
description:
[ppc] use status bits for level/edge detection


diff -r 92867e8ea266d01daa29edd78c0edb59b7f47992 -r 
a1a9a3b498d39ff29803a3d12af61a6041b35f01 xen/arch/ppc/mpic.c
--- a/xen/arch/ppc/mpic.c       Wed Apr 19 17:01:42 2006 -0400
+++ b/xen/arch/ppc/mpic.c       Wed Apr 19 17:02:59 2006 -0400
@@ -32,7 +32,6 @@ typedef int irqreturn_t;
 #define IRQ_POLARITY_MASK      0x2
 #define IRQ_POLARITY_POSITIVE  0x2     /* high level or low->high edge */
 #define IRQ_POLARITY_NEGATIVE  0x0     /* low level or high->low edge */
-#define IRQ_LEVEL      64      /* IRQ level triggered */
 
 #define CONFIG_IRQ_ALL_CPUS 0
 #define distribute_irqs        CONFIG_IRQ_ALL_CPUS
diff -r 92867e8ea266d01daa29edd78c0edb59b7f47992 -r 
a1a9a3b498d39ff29803a3d12af61a6041b35f01 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c        Wed Apr 19 17:01:42 2006 -0400
+++ b/xen/arch/x86/irq.c        Wed Apr 19 17:02:59 2006 -0400
@@ -198,7 +198,7 @@ static void __do_IRQ_guest(int vector)
     {
         d = action->guest[i];
         if ( (action->ack_type != ACKTYPE_NONE) &&
-             !test_and_set_bit(irq, &d->pirq_mask[0]) )
+             !test_and_set_bit(irq, d->pirq_mask) )
             action->in_flight++;
         send_guest_pirq(d, irq);
     }
@@ -285,7 +285,7 @@ static void flush_all_pending_eoi(void *
         ASSERT(action->ack_type == ACKTYPE_EOI);
         ASSERT(desc->status & IRQ_GUEST);
         for ( i = 0; i < action->nr_guests; i++ )
-            clear_bit(vector_to_irq(vector), &action->guest[i]->pirq_mask[0]);
+            clear_bit(vector_to_irq(vector), action->guest[i]->pirq_mask);
         action->in_flight = 0;
         spin_unlock(&desc->lock);
     }
@@ -310,8 +310,8 @@ int pirq_guest_unmask(struct domain *d)
 
         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[0]) )
+        if ( !test_bit(d->pirq_to_evtchn[pirq], s->evtchn_mask) &&
+             test_and_clear_bit(pirq, d->pirq_mask) )
         {
             ASSERT(action->ack_type != ACKTYPE_NONE);
             if ( --action->in_flight == 0 )
@@ -356,14 +356,6 @@ int pirq_acktype(int irq)
 
     desc = &irq_desc[vector];
 
-#if defined (__powerpc__)
-#define IRQ_LEVEL 64
-    if (desc->status & IRQ_LEVEL)
-        return ACKTYPE_UNMASK;
-    else
-        return ACKTYPE_NONE;
-#endif /* defined (__powerpc__) */
-
     /*
      * Edge-triggered IO-APIC interrupts need no final acknowledgement:
      * we ACK early during interrupt processing.
@@ -385,6 +377,16 @@ int pirq_acktype(int irq)
     /* Legacy PIC interrupts can be acknowledged from any CPU. */
     if ( !strcmp(desc->handler->typename, "XT-PIC") )
         return ACKTYPE_UNMASK;
+
+    if ( strstr(desc->handler->typename, "MPIC") ) {
+        if (desc->status & IRQ_LEVEL) {
+            if (desc->status & IRQ_PER_CPU)
+                return ACKTYPE_EOI;
+            else
+                return ACKTYPE_UNMASK;
+        }
+        return ACKTYPE_NONE;
+    }
 
     BUG();
     return 0;
@@ -505,13 +507,13 @@ int pirq_guest_unbind(struct domain *d, 
     switch ( action->ack_type )
     {
     case ACKTYPE_UNMASK:
-        if ( test_and_clear_bit(irq, &d->pirq_mask[0]) &&
+        if ( test_and_clear_bit(irq, d->pirq_mask) &&
              (--action->in_flight == 0) )
             desc->handler->end(vector);
         break;
     case ACKTYPE_EOI:
         /* NB. If #guests == 0 then we clear the eoi_map later on. */
-        if ( test_and_clear_bit(irq, &d->pirq_mask[0]) &&
+        if ( test_and_clear_bit(irq, d->pirq_mask) &&
              (--action->in_flight == 0) &&
              (action->nr_guests != 0) )
         {
@@ -523,7 +525,7 @@ int pirq_guest_unbind(struct domain *d, 
         break;
     }
 
-    BUG_ON(test_bit(irq, &d->pirq_mask[0]));
+    BUG_ON(test_bit(irq, d->pirq_mask));
 
     if ( action->nr_guests != 0 )
         goto out;
@@ -599,16 +601,16 @@ static void dump_irqs(unsigned char key)
                 printk("%u(%c%c%c%c)",
                        d->domain_id,
                        (test_bit(d->pirq_to_evtchn[irq],
-                                 &d->shared_info->evtchn_pending[0]) ?
+                                 d->shared_info->evtchn_pending) ?
                         'P' : '-'),
                        (test_bit(d->pirq_to_evtchn[irq]/BITS_PER_LONG,
                                  &d->shared_info->vcpu_info[0].
                                  evtchn_pending_sel) ?
                         'S' : '-'),
                        (test_bit(d->pirq_to_evtchn[irq],
-                                 &d->shared_info->evtchn_mask[0]) ?
+                                 d->shared_info->evtchn_mask) ?
                         'M' : '-'),
-                       (test_bit(irq, &d->pirq_mask[0]) ?
+                       (test_bit(irq, d->pirq_mask) ?
                         'M' : '-'));
                 if ( i != action->nr_guests )
                     printk(",");
diff -r 92867e8ea266d01daa29edd78c0edb59b7f47992 -r 
a1a9a3b498d39ff29803a3d12af61a6041b35f01 xen/include/xen/irq.h
--- a/xen/include/xen/irq.h     Wed Apr 19 17:01:42 2006 -0400
+++ b/xen/include/xen/irq.h     Wed Apr 19 17:02:59 2006 -0400
@@ -22,6 +22,7 @@ struct irqaction
 #define IRQ_PENDING    4       /* IRQ pending - replay on enable */
 #define IRQ_REPLAY     8       /* IRQ has been replayed but not acked yet */
 #define IRQ_GUEST       16      /* IRQ is handled by guest OS(es) */
+#define IRQ_LEVEL              64      /* IRQ level triggered */
 #define IRQ_PER_CPU     256     /* IRQ is per CPU */
 
 /*



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

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [pushed] [ppc] use status bits for level/edge detection, jimix <=