From patchwork Fri Jul 10 01:04:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: FUJITA Tomonori X-Patchwork-Id: 29649 Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 47777B6F1F for ; Fri, 10 Jul 2009 11:24:56 +1000 (EST) Received: by ozlabs.org (Postfix) id 3975DDDDF7; Fri, 10 Jul 2009 11:24:56 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (bilbo.ozlabs.org [203.10.76.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "bilbo.ozlabs.org", Issuer "CAcert Class 3 Root" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 379F3DDDD4 for ; Fri, 10 Jul 2009 11:24:56 +1000 (EST) Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by bilbo.ozlabs.org (Postfix) with ESMTP id 37EDEB7E88 for ; Fri, 10 Jul 2009 11:21:23 +1000 (EST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 6A098B70BE for ; Fri, 10 Jul 2009 11:20:44 +1000 (EST) Received: by ozlabs.org (Postfix) id 5DB5DDDDF7; Fri, 10 Jul 2009 11:20:44 +1000 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from sh.osrg.net (sh.osrg.net [192.16.179.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0CF00DDDD4 for ; Fri, 10 Jul 2009 11:20:43 +1000 (EST) Received: from localhost (viola.osrg.net [10.76.0.4]) by sh.osrg.net (8.13.8/8.13.8/OSRG-NET) with ESMTP id n6A17ush023554; Fri, 10 Jul 2009 10:08:01 +0900 From: FUJITA Tomonori To: linux-kernel@vger.kernel.org Subject: [PATCH 07/15] ia64: add dma_capable() to replace is_buffer_dma_capable() Date: Fri, 10 Jul 2009 10:04:56 +0900 Message-Id: <1247187904-31999-8-git-send-email-fujita.tomonori@lab.ntt.co.jp> X-Mailer: git-send-email 1.6.0.6 In-Reply-To: <1247187904-31999-1-git-send-email-fujita.tomonori@lab.ntt.co.jp> References: <1247187904-31999-1-git-send-email-fujita.tomonori@lab.ntt.co.jp> Lines: 32 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (sh.osrg.net [192.16.179.4]); Fri, 10 Jul 2009 10:08:01 +0900 (JST) Cc: tony.luck@intel.com, linux-ia64@vger.kernel.org, x86@kernel.org, fujita.tomonori@lab.ntt.co.jp, linuxppc-dev@ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org dma_capable() eventually replaces is_buffer_dma_capable(), which tells if a memory area is dma-capable or not. The problem of is_buffer_dma_capable() is that it doesn't take a pointer to struct device so it doesn't work for POWERPC. Signed-off-by: FUJITA Tomonori --- arch/ia64/include/asm/dma-mapping.h | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/arch/ia64/include/asm/dma-mapping.h b/arch/ia64/include/asm/dma-mapping.h index 5a61b5c..88d0f86 100644 --- a/arch/ia64/include/asm/dma-mapping.h +++ b/arch/ia64/include/asm/dma-mapping.h @@ -69,6 +69,14 @@ dma_set_mask (struct device *dev, u64 mask) return 0; } +static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) +{ + if (!dev->dma_mask) + return 0; + + return addr + size <= *dev->dma_mask; +} + extern int dma_get_cache_alignment(void); static inline void