Skip to content

Commit

Permalink
iommu: add dma_get_mask helper function
Browse files Browse the repository at this point in the history
Several IOMMUs do the same thing to get the dma_mask of a device. This
adds a helper function to do the same thing to sweep them.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
FUJITA Tomonori authored and Ingo Molnar committed Sep 14, 2008
1 parent eecfffc commit 589fc9a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/linux/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ static inline int is_buffer_dma_capable(u64 mask, dma_addr_t addr, size_t size)
#define dma_sync_single dma_sync_single_for_cpu
#define dma_sync_sg dma_sync_sg_for_cpu

static inline u64 dma_get_mask(struct device *dev)
{
if (dev->dma_mask && *dev->dma_mask)
return *dev->dma_mask;
return DMA_32BIT_MASK;
}

extern u64 dma_get_required_mask(struct device *dev);

static inline unsigned int dma_get_max_seg_size(struct device *dev)
Expand Down

0 comments on commit 589fc9a

Please sign in to comment.