Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754200Ab3I0QNd (ORCPT ); Fri, 27 Sep 2013 12:13:33 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:32635 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753565Ab3I0QKy (ORCPT ); Fri, 27 Sep 2013 12:10:54 -0400 X-IronPort-AV: E=Sophos;i="4.90,994,1371081600"; d="scan'208";a="55582482" From: Stefano Stabellini To: CC: , , , , , Stefano Stabellini , , Subject: [PATCH v6 09/19] arm64/xen: get_dma_ops: return xen_dma_ops if we are running on Xen Date: Fri, 27 Sep 2013 17:09:57 +0100 Message-ID: <1380298207-29151-9-git-send-email-stefano.stabellini@eu.citrix.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-DLP: MIA1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1593 Lines: 52 Signed-off-by: Stefano Stabellini Suggested-by: Catalin Marinas CC: catalin.marinas@arm.com CC: will.deacon@arm.com --- arch/arm64/include/asm/dma-mapping.h | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/arch/arm64/include/asm/dma-mapping.h b/arch/arm64/include/asm/dma-mapping.h index c2cb8a0..1dbd1d5 100644 --- a/arch/arm64/include/asm/dma-mapping.h +++ b/arch/arm64/include/asm/dma-mapping.h @@ -23,12 +23,15 @@ #include +#include +#include + #define ARCH_HAS_DMA_GET_REQUIRED_MASK #define DMA_ERROR_CODE (~0) extern struct dma_map_ops *dma_ops; -static inline struct dma_map_ops *get_dma_ops(struct device *dev) +static inline struct dma_map_ops *__get_dma_ops(struct device *dev) { if (unlikely(!dev) || !dev->archdata.dma_ops) return dma_ops; @@ -36,6 +39,14 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev) return dev->archdata.dma_ops; } +static inline struct dma_map_ops *get_dma_ops(struct device *dev) +{ + if (xen_domain()) + return xen_dma_ops; + else + return __get_dma_ops(dev); +} + #include static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr) -- 1.7.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/