ia64/xen-unstable

changeset 9746:eab6fd4949f0

[IA64] Compile iosapic within xen

Compile iosapic within xen. Part of code from Tristan.

Signed-off-by Kevin Tian <kevin.tian@intel.com>
author awilliam@xenbuild.aw
date Fri Apr 21 08:56:34 2006 -0600 (2006-04-21)
parents 19148831ab05
children de2dc4e7966a
files xen/arch/ia64/linux-xen/Makefile xen/arch/ia64/linux-xen/iosapic.c xen/include/asm-ia64/config.h xen/include/asm-ia64/linux-xen/asm/iosapic.h
line diff
     1.1 --- a/xen/arch/ia64/linux-xen/Makefile	Fri Apr 21 08:56:24 2006 -0600
     1.2 +++ b/xen/arch/ia64/linux-xen/Makefile	Fri Apr 21 08:56:34 2006 -0600
     1.3 @@ -13,3 +13,4 @@ obj-y += time.o
     1.4  obj-y += tlb.o
     1.5  obj-y += unaligned.o
     1.6  obj-y += unwind.o
     1.7 +obj-y += iosapic.o
     2.1 --- a/xen/arch/ia64/linux-xen/iosapic.c	Fri Apr 21 08:56:24 2006 -0600
     2.2 +++ b/xen/arch/ia64/linux-xen/iosapic.c	Fri Apr 21 08:56:34 2006 -0600
     2.3 @@ -75,7 +75,9 @@
     2.4  #include <linux/irq.h>
     2.5  #include <linux/kernel.h>
     2.6  #include <linux/list.h>
     2.7 +#ifndef XEN
     2.8  #include <linux/pci.h>
     2.9 +#endif
    2.10  #include <linux/smp.h>
    2.11  #include <linux/smp_lock.h>
    2.12  #include <linux/string.h>
    2.13 @@ -524,7 +526,11 @@ static struct iosapic_rte_info *iosapic_
    2.14  	int preallocated = 0;
    2.15  
    2.16  	if (!iosapic_kmalloc_ok && list_empty(&free_rte_list)) {
    2.17 +#ifdef XEN
    2.18 +		rte = xmalloc_bytes(sizeof(struct iosapic_rte_info) * NR_PREALLOCATE_RTE_ENTRIES);
    2.19 +#else
    2.20  		rte = alloc_bootmem(sizeof(struct iosapic_rte_info) * NR_PREALLOCATE_RTE_ENTRIES);
    2.21 +#endif
    2.22  		if (!rte)
    2.23  			return NULL;
    2.24  		for (i = 0; i < NR_PREALLOCATE_RTE_ENTRIES; i++, rte++)
     3.1 --- a/xen/include/asm-ia64/config.h	Fri Apr 21 08:56:24 2006 -0600
     3.2 +++ b/xen/include/asm-ia64/config.h	Fri Apr 21 08:56:34 2006 -0600
     3.3 @@ -35,6 +35,7 @@
     3.4  #endif
     3.5  #define CONFIG_NR_CPUS NR_CPUS
     3.6  
     3.7 +#define CONFIG_IOSAPIC
     3.8  #define supervisor_mode_kernel (0)
     3.9  
    3.10  #define MAX_DMADOM_PFN (0x7FFFFFFFUL >> PAGE_SHIFT) /* 31 addressable bits */
     4.1 --- a/xen/include/asm-ia64/linux-xen/asm/iosapic.h	Fri Apr 21 08:56:24 2006 -0600
     4.2 +++ b/xen/include/asm-ia64/linux-xen/asm/iosapic.h	Fri Apr 21 08:56:34 2006 -0600
     4.3 @@ -108,5 +108,37 @@ extern void __devinit map_iosapic_to_nod
     4.4  	polarity,trigger)					(gsi)
     4.5  #endif
     4.6  
     4.7 +#ifdef XEN
     4.8 +/* Move to common code later */
     4.9 +/**
    4.10 + * list_move - delete from one list and add as another's head
    4.11 + * @list: the entry to move
    4.12 + * @head: the head that will precede our entry
    4.13 + */
    4.14 +static inline void list_move(struct list_head *list, struct list_head *head)
    4.15 +{
    4.16 +        __list_del(list->prev, list->next);
    4.17 +        list_add(list, head);
    4.18 +}
    4.19 +
    4.20 +#define move_irq(x)
    4.21 +
    4.22 +#define WARN_ON(condition) do { \
    4.23 +	if (unlikely((condition)!=0)) { \
    4.24 +		printk("Badness in %s at %s:%d\n", __FUNCTION__, __FILE__, __LINE__); \
    4.25 +		dump_stack(); \
    4.26 +	} \
    4.27 +} while (0)
    4.28 +
    4.29 +#ifdef nop
    4.30 +#undef nop
    4.31 +#endif
    4.32 +
    4.33 +/* nop for now */
    4.34 +static inline void
    4.35 +set_irq_affinity_info(unsigned int irq, int hwid, int redir) {}
    4.36 +
    4.37 +#endif /* XEN */
    4.38 +
    4.39  # endif /* !__ASSEMBLY__ */
    4.40  #endif /* __ASM_IA64_IOSAPIC_H */