diff options
Diffstat (limited to 'arch/arm/include/asm/dma-mapping.h')
-rw-r--r-- | arch/arm/include/asm/dma-mapping.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h index 1ad2c171054b..8acfef48124a 100644 --- a/arch/arm/include/asm/dma-mapping.h +++ b/arch/arm/include/asm/dma-mapping.h | |||
@@ -11,17 +11,28 @@ | |||
11 | #include <asm-generic/dma-coherent.h> | 11 | #include <asm-generic/dma-coherent.h> |
12 | #include <asm/memory.h> | 12 | #include <asm/memory.h> |
13 | 13 | ||
14 | #include <xen/xen.h> | ||
15 | #include <asm/xen/hypervisor.h> | ||
16 | |||
14 | #define DMA_ERROR_CODE (~0) | 17 | #define DMA_ERROR_CODE (~0) |
15 | extern struct dma_map_ops arm_dma_ops; | 18 | extern struct dma_map_ops arm_dma_ops; |
16 | extern struct dma_map_ops arm_coherent_dma_ops; | 19 | extern struct dma_map_ops arm_coherent_dma_ops; |
17 | 20 | ||
18 | static inline struct dma_map_ops *get_dma_ops(struct device *dev) | 21 | static inline struct dma_map_ops *__generic_dma_ops(struct device *dev) |
19 | { | 22 | { |
20 | if (dev && dev->archdata.dma_ops) | 23 | if (dev && dev->archdata.dma_ops) |
21 | return dev->archdata.dma_ops; | 24 | return dev->archdata.dma_ops; |
22 | return &arm_dma_ops; | 25 | return &arm_dma_ops; |
23 | } | 26 | } |
24 | 27 | ||
28 | static inline struct dma_map_ops *get_dma_ops(struct device *dev) | ||
29 | { | ||
30 | if (xen_initial_domain()) | ||
31 | return xen_dma_ops; | ||
32 | else | ||
33 | return __generic_dma_ops(dev); | ||
34 | } | ||
35 | |||
25 | static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops) | 36 | static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops) |
26 | { | 37 | { |
27 | BUG_ON(!dev); | 38 | BUG_ON(!dev); |