ia64/xen-unstable
changeset 18658:10a2069a1edb
Define a macro IO_APIC_ID() for x86.
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Mon Oct 20 15:13:50 2008 +0100 (2008-10-20) |
parents | e57ca7937ae8 |
children | d752eaa7c1db |
files | xen/drivers/passthrough/vtd/intremap.c xen/include/asm-x86/io_apic.h |
line diff
1.1 --- a/xen/drivers/passthrough/vtd/intremap.c Mon Oct 20 15:13:02 2008 +0100 1.2 +++ b/xen/drivers/passthrough/vtd/intremap.c Mon Oct 20 15:13:50 2008 +0100 1.3 @@ -21,6 +21,7 @@ 1.4 #include <xen/irq.h> 1.5 #include <xen/sched.h> 1.6 #include <xen/iommu.h> 1.7 +#include <asm/hvm/iommu.h> 1.8 #include <xen/time.h> 1.9 #include <xen/pci.h> 1.10 #include <xen/pci_regs.h> 1.11 @@ -179,7 +180,7 @@ unsigned int io_apic_read_remap_rte( 1.12 struct IO_xAPIC_route_entry old_rte = { 0 }; 1.13 struct IO_APIC_route_remap_entry *remap_rte; 1.14 int rte_upper = (reg & 1) ? 1 : 0; 1.15 - struct iommu *iommu = ioapic_to_iommu(mp_ioapics[apic].mpc_apicid); 1.16 + struct iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic)); 1.17 struct ir_ctrl *ir_ctrl = iommu_ir_ctrl(iommu); 1.18 1.19 if ( !iommu || !ir_ctrl || ir_ctrl->iremap_maddr == 0 || 1.20 @@ -224,7 +225,7 @@ void io_apic_write_remap_rte( 1.21 struct IO_xAPIC_route_entry old_rte = { 0 }; 1.22 struct IO_APIC_route_remap_entry *remap_rte; 1.23 unsigned int rte_upper = (reg & 1) ? 1 : 0; 1.24 - struct iommu *iommu = ioapic_to_iommu(mp_ioapics[apic].mpc_apicid); 1.25 + struct iommu *iommu = ioapic_to_iommu(IO_APIC_ID(apic)); 1.26 struct ir_ctrl *ir_ctrl = iommu_ir_ctrl(iommu); 1.27 int saved_mask; 1.28 1.29 @@ -253,7 +254,7 @@ void io_apic_write_remap_rte( 1.30 *(IO_APIC_BASE(apic)+4) = *(((int *)&old_rte)+0); 1.31 remap_rte->mask = saved_mask; 1.32 1.33 - if ( ioapic_rte_to_remap_entry(iommu, mp_ioapics[apic].mpc_apicid, 1.34 + if ( ioapic_rte_to_remap_entry(iommu, IO_APIC_ID(apic), 1.35 &old_rte, rte_upper, value) ) 1.36 { 1.37 *IO_APIC_BASE(apic) = rte_upper ? (reg + 1) : reg;
2.1 --- a/xen/include/asm-x86/io_apic.h Mon Oct 20 15:13:02 2008 +0100 2.2 +++ b/xen/include/asm-x86/io_apic.h Mon Oct 20 15:13:50 2008 +0100 2.3 @@ -20,6 +20,8 @@ 2.4 ((volatile int *)(__fix_to_virt(FIX_IO_APIC_BASE_0 + idx) \ 2.5 + (mp_ioapics[idx].mpc_apicaddr & ~PAGE_MASK))) 2.6 2.7 +#define IO_APIC_ID(idx) (mp_ioapics[idx].mpc_apicid) 2.8 + 2.9 /* 2.10 * The structure of the IO-APIC: 2.11 */