[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [IA64] sn2 IO build fixes



# HG changeset patch
# User awilliam@xxxxxxxxxxxx
# Date 1172684148 25200
# Node ID 2e2019e09e6c21bc0e072bd4e78d47a3bc87ea59
# Parent  21d0d23a2ccac06d4325afc702373f40168ca4be
[IA64] sn2 IO build fixes

Signed-off-by: Jes Sorensen <jes@xxxxxxx>
---
 xen/arch/ia64/linux-xen/sn/kernel/io_init.c |   38 +++++++++++++++++-----------
 xen/arch/ia64/linux-xen/sn/kernel/irq.c     |   15 ++++++++---
 2 files changed, 35 insertions(+), 18 deletions(-)

diff -r 21d0d23a2cca -r 2e2019e09e6c xen/arch/ia64/linux-xen/sn/kernel/io_init.c
--- a/xen/arch/ia64/linux-xen/sn/kernel/io_init.c       Wed Feb 28 10:18:44 
2007 -0700
+++ b/xen/arch/ia64/linux-xen/sn/kernel/io_init.c       Wed Feb 28 10:35:48 
2007 -0700
@@ -20,9 +20,7 @@
 #include <asm/sn/module.h>
 #include <asm/sn/pcibr_provider.h>
 #include <asm/sn/pcibus_provider_defs.h>
-#ifndef XEN
 #include <asm/sn/pcidev.h>
-#endif
 #include <asm/sn/simulator.h>
 #include <asm/sn/sn_sal.h>
 #ifndef XEN
@@ -41,6 +39,7 @@ extern void sn_init_cpei_timer(void);
 extern void sn_init_cpei_timer(void);
 extern void register_sn_procfs(void);
 #ifdef XEN
+#define pci_dev_get(dev)       do{}while(0)
 extern void sn_irq_lh_init(void);
 #endif
 
@@ -65,7 +64,6 @@ int sn_ioif_inited;           /* SN I/O infrastru
 
 struct sn_pcibus_provider *sn_pci_provider[PCIIO_ASIC_MAX_TYPES];      /* 
indexed by asic type */
 
-#ifndef XEN
 static int max_segment_number;          /* Default highest segment number */
 static int max_pcibus_number = 255;    /* Default highest pci bus number */
 
@@ -97,7 +95,6 @@ static struct sn_pcibus_provider sn_pci_
        .dma_unmap = sn_default_pci_unmap,
        .bus_fixup = sn_default_pci_bus_fixup,
 };
-#endif
 
 /*
  * Retrieve the DMA Flush List given nasid, widget, and device.
@@ -148,7 +145,6 @@ static inline u64 sal_get_pcibus_info(u6
        return ret_stuff.v0;
 }
 
-#ifndef XEN
 /*
  * Retrieve the pci device information given the bus and device|function 
number.
  */
@@ -168,6 +164,7 @@ sal_get_pcidev_info(u64 segment, u64 bus
        return ret_stuff.v0;
 }
 
+#ifndef XEN
 /*
  * sn_pcidev_info_get() - Retrieve the pcidev_info struct for the specified
  *                       device.
@@ -185,6 +182,7 @@ sn_pcidev_info_get(struct pci_dev *dev)
        }
        return NULL;
 }
+#endif
 
 /* Older PROM flush WAR
  *
@@ -364,6 +362,7 @@ sn_pci_window_fixup(struct pci_dev *dev,
        controller->window = new_window;
 }
 
+#ifndef XEN
 void sn_pci_unfixup_slot(struct pci_dev *dev)
 {
        struct pci_dev *host_pci_dev = SN_PCIDEV_INFO(dev)->host_pci_dev;
@@ -372,7 +371,9 @@ void sn_pci_unfixup_slot(struct pci_dev 
        pci_dev_put(host_pci_dev);
        pci_dev_put(dev);
 }
-
+#endif
+
+#ifndef XEN
 /*
  * sn_pci_fixup_slot() - This routine sets up a slot's resources
  * consistent with the Linux PCI abstraction layer.  Resources acquired
@@ -437,10 +438,12 @@ void sn_pci_fixup_slot(struct pci_dev *d
                addr = ((addr << 4) >> 4) | __IA64_UNCACHED_OFFSET;
                dev->resource[idx].start = addr;
                dev->resource[idx].end = addr + size;
+#ifndef XEN
                if (dev->resource[idx].flags & IORESOURCE_IO)
                        dev->resource[idx].parent = &ioport_resource;
                else
                        dev->resource[idx].parent = &iomem_resource;
+#endif
        }
        /* Create a pci_window in the pci_controller struct for
         * each device resource.
@@ -480,6 +483,7 @@ void sn_pci_fixup_slot(struct pci_dev *d
                kfree(sn_irq_info);
        }
 }
+#endif
 
 /*
  * sn_pci_controller_fixup() - This routine sets up a bus's resources
@@ -512,6 +516,7 @@ void sn_pci_controller_fixup(int segment
        controller = &sn_controller->pci_controller;
        controller->segment = segment;
 
+#ifndef XEN
        if (bus == NULL) {
                bus = pci_scan_bus(busnum, &pci_root_ops, controller);
                if (bus == NULL)
@@ -533,6 +538,7 @@ void sn_pci_controller_fixup(int segment
        if (prom_bussoft_ptr->bs_asic_type == PCIIO_ASIC_TYPE_PPB)
                goto error_return; /* no further fixup necessary */
 
