Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

parisc: move internal implementation details out of <asm/dma-mapping.h>

Move everything that is not required for the public facing DMA API out
of <asm/dma-mapping.h> and into a new drivers/parisc/iommu.h header.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

Christoph Hellwig and committed by
Helge Deller
9b8eeab0 3e803d3e

+62 -44
-44
arch/parisc/include/asm/dma-mapping.h
··· 26 26 return hppa_dma_ops; 27 27 } 28 28 29 - static inline void * 30 - parisc_walk_tree(struct device *dev) 31 - { 32 - struct device *otherdev; 33 - if(likely(dev->platform_data != NULL)) 34 - return dev->platform_data; 35 - /* OK, just traverse the bus to find it */ 36 - for(otherdev = dev->parent; otherdev; 37 - otherdev = otherdev->parent) { 38 - if(otherdev->platform_data) { 39 - dev->platform_data = otherdev->platform_data; 40 - break; 41 - } 42 - } 43 - return dev->platform_data; 44 - } 45 - 46 - #define GET_IOC(dev) ({ \ 47 - void *__pdata = parisc_walk_tree(dev); \ 48 - __pdata ? HBA_DATA(__pdata)->iommu : NULL; \ 49 - }) 50 - 51 - #ifdef CONFIG_IOMMU_CCIO 52 - struct parisc_device; 53 - struct ioc; 54 - void * ccio_get_iommu(const struct parisc_device *dev); 55 - int ccio_request_resource(const struct parisc_device *dev, 56 - struct resource *res); 57 - int ccio_allocate_resource(const struct parisc_device *dev, 58 - struct resource *res, unsigned long size, 59 - unsigned long min, unsigned long max, unsigned long align); 60 - #else /* !CONFIG_IOMMU_CCIO */ 61 - #define ccio_get_iommu(dev) NULL 62 - #define ccio_request_resource(dev, res) insert_resource(&iomem_resource, res) 63 - #define ccio_allocate_resource(dev, res, size, min, max, align) \ 64 - allocate_resource(&iomem_resource, res, size, min, max, \ 65 - align, NULL, NULL) 66 - #endif /* !CONFIG_IOMMU_CCIO */ 67 - 68 - #ifdef CONFIG_IOMMU_SBA 69 - struct parisc_device; 70 - void * sba_get_iommu(struct parisc_device *dev); 71 - #endif 72 - 73 29 #endif
+2
drivers/parisc/ccio-dma.c
··· 55 55 #include <asm/hardware.h> /* for register_module() */ 56 56 #include <asm/parisc-device.h> 57 57 58 + #include "iommu.h" 59 + 58 60 /* 59 61 ** Choose "ccio" since that's what HP-UX calls it. 60 62 ** Make it easier for folks to migrate from one to the other :^)
+1
drivers/parisc/dino.c
··· 59 59 #include <asm/hardware.h> 60 60 61 61 #include "gsc.h" 62 + #include "iommu.h" 62 63 63 64 #undef DINO_DEBUG 64 65
+2
drivers/parisc/eisa.c
··· 45 45 #include <asm/eisa_bus.h> 46 46 #include <asm/eisa_eeprom.h> 47 47 48 + #include "iommu.h" 49 + 48 50 #if 0 49 51 #define EISA_DBG(msg, arg...) printk(KERN_DEBUG "eisa: " msg, ## arg) 50 52 #else
+2
drivers/parisc/hppb.c
··· 23 23 #include <asm/hardware.h> 24 24 #include <asm/parisc-device.h> 25 25 26 + #include "iommu.h" 27 + 26 28 struct hppb_card { 27 29 unsigned long hpa; 28 30 struct resource mmio_region;
+51
drivers/parisc/iommu.h
··· 1 + #ifndef _IOMMU_H 2 + #define _IOMMU_H 1 3 + 4 + #include <linux/pci.h> 5 + 6 + struct parisc_device; 7 + struct ioc; 8 + 9 + static inline void *parisc_walk_tree(struct device *dev) 10 + { 11 + struct device *otherdev; 12 + 13 + if (likely(dev->platform_data)) 14 + return dev->platform_data; 15 + 16 + /* OK, just traverse the bus to find it */ 17 + for (otherdev = dev->parent; 18 + otherdev; 19 + otherdev = otherdev->parent) { 20 + if (otherdev->platform_data) { 21 + dev->platform_data = otherdev->platform_data; 22 + break; 23 + } 24 + } 25 + 26 + return dev->platform_data; 27 + } 28 + 29 + #define GET_IOC(dev) ({ \ 30 + void *__pdata = parisc_walk_tree(dev); \ 31 + __pdata ? HBA_DATA(__pdata)->iommu : NULL; \ 32 + }) 33 + 34 + #ifdef CONFIG_IOMMU_CCIO 35 + void *ccio_get_iommu(const struct parisc_device *dev); 36 + int ccio_request_resource(const struct parisc_device *dev, 37 + struct resource *res); 38 + int ccio_allocate_resource(const struct parisc_device *dev, 39 + struct resource *res, unsigned long size, 40 + unsigned long min, unsigned long max, unsigned long align); 41 + #else /* !CONFIG_IOMMU_CCIO */ 42 + #define ccio_get_iommu(dev) NULL 43 + #define ccio_request_resource(dev, res) insert_resource(&iomem_resource, res) 44 + #define ccio_allocate_resource(dev, res, size, min, max, align) \ 45 + allocate_resource(&iomem_resource, res, size, min, max, \ 46 + align, NULL, NULL) 47 + #endif /* !CONFIG_IOMMU_CCIO */ 48 + 49 + void *sba_get_iommu(struct parisc_device *dev); 50 + 51 + #endif /* _IOMMU_H */
+2
drivers/parisc/lba_pci.c
··· 49 49 #include <asm/parisc-device.h> 50 50 #include <asm/io.h> /* read/write stuff */ 51 51 52 + #include "iommu.h" 53 + 52 54 #undef DEBUG_LBA /* general stuff */ 53 55 #undef DEBUG_LBA_PORT /* debug I/O Port access */ 54 56 #undef DEBUG_LBA_CFG /* debug Config Space Access (ie PCI Bus walk) */
+2
drivers/parisc/sba_iommu.c
··· 49 49 #include <asm/pdcpat.h> /* for is_pdc_pat() */ 50 50 #include <asm/parisc-device.h> 51 51 52 + #include "iommu.h" 53 + 52 54 #define MODULE_NAME "SBA" 53 55 54 56 /*