diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2009-01-05 09:36:12 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-06 08:06:50 -0500 |
commit | 4d9b977ca674dd40cfc1409a75cb73fca2cee423 (patch) | |
tree | 417f80889ab49c61c2258b157cfe993bdf8d8357 /arch/ia64/kernel/pci-dma.c | |
parent | c82e4417ace9a3a4dddf3332379c771c41040040 (diff) |
set up dma_ops appropriately
This patch introduces a global pointer, dma_ops, which points to an
appropriate dma_mapping_ops that the kernel should use. This is a
common way to handle multiple dma_mapping_ops (X86, POWER, and SPARC).
dma_ops is set in platform_dma_init. We also set it by hand where
machvec_init is callev via subsys_initcall.
- IA64_DIG_VTD uses vtd_dma_ops.
- IA64_HP_ZX1 uses sba_dma_ops.
- IA64_HP_ZX1_SWIOTLB uses hwsw_dma_ops.
- IA64_SGI_SN2 uses sn_dma_ops.
- The rest use swiotlb_dma_ops.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Acked-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/ia64/kernel/pci-dma.c')
-rw-r--r-- | arch/ia64/kernel/pci-dma.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c index f8c38bd2c368..1c1224bd0179 100644 --- a/arch/ia64/kernel/pci-dma.c +++ b/arch/ia64/kernel/pci-dma.c | |||
@@ -41,8 +41,11 @@ struct device fallback_dev = { | |||
41 | .dma_mask = &fallback_dev.coherent_dma_mask, | 41 | .dma_mask = &fallback_dev.coherent_dma_mask, |
42 | }; | 42 | }; |
43 | 43 | ||
44 | extern struct dma_mapping_ops vtd_dma_ops; | ||
45 | |||
44 | void __init pci_iommu_alloc(void) | 46 | void __init pci_iommu_alloc(void) |
45 | { | 47 | { |
48 | dma_ops = &vtd_dma_ops; | ||
46 | /* | 49 | /* |
47 | * The order of these functions is important for | 50 | * The order of these functions is important for |
48 | * fall-back/fail-over reasons | 51 | * fall-back/fail-over reasons |
@@ -76,9 +79,6 @@ iommu_dma_init(void) | |||
76 | return; | 79 | return; |
77 | } | 80 | } |
78 | 81 | ||
79 | struct dma_mapping_ops *dma_ops; | ||
80 | EXPORT_SYMBOL(dma_ops); | ||
81 | |||
82 | int iommu_dma_supported(struct device *dev, u64 mask) | 82 | int iommu_dma_supported(struct device *dev, u64 mask) |
83 | { | 83 | { |
84 | struct dma_mapping_ops *ops = get_dma_ops(dev); | 84 | struct dma_mapping_ops *ops = get_dma_ops(dev); |