# HG changeset patch
# User Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
# Date 1224124385 -32400
# Node ID 5450b008afcec7a5184a0124aab3be639933aec8
# Parent 91ec8f01d6b916af846acda6e949b80523aea3cd
[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@xxxxxxxxx>
---
xen/arch/ia64/vmx/viosapic.c | 18 +++++++++---------
xen/include/asm-ia64/viosapic.h | 2 +-
xen/include/public/arch-ia64/hvm/save.h | 10 +++++++---
3 files changed, 17 insertions(+), 13 deletions(-)
diff -r 91ec8f01d6b9 -r 5450b008afce xen/arch/ia64/vmx/viosapic.c
--- a/xen/arch/ia64/vmx/viosapic.c Thu Oct 16 11:33:05 2008 +0900
+++ b/xen/arch/ia64/vmx/viosapic.c Thu Oct 16 11:33:05 2008 +0900
@@ -46,9 +46,9 @@
static void viosapic_deliver(struct viosapic *viosapic, int irq)
{
- uint16_t dest = viosapic->redirtbl[irq].dest_id;
- uint8_t delivery_mode = viosapic->redirtbl[irq].delivery_mode;
- uint8_t vector = viosapic->redirtbl[irq].vector;
+ uint16_t dest = viosapic->redirtbl[irq].fields.dest_id;
+ uint8_t delivery_mode = viosapic->redirtbl[irq].fields.delivery_mode;
+ uint8_t vector = viosapic->redirtbl[irq].fields.vector;
ASSERT(spin_is_locked(&viosapic->lock));
@@ -78,7 +78,7 @@ static int get_redir_num(struct viosapic
ASSERT(spin_is_locked(&viosapic->lock));
for ( i = 0; i < VIOSAPIC_NUM_PINS; i++ )
- if ( viosapic->redirtbl[i].vector == vector )
+ if ( viosapic->redirtbl[i].fields.vector == vector )
return i;
return -1;
@@ -91,7 +91,7 @@ static void service_iosapic(struct viosa
while ( (irq = iosapic_get_highest_irq(viosapic)) != -1 )
{
- if ( viosapic->redirtbl[irq].trig_mode == SAPIC_LEVEL )
+ if ( viosapic->redirtbl[irq].fields.trig_mode == SAPIC_LEVEL )
viosapic->isr |= (1UL << irq);
viosapic_deliver(viosapic, irq);
@@ -116,7 +116,7 @@ static void viosapic_update_EOI(struct v
if ( !test_and_clear_bit(redir_num, &viosapic->isr) )
{
spin_unlock(&viosapic->lock);
- if ( viosapic->redirtbl[redir_num].trig_mode == SAPIC_LEVEL )
+ if ( viosapic->redirtbl[redir_num].fields.trig_mode == SAPIC_LEVEL )
gdprintk(XENLOG_WARNING, "redir %d not set for %d EOI\n",
redir_num, vector);
return;
@@ -278,7 +278,7 @@ static void viosapic_reset(struct viosap
for ( i = 0; i < VIOSAPIC_NUM_PINS; i++ )
{
- viosapic->redirtbl[i].mask = 0x1;
+ viosapic->redirtbl[i].fields.mask = 0x1;
}
spin_lock_init(&viosapic->lock);
}
@@ -292,11 +292,11 @@ void viosapic_set_irq(struct domain *d,
if ( (irq < 0) || (irq >= VIOSAPIC_NUM_PINS) )
goto out;
- if ( viosapic->redirtbl[irq].mask )
+ if ( viosapic->redirtbl[irq].fields.mask )
goto out;
bit = 1UL << irq;
- if ( viosapic->redirtbl[irq].trig_mode == SAPIC_LEVEL )
+ if ( viosapic->redirtbl[irq].fields.trig_mode == SAPIC_LEVEL )
{
if ( level )
viosapic->irr |= bit;
diff -r 91ec8f01d6b9 -r 5450b008afce xen/include/asm-ia64/viosapic.h
--- a/xen/include/asm-ia64/viosapic.h Thu Oct 16 11:33:05 2008 +0900
+++ b/xen/include/asm-ia64/viosapic.h Thu Oct 16 11:33:05 2008 +0900
@@ -59,7 +59,7 @@ struct viosapic {
spinlock_t lock;
struct vcpu * lowest_vcpu;
uint64_t base_address;
- union viosapic_rte redirtbl[VIOSAPIC_NUM_PINS];
+ union vioapic_redir_entry redirtbl[VIOSAPIC_NUM_PINS];
};
void viosapic_init(struct domain *d);
diff -r 91ec8f01d6b9 -r 5450b008afce xen/include/public/arch-ia64/hvm/save.h
--- a/xen/include/public/arch-ia64/hvm/save.h Thu Oct 16 11:33:05 2008 +0900
+++ b/xen/include/public/arch-ia64/hvm/save.h Thu Oct 16 11:33:05 2008 +0900
@@ -106,7 +106,11 @@ DECLARE_HVM_SAVE_TYPE(VTIME, 5, struct h
*/
#define VIOSAPIC_NUM_PINS 48
-union viosapic_rte
+/* To share VT-d code which uses vioapic_redir_entry.
+ * Although on ia64 this is for vsapic, but we have to vioapic_redir_entry
+ * instead of viosapic_redir_entry.
+ */
+union vioapic_redir_entry
{
uint64_t bits;
struct {
@@ -124,7 +128,7 @@ union viosapic_rte
uint8_t reserved[3];
uint16_t dest_id;
- };
+ } fields;
};
struct hvm_hw_ia64_viosapic {
@@ -134,7 +138,7 @@ struct hvm_hw_ia64_viosapic {
uint32_t pad;
uint64_t lowest_vcpu_id;
uint64_t base_address;
- union viosapic_rte redirtbl[VIOSAPIC_NUM_PINS];
+ union vioapic_redir_entry redirtbl[VIOSAPIC_NUM_PINS];
};
DECLARE_HVM_SAVE_TYPE(VIOSAPIC, 6, struct hvm_hw_ia64_viosapic);
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|