ia64/xen-unstable

changeset 18631:5450b008afce

[IA64] rename struct viosapic_rte in order to share VTD code.

VTD code uses vioapic_redir_entry structure,
This patch lets viosapci.h use the same structure name and some fields.
That IA64 can use the same VTD code with ia32

Signed-off-by: Anthony xu <anthony.xu@intel.com>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Thu Oct 16 11:33:05 2008 +0900 (2008-10-16)
parents 91ec8f01d6b9
children 7db30bf36b0e
files xen/arch/ia64/vmx/viosapic.c xen/include/asm-ia64/viosapic.h xen/include/public/arch-ia64/hvm/save.h
line diff
     1.1 --- a/xen/arch/ia64/vmx/viosapic.c	Thu Oct 16 11:33:05 2008 +0900
     1.2 +++ b/xen/arch/ia64/vmx/viosapic.c	Thu Oct 16 11:33:05 2008 +0900
     1.3 @@ -46,9 +46,9 @@
     1.4  
     1.5  static void viosapic_deliver(struct viosapic *viosapic, int irq)
     1.6  {
     1.7 -    uint16_t dest = viosapic->redirtbl[irq].dest_id;
     1.8 -    uint8_t delivery_mode = viosapic->redirtbl[irq].delivery_mode;
     1.9 -    uint8_t vector = viosapic->redirtbl[irq].vector;
    1.10 +    uint16_t dest = viosapic->redirtbl[irq].fields.dest_id;
    1.11 +    uint8_t delivery_mode = viosapic->redirtbl[irq].fields.delivery_mode;
    1.12 +    uint8_t vector = viosapic->redirtbl[irq].fields.vector;
    1.13  
    1.14      ASSERT(spin_is_locked(&viosapic->lock));
    1.15  
    1.16 @@ -78,7 +78,7 @@ static int get_redir_num(struct viosapic
    1.17  
    1.18      ASSERT(spin_is_locked(&viosapic->lock));
    1.19      for ( i = 0; i < VIOSAPIC_NUM_PINS; i++ )
    1.20 -        if ( viosapic->redirtbl[i].vector == vector )
    1.21 +        if ( viosapic->redirtbl[i].fields.vector == vector )
    1.22              return i;
    1.23  
    1.24      return -1;
    1.25 @@ -91,7 +91,7 @@ static void service_iosapic(struct viosa
    1.26  
    1.27      while ( (irq = iosapic_get_highest_irq(viosapic)) != -1 )
    1.28      {
    1.29 -        if ( viosapic->redirtbl[irq].trig_mode == SAPIC_LEVEL )
    1.30 +        if ( viosapic->redirtbl[irq].fields.trig_mode == SAPIC_LEVEL )
    1.31              viosapic->isr |= (1UL << irq);
    1.32  
    1.33          viosapic_deliver(viosapic, irq);
    1.34 @@ -116,7 +116,7 @@ static void viosapic_update_EOI(struct v
    1.35      if ( !test_and_clear_bit(redir_num, &viosapic->isr) )
    1.36      {
    1.37          spin_unlock(&viosapic->lock);
    1.38 -        if ( viosapic->redirtbl[redir_num].trig_mode == SAPIC_LEVEL )
    1.39 +        if ( viosapic->redirtbl[redir_num].fields.trig_mode == SAPIC_LEVEL )
    1.40              gdprintk(XENLOG_WARNING, "redir %d not set for %d EOI\n",
    1.41                       redir_num, vector);
    1.42          return;
    1.43 @@ -278,7 +278,7 @@ static void viosapic_reset(struct viosap
    1.44  
    1.45      for ( i = 0; i < VIOSAPIC_NUM_PINS; i++ )
    1.46      {
    1.47 -        viosapic->redirtbl[i].mask = 0x1;
    1.48 +        viosapic->redirtbl[i].fields.mask = 0x1;
    1.49      }
    1.50      spin_lock_init(&viosapic->lock);
    1.51  }
    1.52 @@ -292,11 +292,11 @@ void viosapic_set_irq(struct domain *d, 
    1.53      if ( (irq < 0) || (irq >= VIOSAPIC_NUM_PINS) )
    1.54          goto out;
    1.55  
    1.56 -    if ( viosapic->redirtbl[irq].mask )
    1.57 +    if ( viosapic->redirtbl[irq].fields.mask )
    1.58          goto out;
    1.59  
    1.60      bit = 1UL << irq;
    1.61 -    if ( viosapic->redirtbl[irq].trig_mode == SAPIC_LEVEL )
    1.62 +    if ( viosapic->redirtbl[irq].fields.trig_mode == SAPIC_LEVEL )
    1.63      {
    1.64          if ( level )
    1.65              viosapic->irr |= bit;
     2.1 --- a/xen/include/asm-ia64/viosapic.h	Thu Oct 16 11:33:05 2008 +0900
     2.2 +++ b/xen/include/asm-ia64/viosapic.h	Thu Oct 16 11:33:05 2008 +0900
     2.3 @@ -59,7 +59,7 @@ struct viosapic {
     2.4      spinlock_t lock;
     2.5      struct vcpu * lowest_vcpu;
     2.6      uint64_t base_address;
     2.7 -    union viosapic_rte redirtbl[VIOSAPIC_NUM_PINS];
     2.8 +    union vioapic_redir_entry redirtbl[VIOSAPIC_NUM_PINS];
     2.9  };
    2.10  
    2.11  void viosapic_init(struct domain *d);
     3.1 --- a/xen/include/public/arch-ia64/hvm/save.h	Thu Oct 16 11:33:05 2008 +0900
     3.2 +++ b/xen/include/public/arch-ia64/hvm/save.h	Thu Oct 16 11:33:05 2008 +0900
     3.3 @@ -106,7 +106,11 @@ DECLARE_HVM_SAVE_TYPE(VTIME, 5, struct h
     3.4   */
     3.5  #define VIOSAPIC_NUM_PINS     48
     3.6  
     3.7 -union viosapic_rte
     3.8 +/* To share VT-d code which uses vioapic_redir_entry.
     3.9 + * Although on ia64 this is for vsapic, but we have to vioapic_redir_entry
    3.10 + * instead of viosapic_redir_entry.
    3.11 + */
    3.12 +union vioapic_redir_entry
    3.13  {
    3.14      uint64_t bits;
    3.15      struct {
    3.16 @@ -124,7 +128,7 @@ union viosapic_rte
    3.17  
    3.18          uint8_t reserved[3];
    3.19          uint16_t dest_id;
    3.20 -    }; 
    3.21 +    } fields;
    3.22  };
    3.23  
    3.24  struct hvm_hw_ia64_viosapic {
    3.25 @@ -134,7 +138,7 @@ struct hvm_hw_ia64_viosapic {
    3.26      uint32_t    pad;
    3.27      uint64_t    lowest_vcpu_id;
    3.28      uint64_t    base_address;
    3.29 -    union viosapic_rte  redirtbl[VIOSAPIC_NUM_PINS];
    3.30 +    union vioapic_redir_entry  redirtbl[VIOSAPIC_NUM_PINS];
    3.31  };
    3.32  DECLARE_HVM_SAVE_TYPE(VIOSAPIC, 6, struct hvm_hw_ia64_viosapic);
    3.33