introduce iosapci ID, which is used to index DMA engine covering this iosapic.
Signed-off-by; Anthony Xu <anthony.xu@intel.com>
if (BAD_MADT_ENTRY(iosapic, end))
return -EINVAL;
+#ifndef XEN
return iosapic_init(iosapic->address, iosapic->global_irq_base);
+#else
+ return iosapic_init(iosapic->address, iosapic->global_irq_base,
+ iosapic->id);
+#endif
}
static unsigned int __initdata acpi_madt_rev;
unsigned char trigger : 1; /* trigger mode (see iosapic.h) */
} iosapic_intr_info[IA64_NUM_VECTORS];
+#ifndef XEN
static struct iosapic {
char __iomem *addr; /* base address of IOSAPIC */
unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */
unsigned short node; /* numa node association via pxm */
#endif
} iosapic_lists[NR_IOSAPICS];
+#else
+struct iosapic iosapic_lists[NR_IOSAPICS];
+#endif
static unsigned char pcat_compat __devinitdata; /* 8259 compatibility flag */
}
int __devinit
+#ifndef XEN
iosapic_init (unsigned long phys_addr, unsigned int gsi_base)
+#else
+iosapic_init (unsigned long phys_addr, unsigned int gsi_base, unsigned int id)
+#endif
{
int num_rte, err, index;
unsigned int isa_irq, ver;
iosapic_lists[index].addr = addr;
iosapic_lists[index].gsi_base = gsi_base;
iosapic_lists[index].num_rte = num_rte;
+#ifdef XEN
+ iosapic_lists[index].id = id;
+#endif
#ifdef CONFIG_NUMA
iosapic_lists[index].node = MAX_NUMNODES;
#endif
#define NR_IOSAPICS 256
+#ifdef XEN
+struct iosapic {
+ char __iomem *addr; /* base address of IOSAPIC */
+ unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */
+ unsigned short num_rte; /* number of RTE in this IOSAPIC */
+ int rtes_inuse; /* # of RTEs in use on this IOSAPIC */
+ unsigned int id; /* APIC ID */
+#ifdef CONFIG_NUMA
+ unsigned short node; /* numa node association via pxm */
+#endif
+};
+
+extern struct iosapic iosapic_lists[NR_IOSAPICS];
+
+static inline int find_iosapic_by_addr(unsigned long addr)
+{
+ int i;
+
+ for (i = 0; i < NR_IOSAPICS; i++) {
+ if ((unsigned long)iosapic_lists[i].addr == addr)
+ return i;
+ }
+
+ return -1;
+}
+#endif
+
+
static inline unsigned int iosapic_read(char __iomem *iosapic, unsigned int reg)
{
writel(reg, iosapic + IOSAPIC_REG_SELECT);
}
extern void __init iosapic_system_init (int pcat_compat);
+#ifndef XEN
extern int __devinit iosapic_init (unsigned long address,
unsigned int gsi_base);
+#else
+extern int __devinit iosapic_init (unsigned long address,
+ unsigned int gsi_base, unsigned int id);
+#endif
#ifdef CONFIG_HOTPLUG
extern int iosapic_remove (unsigned int gsi_base);
#else