From 76f9f87fa51c9fb62c17986e2066ed467ac2da05 Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Mon, 10 Oct 2005 22:52:26 +1000 Subject: [PATCH] powerpc: Get iseries to compile with ARCH=powerpc This moves the Device_List member from struct device_node to struct pci_dn, which cleans up the device_node and makes the code a little simpler. Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/iseries/hvcall.S | 1 + arch/powerpc/platforms/iseries/iommu.c | 7 +++---- arch/powerpc/platforms/iseries/pci.c | 15 ++++++--------- include/asm-ppc64/pci-bridge.h | 2 ++ 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/arch/powerpc/platforms/iseries/hvcall.S b/arch/powerpc/platforms/iseries/hvcall.S index 9901c0e..07ae6ad 100644 --- a/arch/powerpc/platforms/iseries/hvcall.S +++ b/arch/powerpc/platforms/iseries/hvcall.S @@ -10,6 +10,7 @@ #include #include +#include /* XXX for STACK_FRAME_OVERHEAD */ .text diff --git a/arch/powerpc/platforms/iseries/iommu.c b/arch/powerpc/platforms/iseries/iommu.c index 9ac735d..e40c50b 100644 --- a/arch/powerpc/platforms/iseries/iommu.c +++ b/arch/powerpc/platforms/iseries/iommu.c @@ -89,11 +89,10 @@ static void tce_free_iSeries(struct iommu_table *tbl, long index, long npages) */ static struct iommu_table *iommu_table_find(struct iommu_table * tbl) { - struct device_node *dp; - - list_for_each_entry(dp, &iSeries_Global_Device_List, Device_List) { - struct iommu_table *it = PCI_DN(dp)->iommu_table; + struct pci_dn *pdn; + list_for_each_entry(pdn, &iSeries_Global_Device_List, Device_List) { + struct iommu_table *it = pdn->iommu_table; if ((it != NULL) && (it->it_type == TCE_PCI) && (it->it_offset == tbl->it_offset) && diff --git a/arch/powerpc/platforms/iseries/pci.c b/arch/powerpc/platforms/iseries/pci.c index 70185de..46879d7 100644 --- a/arch/powerpc/platforms/iseries/pci.c +++ b/arch/powerpc/platforms/iseries/pci.c @@ -220,7 +220,7 @@ static struct device_node *build_device_node(HvBusNumber Bus, return NULL; } node->data = pdn; - list_add_tail(&node->Device_List, &iSeries_Global_Device_List); + list_add_tail(&pdn->Device_List, &iSeries_Global_Device_List); #if 0 pdn->DsaAddr = ((u64)Bus << 48) + ((u64)SubBus << 40) + ((u64)0x10 << 32); #endif @@ -549,15 +549,12 @@ EXPORT_SYMBOL(iSeries_memcpy_fromio); */ static struct device_node *find_Device_Node(int bus, int devfn) { - struct list_head *pos; - - list_for_each(pos, &iSeries_Global_Device_List) { - struct device_node *node = - list_entry(pos, struct device_node, Device_List); + struct pci_dn *pdn; - if ((bus == ISERIES_BUS(node)) && - (devfn == PCI_DN(node)->devfn)) - return node; + list_for_each_entry(pdn, &iSeries_Global_Device_List, Device_List) { + if ((bus == pdn->DsaAddr.Dsa.busNumber) && + (devfn == pdn->devfn)) + return pdn->node; } return NULL; } diff --git a/include/asm-ppc64/pci-bridge.h b/include/asm-ppc64/pci-bridge.h index c342c9e..56863df 100644 --- a/include/asm-ppc64/pci-bridge.h +++ b/include/asm-ppc64/pci-bridge.h @@ -3,6 +3,7 @@ #define _ASM_PCI_BRIDGE_H #include +#include #include @@ -74,6 +75,7 @@ struct pci_dn { struct pci_dev *pcidev; /* back-pointer to the pci device */ struct device_node *node; /* back-pointer to the device_node */ #ifdef CONFIG_PPC_ISERIES + struct list_head Device_List; union HvDsaMap DsaAddr; /* Direct Select Address */ /* busNumber, subBusNumber, */ /* deviceId, barNumber */ -- 2.7.4