+#endif
        provider = sn_pci_provider[prom_bussoft_ptr->bs_asic_type];
        if (provider == NULL)
                goto error_return; /* no provider registerd for this asic */
@@ -562,14 +568,18 @@ void sn_pci_controller_fixup(int segment
        controller->window[0].resource.start = prom_bussoft_ptr->bs_legacy_io;
        controller->window[0].resource.end =
            controller->window[0].resource.start + 0xffff;
+#ifndef XEN
        controller->window[0].resource.parent = &ioport_resource;
+#endif
        controller->window[1].offset = prom_bussoft_ptr->bs_legacy_mem;
        controller->window[1].resource.name = "legacy_mem";
        controller->window[1].resource.flags = IORESOURCE_MEM;
        controller->window[1].resource.start = prom_bussoft_ptr->bs_legacy_mem;
        controller->window[1].resource.end =
            controller->window[1].resource.start + (1024 * 1024) - 1;
+#ifndef XEN
        controller->window[1].resource.parent = &iomem_resource;
+#endif
        controller->windows = 2;
 
        /*
@@ -608,6 +618,7 @@ error_return:
        return;
 }
 
+#ifndef XEN
 void sn_bus_store_sysdata(struct pci_dev *dev)
 {
        struct sysdata_el *element;
@@ -644,17 +655,14 @@ void sn_bus_free_sysdata(void)
 
 #define PCI_BUSES_TO_SCAN 256
 
-static int __init sn_pci_init(void)
-{
-#ifndef XEN
+static int __init sn_io_early_init(void)
+{
        int i, j;
        struct pci_dev *pci_dev = NULL;
-#endif
 
        if (!ia64_platform_is("sn2") || IS_RUNNING_ON_FAKE_PROM())
                return 0;
 
-#ifndef XEN
        /*
         * prime sn_pci_provider[].  Individial provider init routines will
         * override their respective default entries.
@@ -663,6 +671,7 @@ static int __init sn_pci_init(void)
        for (i = 0; i < PCIIO_ASIC_MAX_TYPES; i++)
                sn_pci_provider[i] = &sn_pci_default_provider;
 
+#ifndef XEN
        pcibr_init_provider();
        tioca_init_provider();
        tioce_init_provider();
@@ -683,7 +692,7 @@ static int __init sn_pci_init(void)
 #ifdef CONFIG_PROC_FS
        register_sn_procfs();
 #endif
-
+#endif
        /* busses are not known yet ... */
        for (i = 0; i <= max_segment_number; i++)
                for (j = 0; j <= max_pcibus_number; j++)
@@ -695,6 +704,7 @@ static int __init sn_pci_init(void)
         * information.
         */
 
+#ifndef XEN
        while ((pci_dev =
                pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pci_dev)) != NULL)
                sn_pci_fixup_slot(pci_dev);
@@ -769,9 +779,9 @@ void sn_generate_path(struct pci_bus *pc
 #endif
 
 #ifdef XEN
-__initcall(sn_pci_init);
+__initcall(sn_io_early_init);
 #else
-subsys_initcall(sn_pci_init);
+subsys_initcall(sn_io_early_init);
 #endif
 #ifndef XEN
 EXPORT_SYMBOL(sn_pci_fixup_slot);
diff -r 21d0d23a2cca -r 2e2019e09e6c xen/arch/ia64/linux-xen/sn/kernel/irq.c
--- a/xen/arch/ia64/linux-xen/sn/kernel/irq.c   Wed Feb 28 10:18:44 2007 -0700
+++ b/xen/arch/ia64/linux-xen/sn/kernel/irq.c   Wed Feb 28 10:35:48 2007 -0700
@@ -223,6 +223,8 @@ struct hw_interrupt_type irq_type_sn = {
 struct hw_interrupt_type irq_type_sn = {
 #ifndef XEN
        .name           = "SN hub",
+#else
+       .typename       = "SN hub",
 #endif
        .startup        = sn_startup_irq,
        .shutdown       = sn_shutdown_irq,
@@ -242,19 +244,24 @@ unsigned int sn_local_vector_to_irq(u8 v
 
 void sn_irq_init(void)
 {
-#ifndef XEN
        int i;
        irq_desc_t *base_desc = irq_desc;
 
+#ifndef XEN
        ia64_first_device_vector = IA64_SN2_FIRST_DEVICE_VECTOR;
        ia64_last_device_vector = IA64_SN2_LAST_DEVICE_VECTOR;
+#endif
 
        for (i = 0; i < NR_IRQS; i++) {
+#ifdef XEN
+               if (base_desc[i].handler == &no_irq_type) {
+                       base_desc[i].handler = &irq_type_sn;
+#else
                if (base_desc[i].chip == &no_irq_type) {
                        base_desc[i].chip = &irq_type_sn;
-               }
-       }
-#endif
+#endif
+               }
+       }
 }
 
 #ifndef XEN

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.