diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2008-09-09 12:06:47 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-09-10 05:33:44 -0400 |
commit | ac4ff656c07ada78316307b0c0ce8a8eb48aa6dd (patch) | |
tree | 24cca8ef20d79aae3a027ff51a8c8d48f625e968 /arch/x86/kernel/pci-gart_64.c | |
parent | 636dc67cbf8c481a996faf6c23f0532d0f02ebad (diff) |
x86: convert gart to use is_buffer_dma_capable helper function
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/pci-gart_64.c')
-rw-r--r-- | arch/x86/kernel/pci-gart_64.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index 0b99d4a06f74..1b0c412566e5 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c | |||
@@ -214,24 +214,14 @@ static void iommu_full(struct device *dev, size_t size, int dir) | |||
214 | static inline int | 214 | static inline int |
215 | need_iommu(struct device *dev, unsigned long addr, size_t size) | 215 | need_iommu(struct device *dev, unsigned long addr, size_t size) |
216 | { | 216 | { |
217 | u64 mask = *dev->dma_mask; | 217 | return force_iommu || |
218 | int high = addr + size > mask; | 218 | !is_buffer_dma_capable(*dev->dma_mask, addr, size); |
219 | int mmu = high; | ||
220 | |||
221 | if (force_iommu) | ||
222 | mmu = 1; | ||
223 | |||
224 | return mmu; | ||
225 | } | 219 | } |
226 | 220 | ||
227 | static inline int | 221 | static inline int |
228 | nonforced_iommu(struct device *dev, unsigned long addr, size_t size) | 222 | nonforced_iommu(struct device *dev, unsigned long addr, size_t size) |
229 | { | 223 | { |
230 | u64 mask = *dev->dma_mask; | 224 | return !is_buffer_dma_capable(*dev->dma_mask, addr, size); |
231 | int high = addr + size > mask; | ||
232 | int mmu = high; | ||
233 | |||
234 | return mmu; | ||
235 | } | 225 | } |
236 | 226 | ||
237 | /* Map a single continuous physical area into the IOMMU. | 227 | /* Map a single continuous physical area into the IOMMU. |