Release 4.14 arch/h8300/kernel/dma.c
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
*/
#include <linux/dma-mapping.h>
#include <linux/kernel.h>
#include <linux/scatterlist.h>
#include <linux/module.h>
#include <asm/pgalloc.h>
static void *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->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 |
Yoshinori Sato | 101 | 98.06% | 1 | 50.00% |
Krzysztof Kozlowski | 2 | 1.94% | 1 | 50.00% |
Total | 103 | 100.00% | 2 | 100.00% |
static void 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 |
Yoshinori Sato | 37 | 94.87% | 1 | 50.00% |
Krzysztof Kozlowski | 2 | 5.13% | 1 | 50.00% |
Total | 39 | 100.00% | 2 | 100.00% |
static dma_addr_t 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 |
Yoshinori Sato | 37 | 94.87% | 1 | 50.00% |
Krzysztof Kozlowski | 2 | 5.13% | 1 | 50.00% |
Total | 39 | 100.00% | 2 | 100.00% |
static int map_sg(struct device *dev, struct scatterlist *sgl,
int nents, enum dma_data_direction direction,
unsigned long attrs)
{
struct scatterlist *sg;
int i;
for_each_sg(sgl, sg, nents, i) {
sg->dma_address = sg_phys(sg);
}
return nents;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Yoshinori Sato | 57 | 96.61% | 1 | 50.00% |
Krzysztof Kozlowski | 2 | 3.39% | 1 | 50.00% |
Total | 59 | 100.00% | 2 | 100.00% |
const struct dma_map_ops h8300_dma_map_ops = {
.alloc = dma_alloc,
.free = dma_free,
.map_page = map_page,
.map_sg = map_sg,
};
EXPORT_SYMBOL(h8300_dma_map_ops);
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Yoshinori Sato | 279 | 96.88% | 1 | 33.33% |
Krzysztof Kozlowski | 8 | 2.78% | 1 | 33.33% |
Bart Van Assche | 1 | 0.35% | 1 | 33.33% |
Total | 288 | 100.00% | 3 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.