]> err.no Git - linux-2.6/blobdiff - include/asm-powerpc/iommu.h
Merge ../linux-2.6
[linux-2.6] / include / asm-powerpc / iommu.h
index f85dbd305558c0a187d40bfce98593379daead00..51ecfef8d84381a0c5740dc9123c599d5961bd76 100644 (file)
@@ -26,8 +26,9 @@
 #include <linux/spinlock.h>
 #include <linux/device.h>
 #include <linux/dma-mapping.h>
+#include <linux/bitops.h>
+#include <asm/machdep.h>
 #include <asm/types.h>
-#include <asm/bitops.h>
 
 #define IOMMU_PAGE_SHIFT      12
 #define IOMMU_PAGE_SIZE       (ASM_CONST(1) << IOMMU_PAGE_SHIFT)
@@ -68,10 +69,9 @@ struct iommu_table {
 };
 
 struct scatterlist;
-struct device_node;
 
 /* Frees table for an individual device node */
-extern void iommu_free_table(struct device_node *dn);
+extern void iommu_free_table(struct iommu_table *tbl, const char *node_name);
 
 /* Initializes an iommu_table based in values set in the passed-in
  * structure
@@ -79,26 +79,31 @@ extern void iommu_free_table(struct device_node *dn);
 extern struct iommu_table *iommu_init_table(struct iommu_table * tbl,
                                            int nid);
 
-extern int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist,
-                       int nelems, unsigned long mask,
-                       enum dma_data_direction direction);
+extern int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
+                       struct scatterlist *sglist, int nelems,
+                       unsigned long mask, enum dma_data_direction direction,
+                       struct dma_attrs *attrs);
 extern void iommu_unmap_sg(struct iommu_table *tbl, struct scatterlist *sglist,
-                          int nelems, enum dma_data_direction direction);
+                          int nelems, enum dma_data_direction direction,
+                          struct dma_attrs *attrs);
 
-extern void *iommu_alloc_coherent(struct iommu_table *tbl, size_t size,
-                                 dma_addr_t *dma_handle, unsigned long mask,
-                                 gfp_t flag, int node);
+extern void *iommu_alloc_coherent(struct device *dev, struct iommu_table *tbl,
+                                 size_t size, dma_addr_t *dma_handle,
+                                 unsigned long mask, gfp_t flag, int node);
 extern void iommu_free_coherent(struct iommu_table *tbl, size_t size,
                                void *vaddr, dma_addr_t dma_handle);
-extern dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
-                                  size_t size, unsigned long mask,
-                                  enum dma_data_direction direction);
+extern dma_addr_t iommu_map_single(struct device *dev, struct iommu_table *tbl,
+                                  void *vaddr, size_t size, unsigned long mask,
+                                  enum dma_data_direction direction,
+                                  struct dma_attrs *attrs);
 extern void iommu_unmap_single(struct iommu_table *tbl, dma_addr_t dma_handle,
-                              size_t size, enum dma_data_direction direction);
+                              size_t size, enum dma_data_direction direction,
+                              struct dma_attrs *attrs);
 
 extern void iommu_init_early_pSeries(void);
 extern void iommu_init_early_iSeries(void);
 extern void iommu_init_early_dart(void);
+extern void iommu_init_early_pasemi(void);
 
 #ifdef CONFIG_PCI
 extern void pci_iommu_init(void);
@@ -108,6 +113,19 @@ static inline void pci_iommu_init(void) { }
 #endif
 
 extern void alloc_dart_table(void);
+#if defined(CONFIG_PPC64) && defined(CONFIG_PM)
+static inline void iommu_save(void)
+{
+       if (ppc_md.iommu_save)
+               ppc_md.iommu_save();
+}
+
+static inline void iommu_restore(void)
+{
+       if (ppc_md.iommu_restore)
+               ppc_md.iommu_restore();
+}
+#endif
 
 #endif /* __KERNEL__ */
 #endif /* _ASM_IOMMU_H */