Contributors: 6
Author |
Tokens |
Token Proportion |
Commits |
Commit Proportion |
Christoph Hellwig |
69 |
54.76% |
2 |
16.67% |
Michal Simek |
26 |
20.63% |
5 |
41.67% |
Eli Billauer |
24 |
19.05% |
2 |
16.67% |
Paul Gortmaker |
3 |
2.38% |
1 |
8.33% |
Tejun Heo |
3 |
2.38% |
1 |
8.33% |
Greg Kroah-Hartman |
1 |
0.79% |
1 |
8.33% |
Total |
126 |
|
12 |
|
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2009-2010 PetaLogix
* Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corporation
*
* Provide default implementations of the DMA mapping callbacks for
* directly mapped busses.
*/
#include <linux/device.h>
#include <linux/dma-noncoherent.h>
#include <linux/gfp.h>
#include <linux/dma-debug.h>
#include <linux/export.h>
#include <linux/bug.h>
#include <asm/cacheflush.h>
static void __dma_sync(phys_addr_t paddr, size_t size,
enum dma_data_direction direction)
{
switch (direction) {
case DMA_TO_DEVICE:
case DMA_BIDIRECTIONAL:
flush_dcache_range(paddr, paddr + size);
break;
case DMA_FROM_DEVICE:
invalidate_dcache_range(paddr, paddr + size);
break;
default:
BUG();
}
}
void arch_sync_dma_for_device(phys_addr_t paddr, size_t size,
enum dma_data_direction dir)
{
__dma_sync(paddr, size, dir);
}
void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t size,
enum dma_data_direction dir)
{
__dma_sync(paddr, size, dir);
}