ia64/xen-unstable

changeset 10745:129e981a7700

[powerpc] support additional interrupt controller types in xen/arch/x86/irq.c
PowerPC #includes xen/arch/x86/irq.c, so we need to support MPIC interrupt
controllers here.
From: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Jul 14 10:31:36 2006 +0100 (2006-07-14)
parents d51a5ca0fa99
children 80055bb36dc7
files xen/arch/x86/irq.c xen/include/xen/irq.h
line diff
     1.1 --- a/xen/arch/x86/irq.c	Fri Jul 14 10:23:52 2006 +0100
     1.2 +++ b/xen/arch/x86/irq.c	Fri Jul 14 10:31:36 2006 +0100
     1.3 @@ -387,10 +387,6 @@ int pirq_acktype(int irq)
     1.4      if ( !strcmp(desc->handler->typename, "IO-APIC-edge") )
     1.5          return ACKTYPE_NONE;
     1.6  
     1.7 -    /* Legacy PIC interrupts can be acknowledged from any CPU. */
     1.8 -    if ( !strcmp(desc->handler->typename, "XT-PIC") )
     1.9 -        return ACKTYPE_UNMASK;
    1.10 -
    1.11      /*
    1.12       * Level-triggered IO-APIC interrupts need to be acknowledged on the CPU
    1.13       * on which they were received. This is because we tickle the LAPIC to EOI.
    1.14 @@ -398,6 +394,17 @@ int pirq_acktype(int irq)
    1.15      if ( !strcmp(desc->handler->typename, "IO-APIC-level") )
    1.16          return ioapic_ack_new ? ACKTYPE_EOI : ACKTYPE_UNMASK;
    1.17  
    1.18 +    /* Legacy PIC interrupts can be acknowledged from any CPU. */
    1.19 +    if ( !strcmp(desc->handler->typename, "XT-PIC") )
    1.20 +        return ACKTYPE_UNMASK;
    1.21 +
    1.22 +    if ( strstr(desc->handler->typename, "MPIC") )
    1.23 +    {
    1.24 +        if ( desc->status & IRQ_LEVEL )
    1.25 +            return (desc->status & IRQ_PER_CPU) ? ACKTYPE_EOI : ACKTYPE_UNMASK;
    1.26 +        return ACKTYPE_NONE; /* edge-triggered => no final EOI */
    1.27 +    }
    1.28 +
    1.29      BUG();
    1.30      return 0;
    1.31  }
     2.1 --- a/xen/include/xen/irq.h	Fri Jul 14 10:23:52 2006 +0100
     2.2 +++ b/xen/include/xen/irq.h	Fri Jul 14 10:31:36 2006 +0100
     2.3 @@ -22,6 +22,7 @@ struct irqaction
     2.4  #define IRQ_PENDING	4	/* IRQ pending - replay on enable */
     2.5  #define IRQ_REPLAY	8	/* IRQ has been replayed but not acked yet */
     2.6  #define IRQ_GUEST       16      /* IRQ is handled by guest OS(es) */
     2.7 +#define IRQ_LEVEL       64      /* IRQ level triggered */
     2.8  #define IRQ_PER_CPU     256     /* IRQ is per CPU */
     2.9  
    2.10  /*