]> xenbits.xensource.com Git - xen.git/commitdiff
drivers: Remove some CONFIG_X86 ifdef'ery.
authorKeir Fraser <keir@xen.org>
Wed, 12 Sep 2012 19:54:23 +0000 (20:54 +0100)
committerKeir Fraser <keir@xen.org>
Wed, 12 Sep 2012 19:54:23 +0000 (20:54 +0100)
Not quite all, but a great deal was to specifically allow ia64 support
to be retrofitted to x86 platform code. Since we no longer support
ia64 we can happily remove the ifdefs. Any new platform which wanted
to share this code would likely need a different set of ifdefs in any
case, making it a brand new porting effort.

Signed-off-by: Keir Fraser <keir@xen.org>
12 files changed:
xen/drivers/acpi/numa.c
xen/drivers/acpi/pmstat.c
xen/drivers/cpufreq/cpufreq.c
xen/drivers/passthrough/ats.h
xen/drivers/passthrough/pci.c
xen/drivers/passthrough/vtd/dmar.c
xen/drivers/passthrough/vtd/extern.h
xen/drivers/passthrough/vtd/intremap.c
xen/drivers/passthrough/vtd/iommu.c
xen/drivers/passthrough/vtd/quirks.c
xen/drivers/passthrough/vtd/utils.c
xen/drivers/video/vesa.c

index 9f6f36f3282fd969fcc049352cb1000cac4a4314..ff99ffcfc60d9fe2903629fa35c1e4ef35ba3ab2 100644 (file)
@@ -121,16 +121,6 @@ static int __init acpi_parse_slit(struct acpi_table_header *table)
        return 0;
 }
 
-#ifndef CONFIG_X86
-void __init
-acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
-{
-       printk(KERN_WARNING PREFIX
-              "Found unsupported x2apic [0x%08x] SRAT entry\n", pa->apic_id);
-       return;
-}
-#endif
-
 static int __init
 acpi_parse_x2apic_affinity(struct acpi_subtable_header *header,
                           const unsigned long end)
index 909426901fad89a5a6ff17b2c50f29abaa9eeae3..6f266ef0b0ef27c0804951d0239c753b763bd2fb 100644 (file)
@@ -134,7 +134,6 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op)
         break;
     }
 
-#ifdef CONFIG_X86
     case PMSTAT_get_max_cx:
     {
         op->u.getcx.nr = pmstat_get_cx_nr(op->cpuid);
@@ -153,7 +152,6 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op)
         ret = pmstat_reset_cx_stat(op->cpuid);
         break;
     }
-#endif
 
     default:
         printk("not defined sub-hypercall @ do_get_pm_info\n");
index a15f6b50c303d438eda7792c72ac78aafe7c8337..1fea575374d3eb23076432e35536b01a299e62d4 100644 (file)
@@ -481,8 +481,7 @@ int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *dom0_px_in
 
     if ( dom0_px_info->flags & XEN_PX_PSD )
     {
-#ifdef CONFIG_X86
-        /* for X86, check domain coordination */
+        /* check domain coordination */
         if (dom0_px_info->shared_type != CPUFREQ_SHARED_TYPE_ALL &&
             dom0_px_info->shared_type != CPUFREQ_SHARED_TYPE_ANY &&
             dom0_px_info->shared_type != CPUFREQ_SHARED_TYPE_HW)
@@ -490,7 +489,6 @@ int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *dom0_px_in
             ret = -EINVAL;
             goto out;
         }
-#endif
 
         pxpt->shared_type = dom0_px_info->shared_type;
         memcpy ((void *)&pxpt->domain_info,
index a6efa893b2e49ef9d40ede7d2d44ec7935bf004e..0c9f1ffd63c8572b327c9fc0554eeb2a31862ee2 100644 (file)
@@ -26,8 +26,6 @@ struct pci_ats_dev {
     u16 ats_queue_depth;    /* ATS device invalidation queue depth */
 };
 
-#ifdef CONFIG_X86
-
 #define ATS_REG_CAP    4
 #define ATS_REG_CTL    6
 #define ATS_QUEUE_DEPTH_MASK     0xF
@@ -61,36 +59,5 @@ static inline int pci_ats_device(int seg, int bus, int devfn)
     return pci_find_ext_capability(seg, bus, devfn, PCI_EXT_CAP_ID_ATS);
 }
 
