diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-16 17:39:14 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-16 17:39:14 -0800 |
commit | 9b690c3d56ce15dd265b6398f9d8d58c29c17032 (patch) | |
tree | 56477d1f4e596011f17d1c64e8597613330e5439 /include | |
parent | 36cd5c19c3fe8291fac45a262c44c00bd14b531a (diff) | |
parent | af51a9f1848ff50079a10def56a2c064f326af22 (diff) | |
download | linux-9b690c3d56ce15dd265b6398f9d8d58c29c17032.tar.bz2 |
Merge tag 'stable/for-linus-3.8-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb
Pull swiotlb update from Konrad Rzeszutek Wilk:
"Feature:
- Use dma addresses instead of the virt_to_phys and vice versa
functions.
Remove the multitude of phys_to_virt/virt_to_phys calls and instead
operate on the physical addresses instead of virtual in many of the
internal functions. This does provide a speed up in interrupt
handlers that do DMA operations and use SWIOTLB."
* tag 'stable/for-linus-3.8-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb:
swiotlb: Do not export swiotlb_bounce since there are no external consumers
swiotlb: Use physical addresses instead of virtual in swiotlb_tbl_sync_single
swiotlb: Use physical addresses for swiotlb_tbl_unmap_single
swiotlb: Return physical addresses when calling swiotlb_tbl_map_single
swiotlb: Make io_tlb_overflow_buffer a physical address
swiotlb: Make io_tlb_start a physical address instead of a virtual one
swiotlb: Make io_tlb_end a physical address instead of a virtual one
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/swiotlb.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 8d08b3ed406d..071d62c214a6 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h @@ -34,21 +34,25 @@ enum dma_sync_target { SYNC_FOR_CPU = 0, SYNC_FOR_DEVICE = 1, }; -extern void *swiotlb_tbl_map_single(struct device *hwdev, dma_addr_t tbl_dma_addr, - phys_addr_t phys, size_t size, - enum dma_data_direction dir); -extern void swiotlb_tbl_unmap_single(struct device *hwdev, char *dma_addr, +/* define the last possible byte of physical address space as a mapping error */ +#define SWIOTLB_MAP_ERROR (~(phys_addr_t)0x0) + +extern phys_addr_t swiotlb_tbl_map_single(struct device *hwdev, + dma_addr_t tbl_dma_addr, + phys_addr_t phys, size_t size, + enum dma_data_direction dir); + +extern void swiotlb_tbl_unmap_single(struct device *hwdev, + phys_addr_t tlb_addr, size_t size, enum dma_data_direction dir); -extern void swiotlb_tbl_sync_single(struct device *hwdev, char *dma_addr, +extern void swiotlb_tbl_sync_single(struct device *hwdev, + phys_addr_t tlb_addr, size_t size, enum dma_data_direction dir, enum dma_sync_target target); /* Accessory functions. */ -extern void swiotlb_bounce(phys_addr_t phys, char *dma_addr, size_t size, - enum dma_data_direction dir); - extern void *swiotlb_alloc_coherent(struct device *hwdev, size_t size, dma_addr_t *dma_handle, gfp_t flags); |