Release 4.14 arch/cris/arch-v32/drivers/pci/dma.c
// SPDX-License-Identifier: GPL-2.0
/*
* Dynamic DMA mapping support.
*
* On cris there is no hardware dynamic DMA address translation,
* so consistent alloc/free are merely page allocation/freeing.
* The rest of the dynamic DMA mapping interface is implemented
* in asm/pci.h.
*
* Borrowed from i386.
*/
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/pci.h>
#include <linux/gfp.h>
#include <asm/io.h>
static void *v32_dma_alloc(struct device *dev, size_t size,
dma_addr_t *dma_handle, gfp_t gfp, unsigned long attrs)
{
void *ret;
/* ignore region specifiers */
gfp &= ~(__GFP_DMA | __GFP_HIGHMEM);
if (dev == NULL || (dev->coherent_dma_mask < 0xffffffff))
gfp |= GFP_DMA;
ret = (void *)__get_free_pages(gfp, get_order(size));
if (ret != NULL) {
memset(ret, 0, size);
*dma_handle = virt_to_phys(ret);
}
return ret;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Mikael Starvik | 91 | 89.22% | 1 | 25.00% |
Christoph Hellwig | 8 | 7.84% | 1 | 25.00% |
Krzysztof Kozlowski | 2 | 1.96% | 1 | 25.00% |
Al Viro | 1 | 0.98% | 1 | 25.00% |
Total | 102 | 100.00% | 4 | 100.00% |
static void v32_dma_free(struct device *dev, size_t size, void *vaddr,
dma_addr_t dma_handle, unsigned long attrs)
{
free_pages((unsigned long)vaddr, get_order(size));
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Mikael Starvik | 29 | 74.36% | 1 | 33.33% |
Christoph Hellwig | 8 | 20.51% | 1 | 33.33% |
Krzysztof Kozlowski | 2 | 5.13% | 1 | 33.33% |
Total | 39 | 100.00% | 3 | 100.00% |
static inline dma_addr_t v32_dma_map_page(struct device *dev,
struct page *page, unsigned long offset, size_t size,
enum dma_data_direction direction, unsigned long attrs)
{
return page_to_phys(page) + offset;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Christoph Hellwig | 38 | 95.00% | 1 | 50.00% |
Krzysztof Kozlowski | 2 | 5.00% | 1 | 50.00% |
Total | 40 | 100.00% | 2 | 100.00% |
static inline int v32_dma_map_sg(struct device *dev, struct scatterlist *sg,
int nents, enum dma_data_direction direction,
unsigned long attrs)
{
printk("Map sg\n");
return nents;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Christoph Hellwig | 34 | 94.44% | 1 | 50.00% |
Krzysztof Kozlowski | 2 | 5.56% | 1 | 50.00% |
Total | 36 | 100.00% | 2 | 100.00% |
static inline int v32_dma_supported(struct device *dev, u64 mask)
{
/*
* we fall back to GFP_DMA when the mask isn't all 1s,
* so we can't guarantee allocations that must be
* within a tighter range than GFP_DMA..
*/
if (mask < 0x00ffffff)
return 0;
return 1;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Christoph Hellwig | 28 | 100.00% | 1 | 100.00% |
Total | 28 | 100.00% | 1 | 100.00% |
const struct dma_map_ops v32_dma_ops = {
.alloc = v32_dma_alloc,
.free = v32_dma_free,
.map_page = v32_dma_map_page,
.map_sg = v32_dma_map_sg,
.dma_supported = v32_dma_supported,
};
EXPORT_SYMBOL(v32_dma_ops);
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Christoph Hellwig | 152 | 50.33% | 1 | 14.29% |
Mikael Starvik | 136 | 45.03% | 1 | 14.29% |
Krzysztof Kozlowski | 8 | 2.65% | 1 | 14.29% |
Tejun Heo | 3 | 0.99% | 1 | 14.29% |
Greg Kroah-Hartman | 1 | 0.33% | 1 | 14.29% |
Al Viro | 1 | 0.33% | 1 | 14.29% |
Bart Van Assche | 1 | 0.33% | 1 | 14.29% |
Total | 302 | 100.00% | 7 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.