-#else
-
-#define ats_enabled 0
-static inline int enable_ats_device(int seg, int bus, int devfn)
-{
-    BUG();
-    return -ENOSYS;
-}
-
-static inline void disable_ats_device(int seg, int bus, int devfn)
-{
-    BUG();
-}
-
-static inline int pci_ats_enabled(int seg, int bus, int devfn)
-{
-    return 0;
-}
-
-static inline int pci_ats_device(int seg, int bus, int devfn)
-{
-    return 0;
-}
-
-static inline struct pci_ats_dev *get_ats_device(int seg, int bus, int devfn)
-{
-    return NULL;
-}
-
-#endif
-
 #endif /* _ATS_H_ */
 
index 6d08dc68fa0eb252f5e821edb7d21e93abf1304d..254c4c2dbab07b7800eca78167da362e0bab9095 100644 (file)
@@ -29,9 +29,7 @@
 #include <xen/radix-tree.h>
 #include <xen/tasklet.h>
 #include <xsm/xsm.h>
-#ifdef CONFIG_X86
 #include <asm/msi.h>
-#endif
 
 struct pci_seg {
     struct list_head alldevs_list;
index 3fbc5e6e3acb2cf7244e0df4660c35aaecb0c8bc..4acce79de406b47d95a47e6c78e00298846e139a 100644 (file)
@@ -520,7 +520,6 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
     if ( (ret = acpi_dmar_check_length(header, sizeof(*rmrr))) != 0 )
         return ret;
 
-#ifdef CONFIG_X86
     /* This check is here simply to detect when RMRR values are
      * not properly represented in the system memory map and
      * inform the user
@@ -534,7 +533,6 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header)
                 "iommu_inclusive_mapping=1 parameter may be needed.\n",
                 base_addr, end_addr);
     }
-#endif
 
     rmrru = xzalloc(struct acpi_rmrr_unit);
     if ( !rmrru )
@@ -775,14 +773,10 @@ out:
     return ret;
 }
 
-#ifdef CONFIG_X86
 #include <asm/tboot.h>
 /* ACPI tables may not be DMA protected by tboot, so use DMAR copy */
 /* SINIT saved in SinitMleData in TXT heap (which is DMA protected) */
 #define parse_dmar_table(h) tboot_parse_dmar_table(h)
-#else
-#define parse_dmar_table(h) acpi_table_parse(ACPI_SIG_DMAR, h)
-#endif
 
 int __init acpi_dmar_init(void)
 {
@@ -813,14 +807,8 @@ int platform_supports_intremap(void)
     return (dmar_flags & mask) == ACPI_DMAR_INTR_REMAP;
 }
 
-#ifdef CONFIG_X86
 int platform_supports_x2apic(void)
 {
     unsigned int mask = ACPI_DMAR_INTR_REMAP | ACPI_DMAR_X2APIC_OPT_OUT;
-
-    if (!cpu_has_x2apic)
-        return 0;
-
-    return (dmar_flags & mask) == ACPI_DMAR_INTR_REMAP;
+    return cpu_has_x2apic && ((dmar_flags & mask) == ACPI_DMAR_INTR_REMAP);
 }
-#endif
index 0823218e1597bd91260892481e403eac8cc97597..37bba8e80d9845d3ec75cc80df67d4a5ab7b0de5 100644 (file)
@@ -56,32 +56,12 @@ struct acpi_drhd_unit * ioapic_to_drhd(unsigned int apic_id);
 struct acpi_drhd_unit * iommu_to_drhd(struct iommu *iommu);
 struct acpi_rhsa_unit * drhd_to_rhsa(struct acpi_drhd_unit *drhd);
 
-#ifdef CONFIG_X86
 struct acpi_drhd_unit * find_ats_dev_drhd(struct iommu *iommu);
 
 int ats_device(const struct pci_dev *, const struct acpi_drhd_unit *);
 
 int dev_invalidate_iotlb(struct iommu *iommu, u16 did,
                          u64 addr, unsigned int size_order, u64 type);
-#else
-
-static inline struct acpi_drhd_unit *find_ats_dev_drhd(struct iommu *iommu)
-{
-    return NULL;
-}
-
-static inline int ats_device(const struct pci_dev *pdev,
-                             const struct acpi_drhd_unit *drhd)
-{
-    return 0;
-}
-
-static inline int dev_invalidate_iotlb(struct iommu *iommu, u16 did, u64 addr,
-                                       unsigned int size_order, u64 type)
-{
-    return 0;
-}
-#endif
 
 int qinval_device_iotlb(struct iommu *iommu,
                         u32 max_invs_pend, u16 sid, u16 size, u64 addr);
index 1a13a8264dbbef122291c9baa43d932818b8ac8c..24acd26baec9ebdaefe2197152a8a8f827402a2f 100644 (file)
 #include "vtd.h"
 #include "extern.h"
 
-#if defined(CONFIG_X86)
 #include <asm/apic.h>
 #include <asm/io_apic.h>
 #define nr_ioapic_entries(i)  nr_ioapic_entries[i]
-#endif
 
 /*
  * source validation type (SVT)
@@ -302,12 +300,10 @@ static int ioapic_rte_to_remap_entry(struct iommu *iommu,
 
     if ( rte_upper )
     {
-#if defined(CONFIG_X86)
         if ( x2apic_enabled )
             new_ire.lo.dst = value;
         else
             new_ire.lo.dst = (value >> 24) << 8;
-#endif
     }
     else
     {
@@ -316,12 +312,8 @@ static int ioapic_rte_to_remap_entry(struct iommu *iommu,
         new_ire.lo.dm = new_rte.dest_mode;
         new_ire.lo.tm = new_rte.trigger;
         new_ire.lo.dlm = new_rte.delivery_mode;
-#ifdef CONFIG_X86
         /* Hardware require RH = 1 for LPR delivery mode */
         new_ire.lo.rh = (new_ire.lo.dlm == dest_LowestPrio);
-#else
-        new_ire.lo.rh = 0;
-#endif
         new_ire.lo.avail = 0;
         new_ire.lo.res_1 = 0;
         new_ire.lo.vector = new_rte.vector;
@@ -422,8 +414,6 @@ void io_apic_write_remap_rte(
         __ioapic_write_entry(apic, ioapic_pin, 1, old_rte);
 }
 
-#if defined(CONFIG_X86)
-
 static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire)
 {
     int type;
@@ -678,7 +668,6 @@ void msi_msg_write_remap_rte(
 
     msi_msg_to_remap_entry(iommu, pdev, msi_desc, msg);
 }
-#endif
 
 int enable_intremap(struct iommu *iommu, int eim)
 {
@@ -725,10 +714,9 @@ int enable_intremap(struct iommu *iommu, int eim)
         ir_ctrl->iremap_num = 0;
     }
 
-#ifdef CONFIG_X86
     /* set extended interrupt mode bit */
     ir_ctrl->iremap_maddr |= eim ? IRTA_EIME : 0;
-#endif
+
     spin_lock_irqsave(&iommu->register_lock, flags);
 
     /* set size of the interrupt remapping table */
index 257d1a023b4fb140c229ba6edcc8f5f851acc920..2eae02502abff2b7f821daec86157532bdc1239c 100644 (file)
 #include <xen/softirq.h>
 #include <asm/msi.h>
 #include <asm/irq.h>
-#if defined(CONFIG_X86)
 #include <asm/hvm/vmx/vmx.h>
 #include <asm/p2m.h>
 #include <mach_apic.h>
-#endif
 #include "iommu.h"
 #include "dmar.h"
 #include "extern.h"
@@ -1070,7 +1068,6 @@ static void dma_msi_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
     unsigned long flags;
     struct iommu *iommu = desc->action->dev_id;
 
-#ifdef CONFIG_X86
     dest = set_desc_affinity(desc, mask);
     if (dest == BAD_APICID){
         dprintk(XENLOG_ERR VTDPREFIX, "Set iommu interrupt affinity error!\n");
@@ -1094,16 +1091,6 @@ static void dma_msi_set_affinity(struct irq_desc *desc, const cpumask_t *mask)
                     MSI_ADDR_REDIRECTION_CPU:
                     MSI_ADDR_REDIRECTION_LOWPRI;
     msg.address_lo |= MSI_ADDR_DEST_ID(dest & 0xff);
-#else
-    memset(&msg, 0, sizeof(msg));
-    msg.data = desc->arch.vector & 0xff;
-    msg.data |= 1 << 14;
-    msg.address_lo = (MSI_ADDRESS_HEADER << (MSI_ADDRESS_HEADER_SHIFT + 8));
-    msg.address_lo |= MSI_PHYSICAL_MODE << 2;
-    msg.address_lo |= MSI_REDIRECTION_HINT_MODE << 3;
-    dest = cpu_physical_id(cpumask_first(mask));
-    msg.address_lo |= dest << MSI_TARGET_CPU_SHIFT;
-#endif
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     dmar_writel(iommu->reg, DMAR_FEDATA_REG, msg.data);
@@ -1137,11 +1124,7 @@ static int __init iommu_set_interrupt(struct acpi_drhd_unit *drhd)
     }
 
     irq_desc[irq].handler = &dma_msi_type;
-#ifdef CONFIG_X86
     ret = request_irq(irq, iommu_page_fault, 0, "dmar", drhd->iommu);
-#else
-    ret = request_irq_vector(irq, iommu_page_fault, 0, "dmar", drhd->iommu);
-#endif
     if ( ret )
     {
         irq_desc[irq].handler = &no_irq_type;
index da79dd78bc5fff159dada33e056d5454d64f23ee..586be334d6c722e2807755402f54e3dc31ff6b2b 100644 (file)
@@ -132,12 +132,8 @@ static void __init map_igd_reg(void)
     igd_reg = (igd_mmio & IGD_BAR_MASK) + 0x2000;
 
     /* ioremap this physical page */
-#if defined(CONFIG_X86)
     set_fixmap_nocache(FIX_IGD_MMIO, igd_reg);
     igd_reg_va = (u8 *)fix_to_virt(FIX_IGD_MMIO);
-#else
-    igd_reg_va = ioremap_nocache(igd_reg, 0x1000);
-#endif
 }
 
 /*
@@ -363,7 +359,6 @@ void me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map)
  */
 void __init pci_vtd_quirk(struct pci_dev *pdev)
 {
-#ifdef CONFIG_X86
     int seg = pdev->seg;
     int bus = pdev->bus;
     int dev = PCI_SLOT(pdev->devfn);
@@ -376,5 +371,4 @@ void __init pci_vtd_quirk(struct pci_dev *pdev)
         val = pci_conf_read32(seg, bus, dev, func, 0x1AC);
         pci_conf_write32(seg, bus, dev, func, 0x1AC, val | (1 << 31));
     }
-#endif
 }
