[XEN] Add a warning to the i8259 if we generate spurious IRQs. Tidy up
authorSteven Smith <ssmith@xensource.com>
Tue, 31 Oct 2006 11:44:28 +0000 (11:44 +0000)
committerSteven Smith <ssmith@xensource.com>
Tue, 31 Oct 2006 11:44:28 +0000 (11:44 +0000)
a little while I'm here.

Signed-off-by: Steven Smith <sos22@cam.ac.uk>
xen/arch/x86/hvm/i8259.c
xen/include/asm-x86/hvm/vpic.h

index 7cf96f4b57620209d8e0415d06cf587f416b5ed4..470b9e70c1eae711d1976c6589f411f21cc46793 100644 (file)
@@ -210,7 +210,7 @@ static inline void pic_intack(PicState *s, int irq)
         s->irr &= ~(1 << irq);
 }
 
-int pic_read_irq(struct hvm_virpic *s)
+static int pic_read_irq(struct hvm_virpic *s)
 {
     int irq, irq2, intno;
     unsigned long flags;
@@ -225,6 +225,7 @@ int pic_read_irq(struct hvm_virpic *s)
                 pic_intack(&s->pics[1], irq2);
             } else {
                 /* spurious IRQ on slave controller */
+               gdprintk(XENLOG_WARNING, "Spurious irq on slave i8259.\n");
                 irq2 = 7;
             }
             intno = s->pics[1].irq_base + irq2;
@@ -236,10 +237,11 @@ int pic_read_irq(struct hvm_virpic *s)
         /* spurious IRQ on host controller */
         irq = 7;
         intno = s->pics[0].irq_base + irq;
+       gdprintk(XENLOG_WARNING, "Spurious irq on master i8259.\n");
     }
     pic_update_irq(s);
     spin_unlock_irqrestore(&s->lock, flags);
-        
+
     return intno;
 }
 
@@ -430,24 +432,6 @@ static uint32_t pic_ioport_read(void *opaque, uint32_t addr1)
     return ret;
 }
 
-/* memory mapped interrupt status */
-/* XXX: may be the same than pic_read_rq() */
-uint32_t pic_intack_read(struct hvm_virpic *s)
-{
-    int ret;
-    unsigned long flags;
-
-    spin_lock_irqsave(&s->lock, flags);
-    ret = pic_poll_read(&s->pics[0], 0x00);
-    if (ret == 2)
-        ret = pic_poll_read(&s->pics[1], 0x80) + 8;
-    /* Prepare for ISR read */
-    s->pics[0].read_reg_select = 1;
-    spin_unlock_irqrestore(&s->lock, flags);
-    
-    return ret;
-}
-
 static void elcr_ioport_write(void *opaque, uint32_t addr, uint32_t val)
 {
     PicState *s = opaque;
index 8e2d386e59e4e0a08fb9cbaf3347cafa2d6dff0c..67f229f04a4afec80af3f7feb8a674ed369572f4 100644 (file)
@@ -70,9 +70,7 @@ void pic_set_irq_new(void *opaque, int irq, int level);
 void pic_init(struct hvm_virpic *s, 
               void (*irq_request)(void *, int),
               void *irq_request_opaque);
-int pic_read_irq(struct hvm_virpic *s);
 void pic_update_irq(struct hvm_virpic *s); /* Caller must hold s->lock */
-uint32_t pic_intack_read(struct hvm_virpic *s);
 void register_pic_io_hook (void);
 int cpu_get_pic_interrupt(struct vcpu *v, int *type);
 int is_periodic_irq(struct vcpu *v, int irq, int type);