From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757261AbZE2Iod (ORCPT ); Fri, 29 May 2009 04:44:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756754AbZE2IoJ (ORCPT ); Fri, 29 May 2009 04:44:09 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:60514 "EHLO SMTP02.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756495AbZE2IoG (ORCPT ); Fri, 29 May 2009 04:44:06 -0400 X-IronPort-AV: E=Sophos;i="4.41,270,1241409600"; d="scan'208";a="53001165" From: Ian Campbell To: CC: Ian Campbell , FUJITA Tomonori , Ingo Molnar , Jeremy Fitzhardinge , Tony Luck , Subject: [PATCH 1/9] ia64: introduce arch-specific dma-mapping interfaces Date: Fri, 29 May 2009 09:43:55 +0100 Message-ID: <1243586643-5554-2-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 1.5.6.5 In-Reply-To: <1243586643-5554-1-git-send-email-ian.campbell@citrix.com> References: <1243586643-5554-1-git-send-email-ian.campbell@citrix.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org dma_map_range is intended to replace usage of both swiotlb_arch_range_needs_mapping and swiotlb_arch_address_needs_mapping as __weak functions as well as replacing is_buffer_dma_capable. phys_to_dma and dma_to_phys are intended to replace swiotlb_phys_to_bus and swiotlb_bus_to_phys. I choose to use dma rather than bus since a) it matches the parameters and b) avoids confusion on x86 with the existing (but deprecated) virt_to_bus function which relates to ISA device DMA. Signed-off-by: Ian Campbell Cc: FUJITA Tomonori Cc: Ingo Molnar Cc: Jeremy Fitzhardinge Cc: Tony Luck Cc: linux-ia64@vger.kernel.org --- arch/ia64/include/asm/dma-mapping.h | 23 +++++++++++++++++++++++ 1 files changed, 23 insertions(+), 0 deletions(-) diff --git a/arch/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h index 36c0009..7250e1a 100644 --- a/arch/ia64/include/asm/dma-mapping.h +++ b/arch/ia64/include/asm/dma-mapping.h @@ -174,4 +174,27 @@ dma_cache_sync (struct device *dev, void *vaddr, size_t size, #define dma_is_consistent(d, h) (1) /* all we do is coherent memory... */ +static inline dma_addr_t phys_to_dma(struct device *hwdev, phys_addr_t paddr) +{ + return paddr; +} + +static inline phys_addr_t dma_to_phys(struct device *hwdev, dma_addr_t daddr) +{ + return daddr; +} + +static inline bool dma_map_range(struct device *dev, u64 mask, + phys_addr_t addr, size_t size, + dma_addr_t *dma_addr_p) +{ + dma_addr_t dma_addr = phys_to_dma(dev, addr); + + if (dma_addr + size > mask) + return false; + + *dma_addr_p = dma_addr; + return true; +} + #endif /* _ASM_IA64_DMA_MAPPING_H */ -- 1.5.6.5