]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - include/asm-alpha/dma-mapping.h
[ARM] 4038/1: S3C24XX: Fix copyrights in include/asm-arm/arch-s3c2410 (core)
[mirror_ubuntu-artful-kernel.git] / include / asm-alpha / dma-mapping.h
CommitLineData
1da177e4
LT
1#ifndef _ALPHA_DMA_MAPPING_H
2#define _ALPHA_DMA_MAPPING_H
3
1da177e4
LT
4
5#ifdef CONFIG_PCI
6
7#include <linux/pci.h>
8
9#define dma_map_single(dev, va, size, dir) \
10 pci_map_single(alpha_gendev_to_pci(dev), va, size, dir)
11#define dma_unmap_single(dev, addr, size, dir) \
12 pci_unmap_single(alpha_gendev_to_pci(dev), addr, size, dir)
13#define dma_alloc_coherent(dev, size, addr, gfp) \
14 pci_alloc_consistent(alpha_gendev_to_pci(dev), size, addr)
15#define dma_free_coherent(dev, size, va, addr) \
16 pci_free_consistent(alpha_gendev_to_pci(dev), size, va, addr)
17#define dma_map_page(dev, page, off, size, dir) \
817c41d7 18 pci_map_page(alpha_gendev_to_pci(dev), page, off, size, dir)
1da177e4
LT
19#define dma_unmap_page(dev, addr, size, dir) \
20 pci_unmap_page(alpha_gendev_to_pci(dev), addr, size, dir)
21#define dma_map_sg(dev, sg, nents, dir) \
22 pci_map_sg(alpha_gendev_to_pci(dev), sg, nents, dir)
23#define dma_unmap_sg(dev, sg, nents, dir) \
24 pci_unmap_sg(alpha_gendev_to_pci(dev), sg, nents, dir)
25#define dma_supported(dev, mask) \
26 pci_dma_supported(alpha_gendev_to_pci(dev), mask)
27#define dma_mapping_error(addr) \
28 pci_dma_mapping_error(addr)
29
30#else /* no PCI - no IOMMU. */
31
ce5f8d70 32struct scatterlist;
1da177e4 33void *dma_alloc_coherent(struct device *dev, size_t size,
55c5d74b 34 dma_addr_t *dma_handle, gfp_t gfp);
1da177e4
LT
35int 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)
f67637ee 54#define dma_is_consistent(d, h) (1)
1da177e4
LT
55
56int 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)
d3fa72e4 63#define dma_cache_sync(dev, va, size, dir) do { } while (0)
1da177e4
LT
64
65#define dma_get_cache_alignment() L1_CACHE_BYTES
66
67#endif /* _ALPHA_DMA_MAPPING_H */