diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/asm-alpha/dma-mapping.h |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'include/asm-alpha/dma-mapping.h')
-rw-r--r-- | include/asm-alpha/dma-mapping.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/include/asm-alpha/dma-mapping.h b/include/asm-alpha/dma-mapping.h new file mode 100644 index 000000000000..c675f282d6ad --- /dev/null +++ b/include/asm-alpha/dma-mapping.h | |||
@@ -0,0 +1,67 @@ | |||
1 | #ifndef _ALPHA_DMA_MAPPING_H | ||
2 | #define _ALPHA_DMA_MAPPING_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | |||
6 | #ifdef CONFIG_PCI | ||
7 | |||
8 | #include <linux/pci.h> | ||
9 | |||
10 | #define dma_map_single(dev, va, size, dir) \ | ||
11 | pci_map_single(alpha_gendev_to_pci(dev), va, size, dir) | ||
12 | #define dma_unmap_single(dev, addr, size, dir) \ | ||
13 | pci_unmap_single(alpha_gendev_to_pci(dev), addr, size, dir) | ||
14 | #define dma_alloc_coherent(dev, size, addr, gfp) \ | ||
15 | pci_alloc_consistent(alpha_gendev_to_pci(dev), size, addr) | ||
16 | #define dma_free_coherent(dev, size, va, addr) \ | ||
17 | pci_free_consistent(alpha_gendev_to_pci(dev), size, va, addr) | ||
18 | #define dma_map_page(dev, page, off, size, dir) \ | ||
19 | pci_map_single(alpha_gendev_to_pci(dev), page, off, size, dir) | ||
20 | #define dma_unmap_page(dev, addr, size, dir) \ | ||
21 | pci_unmap_page(alpha_gendev_to_pci(dev), addr, size, dir) | ||
22 | #define dma_map_sg(dev, sg, nents, dir) \ | ||
23 | pci_map_sg(alpha_gendev_to_pci(dev), sg, nents, dir) | ||
24 | #define dma_unmap_sg(dev, sg, nents, dir) \ | ||
25 | pci_unmap_sg(alpha_gendev_to_pci(dev), sg, nents, dir) | ||
26 | #define dma_supported(dev, mask) \ | ||
27 | pci_dma_supported(alpha_gendev_to_pci(dev), mask) | ||
28 | #define dma_mapping_error(addr) \ | ||
29 | pci_dma_mapping_error(addr) | ||
30 | |||
31 | #else /* no PCI - no IOMMU. */ | ||
32 | |||
33 | void *dma_alloc_coherent(struct device *dev, size_t size, | ||
34 | dma_addr_t *dma_handle, int gfp); | ||
35 | int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | ||
36 | enum dma_data_direction direction); | ||
37 | |||
38 | #define dma_free_coherent(dev, size, va, addr) \ | ||
39 | free_pages((unsigned long)va, get_order(size)) | ||
40 | #define dma_supported(dev, mask) (mask < 0x00ffffffUL ? 0 : 1) | ||
41 | #define dma_map_single(dev, va, size, dir) virt_to_phys(va) | ||
42 | #define dma_map_page(dev, page, off, size, dir) (page_to_pa(page) + off) | ||
43 | |||
44 | #define dma_unmap_single(dev, addr, size, dir) do { } while (0) | ||
45 | #define dma_unmap_page(dev, addr, size, dir) do { } while (0) | ||
46 | #define dma_unmap_sg(dev, sg, nents, dir) do { } while (0) | ||
47 | |||
48 | #define dma_mapping_error(addr) (0) | ||
49 | |||
50 | #endif /* !CONFIG_PCI */ | ||
51 | |||
52 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | ||
53 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | ||
54 | #define dma_is_consistent(dev) (1) | ||
55 | |||
56 | int dma_set_mask(struct device *dev, u64 mask); | ||
57 | |||
58 | #define dma_sync_single_for_cpu(dev, addr, size, dir) do { } while (0) | ||
59 | #define dma_sync_single_for_device(dev, addr, size, dir) do { } while (0) | ||
60 | #define dma_sync_single_range(dev, addr, off, size, dir) do { } while (0) | ||
61 | #define dma_sync_sg_for_cpu(dev, sg, nents, dir) do { } while (0) | ||
62 | #define dma_sync_sg_for_device(dev, sg, nents, dir) do { } while (0) | ||
63 | #define dma_cache_sync(va, size, dir) do { } while (0) | ||
64 | |||
65 | #define dma_get_cache_alignment() L1_CACHE_BYTES | ||
66 | |||
67 | #endif /* _ALPHA_DMA_MAPPING_H */ | ||