ia64/xen-unstable
changeset 18585:af8eaa3cf782
[IA64] introduce iosapci ID.
introduce iosapci ID, which is used to index DMA engine covering this iosapic.
Signed-off-by; Anthony Xu <anthony.xu@intel.com>
introduce iosapci ID, which is used to index DMA engine covering this iosapic.
Signed-off-by; Anthony Xu <anthony.xu@intel.com>
author | Isaku Yamahata <yamahata@valinux.co.jp> |
---|---|
date | Fri Oct 10 11:58:03 2008 +0900 (2008-10-10) |
parents | 1a77bb358d7b |
children | c2fc4d26ef18 |
files | xen/arch/ia64/linux-xen/acpi.c xen/arch/ia64/linux-xen/iosapic.c xen/include/asm-ia64/linux-xen/asm/iosapic.h |
line diff
1.1 --- a/xen/arch/ia64/linux-xen/acpi.c Fri Oct 10 11:57:23 2008 +0900 1.2 +++ b/xen/arch/ia64/linux-xen/acpi.c Fri Oct 10 11:58:03 2008 +0900 1.3 @@ -294,7 +294,12 @@ acpi_parse_iosapic(struct acpi_subtable_ 1.4 if (BAD_MADT_ENTRY(iosapic, end)) 1.5 return -EINVAL; 1.6 1.7 +#ifndef XEN 1.8 return iosapic_init(iosapic->address, iosapic->global_irq_base); 1.9 +#else 1.10 + return iosapic_init(iosapic->address, iosapic->global_irq_base, 1.11 + iosapic->id); 1.12 +#endif 1.13 } 1.14 1.15 static unsigned int __initdata acpi_madt_rev;
2.1 --- a/xen/arch/ia64/linux-xen/iosapic.c Fri Oct 10 11:57:23 2008 +0900 2.2 +++ b/xen/arch/ia64/linux-xen/iosapic.c Fri Oct 10 11:58:03 2008 +0900 2.3 @@ -128,6 +128,7 @@ static struct iosapic_intr_info { 2.4 unsigned char trigger : 1; /* trigger mode (see iosapic.h) */ 2.5 } iosapic_intr_info[IA64_NUM_VECTORS]; 2.6 2.7 +#ifndef XEN 2.8 static struct iosapic { 2.9 char __iomem *addr; /* base address of IOSAPIC */ 2.10 unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */ 2.11 @@ -137,6 +138,9 @@ static struct iosapic { 2.12 unsigned short node; /* numa node association via pxm */ 2.13 #endif 2.14 } iosapic_lists[NR_IOSAPICS]; 2.15 +#else 2.16 +struct iosapic iosapic_lists[NR_IOSAPICS]; 2.17 +#endif 2.18 2.19 static unsigned char pcat_compat __devinitdata; /* 8259 compatibility flag */ 2.20 2.21 @@ -1035,7 +1039,11 @@ iosapic_check_gsi_range (unsigned int gs 2.22 } 2.23 2.24 int __devinit 2.25 +#ifndef XEN 2.26 iosapic_init (unsigned long phys_addr, unsigned int gsi_base) 2.27 +#else 2.28 +iosapic_init (unsigned long phys_addr, unsigned int gsi_base, unsigned int id) 2.29 +#endif 2.30 { 2.31 int num_rte, err, index; 2.32 unsigned int isa_irq, ver; 2.33 @@ -1064,6 +1072,9 @@ iosapic_init (unsigned long phys_addr, u 2.34 iosapic_lists[index].addr = addr; 2.35 iosapic_lists[index].gsi_base = gsi_base; 2.36 iosapic_lists[index].num_rte = num_rte; 2.37 +#ifdef XEN 2.38 + iosapic_lists[index].id = id; 2.39 +#endif 2.40 #ifdef CONFIG_NUMA 2.41 iosapic_lists[index].node = MAX_NUMNODES; 2.42 #endif
3.1 --- a/xen/include/asm-ia64/linux-xen/asm/iosapic.h Fri Oct 10 11:57:23 2008 +0900 3.2 +++ b/xen/include/asm-ia64/linux-xen/asm/iosapic.h Fri Oct 10 11:58:03 2008 +0900 3.3 @@ -53,6 +53,34 @@ 3.4 3.5 #define NR_IOSAPICS 256 3.6 3.7 +#ifdef XEN 3.8 +struct iosapic { 3.9 + char __iomem *addr; /* base address of IOSAPIC */ 3.10 + unsigned int gsi_base; /* first GSI assigned to this IOSAPIC */ 3.11 + unsigned short num_rte; /* number of RTE in this IOSAPIC */ 3.12 + int rtes_inuse; /* # of RTEs in use on this IOSAPIC */ 3.13 + unsigned int id; /* APIC ID */ 3.14 +#ifdef CONFIG_NUMA 3.15 + unsigned short node; /* numa node association via pxm */ 3.16 +#endif 3.17 +}; 3.18 + 3.19 +extern struct iosapic iosapic_lists[NR_IOSAPICS]; 3.20 + 3.21 +static inline int find_iosapic_by_addr(unsigned long addr) 3.22 +{ 3.23 + int i; 3.24 + 3.25 + for (i = 0; i < NR_IOSAPICS; i++) { 3.26 + if ((unsigned long)iosapic_lists[i].addr == addr) 3.27 + return i; 3.28 + } 3.29 + 3.30 + return -1; 3.31 +} 3.32 +#endif 3.33 + 3.34 + 3.35 static inline unsigned int iosapic_read(char __iomem *iosapic, unsigned int reg) 3.36 { 3.37 writel(reg, iosapic + IOSAPIC_REG_SELECT); 3.38 @@ -71,8 +99,13 @@ static inline void iosapic_eoi(char __io 3.39 } 3.40 3.41 extern void __init iosapic_system_init (int pcat_compat); 3.42 +#ifndef XEN 3.43 extern int __devinit iosapic_init (unsigned long address, 3.44 unsigned int gsi_base); 3.45 +#else 3.46 +extern int __devinit iosapic_init (unsigned long address, 3.47 + unsigned int gsi_base, unsigned int id); 3.48 +#endif 3.49 #ifdef CONFIG_HOTPLUG 3.50 extern int iosapic_remove (unsigned int gsi_base); 3.51 #else