x86: dma-ops on highmem fix
[deliverable/linux.git] / arch / x86 / kernel / pci-base_32.c
CommitLineData
22456b97
GC
1#include <linux/mm.h>
2#include <linux/kernel.h>
3#include <linux/module.h>
4#include <linux/dma-mapping.h>
5#include <asm/dma-mapping.h>
6
2be62149 7static dma_addr_t pci32_map_single(struct device *dev, phys_addr_t ptr,
22456b97
GC
8 size_t size, int direction)
9{
10 WARN_ON(size == 0);
11 flush_write_buffers();
2be62149 12 return ptr;
22456b97
GC
13}
14
16a3ce9b
GC
15static int pci32_dma_map_sg(struct device *dev, struct scatterlist *sglist,
16 int nents, int direction)
17{
18 struct scatterlist *sg;
19 int i;
20
21 WARN_ON(nents == 0 || sglist[0].length == 0);
22
23 for_each_sg(sglist, sg, nents, i) {
24 BUG_ON(!sg_page(sg));
25
26 sg->dma_address = sg_phys(sg);
27 }
28
29 flush_write_buffers();
30 return nents;
31}
32
22456b97
GC
33static const struct dma_mapping_ops pci32_dma_ops = {
34 .map_single = pci32_map_single,
0cb0ae68 35 .unmap_single = NULL,
16a3ce9b 36 .map_sg = pci32_dma_map_sg,
72c784f8 37 .unmap_sg = NULL,
c01dd8cf 38 .sync_single_for_cpu = NULL,
9231b269 39 .sync_single_for_device = NULL,
627610fc 40 .sync_single_range_for_cpu = NULL,
71362332 41 .sync_single_range_for_device = NULL,
ed435dee 42 .sync_sg_for_cpu = NULL,
e7f3a913 43 .sync_sg_for_device = NULL,
22456b97
GC
44};
45
46const struct dma_mapping_ops *dma_ops = &pci32_dma_ops;
47EXPORT_SYMBOL(dma_ops);
This page took 0.026251 seconds and 5 git commands to generate.