mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
iommu: add iommu_device_max_index IOMMU helper function
This function helps IOMMUs to know the highest address that a device can access to. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
6e03f99803
commit
eecfffc154
1 changed files with 10 additions and 0 deletions
|
@ -1,3 +1,13 @@
|
|||
static inline unsigned long iommu_device_max_index(unsigned long size,
|
||||
unsigned long offset,
|
||||
u64 dma_mask)
|
||||
{
|
||||
if (size + offset > dma_mask)
|
||||
return dma_mask - offset + 1;
|
||||
else
|
||||
return size;
|
||||
}
|
||||
|
||||
extern int iommu_is_span_boundary(unsigned int index, unsigned int nr,
|
||||
unsigned long shift,
|
||||
unsigned long boundary_size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue