drivers: Remove some CONFIG_X86 ifdef'ery.

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>
This commit is contained in:
Keir Fraser committed 2012-09-12 20:54:23 +01:00
1 parent a9c02a0d88
commit 4e11d97bd9
12 files changed
+3 -134

No files matched your search

-10
View 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)
-2
View 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");
+1 -3
View 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,
-33
View 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_ */
-2
View 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;
+1 -13
View 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
-20
View 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);
+1 -13
View File
@@ -31,11 +31,9 @@
#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 */
-17
View File
@@ -34,11 +34,9 @@
#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;
-6
View 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
}
-7
View File
@@ -27,10 +27,7 @@
#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 = {
-8
View 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 )
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.