direct-io.hg

changeset 12041:159af40a1b37

[XEN] Add a warning to the i8259 if we generate spurious IRQs. Tidy up
a little while I'm here.

Signed-off-by: Steven Smith <sos22@cam.ac.uk>
author Steven Smith <ssmith@xensource.com>
date Tue Oct 31 11:44:28 2006 +0000 (2006-10-31)
parents 79a40acadb41
children 15b5cc51db30
files xen/arch/x86/hvm/i8259.c xen/include/asm-x86/hvm/vpic.h
line diff
     1.1 --- a/xen/arch/x86/hvm/i8259.c	Tue Oct 31 11:38:55 2006 +0000
     1.2 +++ b/xen/arch/x86/hvm/i8259.c	Tue Oct 31 11:44:28 2006 +0000
     1.3 @@ -210,7 +210,7 @@ static inline void pic_intack(PicState *
     1.4          s->irr &= ~(1 << irq);
     1.5  }
     1.6  
     1.7 -int pic_read_irq(struct hvm_virpic *s)
     1.8 +static int pic_read_irq(struct hvm_virpic *s)
     1.9  {
    1.10      int irq, irq2, intno;
    1.11      unsigned long flags;
    1.12 @@ -225,6 +225,7 @@ int pic_read_irq(struct hvm_virpic *s)
    1.13                  pic_intack(&s->pics[1], irq2);
    1.14              } else {
    1.15                  /* spurious IRQ on slave controller */
    1.16 +		gdprintk(XENLOG_WARNING, "Spurious irq on slave i8259.\n");
    1.17                  irq2 = 7;
    1.18              }
    1.19              intno = s->pics[1].irq_base + irq2;
    1.20 @@ -236,10 +237,11 @@ int pic_read_irq(struct hvm_virpic *s)
    1.21          /* spurious IRQ on host controller */
    1.22          irq = 7;
    1.23          intno = s->pics[0].irq_base + irq;
    1.24 +	gdprintk(XENLOG_WARNING, "Spurious irq on master i8259.\n");
    1.25      }
    1.26      pic_update_irq(s);
    1.27      spin_unlock_irqrestore(&s->lock, flags);
    1.28 -        
    1.29 +
    1.30      return intno;
    1.31  }
    1.32  
    1.33 @@ -430,24 +432,6 @@ static uint32_t pic_ioport_read(void *op
    1.34      return ret;
    1.35  }
    1.36  
    1.37 -/* memory mapped interrupt status */
    1.38 -/* XXX: may be the same than pic_read_rq() */
    1.39 -uint32_t pic_intack_read(struct hvm_virpic *s)
    1.40 -{
    1.41 -    int ret;
    1.42 -    unsigned long flags;
    1.43 -
    1.44 -    spin_lock_irqsave(&s->lock, flags);
    1.45 -    ret = pic_poll_read(&s->pics[0], 0x00);
    1.46 -    if (ret == 2)
    1.47 -        ret = pic_poll_read(&s->pics[1], 0x80) + 8;
    1.48 -    /* Prepare for ISR read */
    1.49 -    s->pics[0].read_reg_select = 1;
    1.50 -    spin_unlock_irqrestore(&s->lock, flags);
    1.51 -    
    1.52 -    return ret;
    1.53 -}
    1.54 -
    1.55  static void elcr_ioport_write(void *opaque, uint32_t addr, uint32_t val)
    1.56  {
    1.57      PicState *s = opaque;
     2.1 --- a/xen/include/asm-x86/hvm/vpic.h	Tue Oct 31 11:38:55 2006 +0000
     2.2 +++ b/xen/include/asm-x86/hvm/vpic.h	Tue Oct 31 11:44:28 2006 +0000
     2.3 @@ -70,9 +70,7 @@ void pic_set_irq_new(void *opaque, int i
     2.4  void pic_init(struct hvm_virpic *s, 
     2.5                void (*irq_request)(void *, int),
     2.6                void *irq_request_opaque);
     2.7 -int pic_read_irq(struct hvm_virpic *s);
     2.8  void pic_update_irq(struct hvm_virpic *s); /* Caller must hold s->lock */
     2.9 -uint32_t pic_intack_read(struct hvm_virpic *s);
    2.10  void register_pic_io_hook (void);
    2.11  int cpu_get_pic_interrupt(struct vcpu *v, int *type);
    2.12  int is_periodic_irq(struct vcpu *v, int irq, int type);