From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: [PATCH 8/8] ia64: implement dma_mmap_coherent() Date: Fri, 10 Jul 2009 15:16:11 +0200 Message-ID: References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: Received: from cantor.suse.de ([195.135.220.2]:57105 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751455AbZGJNQM (ORCPT ); Fri, 10 Jul 2009 09:16:12 -0400 Sender: linux-arch-owner@vger.kernel.org List-ID: To: linux-arch@vger.kernel.org Cc: Gerhard Pircher A lazy version of dma_mmap_coherent() implementation for IA64. Signed-off-by: Takashi Iwai --- arch/ia64/include/asm/dma-mapping.h | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/arch/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h index 5a61b5c..70b2c61 100644 --- a/arch/ia64/include/asm/dma-mapping.h +++ b/arch/ia64/include/asm/dma-mapping.h @@ -84,4 +84,20 @@ dma_cache_sync (struct device *dev, void *vaddr, size_t size, #define dma_is_consistent(d, h) (1) /* all we do is coherent memory... */ +#define ARCH_HAS_DMA_MMAP_COHERENT +static inline int dma_mmap_coherent(struct device *dev, + struct vm_area_struct *vma, + void *cpu_addr, dma_addr_t handle, + size_t size) +{ + struct dma_map_ops *ops = get_dma_ops(dev); + unsigned long pfn; + + if (ops->mmap_coherent) + return ops->mmap_coherent(dev, vma, cpu_addr, handle, size); + pfn = page_to_pfn(virt_to_page(cpu_addr)); + return remap_pfn_range(vma, vma->vm_start, pfn + vma->vm_pgoff, + size, vma->vm_page_prot); +} + #endif /* _ASM_IA64_DMA_MAPPING_H */ -- 1.6.3.2