index a3868eb3e372d7b98a11d88552c9a592e7d3fcfe..558f779f2bd9e0489922878ef17c889489378fc5 100644 (file)
 #include "dmar.h"
 #include "vtd.h"
 #include "extern.h"
-
-#if defined(CONFIG_X86)
 #include <asm/io_apic.h>
-#endif
 
 int is_usb_device(u16 seg, u8 bus, u8 devfn)
 {
@@ -188,7 +185,6 @@ void print_vtd_entries(struct iommu *iommu, int bus, int devfn, u64 gmfn)
 
 static void dump_iommu_info(unsigned char key)
 {
-#if defined(CONFIG_X86)
     struct acpi_drhd_unit *drhd;
     struct iommu *iommu;
     int i;
@@ -300,9 +296,6 @@ static void dump_iommu_info(unsigned char key)
             }
         }
     }
-#else
-    printk("%s: not implemented for now\n", __func__);
-#endif
 }
 
 struct keyhandler dump_iommu_info_keyhandler = {
index 91b6001decb27fe572e82deb591cf8bfb8e3f9bf..e24eb97c4e9b9ced2dc5d0affb4f55ec3039d1d7 100644 (file)
@@ -151,8 +151,6 @@ void __init vesa_init(void)
     xfree(line_len);
 }
 
-#if defined(CONFIG_X86)
-
 #include <asm/mtrr.h>
 
 static unsigned int vesa_mtrr;
@@ -191,12 +189,6 @@ static void lfb_flush(void)
         __asm__ __volatile__ ("sfence" : : : "memory");
 }
 
-#else /* !defined(CONFIG_X86) */
-
-#define lfb_flush() ((void)0)
-
-#endif
-
 void __init vesa_endboot(bool_t keep)
 {
     if ( keep )