mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-18 18:43:59 +08:00
[PATCH] x86_64: implement dma_sync_single_range_for_{cpu,device}
Re-implement dma_sync_single_range_for_{cpu,device} for x86_64 using swiotlb_sync_single_range_for_{cpu,device}. Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
This commit is contained in:
parent
569c8bf5d8
commit
8d15d19e44
@ -85,10 +85,33 @@ static inline void dma_sync_single_for_device(struct device *hwdev,
|
|||||||
flush_write_buffers();
|
flush_write_buffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
#define dma_sync_single_range_for_cpu(dev, dma_handle, offset, size, dir) \
|
static inline void dma_sync_single_range_for_cpu(struct device *hwdev,
|
||||||
dma_sync_single_for_cpu(dev, dma_handle, size, dir)
|
dma_addr_t dma_handle,
|
||||||
#define dma_sync_single_range_for_device(dev, dma_handle, offset, size, dir) \
|
unsigned long offset,
|
||||||
dma_sync_single_for_device(dev, dma_handle, size, dir)
|
size_t size, int direction)
|
||||||
|
{
|
||||||
|
if (direction == DMA_NONE)
|
||||||
|
out_of_line_bug();
|
||||||
|
|
||||||
|
if (swiotlb)
|
||||||
|
return swiotlb_sync_single_range_for_cpu(hwdev,dma_handle,offset,size,direction);
|
||||||
|
|
||||||
|
flush_write_buffers();
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void dma_sync_single_range_for_device(struct device *hwdev,
|
||||||
|
dma_addr_t dma_handle,
|
||||||
|
unsigned long offset,
|
||||||
|
size_t size, int direction)
|
||||||
|
{
|
||||||
|
if (direction == DMA_NONE)
|
||||||
|
out_of_line_bug();
|
||||||
|
|
||||||
|
if (swiotlb)
|
||||||
|
return swiotlb_sync_single_range_for_device(hwdev,dma_handle,offset,size,direction);
|
||||||
|
|
||||||
|
flush_write_buffers();
|
||||||
|
}
|
||||||
|
|
||||||
static inline void dma_sync_sg_for_cpu(struct device *hwdev,
|
static inline void dma_sync_sg_for_cpu(struct device *hwdev,
|
||||||
struct scatterlist *sg,
|
struct scatterlist *sg,
|
||||||
|
Loading…
Reference in New Issue
Block a user